MT Core (C++)
Core library for replacing C++ standard in project usage
|
Represents a Pseudo Random Number Generator. More...
#include <random.hpp>
Public Member Functions | |
bool | can_get1_0 () const noexcept |
bool | can_get_uint () const noexcept |
bool | can_reseed () const noexcept |
double | next1_0 () noexcept |
Gets a number n such that $0 <= n < 1$ Will abort of canGet1_0 is false! | |
u64 | next_uint () noexcept |
Gets the next unsigned 64-bit integer from the PRNG Will abort of canGetUInt is false! | |
u64 | in_range (const u64 min, const u64 max) noexcept |
Gets number between min (inclusive) and max value (exclusive) Prioritizes nextUInt over next1_0. | |
f64 | in_range_f64 (const f64 min, const f64 max) noexcept |
Gets number between min (inclusive) and max value (exclusive) Prioritizes next1_0 over nextUInt. | |
Result< void, SeedError > | seed (const u64 seed) noexcept |
Reseeds the PRNG. | |
void | deinit () noexcept |
Deinitializes a PRNG NOTE: It is NOT safe to use a PRNG after it has been deinitialized! | |
Public Attributes | |
PrngState | state |
const PrngVTable * | vtable |
Represents a Pseudo Random Number Generator.
Definition at line 100 of file random.hpp.
|
inlinenodiscardnoexcept |
Definition at line 109 of file random.hpp.
|
inlinenodiscardnoexcept |
Definition at line 114 of file random.hpp.
|
inlinenodiscardnoexcept |
Definition at line 119 of file random.hpp.
|
inlinenoexcept |
Deinitializes a PRNG NOTE: It is NOT safe to use a PRNG after it has been deinitialized!
Definition at line 214 of file random.hpp.
Gets number between min (inclusive) and max value (exclusive) Prioritizes nextUInt over next1_0.
min | Minimum value |
max | Maximum value |
Definition at line 148 of file random.hpp.
Gets number between min (inclusive) and max value (exclusive) Prioritizes next1_0 over nextUInt.
min | Minimum value |
max | Maximum value |
Definition at line 180 of file random.hpp.
|
inlinenodiscardnoexcept |
Gets a number n such that $0 <= n < 1$ Will abort of canGet1_0 is false!
Definition at line 125 of file random.hpp.
|
inlinenodiscardnoexcept |
Gets the next unsigned 64-bit integer from the PRNG Will abort of canGetUInt is false!
Definition at line 135 of file random.hpp.
Reseeds the PRNG.
Definition at line 205 of file random.hpp.
PrngState mtcore::Prng::state |
Definition at line 102 of file random.hpp.
const PrngVTable* mtcore::Prng::vtable |
Definition at line 104 of file random.hpp.