Public Member Functions
CRandom Class Reference

## Detailed Description

A random number sequence generator class.

random values:generator for C++ If two instances of this class are created with the same seed, the exact same sequence of random numbers are generated by both objects.

Since:
  8.0 (2010)

`#include <xsi_random.h>`

List of all members.

## 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)

## Constructor & Destructor Documentation

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.

Parameters:

  in_nSeed | Initial seed value.

SICPPSDK_INLINE CRandom | ( | const CRandom & | in_random | ) |

Copy constructor. Creates a new random generator from an existing random generator.

Parameters:

  in_random | CRandom object. The new object is initialized with the seed and current index from the source CRandom object.

~CRandom | ( |  | ) | `[inline]`

Destructor.

## Member Function Documentation

SICPPSDK_INLINE void PutSeed | ( | LONG | in_nSeed | ) |

Updates the seed value for this random generator object using the specified value.

Parameters:

  in_nSeed | New seed value.

SICPPSDK_INLINE LONG GetValue | ( | void |  | ) | const

Returns the sequence current value.

Returns:
  The sequence current value.

SICPPSDK_INLINE float GetNormalizedValue | ( |  | ) | const

Returns the sequence current value in the range of [0,1.0]

Returns:
  float value.

SICPPSDK_INLINE operator LONG | ( |  | ) | const

Returns the sequence current value.

Returns:
  The sequence current value.

void PutIndex | ( | ULONG | in_nIndex | ) |

Set the sequence index to the specified index value.

Parameters:

  in_nIndex | New index value.

SICPPSDK_INLINE LONG operator++ | ( |  | ) |

Prefix increment operator. Sets the current sequence number to the next generated random value.

Returns:
  The sequence next value.

SICPPSDK_INLINE LONG operator++ | ( | int |  | ) |

Postfix increment operator. Sets the current sequence number to the next generated random value.

Returns:
  The sequence value prior to the operation.

SICPPSDK_INLINE LONG operator-- | ( |  | ) |

Prefix decrement operator. Sets the current sequence number to the previous sequence random value.

Returns:
  The sequence previous value.

SICPPSDK_INLINE LONG operator-- | ( | int |  | ) |

Postfix decrement operator. Sets the current sequence number to the previous sequence random value.

Returns:
  The sequence value prior the operation.

SICPPSDK_INLINE void Skip | ( | ULONG | in_nOffset | ) |

Skips the specified number of elements in the sequence as specified by an offset.

Parameters:

  in_nOffset | Number of elements to skip.

The documentation for this class was generated from the following file:

- xsi_random.h