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

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

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

Detailed Description

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.

Constructor & Destructor Documentation

◆ LinCon()

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

Definition at line 204 of file al_Random.hpp.

Member Function Documentation

◆ type()

void al::rnd::LinCon::type ( int  v)
inline

Change the type of equation used.

0 - Knuth, Numerical Recipes in C
1 - BCPL

Definition at line 216 of file al_Random.hpp.


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