![]() |
MAGE
v0.171.0
Matthias Advanced Game Engine
|
#include <rng.hpp>
Public Member Functions | |
RNG (U32 seed=606418532u) noexcept | |
RNG (const RNG &rng) noexcept=default | |
RNG (RNG &&rng) noexcept=default | |
~RNG ()=default | |
RNG & | operator= (const RNG &rng)=delete |
RNG & | operator= (RNG &&rng)=delete |
void | Seed (U32 seed) noexcept |
F32 | Uniform () noexcept |
F32 | Uniform (F32 low, F32 high) noexcept |
Private Attributes | |
std::minstd_rand | m_generator |
std::uniform_real_distribution< F32 > | m_distribution |
A class of (uniform) random number generators (RNGs).
|
explicitnoexcept |
Constructs a RNG with the given seed.
[in] | seed | The seed. |
|
defaultnoexcept |
|
defaultnoexcept |
|
default |
Destructs this RNG.
|
noexcept |
Generates a uniform random number in [0,1).
Generates a uniform random number in [start,end).
[in] | low | The lower (inclusive) bound of the interval. |
[in] | high | The upper (exclusive) bound of the interval. |
|
private |
The uniform real number distribution of this RNG.
|
private |
The random number generator, Newer "Minimum standard", of this RNG. This LCG has a much smaller footprint compared to the default Mersenne Twister used in the std.