Skip to content

Commit

Permalink
sync of some files with Annotationi.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
h-dh committed Oct 14, 2015
1 parent f15798c commit eb1db41
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 28 deletions.
9 changes: 5 additions & 4 deletions include/hdhC.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,15 @@ T clearLeastBits( T v, size_t shft=2);
op: "<" --> x + e < y \n
op: ">" --> x > y + e
*/
/*
bool
compare(double x, double y,
std::string op="eq", double epsilon=NUMERICAL_TOLERANCE);
compare(double x, std::string op, double y,
double epsilon=NUMERICAL_TOLERANCE);
*/

/*! epsilon is 10^-DECS of the smaller value of the magnitude of x and y*/
bool
compare(double x, double y,
std::string op="eq", int DECS=10);
compare(double x, char op, double y, int DECS=10);

//! Convert time
/*! Time given in a certain unit is converted to a target unit.
Expand Down
4 changes: 2 additions & 2 deletions include/readline.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ class ReadLine

//! Get i-th item from line.
std::string
getItem( size_t i);
getItem(size_t i) { return split[i]; }

//! Get a vector filled with the line items.
std::vector<std::string>
getItems( void );
getItems(void) { return split.getItems(); }

//! Get range of items filled into a vector.
/*! By default, range starts at index 'beg' to the end of the line.*/
Expand Down
5 changes: 3 additions & 2 deletions src/InFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,10 +575,11 @@ InFile::init(void)
std::string table="*";
std::string level="L1";
std::string task="";
std::vector<std::string> freq;
std::vector<std::string> value;
std::vector<size_t> xRecord_01;
std::vector<size_t> xRecord_01;

notes->push_front(key , "*", level, table, task, "", value,
notes->push_front(key , "*", freq, level, table, task, "", value,
xRecord_01, xRecord_01);
notes->inq(key);

Expand Down
7 changes: 2 additions & 5 deletions src/NcAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2190,11 +2190,8 @@ NcAPI::getAttString(std::string attName, std::string varName)
getAttValues(vs, attName, varName);
if( vs.size() )
return vs[0];
else
{
std::string s;
return s;
}

return "";
}

std::string
Expand Down
12 changes: 0 additions & 12 deletions src/ReadLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,6 @@ ReadLine::findLine( std::string &rline, std::string &str, int opos )
return is;
}

std::string
ReadLine::getItem( size_t index)
{
return split[index] ;
}

std::vector<std::string>
ReadLine::getItems( void)
{
return split.getItems() ;
}

std::vector<std::string>
ReadLine::getItems( size_t beg, size_t end )
{
Expand Down
8 changes: 5 additions & 3 deletions src/hdhC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ T clearLeastBits( T v, size_t shft)
return v;
}

bool compare(double x, double y, char op, double epsilon)
/*
bool compare(double x, char op, double y, double epsilon)
{
// compare x and y within uncertainty ranges e
// modes: op: '=' --> x == y
Expand Down Expand Up @@ -251,9 +252,10 @@ bool compare(double x, double y, char op, double epsilon)
return false;
}
*/

bool
compare(double x, double y, char op, int decimals)
compare(double x, char op, double y, int decimals)
{
// fabs( (x + x*10^-decimals) op (y + y*10^-decimals )

Expand Down Expand Up @@ -737,7 +739,7 @@ void envelope( std::vector<double> &x, std::vector<double> &y,
template<typename T>
bool equal(T x1, T x2, double epsilon)
{
// Is (x1-x2) == 0 under the constraint of comuter inaccuracies?
// Is (x1-x2) == 0 under the constraint of computer inaccuracies?
// Get the magnitude and compare values to an adjusted epsilon.

// return: true if fabs(x1-x2) < magnitude*epsilon
Expand Down

0 comments on commit eb1db41

Please sign in to comment.