Namespaces
Variants
Views
Actions

std::negative_binomial_distribution::negative_binomial_distribution

From cppreference.com
 
 
 
 
 

Template:ddcl list begin <tr class="t-dcl ">

<td >
explicit negative_binomial_distribution( IntType k = 1, double p = 0.5 );
</td>

<td > (1) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
explicit negative_binomial_distribution( const param_type& params );
</td>

<td > (2) </td> <td > (since C++11) </td> </tr> Template:ddcl list end

Constructs a new distribution object. The first version uses k and p as the distribution parameters, the second version uses params as the distribution parameters.

Parameters

k - the k distribution parameter (number of trial failures)
p - the p distribution parameter (probability of a trial generating true)
params - the distribution parameter set

Notes

Requires that 0 < p ≤ 1 and 0 < k.

The default-constructed std::negative_binomial_distribution is equivalent to the default-constructed std::geometric_distribution.