|
Public Member Functions |
| ZRandGen () |
| Constructor which does an initial seeding using time.
|
| ZRandGen (unsigned long seed) |
| Constructor which does an initial seeding.
|
void | Seed (unsigned long seed) |
| Seed random number generator.
|
unsigned int | Rand (unsigned int max) |
| Obtain random integer [0,max).
|
unsigned long | Rand (unsigned long max) |
| Obtain random integer [0,max).
|
int | Rand (int min, int max) |
| Obtain random integer [min,max].
|
long | Rand (long min, long max) |
| Obtain random integer [min,max].
|
float | Rand (float min, float max) |
| Obtain random integer [min,max].
|
double | Rand (double min, double max) |
| Obtain random integer [min,max].
|
double | RandDouble () |
| Obtain random double [0,1).
|
Protected Member Functions |
unsigned long | genrand_int32 () |
| Workhorse of random generator, only used internally.
|
Protected Attributes |
unsigned long | rStateVector [N] |
| Each instance of the algorithm requires a state vector.
|
unsigned long | rStateVectorIndex |
| Used internally to traversing the rStateVector.
|
Static Protected Attributes |
const unsigned long | N = 624 |
| Number of random numbers to generate at once.
|
const unsigned long | M = 397 |
| A constant used internally by Mersenne Twister.
|
const unsigned long | MATRIX_A = 0x9908b0dfUL |
| Constant vector A, used internally by Mersenne Twister.
|
const unsigned long | UPPER_MASK = 0x80000000UL |
| Most signifigan w-r bits, used internally by Mersenne Twister.
|
const unsigned long | LOWER_MASK = 0x7fffffffUL |
| Least signifigant r bits, used internally by Mersenne Twister.
|