std::negative_binomial_distribution<IntType>::negative_binomial_distribution

来自cppreference.com
 
 
 
 
 
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 为分布参数。 @32 以 params 为分布参数。

参数

k-k 分布参数(试验成功次数)
p-p 分布参数(试验生成 true 的概率)
params-分布参数集

注解

要求 0 < p ≤ 10 < k

p == 1,则调用不接受 param_type 对象的 operator() 的重载将导致未定义行为。

默认构造的 std::negative_binomial_distribution 等价于默认构造的 std::geometric_distribution

缺陷报告

下列更改行为的缺陷报告追溯地应用于以前出版的 C++ 标准。

缺陷报告应用于出版时的行为正确行为
P0935R0C++11默认构造函数曾为 explicit使之为隐式