torque Torque Game Engine Documentation
TGE Version 1.5.2

MRandomLCG Class Reference

#include <mRandom.h>

Inheritance diagram for MRandomLCG:

Inheritance graph
[legend]

Detailed Description

Linear Congruential Method, the "minimal standard generator".

Fast, farly good random numbers (better than using rand)

Author:
Park & Miller, 1988, Comm of the ACM, 31(10), pp. 1192-1201


Public Member Functions

 MRandomLCG ()
 MRandomLCG (S32 s)
void setSeed (S32 s)
S32 randI (S32 i, S32 n)
 i..n integer generator
U32 randI (void)
 0..2^31 random number generator

Static Public Member Functions

static void setGlobalRandSeed (U32 seed)

Static Protected Attributes

static const S32 msQuotient
static const S32 msRemainder


Constructor & Destructor Documentation

MRandomLCG::MRandomLCG (  ) 

MRandomLCG::MRandomLCG ( S32  s  ) 


Member Function Documentation

static void MRandomLCG::setGlobalRandSeed ( U32  seed  )  [static]

void MRandomLCG::setSeed ( S32  s  )  [virtual]

Implements MRandomGenerator.

S32 MRandomLCG::randI ( S32  i,
S32  n 
) [inline]

i..n integer generator

Reimplemented from MRandomGenerator.

U32 MRandomLCG::randI ( void   )  [virtual]

0..2^31 random number generator

Implements MRandomGenerator.


Field Documentation

const S32 MRandomLCG::msQuotient [static, protected]

const S32 MRandomLCG::msRemainder [static, protected]




All Rights Reserved GarageGames.com, Inc. 1999-2005
Auto-magically Generated with Doxygen