std::philox_engine| Member functions |
philox_engine::philox_engine |
|
|
| Generation |
|
|
| Characteristics |
|
|
| Non-member functions |
|
|
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 sequenceX are set to zero.
- The first element of the sequenceK is set to\(\scriptsize value \mod 2^w \)value mod 2w
, the remaining elements are set to zero. - The value ofj is 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 sequenceX are set to zero.
- Given(w-1)/32+1 asp, the elements of the sequenceK are set by the following steps:
- Creates an invented array objecta of lengthn/2* p.
- Callsseq.generate(a+0, a+ n/2* p).
- For each integerk in
[0, n/2), sets\(\scriptsize K_k \)Kk to\(\scriptsize (\sum^{p-1}_{i=0} a_{k \cdot p+i} \cdot 2^{32i}) \mod 2^w \)(∑p-1
i=0 ak·p+i·232i
) mod 2w
.
- The value ofj is 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 istrue.
- ↑1.01.1The bufferY is intentionally not being set. Asj is being set ton-1, the next state transition always generates new random values and stores them inY.
[edit]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 |
[edit]Complexity
1,2) Constant.
3) Same as the complexity of theseq.generate call.
4) Constant.
[edit]Exceptions
3) If
SeedSeq is not
std::seed_seq, throws the exceptions thrown by the
seq.generate call.
[edit]See also
| sets the current state of the engine (public member function)[edit] |
| sets the current counter of the engine (public member function)[edit] |