[#absl-zipf_distribution] = xref:absl.adoc[absl]::zipf_distribution :relfileprefix: ../ :mrdocs: A distribution over random integer‐values in the range [0, k]. == Synopsis Declared in `<absl/random/zipf_distribution.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename IntType = int> class zipf_distribution; ---- == Description absl::zipf_distribution produces random integer‐values in the range [0, k], distributed according to the unnormalized discrete probability function: P(x) = (v + x) ˆ ‐q The parameter `v` must be greater than 0 and the parameter `q` must be greater than 1. If either of these parameters take invalid values then the behavior is undefined. IntType is the result_type generated by the generator. It must be of integral type; a static_assert ensures this is the case. The implementation is based on W.Hormann, G.Derflinger: "Rejection‐Inversion to Generate Variates from Monotone Discrete Distributions" http://eeyore.wu‐wien.ac.at/papers/96‐04‐04.wh‐der.ps.gz == Types [cols="1,4"] |=== | Name| Description | xref:absl/zipf_distribution/param_type.adoc[`param_type`] | The parameter set of the distribution. |=== == Type Aliases [cols="1,4"] |=== | Name| Description | xref:absl/zipf_distribution/result_type.adoc[`result_type`] | The type of the values produced by the distribution. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:absl/zipf_distribution/2constructor-06.adoc[`zipf_distribution`] [.small]#[constructor]# | Constructors | xref:absl/zipf_distribution/k.adoc[`k`] | Returns the largest value the distribution can produce. | xref:absl/zipf_distribution/max.adoc[`max`] | Returns the largest value the distribution can produce. | xref:absl/zipf_distribution/min.adoc[`min`] | Returns the smallest value the distribution can produce. | 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. | xref:absl/zipf_distribution/reset.adoc[`reset`] | Resets the internal state of the distribution. | xref:absl/zipf_distribution/v.adoc[`v`] | Returns the offset parameter of the distribution. |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:absl/operator_not_eq-007.adoc[absl::operator!=]` | Compares two distributions for inequality. | `xref:absl/operator_eq-0ad.adoc[absl::operator==]` | Compares two distributions for equality. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#