Inheritance diagram for NormalRandom:
This class generates random numbers from a Gaussian distribution.
Definition at line 338 of file Random.H.
Public Member Functions | |
NormalRandom (const double mean=0.0, const double variance=1.0, const unsigned long seed=1UL) | |
Generate samples | |
double | number () |
Generate a sample from the random variable. | |
Moments of the random variable | |
double | mean () const |
double | variance () const |
double | stdDev () const |
Change parameters of the random variable | |
void | setMean (const double mean) |
void | setVariance (const double variance) |
void | setStdDev (const double std_dev) |
void | setParameters (const double mean, const double variance) |
Private Attributes | |
double | m_mean |
double | m_std_dev |
NormalRandom | ( | const double | mean = 0.0 , |
|
const double | variance = 1.0 , |
|||
const unsigned long | seed = 1UL | |||
) | [inline] |
double number | ( | ) | [inline, virtual] |
Generate a sample from the random variable.
This function generates a sample from the random variable represented by the class instance.
Implements RealRandom.
Definition at line 659 of file Random.H.
References m_mean, m_std_dev, and MTRand::rand().
double mean | ( | ) | const [inline, virtual] |
Implements RealRandom.
Definition at line 357 of file Random.H.
References m_mean.
double variance | ( | ) | const [inline, virtual] |
Implements RealRandom.
Definition at line 358 of file Random.H.
References m_std_dev.
double stdDev | ( | ) | const [inline, virtual] |
Implements RealRandom.
Definition at line 359 of file Random.H.
References m_std_dev.
void setMean | ( | const double | mean | ) | [inline] |
Set the mean of the random variable.
mean | The new mean of the random variable. |
Definition at line 366 of file Random.H.
References m_mean.
Referenced by setParameters().
void setVariance | ( | const double | variance | ) | [inline] |
Set the variance of the random variable.
variance | The new variance of the random variable. |
Definition at line 369 of file Random.H.
References m_std_dev.
Referenced by setParameters().
void setStdDev | ( | const double | std_dev | ) | [inline] |
void setParameters | ( | const double | mean, | |
const double | variance | |||
) | [inline] |
Set the mean and variance of the random variable.
mean | The new mean of the random variable. | |
variance | The new variance of the random variable. |
Definition at line 376 of file Random.H.
References setMean(), and setVariance().
double m_mean [private] |
double m_std_dev [private] |
Definition at line 382 of file Random.H.
Referenced by number(), setStdDev(), setVariance(), stdDev(), and variance().