LinearCongruentialRandom< FLOAT > Class Template Reference Math Library

#include <lib_math.h>

详细描述

template<typename FLOAT>
class maxon::LinearCongruentialRandom< FLOAT >

Linear congruential random value generator. The class will always produce the same output if the initialization seed was matching.

公共成员函数

  LinearCongruentialRandom ()
void  Init ( UInt32 seed)
FLOAT  Get01 ()
FLOAT  Get11 ()
UInt32   GetUInt32 ()
UInt32   GetSeed () const
void  SetSeed ( UInt32 seed)

Private Attributes

UInt32   _seed

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

◆  LinearCongruentialRandom()

LinearCongruentialRandom ( )

成员函数文档编制

◆  Init()

void Init ( UInt32   seed )

Initialize the random class with a custom seed value. The seed initially is advanced to avoid clustering close to 0 for typical user-adjusted values.

参数
[in] seed Seed value.

◆  Get01()

FLOAT Get01 ( )

Returns the next random value in the range of [0..1].

◆  Get11()

FLOAT Get11 ( )

Returns the next random value in the range of [-1..1].

◆  GetUInt32()

UInt32 GetUInt32 ( )

Returns the next 32-bit random value.

◆  GetSeed()

UInt32 GetSeed ( ) const

Returns the current seed value.

◆  SetSeed()

void SetSeed ( UInt32   seed )

Changes the seed value (.

另请参阅
Init ).

Member Data Documentation

◆  _seed

UInt32 _seed
private