Allolib  1.0
C++ Components For Interactive Multimedia
al::rnd::MulLinCon Class Reference

Multiplicative linear congruential uniform pseudo-random number generator. More...

#include <C:/Users/Andres/source/repos/casm_viewer/external/tinc/external/allolib/include/al/math/al_Random.hpp>

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ MulLinCon()

al::rnd::MulLinCon::MulLinCon ( uint32_t  seed)
inline
Parameters
[in]seedInitial seed value

Definition at line 253 of file al_Random.hpp.

Member Function Documentation

◆ type()

void al::rnd::MulLinCon::type ( int  v)
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.


The documentation for this class was generated from the following file: