|
static bool | getCxx11Enabled () |
|
static bool | sleep (const unsigned int &numMilliseconds) |
|
static Float | scale (const Float &x, const Float &minSource, const Float &maxSource, const Float &minTarget, const Float &maxTarget, const bool constrain=false) |
|
static std::string | intToString (const int &i) |
|
static std::string | intToString (const unsigned int &i) |
|
static std::string | toString (const int &i) |
|
static std::string | toString (const unsigned int &i) |
|
static std::string | toString (const long &i) |
|
static std::string | toString (const unsigned long &i) |
|
static std::string | toString (const unsigned long long &i) |
|
static std::string | toString (const bool &b) |
|
static std::string | toString (const float &v) |
|
static std::string | toString (const double &v) |
|
static std::string | toString (const long double &v) |
|
static int | stringToInt (const std::string &s) |
|
static double | stringToDouble (const std::string &s) |
|
static Float | stringToFloat (const std::string &s) |
|
static bool | stringToBool (const std::string &s) |
|
static bool | stringEndsWith (const std::string &str, const std::string &ending) |
|
static Float | limit (const Float value, const Float minValue, const Float maxValue) |
|
static Float | sum (const VectorFloat &x) |
|
static Float | dotProduct (const VectorFloat &a, const VectorFloat &b) |
|
static Float | euclideanDistance (const VectorFloat &a, const VectorFloat &b) |
|
static Float | manhattanDistance (const VectorFloat &a, const VectorFloat &b) |
|
static Float | cosineDistance (const VectorFloat &a, const VectorFloat &b) |
|
static VectorFloat | scale (const VectorFloat &x, const Float minSource, const Float maxSource, const Float minTarget=0, const Float maxTarget=1, const bool constrain=false) |
|
static VectorFloat | normalize (const VectorFloat &x) |
|
static VectorFloat | limit (const VectorFloat &x, const Float minValue, const Float maxValue) |
|
static Float | getMin (const VectorFloat &x) |
|
static unsigned int | getMinIndex (const VectorFloat &x) |
|
static Float | getMax (const VectorFloat &x) |
|
static unsigned int | getMaxIndex (const VectorFloat &x) |
|
static unsigned int | getMin (const std::vector< unsigned int > &x) |
|
static unsigned int | getMax (const std::vector< unsigned int > &x) |
|
static unsigned int | getOS () |
|
static void | cartToPolar (const Float x, const Float y, Float &r, Float &theta) |
|
static void | polarToCart (const Float r, const Float theta, Float &x, Float &y) |
|
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. A wildcard (.*) can be used to indicate any file in the directory. Multiple filetypes can be searched for by seperating the file type via |. For example: *.csv|*.grt will return any CSV or GRT files in the directory. More...
|
|
Definition at line 45 of file Util.h.
Computes the cosine distance between the two input vectors. The two input vectors must have the same size. The cosine distance can be used as a similarity measure, the distance ranges from −1 meaning exactly opposite, to 1 meaning exactly the same, with 0 usually indicating independence, and in-between values indicating intermediate similarity or dissimilarity.
- Parameters
-
a | the first vector for the cosine distance |
a | the second vector for the cosine distance |
- Returns
- the cosine distance between the two input vectors, if the two input vectors are not the same size then the dist will be INF
Definition at line 208 of file Util.cpp.
bool Util::stringToBool |
( |
const std::string & |
s | ) |
|
|
static |
Converts a string to a boolean. Any string that matches true, True, TRUE, t, T, or 1 will return true, anything else will return false.
- Parameters
-
s | the value you want to convert to a bool |
- Returns
- bool: the value as a bool
Definition at line 146 of file Util.cpp.