class UIntType, std::size_t w, std::size_t n, std::size_t m, std::size_t r,
UIntType a, std::size_t u, UIntType d, std::size_t s,
UIntType b, std::size_t t, UIntType c, std::size_t l, UIntType f
mersenne_twister_engine
is a random number engine based on Mersenne Twister algorithm. It produces high quality, but not cryptographically secure, unsigned integer random numbers of type UIntType
on the interval \(\scriptsize {[0,2^w)}\)[0, 2w
).
If any of the following restrictions is violated, the program is ill-formed:
[
1,
n]
.The size of the states of mersenne_twister_engine
is n, each of them consists of a sequence X of n values of type result_type
. \(\scriptsize X_j\)Xj stands for the \(\scriptsize j\mod n\)j mod nth value (starting from 0) of X.
Given the following bitwise operation notations:
The transition algorithm of mersenne_twister_engine
(\(\scriptsize TA(x_i)\)TA(xi)) is defined as follows:
The generation algorithm of mersenne_twister_engine
(\(\scriptsize GA(x_i)\)GA(xi)) is defined as follows:
The following specializations define the random number engine with two commonly used parameter sets:
Type Definitionmt19937
(C++11)
std::mersenne_twister_engine<std::uint_fast32_t,
32, 624, 397, 31,
0x9908b0df, 11,
0xffffffff, 7,
0x9d2c5680, 15,
0xefc60000, 18, 1812433253>
32-bit Mersenne Twister by Matsumoto and Nishimura, 1998[edit]
mt19937_64
(C++11)
std::mersenne_twister_engine<std::uint_fast64_t,
64, 312, 156, 31,
0xb5026f5aa96619e9, 29,
0x5555555555555555, 17,
0x71d67fffeda60000, 37,
0xfff7eee000000000, 43,
6364136223846793005>
64-bit Mersenne Twister by Matsumoto and Nishimura, 2000[edit]
result_type
UIntType
[edit] Data members
constexpr size_t word_size
[static]
wconstexpr size_t state_size
[static]
nconstexpr size_t shift_size
[static]
mconstexpr size_t mask_bits
[static]
rconstexpr UIntType xor_mask
[static]
aconstexpr size_t tempering_u
[static]
uconstexpr UIntType tempering_d
[static]
dconstexpr size_t tempering_s
[static]
sconstexpr UIntType tempering_b
[static]
bconstexpr size_t tempering_t
[static]
tconstexpr UIntType tempering_c
[static]
cconstexpr size_t tempering_l
[static]
lconstexpr UIntType initialization_multiplier
[static]
fconstexpr UIntType default_seed
[static]
5489uRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4