std::discrete_distribution<IntType>:: operator()
From cppreference.net
<
cpp
|
numeric
|
random
|
discrete distribution
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::discrete_distribution
| Member functions | ||||
| Generation | ||||
|
discrete_distribution::operator()
|
||||
| Characteristics | ||||
| Non-member functions | ||||
|
(C++11)
(C++11)
(until C++20)
|
||||
|
(C++11)
(C++11)
|
|
template
<
class
Generator
>
result_type operator ( ) ( Generator & g ) ; |
(1) | (C++11以降) |
|
template
<
class
Generator
>
result_type operator ( ) ( Generator & g, const param_type & params ) ; |
(2) | (C++11以降) |
関連する確率関数に従って分布する乱数を生成します。エントロピーは g. operator ( ) を呼び出すことで取得されます。
最初のバージョンは関連付けられたパラメータセットを使用し、2番目のバージョンは params を使用します。関連付けられたパラメータセットは変更されません。
パラメータ
| g | - | 一様乱数ビット生成器オブジェクト |
| params | - | 関連付けられたパラメータセットの代わりに使用する分布パラメータセット |
| 型要件 | ||
-
Generator
は
UniformRandomBitGenerator
の要件を満たさなければならない。
|
||
戻り値
生成された乱数。
計算量
償却定数回の g. operator ( ) の呼び出し。