25 #include <queso/RngGsl.h>
26 #include <gsl/gsl_randist.h>
38 m_rng = gsl_rng_alloc(gsl_rng_ranlxd2);
44 std::cout <<
"In RngGsl::constructor():"
45 <<
"\n m_seed = " <<
m_seed
68 m_rng = gsl_rng_alloc(gsl_rng_ranlxd2);
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);
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.
double gaussianSample(double stdDev) const
void resetSeed(int newSeed)
Resets the seed with value newSeed.
const gsl_rng * rng() const
GSL random number generator.
#define queso_require_msg(asserted, msg)
Class for random number generation (base class for either GSL or Boost RNG).
RngGsl()
Default Constructor: it should not be used.
virtual void resetSeed(int newSeed)
Resets the seed with value newSeed.
double betaSample(double alpha, double beta) const
Samples a value from a Beta distribution. Support: [0,1].
unsigned long int gsl_rng_default_seed
int m_worldRank
Rank of processor.