#include <cel_random.h>
Public Member Functions | |
Random () | |
Random (u32 inSeed) | |
Random (const Random &inRandom) | |
void | sgenrand (u32 seed) |
double | genrand () |
size_t | genrand_n (size_t n) |
u32 | forward () |
Pseudo random number generator based on Mersenne Twister Random Number Generator algorithm.
Celartem::Random::Random | ( | ) |
Initializes the random number generator using current tick count obtained by TimeUtils::getTick();
Celartem::Random::Random | ( | u32 | inSeed | ) |
Initializes the random number generator using the specified seed.
This method internally calls sgenrand method.
inSeed | Seed value. |
Celartem::Random::Random | ( | const Random & | inRandom | ) |
u32 Celartem::Random::forward | ( | ) |
Forward the state of the random number generator.
double Celartem::Random::genrand | ( | ) |
Generates a fraction number in [0 1).
size_t Celartem::Random::genrand_n | ( | size_t | n | ) |
Generates an integral number in [0 n).
n | An integral number. |
void Celartem::Random::sgenrand | ( | u32 | seed | ) |
Initializes the random number generator using the specified seed.
inSeed | Seed value. |