Base Framework
|
Random number generator. More...
#include <base/math/Random.h>
Public Types | |
enum | Generator { MT11213A = 0, MT11213B = 1, MT19937 = 2, TT800 = 3 } |
typedef RandomImpl::Traits< TT800 > | Traits |
Static Public Member Functions | |
static void | randomize () noexcept |
static void | randomize (unsigned int seed) noexcept |
static unsigned int | getInteger () noexcept |
static float | getFloat () noexcept |
static double | getDouble () noexcept |
static long double | getLongDouble () noexcept |
Random number generator.
Implementation of a pseudorandom number generator. The generator in described in the paper "Mersenne Twister: A 623-dimensionally equidistributed uniform pseudorandom number generator" by Makoto Matsumoto and Takuji Nishimura. The implementation is MT-safe.
typedef RandomImpl::Traits<TT800> RandomLegacy::Traits |
Specifies the generator to be used.
The supported generators.
|
inlinestaticnoexcept |
Returns a random real number in the range [0;1].
|
inlinestaticnoexcept |
Returns a random real number in the range [0;1].
|
staticnoexcept |
Returns a random integer (unsigned) utilizing the full range of the type.
|
inlinestaticnoexcept |
Returns a random real number in the range [0;1].
|
staticnoexcept |
Initializes the internal state of the generator from the current time.
|
staticnoexcept |
Initializes the internal state of the generator.
seed | The desired seed (generator does not work with zero). |