37 #include "RandomNumberGenerator.hpp"
42 : mMersenneTwisterGenerator(0u),
43 mGenerateUnitReal(mMersenneTwisterGenerator, boost::uniform_real<>()),
44 #if BOOST_VERSION < 105600
45 mGenerateStandardNormal(mMersenneTwisterGenerator, boost::random::normal_distribution_v156<>(mMersenneTwisterGenerator, 0.0, 1.0))
47 mGenerateStandardNormal(mMersenneTwisterGenerator, boost::normal_distribution<>(0.0, 1.0))
85 #if BOOST_VERSION < 103700
97 if (base - 1u >= base_range)
127 boost::gamma_distribution<> gd(shape);
130 return scale*var_gamma();
136 boost::exponential_distribution<> ed(scale);
139 boost::variate_generator<boost::mt19937& , boost::exponential_distribution<> > var_exponential(
mMersenneTwisterGenerator, ed);
142 return var_exponential();
159 for (
unsigned i=0; i<num; i++)
164 for (
unsigned end=num-1; end>0; end--)
168 unsigned temp = rValues[end];
169 rValues[end] = rValues[k];
boost::variate_generator< boost::mt19937 &, boost::random::normal_distribution_v156<> > mGenerateStandardNormal
unsigned randMod(unsigned base)
void Reseed(unsigned seed)
static RandomNumberGenerator * mpInstance
double NormalRandomDeviate(double mean, double stdDev)
void Shuffle(std::vector< boost::shared_ptr< T > > &rValues)
boost::variate_generator< boost::mt19937 &, boost::uniform_real<> > mGenerateUnitReal
boost::mt19937 mMersenneTwisterGenerator
static RandomNumberGenerator * Instance()
double StandardNormalRandomDeviate()
double GammaRandomDeviate(double shape, double scale)
double ExponentialRandomDeviate(double scale)