Relacs Numerics Library
0.9.8
|
#include <random.h>
Public Member Functions | |
Ran3 (void) | |
Ran3 (unsigned long seed) | |
virtual | ~Ran3 (void) |
virtual unsigned long | setSeed (unsigned long seed) |
virtual unsigned long | integer (void) |
virtual unsigned long | min (void) const |
virtual unsigned long | max (void) const |
unsigned long | operator() (unsigned long n) |
double | operator() (void) |
virtual double | uniform (void) |
virtual double | gaussian (void) |
virtual double | exponential (void) |
virtual double | gamma (int a) |
virtual string | name (void) |
Public Member Functions inherited from RandomBase | |
RandomBase (void) | |
RandomBase (unsigned long seed) | |
virtual | ~RandomBase (void) |
unsigned long | operator() (unsigned long n) |
double | operator() (void) |
An implementation of RandomBase with the ran3 random number generator from the numerical recipes.
Ran3 | ( | void | ) |
References Ran3::setSeed().
Ran3 | ( | unsigned long | seed | ) |
References Ran3::setSeed().
|
virtual |
|
virtual |
Set the seed of the random number generator to seed. If seed is 0, then the system time is used to generate a seed to imitate real randomness. Returns the seed.
Implements RandomBase.
Referenced by Ran3::Ran3().
|
virtual |
Returns a uniformly distributed random integer between min() and max().
Implements RandomBase.
Referenced by Ran3::uniform().
|
virtual |
The minimum value integer() returns.
Implements RandomBase.
|
virtual |
The maximum value integer() returns.
Implements RandomBase.
|
inline |
Returns an uniformly distributed integer random number between zero and n. The range includes 0 but excludes n. This operator conforms to the STL RandomNumberGenerator specification. This function is NOT virtual in order to speed up computation.
References relacs::ceil().
|
inline |
Returns a uniformly distributed random number between zero and one. The range includes 0.0 but excludes 1.0. This function is NOT virtual in order to speed up computation.
Referenced by Ran3::exponential(), Ran3::gamma(), and Ran3::gaussian().
|
virtual |
Returns a uniformly distributed random number between zero and one. The range includes 0.0 but excludes 1.0.
Implements RandomBase.
References Ran3::integer().
|
virtual |
Returns a unit gaussian distributed random number.
Implements RandomBase.
References relacs::log(), Ran3::operator()(), and relacs::sqrt().
|
virtual |
Returns an exponential distributed random number with mean one.
Reimplemented from RandomBase.
References relacs::log(), and Ran3::operator()().
|
virtual |
Returns a gamma distributed random number p(x) dx = x^(a-1) exp(-x)/Gamma(a) dx.
Reimplemented from RandomBase.
References relacs::exp(), relacs::log(), Ran3::operator()(), and relacs::sqrt().
|
virtual |
The name of the random number generator ("ran3").
Implements RandomBase.