Random Class Reference

#include <c4d_tools.h>

详细描述

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

公共成员函数

  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

构造函数 & 析构函数文档编制

◆  Random()

Random ( )

Default constructor.

成员函数文档编制

◆  Init()

void Init ( UInt32   s )

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

参数
[in] s The initial seed to start the random number sequence.

◆  Get01()

Float Get01 ( void  )

Gets a random value between 0 and 1 .

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

◆  Get11()

Float Get11 ( void  )

Gets a random value between -1 and +1 .

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

◆  GetG01()

Float GetG01 ( void  )

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

返回
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.

返回
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.

返回
The current seed.

Member Data Documentation

◆  seed

UInt32 seed
private

◆  iset

Int32 iset
private

◆  gset

Float gset
private