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以降) | |
乱数エンジンの counter を設定します。
-
各整数
k
について
[ 0 ,n)の範囲内で、 \(\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) .
(注:原文のテキスト「.」のみが翻訳対象となります。C++用語「O(n)」は翻訳せず、HTMLタグと属性もそのまま保持しています)関連項目
|
エンジンを構築する
(public member function) |
|
|
エンジンの現在の状態を設定する
(public member function) |