Random Class Reference

#include <c4d_tools.h>

Detailed Description

A class to generate random number sequences.
Uniform and Gaussian deviates can be generated.

Public Member Functions

 Random ()
 
void Init (UInt32 s)
 
Float Get01 (void)
 
Float Get11 (void)
 
Float GetG01 (void)
 
Float GetG11 (void)
 
Int32 GetSeed (void) const
 

Private Attributes

UInt32 seed
 
Int32 iset
 
Float gset
 

Constructor & Destructor Documentation

§ Random()

Random ( )

Default constructor.

Member Function Documentation

§ Init()

void Init ( UInt32  s)

Initializes the random number sequence from a starting seed. Each seed will give a different sequence of random numbers.

Parameters
[in]sThe initial seed to start the random number sequence.

§ Get01()

Float Get01 ( void  )

Gets a random value between 0 and 1.

Returns
A random value in the range [0, 1].

§ Get11()

Float Get11 ( void  )

Gets a random value between -1 and +1.

Returns
A random value in the range [-1, +1].

§ GetG01()

Float GetG01 ( void  )

Gets a random value between 0 and 1 with Gaussian distribution.

Returns
A random value in the range [0, 1] with Gaussian distribution.

§ GetG11()

Float GetG11 ( void  )

Gets a random value between -1 and +1 with Gaussian distribution.

Returns
A random value in the range [-1, +1] with Gaussian distribution.

§ GetSeed()

Int32 GetSeed ( void  ) const

Gets the seed representing the current state of the random number generator.

Returns
The current seed.

Member Data Documentation

§ seed

UInt32 seed
private

§ iset

Int32 iset
private

§ gset

Float gset
private