Defines general utility functions and adds an abstraction layer for platform-dependent functionality.
More...
|
size_t | dai::BigInt_size_t (const BigInt &N) |
| Safe down-cast of big integer to size_t. More...
|
|
bool | dai::isnan (Real x) |
| Returns true if argument is NAN (Not A Number) More...
|
|
Real | dai::log (Real x) |
| Returns logarithm of x. More...
|
|
Real | dai::log0 (Real x) |
| Returns logarithm of x, or 0 if x == 0. More...
|
|
Real | dai::exp (Real x) |
| Returns exponent of x. More...
|
|
Real | dai::pow (Real x, Real y) |
| Returns x to the power y. More...
|
|
double | dai::toc () |
| Returns wall clock time in seconds. More...
|
|
template<class T > |
T | dai::abs (const T &t) |
| Returns absolute value of t. More...
|
|
void | dai::rnd_seed (size_t seed) |
| Sets the random seed. More...
|
|
Real | dai::rnd_uniform () |
| Returns a real number, distributed uniformly on [0,1) More...
|
|
Real | dai::rnd_stdnormal () |
| Returns a real number from a standard-normal distribution. More...
|
|
int | dai::rnd_int (int min, int max) |
| Returns a random integer in interval [min, max]. More...
|
|
int | dai::rnd (int n) |
| Returns a random integer in the half-open interval [0, n) More...
|
|
template<class T > |
std::string | dai::toString (const T &x) |
| Converts a variable of type T to a std::string by using a boost::lexical_cast . More...
|
|
template<class T > |
T | dai::fromString (const std::string &x) |
| Converts a variable of type std::string to T by using a boost::lexical_cast . More...
|
|
template<class T > |
std::ostream & | dai::operator<< (std::ostream &os, const std::vector< T > &x) |
| Writes a std::vector<> to a std::ostream . More...
|
|
template<class T > |
std::ostream & | dai::operator<< (std::ostream &os, const std::set< T > &x) |
| Writes a std::set<> to a std::ostream . More...
|
|
template<class T1 , class T2 > |
std::ostream & | dai::operator<< (std::ostream &os, const std::map< T1, T2 > &x) |
| Writes a std::map<> to a std::ostream . More...
|
|
template<class T1 , class T2 > |
std::ostream & | dai::operator<< (std::ostream &os, const std::pair< T1, T2 > &x) |
| Writes a std::pair<> to a std::ostream . More...
|
|
template<class T > |
std::vector< T > | dai::concat (const std::vector< T > &u, const std::vector< T > &v) |
| Concatenates two vectors. More...
|
|
std::vector< std::string > | dai::tokenizeString (const std::string &s, bool singleDelim, const std::string &delim="\t\n") |
| Split a string into tokens delimited by one of the characters in delim. More...
|
|
Defines general utility functions and adds an abstraction layer for platform-dependent functionality.