RNG
Fields
const unsigned int |
Functions
void * |
|
const void * |
|
class T_As |
|
class T_As |
|
void |
|
unsigned int |
|
double |
Detailed Description
-
class RNG : public RED::Object
Abstract class providing an interface to random number generators.
@related class RED::Random, class RED::FastRandom
REDsdk makes an extensive use of random numbers. As a consequence REDsdk provides several random number generators for dedicated usages. Each generator inherits this class.
Subclassed by RED::FastRandom, RED::Random
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.
-
virtual void Init(unsigned int iSeed) = 0
Initializes a 32bit pseudo-random numbers generator.
- Parameters
iSeed – seed used for initialization.
-
virtual unsigned int Rand32() = 0
- Returns
a 32bit pseudo-random number in the range [0, RED::Random::Max32-1].
-
double RandD()
- Returns
A pseudo-random number in the rang [ 0.0, 1.0 ].
Public Static Attributes
-
static const unsigned int Max32
Maximum value returned by Rand32 + 1.
-
virtual void *As(const RED::CID &iCID)