36 #include "RandomNumberGenerator.hpp"
39 #if BOOST_VERSION < 106400 // #2893
48 : mMersenneTwisterGenerator(0u),
49 mGenerateUnitReal(mMersenneTwisterGenerator, boost::uniform_real<>()),
50 #if BOOST_VERSION < 106400
51 mGenerateStandardNormal(mMersenneTwisterGenerator, boost::random::normal_distribution_v165<>(0.0, 1.0))
53 mGenerateStandardNormal(mMersenneTwisterGenerator, boost::normal_distribution<>(0.0, 1.0))
96 if (base - 1u >= base_range)
128 #if BOOST_VERSION < 106400
130 boost::variate_generator<boost::mt19937&, boost::random::gamma_distribution_v165<> > var_gamma(
mMersenneTwisterGenerator, gd);
132 boost::gamma_distribution<> gd(shape);
135 return scale * var_gamma();
142 #if BOOST_VERSION < 106400
144 boost::variate_generator<boost::mt19937&, boost::random::exponential_distribution_v165<> > var_exponential(
mMersenneTwisterGenerator, ed);
146 boost::exponential_distribution<> ed(scale);
147 boost::variate_generator<boost::mt19937&, boost::exponential_distribution<> > var_exponential(
mMersenneTwisterGenerator, ed);
150 return var_exponential();
167 for (
unsigned i = 0; i < num; i++)
172 for (
unsigned end = num - 1; end > 0; end--)
176 unsigned temp = rValues[end];
177 rValues[end] = rValues[k];
unsigned randMod(unsigned base)
void Reseed(unsigned seed)
boost::variate_generator< boost::mt19937 &, boost::random::normal_distribution_v165<> > mGenerateStandardNormal
static RandomNumberGenerator * mpInstance
double NormalRandomDeviate(double mean, double stdDev)
boost::variate_generator< boost::mt19937 &, boost::uniform_real<> > mGenerateUnitReal
void Shuffle(std::vector< boost::shared_ptr< T > > &rValues)
boost::mt19937 mMersenneTwisterGenerator
static RandomNumberGenerator * Instance()
double StandardNormalRandomDeviate()
double GammaRandomDeviate(double shape, double scale)
double ExponentialRandomDeviate(double scale)