#include <random.h>
Public Methods | |
| GltRandomLCG (const uint32 seed=199125) | |
| Constructor, seed is optional (must not be zero). | |
| GltRandomLCG (const GltRandomLCG &rng) | |
| Copy constructor. | |
| ~GltRandomLCG () | |
| Destructor. | |
| uint32 | rand () const |
| Random number in [0,max()]. | |
| uint32 | max () const |
| Maximum possible random number. | |
| void | seed (const uint32 seed=199125) |
| Seed the random number generator. | |
| GltRandomLCG & | base () |
| Base random number generator. | |
| const GltRandomLCG & | base () const |
| Base random number generator. | |
Static Public Attributes | |
| GltRandomLCG | rng |
| A global LCG random number generator for convenience. | |
X[n+1] = (X[n]*a)m
Adapted from Numerical Recipies in C, 2nd Ed
Similar to FreeBSD random number generator
Definition at line 54 of file random.h.
1.2.18