class RED::FastRandom
Class providing a xorshift-based pseudo-random numbers generator. More...
#include <REDRandom.h>
Inherits: RNG.
Public functions:
FastRandom ( unsigned int iSeed = 24091975 ) | |
virtual void * | As ( const RED::CID & iCID ) |
virtual const void * | As ( const RED::CID & iCID ) const |
template< class T_As > const T_As * | As ( ) const |
template< class T_As > T_As * | As ( ) |
virtual void | Init ( unsigned int iSeed ) |
virtual unsigned int | Rand32 ( ) |
Public static functions:
static RED::CID | GetClassID ( ) |
Private variables:
unsigned int | _x |
Detailed description:
Class providing a xorshift-based pseudo-random numbers generator.
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.
Functions documentation
public RED::FastRandom::FastRandom | ( | unsigned int | iSeed = 24091975 | ) |
Constructs a random numbers generator.
Parameters:
iSeed: | seed used for initialization. |
public static RED::CID RED::FastRandom::GetClassID | ( | ) |
Reimplements: RED::RNG::GetClassID.
public virtual void * RED::FastRandom::As | ( | const RED::CID & | iCID | ) |
Converts the object to an instance of the given type.
Parameters:
iCID: | Requested class. |
Returns:
Reimplements: RED::RNG::As.
public virtual const void * RED::FastRandom::As | ( | const RED::CID & | iCID | ) const |
Converts the object to an instance of the given type.
Parameters:
iCID: | Requested class. |
Returns:
Reimplements: RED::RNG::As.
template< class T_As > public const T_As * RED::FastRandom::As | ( | ) const |
Template version of the as const method.
Simply set T to be the class you want to retrieve an interface to.
Returns:
Reimplements: RED::RNG::As.
template< class T_As > public T_As * RED::FastRandom::As | ( | ) |
Template version of the as method.
Simply set T to be the class you want to retrieve an interface to.
Returns:
Reimplements: RED::RNG::As.
public virtual void RED::FastRandom::Init | ( | unsigned int | iSeed | ) |
Initializes a 32bit pseudo-random numbers generator.
Parameters:
iSeed: | seed used for initialization. |
Implements: RED::RNG::Init.
public virtual unsigned int RED::FastRandom::Rand32 | ( | ) |
Returns:
Implements: RED::RNG::Rand32.
Variables documentation
call me x.