queso-0.53.0
|
#include <RngGsl.h>
Public Member Functions | |
Constructor/Destructor methods | |
RngGsl (int seed, int worldRank) | |
Constructor with seed. More... | |
~RngGsl () | |
Destructor. More... | |
Public Member Functions inherited from QUESO::RngBase | |
RngBase (int seed, int worldRank) | |
Constructor with seed. More... | |
virtual | ~RngBase () |
Virtual destructor. More... | |
int | seed () const |
Sets the seed. More... | |
Sampling methods | |
gsl_rng * | m_rng |
GSL random number generator. More... | |
void | resetSeed (int newSeed) |
Resets the seed with value newSeed . More... | |
double | uniformSample () const |
Samples a value from a uniform distribution. Support: [0,1] or [a,b]. More... | |
double | gaussianSample (double stdDev) const |
double | betaSample (double alpha, double beta) const |
Samples a value from a Beta distribution. Support: [0,1]. More... | |
double | gammaSample (double a, double b) const |
Samples a value from a Gamma distribution. Support: [0,infinity). More... | |
const gsl_rng * | rng () const |
GSL random number generator. More... | |
RngGsl () | |
Default Constructor: it should not be used. More... | |
Additional Inherited Members | |
Protected Attributes inherited from QUESO::RngBase | |
int | m_seed |
Seed. More... | |
int | m_worldRank |
Rank of processor. More... | |
RngGsl::RngGsl | ( | int | seed, |
int | worldRank | ||
) |
Constructor with seed.
Constructor with seed ------------------------—.
Definition at line 32 of file RngGsl.C.
References gsl_rng_default_seed, m_rng, QUESO::RngBase::m_seed, QUESO::RngBase::m_worldRank, and queso_require_msg.
|
protected |
Default Constructor: it should not be used.
|
virtual |
Samples a value from a Beta distribution. Support: [0,1].
The Beta Distribution is a continuous probability distribution; it has two free parameters, which are labeled alpha and beta. The beta distribution is used as a prior distribution for binomial proportions in Bayesian analysis (Evans et al. 2000, p. 34). Uses gsl_ran_beta(). Support (domain): [0,1].
Implements QUESO::RngBase.
Definition at line 89 of file RngGsl.C.
References m_rng.
|
virtual |
Samples a value from a Gamma distribution. Support: [0,infinity).
The Gamma Distribution is a continuous probability distribution; it has two free parameters, which may be labeled: a shape parameter a and an inverse scale parameter b, called a rate parameter. Uses gsl_ran_gamma(). Support (domain): [0,infinity).
Implements QUESO::RngBase.
Definition at line 96 of file RngGsl.C.
References m_rng.
|
virtual |
Samples a value from a Gaussian distribution with standard deviation given by stdDev
. Support: (-infinity, infinity).
The parameter mu (mean or expectation of the distribution) in this Gaussian sample is set to zero, and thus, needs to be provided in an alternative way (e.g., in the form of a sum. The parameter stdDev is its standard deviation; its variance is therefore stdDev^2. A random variable with a Gaussian distribution is said to be normally distributed and is called a normal deviate. Uses gsl_ran_gaussian(). Support: (-infinity, infinity).
Implements QUESO::RngBase.
Definition at line 82 of file RngGsl.C.
References m_rng.
|
virtual |
Resets the seed with value newSeed
.
Reimplemented from QUESO::RngBase.
Definition at line 62 of file RngGsl.C.
References gsl_rng_default_seed, m_rng, QUESO::RngBase::m_seed, queso_require_msg, and QUESO::RngBase::resetSeed().
const gsl_rng * RngGsl::rng | ( | ) | const |
|
virtual |
Samples a value from a uniform distribution. Support: [0,1] or [a,b].
This function samples from continuous uniform distribution on the range [0,1). It is possible to scale this distribution so the support is defined by the two parameters, a and b, which are its minimum and maximum values. Support: -infinity < a < x< b< infinity. Uses gsl_rng_uniform(m_rng).
Implements QUESO::RngBase.
Definition at line 75 of file RngGsl.C.
References m_rng.
|
protected |
GSL random number generator.
It is chosen, in the constructor, to be of type gsl_rng_ranlxd2.
Definition at line 111 of file RngGsl.h.
Referenced by betaSample(), gammaSample(), gaussianSample(), resetSeed(), rng(), RngGsl(), uniformSample(), and ~RngGsl().