44 static inline void ltrim(std::string &s)
46 s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](
int ch) {
return !std::isspace(ch); }));
51 static inline void rtrim(std::string &s)
53 s.erase(std::find_if(s.rbegin(), s.rend(), [](
int ch) {
return !std::isspace(ch); }).base(), s.end());
58 static inline void trim(std::string &s)
70 double diff = fabs(a - b);
74 if (diff <= fmax(fabs(a), fabs(b)) * reltol)
84 for (
unsigned int start = 0, end = length-1; start < end; start++, end--)
87 array[start] = array[end];
void reverseArray(T *array, unsigned int length)
Definition: Util.h:81
const double DOUBLEEQUAL_RELTOL
Definition: Util.h:65
static bool almostEqualRelativeAndAbs(double a, double b, double reltol=DOUBLEEQUAL_RELTOL, double abstol=DOUBLEEQUAL_ABSTOL)
Definition: Util.h:68
static void rtrim(std::string &s)
Definition: Util.h:51
const double DOUBLEEQUAL_ABSTOL
Definition: Util.h:64
static void ltrim(std::string &s)
Definition: Util.h:44
static void trim(std::string &s)
Definition: Util.h:58