12 #ifndef GRT_UTIL_HEADER
13 #define GRT_UTIL_HEADER
16 #include "GRTVersionInfo.h"
17 #include "GRTTypedefs.h"
18 #include "../DataStructures/VectorFloat.h"
19 #include "../DataStructures/MatrixFloat.h"
21 #ifdef __GRT_WINDOWS_BUILD__
31 #ifdef __GRT_OSX_BUILD__
37 #ifdef __GRT_LINUX_BUILD__
68 static bool sleep(
const unsigned int &numMilliseconds);
81 static Float
scale(
const Float &x,
const Float &minSource,
const Float &maxSource,
const Float &minTarget,
const Float &maxTarget,
const bool constrain=
false);
97 static std::string
intToString(
const unsigned int &i);
105 static std::string
toString(
const int &i);
113 static std::string
toString(
const unsigned int &i);
121 static std::string
toString(
const long &i);
129 static std::string
toString(
const unsigned long &i);
137 static std::string
toString(
const unsigned long long &i);
145 static std::string
toString(
const bool &b);
153 static std::string
toString(
const float &v);
161 static std::string
toString(
const double &v);
169 static std::string
toString(
const long double &v);
210 static bool stringEndsWith(
const std::string &str,
const std::string &ending);
223 static Float
limit(
const Float value,
const Float minValue,
const Float maxValue);
283 static VectorFloat scale(
const VectorFloat &x,
const Float minSource,
const Float maxSource,
const Float minTarget=0,
const Float maxTarget=1,
const bool constrain=
false);
342 static unsigned int getMin(
const std::vector< unsigned int > &x);
350 static unsigned int getMax(
const std::vector< unsigned int > &x);
357 static unsigned int getOS();
368 static void cartToPolar(
const Float x,
const Float y,Float &r, Float &theta);
379 static void polarToCart(
const Float r,
const Float theta,Float &x, Float &y);
393 static bool parseDirectory(
const std::string directoryPath,
const std::string type, std::vector< std::string > &filenames );
404 #endif // GRT_UTIL_HEADER
static std::string toString(const int &i)
static Float manhattanDistance(const VectorFloat &a, const VectorFloat &b)
static void polarToCart(const Float r, const Float theta, Float &x, Float &y)
static Float scale(const Float &x, const Float &minSource, const Float &maxSource, const Float &minTarget, const Float &maxTarget, const bool constrain=false)
static Float stringToFloat(const std::string &s)
static double stringToDouble(const std::string &s)
static Float getMin(const VectorFloat &x)
static bool sleep(const unsigned int &numMilliseconds)
static std::string intToString(const int &i)
static bool getCxx11Enabled()
static void cartToPolar(const Float x, const Float y, Float &r, Float &theta)
static unsigned int getMinIndex(const VectorFloat &x)
static bool stringToBool(const std::string &s)
static VectorFloat normalize(const VectorFloat &x)
static Float euclideanDistance(const VectorFloat &a, const VectorFloat &b)
static Float limit(const Float value, const Float minValue, const Float maxValue)
static unsigned int getOS()
static bool stringEndsWith(const std::string &str, const std::string &ending)
static Float getMax(const VectorFloat &x)
static unsigned int getMaxIndex(const VectorFloat &x)
static int stringToInt(const std::string &s)
static Float sum(const VectorFloat &x)
static Float cosineDistance(const VectorFloat &a, const VectorFloat &b)
static bool parseDirectory(const std::string directoryPath, const std::string type, std::vector< std::string > &filenames)
Parses a directory and returns a list of filenames in that directory that match the file type...
static Float dotProduct(const VectorFloat &a, const VectorFloat &b)