[#absl-Zipf]
= xref:absl.adoc[absl]::Zipf
:relfileprefix: ../
:mrdocs:

Produces a random integral value from a Zipf distribution&period;

== Synopsis

Declared in `&lt;absl&sol;random&sol;distributions&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename IntType,
    typename URBG&gt;
IntType
Zipf(
    URBG&& urbg,
    IntType hi = (std&colon;&colon;numeric&lowbar;limits&lt;IntType&gt;&colon;&colon;max)(),
    double q = 2&period;0,
    double v = 1&period;0);
----

== Description

`absl&colon;&colon;Zipf` produces discrete probabilities commonly used for modelling of rare events over the closed interval &lsqb;0, hi&rsqb;&period; The parameters `v` and `q` determine the skew of the distribution&period; `T` must be an integral type, but may be inferred from the type of `hi`&period;

See http&colon;&sol;&sol;mathworld&period;wolfram&period;com&sol;ZipfDistribution&period;html

Example&colon;

absl&colon;&colon;BitGen bitgen&semi; &period;&period;&period; int term&lowbar;rank &equals; absl&colon;&colon;Zipf&lt;int&gt;(bitgen)&semi;

== Return Value

A random value drawn from the Zipf distribution&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *urbg*
| The uniform random bit generator&period;
| *hi*
| The inclusive upper bound of the interval&period;
| *q*
| The skew parameter of the distribution&period;
| *v*
| The shift parameter of the distribution&period;
|===


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