std::philox_engine<UIntType,w,n,r,consts>::philox_engine
From cppreference.com
philox_engine() : philox_engine(default_seed) {}
|
(1) | (since C++26) |
explicit philox_engine( result_type value );
|
(2) | (since C++26) |
template< class SeedSeq >
explicit philox_engine( SeedSeq& seq );
|
(3) | (since C++26) |
philox_engine( const philox_engine& other );
|
(4) | (since C++26) (implicitly declared) |
Constructs the pseudo-random number engine.
1) The default constructor.
- If the default-constructed engine is of type
std::philox4x32, the 10000th consecutive invocation of it produces the value1955073260. - If the default-constructed engine is of type
std::philox4x64, the 10000th consecutive invocation of it produces the value3409172418970261260.
2) Constructs the engine with a seed value
value. The engine's initial state is determined as follows:[1]
- All elements of the sequence
Xare set to zero. - The first element of the sequence
Kis set to value mod 2w
, the remaining elements are set to zero. - The value of
jis set ton - 1.
3) Constructs the engine with a seed sequence
seq. The engine's initial state is determined as follows:[1]
- All elements of the sequence
Xare set to zero. - Given
(w - 1) / 32 + 1asp, the elements of the sequenceKare set by the following steps:
- Creates an invented array object
aof lengthn / 2 * p. - Calls
seq.generate(a + 0, a + n / 2 * p). - For each integer
kin[0,n / 2), sets Kk to (∑p-1
i=0 ak·p+i·232i
) mod 2w
.
- The value of
jis set ton - 1.
This overload participates in overload resolution only if
SeedSeq meets the requirements of SeedSequence.4) The copy constructor. Upon construction,
*this == other is true.
Parameters
| value | - | seed value to use in the initialization of the internal state |
| seq | - | seed sequence to use in the initialization of the internal state |
Complexity
1,2) Constant.
3) Same as the complexity of the
seq.generate call.4) Constant.
Exceptions
See also
| sets the current state of the engine (public member function) | |
| sets the current counter of the engine (public member function) |