[rand.predef] (original) (raw)

29 Numerics library [numerics]

29.5 Random number generation [rand]

29.5.6 Engines and engine adaptors with predefined parameters [rand.predef]

using minstd_rand0 = linear_congruential_engine<uint_fast32_t, 16'807, 0, 2'147'483'647>;

Required behavior: The consecutive invocation of a default-constructed object of type minstd_rand0 produces the value 1043618065.

using minstd_rand = linear_congruential_engine<uint_fast32_t, 48'271, 0, 2'147'483'647>;

Required behavior: The consecutive invocation of a default-constructed object of type minstd_rand produces the value 399268537.

using mt19937 = mersenne_twister_engine<uint_fast32_t, 32, 624, 397, 31,0x9908'b0df, 11, 0xffff'ffff, 7, 0x9d2c'5680, 15, 0xefc6'0000, 18, 1'812'433'253>;

Required behavior: The consecutive invocation of a default-constructed object of type mt19937 produces the value 4123659995.

using mt19937_64 = mersenne_twister_engine<uint_fast64_t, 64, 312, 156, 31,0xb502'6f5a'a966'19e9, 29, 0x5555'5555'5555'5555, 17,0x71d6'7fff'eda6'0000, 37, 0xfff7'eee0'0000'0000, 43, 6'364'136'223'846'793'005>;

Required behavior: The consecutive invocation of a default-constructed object of type mt19937_64 produces the value 9981545732273789042.

using ranlux24_base = subtract_with_carry_engine<uint_fast32_t, 24, 10, 24>;

Required behavior: The consecutive invocation of a default-constructed object of type ranlux24_base produces the value7937952.

using ranlux48_base = subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>;

Required behavior: The consecutive invocation of a default-constructed object of type ranlux48_base produces the value61839128582725.

using ranlux24 = discard_block_engine<ranlux24_base, 223, 23>;

Required behavior: The consecutive invocation of a default-constructed object of type ranlux24 produces the value9901578.

using ranlux48 = discard_block_engine<ranlux48_base, 389, 11>;

Required behavior: The consecutive invocation of a default-constructed object of type ranlux48 produces the value249142670248501.

using knuth_b = shuffle_order_engine<minstd_rand0,256>;

Required behavior: The consecutive invocation of a default-constructed object of type knuth_b produces the value 1112339016.

using default_random_engine = _implementation-defined_;

Remarks: The choice of engine type named by this typedefis implementation-defined.

[Note 1:

The implementation can select this type on the basis of performance, size, quality, or any combination of such factors, so as to provide at least acceptable engine behavior for relatively casual, inexpert, and/or lightweight use.

Because different implementations can select different underlying engine types, code that uses this typedef need not generate identical sequences across implementations.

— _end note_]

using philox4x32 = philox_engine<uint_fast32_t, 32, 4, 10,0xCD9E8D57, 0x9E3779B9, 0xD2511F53, 0xBB67AE85>;

Required behavior: The consecutive invocation a default-constructed object of type philox4x32produces the value 1955073260.

using philox4x64 = philox_engine<uint_fast64_t, 64, 4, 10,0xCA5A826395121157, 0x9E3779B97F4A7C15, 0xD2E7470EE14C6C93, 0xBB67AE8584CAA73B>;

Required behavior: The consecutive invocation a default-constructed object of type philox4x64produces the value 3409172418970261260.