class
<random>

std::mt19937

typedef mersenne_twister_engine<uint_fast32_t,  32,624,397,31,0x9908b0df,11,0xffffffff,7,0x9d2c5680,15,0xefc60000,18,1812433253>  mt19937;
Mersenne Twister 19937 generator
A Mersenne Twister pseudo-random generator of 32-bit numbers with a state size of 19937 bits.

It is an instantiation of the mersenne_twister_engine with the following template parameters:
parameternamevalue
UIntTyperesult typeuint_fast32_t
wword size32
nstate size624
mshift size397
rmask bits31
aXOR mask0x9908b0df
utempering u11
dtempering d0xffffffff
stempering s7
btempering b0x9d2c5680
ttempering t15
ctempering c0xefc60000
ltempering l18
finitialization multiplier1812433253

Member types

The following alias is a member type of mt19937:

member typedefinitionnotes
result_typeuint_fast32_tThe type of the numbers generated.

Member functions

As a mersenne_twister_engine type, it has the following member functions:

Non-member functions

As a mersenne_twister_engine type, the following operator overloads may be applied to it:

Member constexpr constants

member constantdefinitionnotes
word_size32The number of bits of each word in the state sequence.
state_size624The number of elements in the state sequence (degree of recurrence).
shift_size397The shift size used on twists to transform the values.
mask_bits31The number of bits that mark the separation point of words on each twist.
xor_mask0x9908b0dfThe XOR mask applied as the linear function on each twist.
tempering_u11The shift size of parameter u used in the tempering process of the generation algorithm.
tempering_d0xffffffffThe XOR mask used as parameter d in the tempering process of the generation algorithm.
tempering_s7The shift size of parameter s used in the tempering process of the generation algorithm.
tempering_b0x9d2c5680The XOR mask used as parameter b in the tempering process of the generation algorithm.
tempering_t15The shift size of parameter t used in the tempering process of the generation algorithm.
tempering_c0xefc60000The XOR mask used as parameter c in the tempering process of the generation algorithm.
tempering_l18The shift size of parameter l used in the tempering process of the generation algorithm.
initialization_multiplier1812433253The initialization multiplier used to seed the state sequence when a single value is used as seed.
default_seed5489uThe default seed used on construction or seeding.

See also