11 #ifndef __RD_UTILS_H__ 12 #define __RD_UTILS_H__ 17 #include <boost/random.hpp> 30 bool feq(
double v1,
double v2,
double tol=1e-4);
52 typename T::const_iterator refIt=ref.begin();
53 typename T::iterator probeIt=probe.begin();
54 typename T::iterator probeIt2;
56 unsigned int nSwaps = 0;
57 while(refIt!=ref.end()){
58 if((*probeIt)!=(*refIt)){
61 while((*probeIt2)!=(*refIt) && probeIt2!=probe.end()){
64 if(probeIt2 != probe.end()){
69 std::swap(*probeIt,*probeIt2);
double computeIntVectPrimesProduct(const INT_VECT &ring)
compute the product of the set of primes corresponding to the values in an INT_VECT ...
boost::minstd_rand rng_type
#define CHECK_INVARIANT(expr, mess)
double getRandomVal(int seed=-1)
const int NUM_PRIMES_AVAIL
the number of primes available and stored
double_source_type & getDoubleRandomSource()
return a reference to the global (Boost) random source
double int_pow< 0 >(double)
std::vector< int > INT_VECT
boost::uniform_real uniform_double
double int_pow< 1 >(double x)
boost::variate_generator< rng_type &, uniform_double > double_source_type
Includes a bunch of functionality for handling Atom and Bond queries.
const int FILE_MAXLINE
an assumed maximum length for lines read from files
boost::variate_generator< rng_type &, uniform_int > int_source_type
#define PRECONDITION(expr, mess)
int firstThousandPrimes[NUM_PRIMES_AVAIL]
unsigned int countSwapsToInterconvert(const T &ref, T probe)
boost::uniform_int uniform_int
bool feq(double v1, double v2, double tol=1e-4)
floating point comparison with a tolerance
rng_type & getRandomGenerator(int seed=-1)
Optionally seed and return a reference to the global (Boost) random generator.