std::negative_binomial_distribution<IntType>::negative_binomial_distribution
提供: cppreference.com
< 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
を使用し、 (2) は分布のパラメータとして 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 | 適用先 | 発行時の動作 | 正しい動作 |
---|---|---|---|
P0935R0 | C++11 | default constructor was explicit | made implicit |