std::philox_engine<UIntType,w,n,r,consts>:: set_counter
From cppreference.com
<
cpp
|
numeric
|
random
|
philox engine
C++
Numerics library
Common mathematical functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Mathematical special functions (C++17) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Mathematical constants (C++20) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Basic linear algebra algorithms (C++26) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Data-parallel types (
simd
)
(C++26)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Floating-point environment (C++11) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Complex numbers | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Numeric array (
valarray
)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Pseudo-random number generation | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Factor operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Interpolations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Saturation arithmetic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Generic numeric operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Bit operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Pseudo-random number generation
|
|
std::philox_engine
Member functions | ||||
philox_engine::set_counter
|
||||
Generation | ||||
Characteristics | ||||
Non-member functions | ||||
(C++26)
|
||||
(C++26)
(C++26)
|
void
set_counter
(
const
std::
array
<
result_type, n
>
&
c
)
;
|
(since C++26) | |
Sets the counter of the random-number engine.
-
For each integer
k
in
[
0 ,
n)
, sets \(\scriptsize X_k \) X k to \(\scriptsize c_{n-1-k} \mod 2^w \) c n-1-k mod 2 w . - The value of j is set to n - 1 . [1]
- ↑ As j is being set to n - 1 , the next state transition always generates new random values.
Parameters
c | - | counter sequence to use to set the counter |
Complexity
\(\scriptsize O(n) \) O(n) .
See also
constructs the engine
(public member function) |
|
sets the current state of the engine
(public member function) |
Retrieved from "
https://en.cppreference.com/mwiki/index.php?title=cpp/numeric/random/philox_engine/set_counter&oldid=175557
"