Allolib
1.0
C++ Components For Interactive Multimedia
|
Multiplicative linear congruential uniform pseudo-random number generator. More...
Public Member Functions | |
MulLinCon () | |
Default constructor uses a randomly generated seed. | |
MulLinCon (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... | |
Multiplicative linear congruential uniform pseudo-random number generator.
This generator is faster than LinCon requiring only a single integer multiply per iteration. However, the downside is that it produces lower quality (less "random") results than LinCon. Because of this, it is really not appropriate for simulations, but due to its speed it is very useful for synthesizing noise for audio and graphics.
Definition at line 244 of file al_Random.hpp.
|
inline |
[in] | seed | Initial seed value |
Definition at line 253 of file al_Random.hpp.
|
inline |
Change the type of equation used.
0 - L'Ecuyer M8 (optimal generator for <= 8 dimensions)
1 - L'Ecuyer M16 (optimal generator for <= 16 dimensions)
2 - L'Ecuyer M32 (optimal generator for <= 32 dimensions)
3 - Marsaglia, Super-Duper
Definition at line 267 of file al_Random.hpp.