Allolib
1.0
C++ Components For Interactive Multimedia
|
Linear congruential uniform pseudo-random number generator. More...
Public Member Functions | |
LinCon () | |
Default constructor uses a randomly generated seed. | |
LinCon (uint32_t seed) | |
uint32_t | operator() () |
Generate next uniform random integer in [0, 2^32) | |
void | seed (uint32_t v) |
Set seed. | |
void | type (int v) |
Change the type of equation used. More... | |
Linear congruential uniform pseudo-random number generator.
This generator is very fast requiring only a single integer multiply and add per iteration. However, the least significant bits of the numbers are less random; the most extreme case being the LSB which at best flips between 0 and 1. This generator also exhibits poor dimensional distribution, therefore it is best to have a different generator for each dimension, rather than sharing one.
Definition at line 195 of file al_Random.hpp.
|
inline |
[in] | seed | Initial seed value |
Definition at line 204 of file al_Random.hpp.
|
inline |
Change the type of equation used.
0 - Knuth, Numerical Recipes in C
1 - BCPL
Definition at line 216 of file al_Random.hpp.