std::negative_binomial_distribution<IntType>:: negative_binomial_distribution
From ja.cppreference.net
<
cpp
|
numeric
|
random
|
negative binomial distribution
|
negative_binomial_distribution
(
)
:
negative_binomial_distribution
(
1
)
{
}
|
(1) | (C++11以降) |
|
explicit
negative_binomial_distribution
(
IntType k,
double
p
=
0.5
)
;
|
(2) | (C++11以降) |
|
explicit
negative_binomial_distribution
(
const
param_type
&
params
)
;
|
(3) | (C++11以降) |
新しい分布オブジェクトを構築します。
2)
分布パラメータとして
k
と
p
を使用します。
3)
分布パラメータとして
params
を使用します。
パラメータ
| k | - | k分布パラメータ(試行成功回数) |
| p | - | p分布パラメータ(試行が true を生成する確率) |
| params | - | 分布パラメータセット |
注記
0 < p ≤ 1 かつ 0 < k を要求します。
p == 1
の場合、
operator()
オーバーロードのうち
param_type
オブジェクトを受け取らないバージョンへの以降の呼び出しは、未定義動作を引き起こします。
デフォルト構築された
std::negative_binomial_distribution
は、デフォルト構築された
std::geometric_distribution
と等価です。
不具合報告
以下の動作変更の欠陥報告書は、以前に公開されたC++規格に対して遡及的に適用されました。
| DR | Applied to | Behavior as published | Correct behavior |
|---|---|---|---|
| P0935R0 | C++11 | default constructor was explicit | made implicit |