Class LinearCongruential
Defined in File RandomNumbers.h
Class Documentation
-
class LinearCongruential
X_{n+1} = ( a X_n + c ) mod m, m = 0 meaning 2^64.
Public Types
-
using result_type = std::uint64_t
Public Functions
-
LinearCongruential(std::uint64_t a, std::uint64_t c, std::uint64_t m, std::uint64_t seed)
- Pre:
m == 0 or ( a < m and c < m and seed < m )
-
std::uint64_t operator()(void)
-
inline std::uint64_t min(void) const
-
inline std::uint64_t max(void) const
-
std::uint64_t period(std::uint64_t limit) const
the period, by walking the sequence, when it is at most limit; 0 otherwise
Public Static Functions
-
static LinearCongruential minstd(std::uint64_t seed = 1)
the generator of Park and Miller, a = 16807, c = 0, m = 2^31 - 1
-
static LinearCongruential mmix(std::uint64_t seed = 1)
the generator of Knuth for MMIX, m = 2^64
-
using result_type = std::uint64_t