More information on the implementation of this random number generator is available in the GSL manual.
Matsumoto, M. and Nishimura, T. Mersenne Twister: A 623-dimensionally equidistributed uniform pseudorandom number generator. ACM Transactions on Modeling and Computer Simulation, 1998, 8, 3-30.
Definition at line 40 of file Random.hpp.
Static Public Member Functions | |
| static void | seed (unsigned int seed) |
| Seed the random number generator. | |
| static double | uniform (const double lower=0.0, const double upper=1.0) |
| Generate a random number from a uniform distribution over the given interval. | |
| static double | gaussian (const double mean=0.0, const double sigma=1.0) |
| Generate a random number from a Gaussian distribution with the given mean and standard deviation. | |
| static unsigned int | bernoulli (const double p=0.5) |
| Generate a boolean value from a Bernoulli distribution. | |
| static vector | unitVector (const unsigned int N) |
| Generate a random unit vector. | |
| static matrix | orthonormalMatrix (const unsigned int N) |
| Generate a random orthonormal matrix. | |
| void seed | ( | unsigned int | seed | ) | [static] |
Seed the random number generator.
| seed | Seed value. |
Definition at line 24 of file Random.cpp.
| double uniform | ( | const double | lower = 0.0, |
|
| const double | upper = 1.0 | |||
| ) | [inline, static] |
Generate a random number from a uniform distribution over the given interval.
| lower | Lower bound on the interval. | |
| upper | Upper bound on the interval. |
Definition at line 129 of file Random.hpp.
| double gaussian | ( | const double | mean = 0.0, |
|
| const double | sigma = 1.0 | |||
| ) | [inline, static] |
Generate a random number from a Gaussian distribution with the given mean and standard deviation.
| mean | Mean of the distribution. | |
| sigma | Standard deviation of the distribution. |
Definition at line 137 of file Random.hpp.
| unsigned int bernoulli | ( | const double | p = 0.5 |
) | [inline, static] |
Generate a boolean value from a Bernoulli distribution.
| p | Probability of true, between 0 and 1 inclusive. |
Definition at line 145 of file Random.hpp.
| vector unitVector | ( | const unsigned int | N | ) | [static] |
Generate a random unit vector.
| N | Size of unit vector. |
N dimensions. Definition at line 62 of file Random.cpp.
| matrix orthonormalMatrix | ( | const unsigned int | N | ) | [static] |
Generate a random orthonormal matrix.
| N | Size of matrix. |
N by N orthonormal matrix.
Definition at line 75 of file Random.cpp.
1.5.3