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

A distribution over random integer&hyphen;values in the range &lsqb;0, k&rsqb;&period;

== Synopsis

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

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

== Description

absl&colon;&colon;zipf&lowbar;distribution produces random integer&hyphen;values in the range &lsqb;0, k&rsqb;, distributed according to the unnormalized discrete probability function&colon;

P(x) &equals; (v &plus; x) &circ; &hyphen;q

The parameter `v` must be greater than 0 and the parameter `q` must be greater than 1&period; If either of these parameters take invalid values then the behavior is undefined&period;

IntType is the result&lowbar;type generated by the generator&period; It must be of integral type&semi; a static&lowbar;assert ensures this is the case&period;

The implementation is based on W&period;Hormann, G&period;Derflinger&colon;

&quot;Rejection&hyphen;Inversion to Generate Variates from Monotone Discrete Distributions&quot;

http&colon;&sol;&sol;eeyore&period;wu&hyphen;wien&period;ac&period;at&sol;papers&sol;96&hyphen;04&hyphen;04&period;wh&hyphen;der&period;ps&period;gz

== Types

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


== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:absl/zipf_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/zipf_distribution/2constructor-06.adoc[`zipf&lowbar;distribution`]         [.small]#[constructor]#
| Constructors
| xref:absl/zipf_distribution/k.adoc[`k`] 
| Returns the largest value the distribution can produce&period;
| xref:absl/zipf_distribution/max.adoc[`max`] 
| Returns the largest value the distribution can produce&period;
| xref:absl/zipf_distribution/min.adoc[`min`] 
| Returns the smallest value the distribution can produce&period;
| xref:absl/zipf_distribution/operator_call-0653.adoc[`operator()`] 
| Function call operators
| xref:absl/zipf_distribution/param-0a.adoc[`param`] 
| `param` overloads
| xref:absl/zipf_distribution/q.adoc[`q`] 
| Returns the exponent parameter of the distribution&period;
| xref:absl/zipf_distribution/reset.adoc[`reset`] 
| Resets the internal state of the distribution&period;
| xref:absl/zipf_distribution/v.adoc[`v`] 
| Returns the offset parameter of the distribution&period;
|===


== Friends

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


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