37 #ifndef RANDOM_NUMBERS_RANDOM_NUMBERS_ 38 #define RANDOM_NUMBERS_RANDOM_NUMBERS_ 40 #include <boost/random/mersenne_twister.hpp> 41 #include <boost/random/uniform_real.hpp> 42 #include <boost/random/uniform_int.hpp> 43 #include <boost/random/variate_generator.hpp> 44 #include <boost/random/normal_distribution.hpp> 76 return (upper_bound - lower_bound) *
uni_() + lower_bound;
88 return normal_() * stddev + mean;
99 boost::uniform_int<> dis(min, max);
113 boost::variate_generator<boost::mt19937&, boost::uniform_real<> >
uni_;
114 boost::variate_generator<boost::mt19937&, boost::normal_distribution<> >
normal_;
double gaussian(double mean, double stddev)
Generate a random real using a normal distribution with given mean and variance.
int uniformInteger(int min, int max)
Generate an integer uniformly at random within a specified range (inclusive)
boost::mt19937 generator_
void quaternion(double value[4])
Uniform random unit quaternion sampling. The computed value has the order (x,y,z,w) ...
double uniform01(void)
Generate a random real between 0 and 1.
boost::uint32_t getFirstSeed()
Allow the randomly generated seed to be saved so that experiments / benchmarks can be recreated in th...
boost::uniform_real uniDist_
boost::variate_generator< boost::mt19937 &, boost::normal_distribution<> > normal_
double uniformReal(double lower_bound, double upper_bound)
Generate a random real within given bounds: [lower_bound, upper_bound)
double gaussian01(void)
Generate a random real using a normal distribution with mean 0 and variance 1.
boost::normal_distribution normalDist_
boost::variate_generator< boost::mt19937 &, boost::uniform_real<> > uni_
RandomNumberGenerator(void)
Constructor. Always sets a "random" random seed.
Random number generation (wrapper for boost). An instance of this class cannot be used by multiple th...