Mungojerrie  1.1
Mungojerrie
Classes | Namespaces | Typedefs | Functions
Util.hh File Reference

Utility functions. More...

#include <vector>
#include <set>
#include <string>
#include <iostream>
#include <sstream>
#include <random>
#include <boost/random.hpp>
#include <boost/functional/hash.hpp>
#include <chrono>
#include <functional>
#include "cuddObj.hh"
#include "State.hh"
Include dependency graph for Util.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Util::BddCompare
 Class that defines a comparison operator for the BDD class. More...
 
class  Util::PairWithBddCompare< T >
 Class that defines a comparison operator for pairs with BDDs. More...
 
class  Util::PairHash< T1, T2 >
 Class that defines a hash function for pairs. More...
 

Namespaces

 Util
 Namespace of utilities.
 

Typedefs

using Util::RandomEngine = std::mt19937
 

Functions

void Util::replace (std::string &str, std::string const &from, std::string const &to)
 Replace first occurrence of "from" in "str" with "to.".
 
void Util::replaceAll (std::string &str, std::string const &from, std::string const &to)
 Replace all occurrences of "from" in "str" with "to.".
 
char ** Util::cStringArrayAlloc (std::vector< std::string > const &sv)
 Copy a vector of C++ strings to an array of C strings.
 
void Util::cStringArrayFree (char **sa, size_t n)
 Dispose of an array of C strings.
 
template<typename T >
std::string Util::to_string (T const &num)
 Replacement for std::to_string since cygwin does not have it.
 
template<typename T , typename Comp >
std::vector< std::set< T, Comp > > Util::mapToPartition (std::map< T, unsigned, Comp > const &m)
 Converts a partition map to a vector of sets.
 
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.
 
template<typename Iterator >
std::iterator_traits< Iterator >::value_type Util::sample_discrete_distribution (Iterator first, Iterator last)
 Returns a sample from the discrete distribution defined by the iterators.
 
int Util::sample_discrete_distribution (std::vector< double > const &weights)
 Returns a sample from discrete distribution defined by weights.
 
template<typename IntType >
IntType Util::sample_uniform_distribution (IntType low, IntType hi)
 Returns a sample from a uniform integer distribution.
 
chrono::time_point< chrono::system_clock > Util::stopwatch ()
 Records a reference time.
 
void Util::printElapsedTag (std::ostream &os=std::cout)
 Prints tag with elapsed time in seconds.
 
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 (std::string const &str, std::string const &pre)
 Returns true if pre is a prefix of str.
 

Detailed Description

Utility functions.

Author
Mateo Perez, Fabio Somenzi, Ashutosh Trivedi