FastRandom

Functions

CID

GetClassID

void *

As

const void *

As

class T_As

As

class T_As

As

FastRandom

void

Init

unsigned int

Rand32

Detailed Description

class FastRandom : public RED::RNG

Class providing a xorshift-based pseudo-random numbers generator.

@related class RED::Random

This implementation is cross-platform and ensures users that the same numbers will be returned for a given seed on every machine run under any OS.

This generator is intended to be very fast for random numbers generation when very good statistics performances are not the key.

Public Functions

virtual void *As(const RED::CID &iCID)

Converts the object to an instance of the given type.

Parameters

iCID – Requested class.

Returns

An object pointer of the given class on success, NULL otherwise.

virtual const void *As(const RED::CID &iCID) const

Converts the object to an instance of the given type.

Parameters

iCID – Requested class.

Returns

An object pointer of the given class on success, NULL otherwise.

template<class T_As>
inline T_As *As()
template<class T_As>
inline const T_As *As() const
FastRandom(unsigned int iSeed = 24091975)

Constructs a random numbers generator.

Parameters

iSeed – seed used for initialization.

virtual void Init(unsigned int iSeed)

Initializes a 32bit pseudo-random numbers generator.

Parameters

iSeed – seed used for initialization.

virtual unsigned int Rand32()
Returns

a 32bit pseudo-random number in the range [0, RED::Random::Max32-1].

Public Static Functions

static inline RED::CID GetClassID()