25 #include <queso/Defines.h>
26 #include <queso/RngGsl.h>
27 #include <gsl/gsl_randist.h>
38 m_rng = gsl_rng_alloc(gsl_rng_ranlxd2);
39 queso_require_msg(
m_rng,
"null m_rng");
44 std::cout <<
"In RngGsl::constructor():"
45 <<
"\n m_seed = " <<
m_seed
68 m_rng = gsl_rng_alloc(gsl_rng_ranlxd2);
69 queso_require_msg(
m_rng,
"null m_rng");
77 return gsl_rng_uniform(
m_rng);
84 return gsl_ran_gaussian(
m_rng,stdDev);
91 return gsl_ran_beta(
m_rng,alpha,beta);
98 return gsl_ran_gamma(
m_rng,a,b);
virtual void resetSeed(int newSeed)
Resets the seed with value newSeed.
void resetSeed(int newSeed)
Resets the seed with value newSeed.
const gsl_rng * rng() const
GSL random number generator.
double uniformSample() const
Samples a value from a uniform distribution. Support: [0,1] or [a,b].
double gammaSample(double a, double b) const
Samples a value from a Gamma distribution. Support: [0,infinity).
gsl_rng * m_rng
GSL random number generator.
Class for random number generation (base class for either GSL or Boost RNG).
double gaussianSample(double stdDev) const
int m_worldRank
Rank of processor.
RngGsl()
Default Constructor: it should not be used.
double betaSample(double alpha, double beta) const
Samples a value from a Beta distribution. Support: [0,1].
unsigned long int gsl_rng_default_seed