18 #include <boost/random.hpp>
55 PRECONDITION(ref.size() == probe.size(),
"size mismatch");
56 typename T::const_iterator refIt = ref.begin();
57 typename T::iterator probeIt = probe.begin();
58 typename T::iterator probeIt2;
60 unsigned int nSwaps = 0;
61 while (refIt != ref.end()) {
62 if ((*probeIt) != (*refIt)) {
65 while ((*probeIt2) != (*refIt) && probeIt2 != probe.end()) {
68 if (probeIt2 != probe.end()) {
73 std::swap(*probeIt, *probeIt2);
88 double half =
int_pow<n / 2>(x);
92 return half * half * x;
#define CHECK_INVARIANT(expr, mess)
#define PRECONDITION(expr, mess)
#define RDKIT_RDGENERAL_EXPORT
RDKIT_RDGENERAL_EXPORT rng_type & getRandomGenerator(int seed=-1)
std::vector< int > INT_VECT
boost::uniform_int uniform_int
RDKIT_RDGENERAL_EXPORT bool feq(double v1, double v2, double tol=1e-4)
floating point comparison with a tolerance
boost::minstd_rand rng_type
boost::variate_generator< rng_type &, uniform_double > double_source_type
RDKIT_RDGENERAL_EXPORT double computeIntVectPrimesProduct(const INT_VECT &ring)
compute the product of the set of primes corresponding to the values in an INT_VECT
boost::variate_generator< rng_type &, uniform_int > int_source_type
RDKIT_RDGENERAL_EXPORT std::string augmentTagName(const std::string &tag)
int firstThousandPrimes[NUM_PRIMES_AVAIL]
RDKIT_RDGENERAL_EXPORT double_source_type & getDoubleRandomSource()
return a reference to the global (Boost) random source
const int NUM_PRIMES_AVAIL
the number of primes available and stored
unsigned int countSwapsToInterconvert(const T &ref, T probe)
boost::uniform_real uniform_double
const int FILE_MAXLINE
an assumed maximum length for lines read from files
RDKIT_RDGENERAL_EXPORT double getRandomVal(int seed=-1)
double int_pow< 0 >(double)
double int_pow< 1 >(double x)