top | up | prev | next

MT Class

Definition at line 59 of Random.cpp

Constructors

MT()

Member Functions

uint32_t GenRand()
void Init(uint32_t seed)
void InitWithRandomSeed()
bool Initialized()

Member Variables

bool initialized
const uint32_t lowerMask static
const int32_t m static
const uint32_t matrixA static
int32_t mti
const int32_t n static
const uint32_t upperMask static

Constructor Details

MT Constructor

cmajor::rt::MT::MT()

Definition at line 123 of Random.cpp :
123 : initialized(false)mti(0)mt()mag()
124 {
125 }


Declaration at line 68 of Random.cpp


Member Function Details

GenRand Member Function

uint32_t cmajor::rt::MT::GenRand()

Definition at line 89 of Random.cpp


Init Member Function

void cmajor::rt::MT::Init(uint32_t seed)

Definition at line 78 of Random.cpp :
 79 {
 80     initialized = true;
 81     mt[0] = seed;
 82     for (mti = 1; mti < n; ++mti)
 83     {
 84         mt[mti] = 1812433253u * (mt[mti - 1] ^ (mt[mti - 1] >> 30u)) + static_cast<uint32_t>(mti);
 85     }
 86     mag[0] = 0u;
 87     mag[1] = matrixA;
 88 }


Called by: cmajor::rt::MT::InitWithRandomSeed


InitWithRandomSeed Member Function

void cmajor::rt::MT::InitWithRandomSeed()

Definition at line 73 of Random.cpp :
 74 {
 75     uint32_t seed = RtGetRandomSeed();
 76     Init(seed);
 77 }


Calls: cmajor::rt::MT::Init


Initialized Member Function

bool cmajor::rt::MT::Initialized()

Definition at line 69 of Random.cpp :
 70 {
 71     return initialized;
 72 }



top | up | prev | next