queso-0.53.0
|
Class for random number generation (base class for either GSL or Boost RNG). More...
#include <RngBase.h>
Public Member Functions | |
Constructor/Destructor methods | |
RngBase (int seed, int worldRank) | |
Constructor with seed. More... | |
virtual | ~RngBase () |
Virtual destructor. More... | |
Sampling methods | |
int | seed () const |
Sets the seed. More... | |
virtual void | resetSeed (int newSeed) |
Resets the seed with value newSeed . More... | |
virtual double | uniformSample () const =0 |
Samples a value from a uniform distribution. More... | |
virtual double | gaussianSample (double stdDev) const =0 |
Samples a value from a Gaussian distribution with standard deviation given by stdDev . More... | |
virtual double | betaSample (double alpha, double beta) const =0 |
Samples a value from a Beta distribution. More... | |
virtual double | gammaSample (double a, double b) const =0 |
Samples a value from a Gamma distribution. More... | |
Protected Attributes | |
int | m_seed |
Seed. More... | |
int | m_worldRank |
Rank of processor. More... | |
Private Member Functions | |
RngBase () | |
Default Constructor: it should not be used. More... | |
void | privateResetSeed () |
Reset seed. More... | |
Class for random number generation (base class for either GSL or Boost RNG).
This class is a “virtual” class of generic random number generator, in order to accommodate either GSL or Boost RNG.
QUESO::RngBase::RngBase | ( | int | seed, |
int | worldRank | ||
) |
|
virtual |
|
private |
Default Constructor: it should not be used.
|
pure virtual |
Samples a value from a Beta distribution.
Implemented in QUESO::RngGsl, and QUESO::RngBoost.
Referenced by QUESO::GslVector::cwSetBeta().
|
pure virtual |
Samples a value from a Gamma distribution.
Implemented in QUESO::RngGsl, and QUESO::RngBoost.
Referenced by QUESO::GslVector::cwSetGamma(), and QUESO::GslVector::cwSetInverseGamma().
|
pure virtual |
Samples a value from a Gaussian distribution with standard deviation given by stdDev
.
Implemented in QUESO::RngGsl, and QUESO::RngBoost.
Referenced by QUESO::GslVector::cwSetGaussian(), QUESO::InfiniteDimensionalGaussian::draw(), and QUESO::MiscGammar().
|
private |
Reset seed.
Definition at line 57 of file RngBase.C.
References m_seed, and m_worldRank.
Referenced by resetSeed(), and RngBase().
|
virtual |
Resets the seed with value newSeed
.
Reimplemented in QUESO::RngGsl, and QUESO::RngBoost.
Definition at line 49 of file RngBase.C.
References m_seed, and privateResetSeed().
Referenced by QUESO::RngGsl::resetSeed(), and QUESO::BaseEnvironment::resetSeed().
int QUESO::RngBase::seed | ( | ) | const |
Sets the seed.
Definition at line 43 of file RngBase.C.
References m_seed.
Referenced by QUESO::BaseEnvironment::seed().
|
pure virtual |
Samples a value from a uniform distribution.
Implemented in QUESO::RngGsl, and QUESO::RngBoost.
Referenced by QUESO::GslVector::cwSetUniform(), QUESO::MiscGammar(), and QUESO::FiniteDistribution::sample().
|
protected |
Seed.
Definition at line 82 of file RngBase.h.
Referenced by privateResetSeed(), resetSeed(), QUESO::RngGsl::resetSeed(), QUESO::RngGsl::RngGsl(), and seed().
|
protected |
Rank of processor.
Definition at line 85 of file RngBase.h.
Referenced by privateResetSeed(), and QUESO::RngGsl::RngGsl().