[#absl-poisson_distribution]
= xref:absl.adoc[absl]::poisson&lowbar;distribution
:relfileprefix: ../
:mrdocs:

A distribution that generates discrete Poisson&hyphen;distributed variates&period;

== Synopsis

Declared in `&lt;absl&sol;random&sol;poisson&lowbar;distribution&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename IntType = int&gt;
class poisson&lowbar;distribution;
----

== Description

Generates discrete variates conforming to a Poisson distribution&period; p(n) &equals; (mean&circ;n &sol; n!) exp(&hyphen;mean)

Depending on the parameter, the distribution selects one of the following algorithms&colon; &ast; The standard algorithm, attributed to Knuth, extended using a split method for larger values &ast; The &quot;Ratio of Uniforms as a convenient method for sampling from classical discrete distributions&quot;, Stadlober, 1989&period; http&colon;&sol;&sol;www&period;sciencedirect&period;com&sol;science&sol;article&sol;pii&sol;0377042790903495

NOTE&colon; param&lowbar;type&period;mean() is a double, which permits values larger than poisson&lowbar;distribution&lt;IntType&gt;&colon;&colon;max(), however this should be avoided and the distribution results are limited to the max() value&period;

The goals of this implementation are to provide good performance while still being thread&hyphen;safe&colon; This limits the implementation to not using lgamma provided by &lt;math&period;h&gt;&period;

== Types

[cols="1,4"]
|===
| Name| Description
| xref:absl/poisson_distribution/param_type.adoc[`param&lowbar;type`] 
| The parameter set of the distribution&period;
|===


== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:absl/poisson_distribution/result_type.adoc[`result&lowbar;type`] 
| The type of the values produced by the distribution&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:absl/poisson_distribution/2constructor-03.adoc[`poisson&lowbar;distribution`]         [.small]#[constructor]#
| Constructors
| xref:absl/poisson_distribution/max.adoc[`max`] 
| Returns the largest value the distribution can produce&period;
| xref:absl/poisson_distribution/mean.adoc[`mean`] 
| Returns the mean of the distribution&period;
| xref:absl/poisson_distribution/min.adoc[`min`] 
| Returns the smallest value the distribution can produce&period;
| xref:absl/poisson_distribution/operator_call-09.adoc[`operator()`] 
| Function call operators
| xref:absl/poisson_distribution/param-00.adoc[`param`] 
| `param` overloads
| xref:absl/poisson_distribution/reset.adoc[`reset`] 
| Resets the internal state of the distribution&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:absl/operator_not_eq-09d.adoc[absl::operator!&equals;]`
| Compares two distributions for inequality&period;
| `xref:absl/operator_eq-021.adoc[absl::operator&equals;&equals;]`
| Compares two distributions for equality&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
