Mersenne Twister. More...
#include <twister.h>
Public Member Functions | |
MersenneTwister () | |
Constructor. More... | |
MersenneTwister (unsigned seed) | |
Constructor. Uses a user specified integer as seed. | |
unsigned | next (unsigned r) |
Return integers in the range of [0, r) | |
unsigned | next () |
Generate the next random integer in the range of 0-(2^{32}-1). | |
double | nextDouble () |
float | nextFloat () |
int | nextInt () |
Next integer. | |
long | nextLong () |
virtual double | operator() () |
Return a floating-point value in the range of [0, 1). | |
void | setSeed (unsigned seed) |
Initializing the array with a seed. | |
Mersenne Twister.
It generates uniform random numbers, which is further used in other random number generators.
|
inline |
Constructor.
This default constructor uses a value of the current time as the seed to initialize. Define FASTBIT_USE_DEV_URANDOM if one desires to initialize the random number generator with a more unpredictable seed.
References setSeed().