#include <xsi_random.h>
A random number sequence generator class.
If two instances of this class are created with the same seed, the exact same sequence of random numbers are generated by both objects.
Public Member Functions |
|
SICPPSDK_INLINE | CRandom () |
SICPPSDK_INLINE | CRandom (LONG in_nSeed) |
SICPPSDK_INLINE | CRandom (const CRandom &in_random) |
~CRandom () | |
SICPPSDK_INLINE void | PutSeed (LONG in_nSeed) |
SICPPSDK_INLINE LONG | GetValue () const |
SICPPSDK_INLINE float | GetNormalizedValue () const |
SICPPSDK_INLINE | operator LONG () const |
void | PutIndex (ULONG in_nIndex) |
SICPPSDK_INLINE LONG | operator++ () |
SICPPSDK_INLINE LONG | operator++ (int) |
SICPPSDK_INLINE LONG | operator-- () |
SICPPSDK_INLINE LONG | operator-- (int) |
SICPPSDK_INLINE void | Skip (ULONG in_nOffset) |
SICPPSDK_INLINE CRandom | ( | ) |
Creates a new random generator based on a seed value of 0.
SICPPSDK_INLINE CRandom | ( | LONG | in_nSeed | ) |
Constructor. Creates a new random generator using the specified seed value.
in_nSeed | Initial seed value. |
~CRandom | ( | ) | [inline] |
Destructor.
SICPPSDK_INLINE void PutSeed | ( | LONG | in_nSeed | ) |
Updates the seed value for this random generator object using the specified value.
in_nSeed | New seed value. |
SICPPSDK_INLINE LONG GetValue | ( | void | ) | const |
SICPPSDK_INLINE float GetNormalizedValue | ( | ) | const |
Returns the sequence current value in the range of [0,1.0]
SICPPSDK_INLINE operator LONG | ( | ) | const |
Returns the sequence current value.
void PutIndex | ( | ULONG | in_nIndex | ) |
Set the sequence index to the specified index value.
in_nIndex | New index value. |
SICPPSDK_INLINE LONG operator++ | ( | ) |
Prefix increment operator. Sets the current sequence number to the next generated random value.
SICPPSDK_INLINE LONG operator++ | ( | int | ) |
Postfix increment operator. Sets the current sequence number to the next generated random value.
SICPPSDK_INLINE LONG operator-- | ( | ) |
Prefix decrement operator. Sets the current sequence number to the previous sequence random value.
SICPPSDK_INLINE LONG operator-- | ( | int | ) |
Postfix decrement operator. Sets the current sequence number to the previous sequence random value.
SICPPSDK_INLINE void Skip | ( | ULONG | in_nOffset | ) |
Skips the specified number of elements in the sequence as specified by an offset.
in_nOffset | Number of elements to skip. |