Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

GltRandomLCG Class Reference
[GLT Math]

The Park and Miller "Minimal Standard" LCG generator. More...

#include <random.h>

List of all members.

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.


Detailed Description

The Park and Miller "Minimal Standard" LCG generator.

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.


The documentation for this class was generated from the following files:
Generated on Tue Nov 5 11:11:45 2002 for GLT by doxygen1.2.18