Torque2D Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Static Protected Attributes | List of all members
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 | ( |  | ) |

RandomLCG | ( | const S32 | seed | ) |

## Member Function Documentation

U32 randI | ( | void |  | ) |
| virtual

Implements RandomGeneratorBase.

void setGlobalRandSeed | ( | const U32 | seed | ) |
| static

void setSeed | ( | const S32 | seed | ) |
| virtual

Implements RandomGeneratorBase.

## Member Data Documentation

const S32 msQuotient = S32_MAX / 16807L
| static protected

const S32 msRemainder = S32_MAX % 16807L
| static protected

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

- math/mRandom.h
- math/mRandom.cc