std::philox_engine<UIntType,w,n,r,consts>:: set_counter
From cppreference.net
<
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 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Bit manipulation (C++20) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Saturation arithmetic (C++26) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Factor operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Interpolations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Generic numeric operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| C-style checked integer arithmetic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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
)
;
|
(自 C++26 起) | |
设置随机数引擎的 计数器 。
-
对于每个在
[ 0 ,n)范围内的整数 k ,将 \(\scriptsize X_k \) X k 设为 \(\scriptsize c_{n-1-k} \mod 2^w \) c n-1-k mod 2 w
。 - 将 j 的值设为 n - 1 。 [1]
- ↑ 当 j 被设置为 n - 1 时,下一个状态转换总是会生成新的随机值。
参数
| c | - | 用于设置计数器的计数器序列 |
复杂度
\(\scriptsize O(n) \) O(n) 。
参见
|
构造引擎
(公开成员函数) |
|
|
设置引擎的当前状态
(公开成员函数) |