Torque2D Reference
Loading...
Searching...
No Matches
RandomLCG Class Reference

#include <mRandom.h>

Inheritance diagram for RandomLCG:

Public Member Functions

 RandomLCG ()
 RandomLCG (const S32 seed)
void setSeed (const S32 seed)
U32 randI (void)
Public Member Functions inherited from RandomGeneratorBase
void resetSeed (void)
S32 getSeed (void) const
F32 randRangeF (const F32 from, const F32 to)
S32 randRangeI (const S32 from, const S32 to)
virtual F32 randF (void)

Static Public Member Functions

static void setGlobalRandSeed (const U32 seed)

Static Protected Attributes

static const S32 msQuotient = S32_MAX / 16807L
static const S32 msRemainder = S32_MAX % 16807L

Additional Inherited Members

Protected Member Functions inherited from RandomGeneratorBase
 RandomGeneratorBase ()
Protected Attributes inherited from RandomGeneratorBase
S32 mSeed

Detailed Description

Linear Congruential Method, the "minimal standard generator"

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

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

Constructor & Destructor Documentation

◆ RandomLCG() [1/2]

RandomLCG ( )

◆ RandomLCG() [2/2]

RandomLCG ( const S32 seed)

Member Function Documentation

◆ randI()

U32 randI ( void )
virtual

Implements RandomGeneratorBase.

◆ setGlobalRandSeed()

void setGlobalRandSeed ( const U32 seed)
static

◆ setSeed()

void setSeed ( const S32 seed)
virtual

Implements RandomGeneratorBase.

Member Data Documentation

◆ msQuotient

const S32 msQuotient = S32_MAX / 16807L
staticprotected

◆ msRemainder

const S32 msRemainder = S32_MAX % 16807L
staticprotected

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