Mungojerrie  1.0
Mungojerrie
Namespaces | Functions
Util.cc File Reference

Utility functions. More...

#include <cstring>
#include <limits>
#include <algorithm>
#include "Util.hh"
Include dependency graph for Util.cc:

Namespaces

 Util
 Namespace of utilities.
 

Functions

void Util::replace (string &str, string const &from, string const &to)
 
void Util::replaceAll (string &str, string const &from, string const &to)
 
char ** Util::cStringArrayAlloc (vector< string > const &sv)
 
void Util::cStringArrayFree (char **sa, size_t n)
 Dispose of an array of C strings.
 
RandomEngine & Util::urng ()
 Returns reference to uniform random number generator.
 
void Util::seed_urng ()
 Seeds the uniform random number generator.
 
void Util::seed_urng (unsigned seed)
 Seeds the uniform random number generator.
 
unsigned int Util::get_urng_seed ()
 Return the seed for the uniform random number generator.
 
int Util::sample_discrete_distribution (vector< double > const &weights)
 
chrono::time_point< chrono::system_clock > Util::stopwatch ()
 Records a reference time.
 
void Util::printElapsedTag (ostream &os)
 
double Util::getElapsedTime ()
 Returns the elapsed time in seconds.
 
const char * Util::to_decimal (int number)
 Converts an int to an array of characters in base 10.
 
bool Util::is_prefix (string const &str, string const &pre)
 

Detailed Description

Utility functions.

Author
Mateo Perez, Fabio Somenzi, Ashutosh Trivedi