absl::poisson_distribution

A distribution that generates discrete Poisson-distributed variates.

Synopsis

Declared in <absl/random/poisson_distribution.h>

template<typename IntType = int>
class poisson_distribution;

Description

Generates discrete variates conforming to a Poisson distribution. p(n) = (mean^n / n!) exp(-mean)

Depending on the parameter, the distribution selects one of the following algorithms: * The standard algorithm, attributed to Knuth, extended using a split method for larger values * The "Ratio of Uniforms as a convenient method for sampling from classical discrete distributions", Stadlober, 1989. http://www.sciencedirect.com/science/article/pii/0377042790903495

NOTE: param_type.mean() is a double, which permits values larger than poisson_distribution<IntType>::max(), however this should be avoided and the distribution results are limited to the max() value.

The goals of this implementation are to provide good performance while still being thread-safe: This limits the implementation to not using lgamma provided by <math.h>.

Types

NameDescription
param_type The parameter set of the distribution.

Type Aliases

NameDescription
result_type The type of the values produced by the distribution.

Member Functions

NameDescription
poisson_distribution [constructor]Constructors
max Returns the largest value the distribution can produce.
mean Returns the mean of the distribution.
min Returns the smallest value the distribution can produce.
operator() Function call operators
param param overloads
reset Resets the internal state of the distribution.

Friends

NameDescription
absl::operator!=Compares two distributions for inequality.
absl::operator==Compares two distributions for equality.