#include <NormalRng.h>
Public Member Functions | |
NormalRng () | |
virtual | ~NormalRng () |
void | setMean (double mean) |
void | setVariance (double variance) |
void | setMethod (int method) |
int | getMethod () const |
virtual void | vReinit (const Eref &e, ProcPtr p) |
Static Public Member Functions | |
static const Cinfo * | initCinfo () |
This is MOOSE wrapper for normally distributed random number generator class, Normal. The default
NormalRng::NormalRng | ( | ) |
By default the method used for normal distribution is alias method by Ahrens and Dieter. In order to use some method other than the default Alias method, one should call setMethod with a proper method index before calling reset ( reinit ). Since different methods create different random sequences, the combined sequence may not have the intended distribution. By default mean and variance are set to 0.0 and 1.0 respectively.
References RandGenerator::rng_.
virtual NormalRng::~NormalRng | ( | ) | [inline, virtual] |
int NormalRng::getMethod | ( | void | ) | const |
Returns the algorithm used. 0 for alias method. 1 for BoxMueller method.
References Normal::getMethod(), and RandGenerator::rng_.
Referenced by initCinfo().
const Cinfo * NormalRng::initCinfo | ( | ) | [static] |
Reimplemented from RandGenerator.
References RandGenerator::getMean(), getMethod(), RandGenerator::getVariance(), RandGenerator::initCinfo(), setMean(), setMethod(), and setVariance().
void NormalRng::setMean | ( | double | mean | ) |
Set the mean of the internal generator object.
References RandGenerator::rng_, and Normal::setMean().
Referenced by initCinfo().
void NormalRng::setMethod | ( | int | method | ) |
Set the algorithm to be used. 1 for BoxMueller method. Anything else for alias method.
References Normal::getMethod(), RandGenerator::rng_, and Normal::setMethod().
Referenced by initCinfo().
void NormalRng::setVariance | ( | double | variance | ) |
Since normal distribution is defined in terms of mean and variance, we want to store them in order to create the internal generator object.
References RandGenerator::rng_, and Normal::setVariance().
Referenced by initCinfo().
Reimplemented from RandGenerator.