|
struct | zRandMT |
| random number generator based on Mersenne twister. More...
|
|
random number operations are not available in the kernel space
convenient reimplementations of the standard rand() function. Note that they are naive implementations of pseudo-random byte sequences.
◆ zRandInit
◆ zRandI
#define zRandI |
( |
|
min, |
|
|
|
max |
|
) |
| zRandMTI( NULL, min, max ) |
◆ zRandF
#define zRandF |
( |
|
min, |
|
|
|
max |
|
) |
| zRandMTF( NULL, min, max ) |
◆ zRandN
◆ zRandNU
◆ zRandInitMT()
initialize a random number generator based on Mersenne twister.
zRandInitMT() initializes Mersenne twister mt by seeding the current time for a new history. If the null pointer is given for mt, it makes use of the internal default instance.
◆ zRandMTI()
int zRandMTI |
( |
zRandMT * |
mt, |
|
|
int |
min, |
|
|
int |
max |
|
) |
| |
a pseudo-random integer between min and max.
◆ zRandMTF()
double zRandMTF |
( |
zRandMT * |
mt, |
|
|
double |
min, |
|
|
double |
max |
|
) |
| |
a pseudo-random double-precision floating-point value between min and max.
◆ zRandMTN()
a pseudo-random double-precision floating-point value in the range of [0,1].
◆ zRandMTNU()
a pseudo-random value in the range of [0,1).
◆ zRandMTDefault()
return a pointer to the default random number generator.