12#ifndef SST_CORE_RNG_GAUSSIAN_H
13#define SST_CORE_RNG_GAUSSIAN_H
88 double gauss_u, gauss_v, sq_sum;
93 sq_sum = (gauss_u * gauss_u) + (gauss_v * gauss_v);
94 }
while ( sq_sum >= 1 || sq_sum == 0 );
104 double multiplier = sqrt(-2.0 * log(sq_sum) / sq_sum);
108 return mean +
stddev * gauss_u * multiplier;
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition serializer.h:45
Creates a Gaussian (normal) distribution for which to sample.
Definition gaussian.h:28
double getNextDouble() override
Gets the next double value in the distribution.
Definition gaussian.h:81
bool usePair
Random numbers for the distribution are read in pairs, this tells the code to use the second of the p...
Definition gaussian.h:169
~GaussianDistribution()
Destroys the Gaussian distribution.
Definition gaussian.h:70
Random * baseDistrib
The base random number generator for the distribution.
Definition gaussian.h:161
double getMean()
Gets the mean of the distribution.
Definition gaussian.h:116
bool deleteDistrib
Controls whether the destructor deletes the distribution (we need to ensure we do this IF we created ...
Definition gaussian.h:175
GaussianDistribution(double mn, double sd, Random *baseRNG)
Creates a new distribution with a predefined random number generator with a specified mean and standa...
Definition gaussian.h:54
void serialize_order(SST::Core::Serialization::serializer &ser) override
Serialization function for checkpoint.
Definition gaussian.h:134
GaussianDistribution(double mn, double sd)
Creates a new distribution with a predefined random number generator with a specified mean and standa...
Definition gaussian.h:36
double unusedPair
Random numbers for the distribution are read in pairs, this stores the second of the pair.
Definition gaussian.h:165
double getStandardDev()
Gets the standard deviation of the distribution.
Definition gaussian.h:122
ImplementSerializable(SST::RNG::GaussianDistribution) protected double stddev
Serialization macro.
Definition gaussian.h:147
GaussianDistribution()
Default constructor.
Definition gaussian.h:127
Implements a Mersenne-based RNG for use in the SST core or components.
Definition mersenne.h:34
RandomDistribution()
Creates the base (abstract) class of a distribution.
Definition distrib.h:41
Implements the base class for random number generators for the SST core.
Definition rng.h:29