#include <RandomNumberGenerator.h>

Public Types | |
| enum | { STDLIBERAND48, NUMBER_OF_CALLS } |
Public Member Functions | |
| RandomNumberGenerator () | |
| Default constructor. | |
| virtual | ~RandomNumberGenerator () |
| Default destructor. | |
| virtual RandomNumberGenerator * | Clone ()=0 |
| Intelligent clone. | |
| virtual void | PrintSeed (std::ostream &)=0 |
| Prints the seed to a stream. | |
| virtual glotz_flt | GetUniformFloat ()=0 |
| Generates floats from a uniform distribution (0, 1). | |
| int | GetUniformInt (int, int) |
| Generates integers from a bounded uniform distribution. | |
| glotz_flt | GetUniformFloat (glotz_flt, glotz_flt) |
| Generates floats from uniform distribution between two bounds. | |
| glotz_flt | GetGaussianFloat () |
| Generates floats from a standard Gaussian distribution. | |
| glotz_flt | GetGaussianFloat (glotz_flt, glotz_flt) |
| Generates floats from a modified Gaussian distribution. | |
| glotz_flt | GetExponentialFloat (glotz_flt) |
| Generates floats from an exponential distribution. | |
| glotz_flt | GetCauchyFloat () |
| Generates floats from a Cauchy distribution. | |
| glotz_vec | GetUniformVector () |
| Generates a float vector uniformly distributed between (0, 1). | |
| glotz_vec | GetUniformVector (glotz_flt, glotz_flt) |
| Generates a float vector from a bounded uniform distribution. | |
| glotz_vec | GetGaussianVector () |
| Generates a float vector from a standard Gaussian distribution. | |
| glotz_vec | GetGaussianVector (glotz_flt, glotz_flt) |
| Generates a float vector from a modified Gaussian distribution. | |
| glotz_vec | GetExponentialVector (glotz_flt) |
| Generates a float vector from a exponential distribution. | |
| glotz_vec | GetCauchyVector () |
| Generates a float vector from a Cauchy distribution. | |
| glotz_quat | GetUniformQuaternion () |
| Generates a float quaternion from a uniform distribution. | |
| glotz_quat | GetUniformQuaternion (glotz_flt, glotz_flt) |
| Generates a float quaternion from bounded unifrom distribution. | |
| virtual void | PrintRestartData (std::ostream &) |
| Prints restart data. | |
| virtual void | ScanRestartData (std::istream &) |
| Scans restart data. | |
Static Public Member Functions | |
| static RandomNumberGenerator * | ParseRestartData (std::istream &) |
| Allocates a RNG object from restart data. | |
| static void | InitializeRestartMap () |
| Forms the restart map. | |
Static Public Attributes | |
| static std::map < std::string, int > | sRestartMap |
| Map of key restart data variable identifiers. | |
Protected Member Functions | |
| void | Marsaglia (glotz_flt &, glotz_flt &) |
| Implementation of the Marsaglia algorithm. | |
Private Attributes | |
| bool | mMarsagliaPairIsCurrent |
| True is we have an extra Marsaglia random number. | |
| glotz_flt | mMarsagliaFloatA |
| First Marsaglia random number. | |
| glotz_flt | mMarsagliaFloatB |
| Second Marsaglia random number. | |
| glotzmath::RandomNumberGenerator::RandomNumberGenerator | ( | ) |
Default constructor.
| glotzmath::RandomNumberGenerator::~RandomNumberGenerator | ( | ) | [virtual] |
Default destructor.
| virtual RandomNumberGenerator* glotzmath::RandomNumberGenerator::Clone | ( | ) | [pure virtual] |
| virtual void glotzmath::RandomNumberGenerator::PrintSeed | ( | std::ostream & | ) | [pure virtual] |
| virtual glotz_flt glotzmath::RandomNumberGenerator::GetUniformFloat | ( | ) | [pure virtual] |
| int glotzmath::RandomNumberGenerator::GetUniformInt | ( | int | min, | |
| int | max | |||
| ) | [inline] |
Generates integers from a bounded uniform distribution.
| min | is the lower bound of the uniform distribution | |
| max | is the upper bound of the uniform distribution |
| glotz_flt glotzmath::RandomNumberGenerator::GetUniformFloat | ( | glotz_flt | min, | |
| glotz_flt | max | |||
| ) | [inline] |
Generates floats from uniform distribution between two bounds.
| min | is the lower bound of the uniform distribution | |
| max | is the upper bound of the uniform distribution |
| glotz_flt glotzmath::RandomNumberGenerator::GetGaussianFloat | ( | ) | [inline] |
Generates floats from a standard Gaussian distribution.
| glotz_flt glotzmath::RandomNumberGenerator::GetGaussianFloat | ( | glotz_flt | mean, | |
| glotz_flt | sqrtVariance | |||
| ) | [inline] |
Generates floats from a modified Gaussian distribution.
| mean | is the mean of the desired Gaussian distribution to sample from | |
| sqrtVariance | is the square root of the variance of the desired Gaussian distribution |
Generates floats from an exponential distribution.
| lambda | is the power of the exponential |
| glotz_flt glotzmath::RandomNumberGenerator::GetCauchyFloat | ( | ) | [inline] |
Generates floats from a Cauchy distribution.
| glotz_vec glotzmath::RandomNumberGenerator::GetUniformVector | ( | ) | [inline] |
Generates a float vector uniformly distributed between (0, 1).
| glotz_vec glotzmath::RandomNumberGenerator::GetUniformVector | ( | glotz_flt | min, | |
| glotz_flt | max | |||
| ) | [inline] |
Generates a float vector from a bounded uniform distribution.
| min | is the lower bound of the uniform distribution | |
| max | is the upper bound of the uniform distribution |
| glotz_vec glotzmath::RandomNumberGenerator::GetGaussianVector | ( | ) | [inline] |
Generates a float vector from a standard Gaussian distribution.
Calls RandomNumberGenerator::GetGaussianFloat().
| glotz_vec glotzmath::RandomNumberGenerator::GetGaussianVector | ( | glotz_flt | mean, | |
| glotz_flt | sqrtVar | |||
| ) | [inline] |
Generates a float vector from a modified Gaussian distribution.
Generates a float vector from a exponential distribution.
| lambda | is the power of the exponential |
| glotz_vec glotzmath::RandomNumberGenerator::GetCauchyVector | ( | ) | [inline] |
Generates a float vector from a Cauchy distribution.
| glotz_quat glotzmath::RandomNumberGenerator::GetUniformQuaternion | ( | ) | [inline] |
Generates a float quaternion from a uniform distribution.
| glotz_quat glotzmath::RandomNumberGenerator::GetUniformQuaternion | ( | glotz_flt | min, | |
| glotz_flt | max | |||
| ) | [inline] |
Generates a float quaternion from bounded unifrom distribution.
| RandomNumberGenerator * glotzmath::RandomNumberGenerator::ParseRestartData | ( | std::istream & | is | ) | [static] |
Allocates a RNG object from restart data.
| void glotzmath::RandomNumberGenerator::PrintRestartData | ( | std::ostream & | os | ) | [virtual] |
| void glotzmath::RandomNumberGenerator::ScanRestartData | ( | std::istream & | is | ) | [virtual] |
| void glotzmath::RandomNumberGenerator::InitializeRestartMap | ( | ) | [static] |
Forms the restart map.
| void glotzmath::RandomNumberGenerator::Marsaglia | ( | glotz_flt & | x1, | |
| glotz_flt & | x2 | |||
| ) | [inline, protected] |
Implementation of the Marsaglia algorithm.
Generates two Gaussian random variables using the Marsaglia algorithm.
| x1 | is a reference to a floating point number | |
| x2 | is a reference to a (different) floating point number |
std::map< std::string, int > glotzmath::RandomNumberGenerator::sRestartMap [static] |
Map of key restart data variable identifiers.
bool glotzmath::RandomNumberGenerator::mMarsagliaPairIsCurrent [private] |
True is we have an extra Marsaglia random number.
First Marsaglia random number.
Second Marsaglia random number.
1.5.3