yat
0.8.3pre
|
Gaussian distribution. More...
#include <yat/random/random.h>
Public Member Functions | |
Gaussian (const double s=1, const double m=0) | |
Constructor. | |
double | operator() (void) const |
double | operator() (const double s) const |
double | operator() (const double s, const double m) const |
void | seed (unsigned long s) const |
Set the seed to s. | |
unsigned long | seed_from_devurandom (void) |
Set the seed using the /dev/urandom device. | |
Protected Attributes | |
RNG * | rng_ |
pointer to GSL random generator |
Gaussian distribution.
Class for generating a random number from a Gaussian distribution between zero and unity. Utilizes the Box-Muller algorithm, which needs two calls to random generator.
Distribution function
Expectation value:
Variance:
|
explicit |
Constructor.
s | is the standard deviation of distribution |
m | is the expectation value of the distribution |
|
virtual |
Implements theplu::yat::random::Continuous.
double theplu::yat::random::Gaussian::operator() | ( | const double | s | ) | const |
double theplu::yat::random::Gaussian::operator() | ( | const double | s, |
const double | m | ||
) | const |
|
inherited |
Set the seed to s.
Set the seed to s in the underlying rng. If s is zero, a default value from the rng's original implementation is used (cf. GSL documentation).
|
inherited |
Set the seed using the /dev/urandom device.