explicit mersenne_twister_engine( result_type value = default_seed ); | (1) | (since C++11) |
template< class Sseq > explicit mersenne_twister_engine( Sseq& s ); | (2) | (since C++11) |
mersenne_twister_engine( const mersenne_twister_engine& ); | (3) | (since C++11) (implicitly declared) |
Constructs the pseudo-random number engine.
n
values Xresult_type
) as follows: value mod 2ws.generate(a, a+n*k)
where a is an array of length n*k and k is ceil(w/32) and then, iteratively for i=-n,...,-1, setting each element of the engine state XNote: initialization requirements are based on the 2002 version of Mersenne Twister, mt19937ar.c.
The overload (2) only participates in overload resolution if Sseq
qualifies as a SeedSequence
. In particular, it is excluded from the set of candidate functions if Sseq
is convertible to result_type
.
value | - | seed value to use in the initialization of the internal state |
s | - | seed sequence to use in the initialization of the internal state |
linear in n
(the state size).
sets the current state of the engine (public member function) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine/mersenne_twister_engine