名前空間
変種
操作

std::negative_binomial_distribution<IntType>::negative_binomial_distribution

提供: cppreference.com
 
 
 
擬似乱数生成
一様ランダムビットジェネレータ
エンジンとエンジンアダプタ
非決定的なジェネレータ
分布
一様分布
ベルヌーイ分布
ポアソン分布
正規分布
標本分布
シードシーケンス
(C++11)
C のライブラリ
 
 
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) は分布のパラメータとして kp を使用し、 (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