FastRandom
Functions
void * |
|
const void * |
|
class T_As |
|
class T_As |
|
void |
|
unsigned int |
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.
-
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].
-
virtual void *As(const RED::CID &iCID)