A distribution over random integer‐values in the range [0, k].
Synopsis
Declared in <absl/random/zipf_distribution.h>
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
Name |
Description |
The parameter set of the distribution. |
Type Aliases
Name |
Description |
The type of the values produced by the distribution. |
Member Functions
Name |
Description |
|
Constructors |
Returns the largest value the distribution can produce. |
|
Returns the largest value the distribution can produce. |
|
Returns the smallest value the distribution can produce. |
|
Function call operators |
|
|
|
Returns the exponent parameter of the distribution. |
|
Resets the internal state of the distribution. |
|
Returns the offset parameter of the distribution. |
Friends
Name |
Description |
Compares two distributions for inequality. |
|
Compares two distributions for equality. |
Created with MrDocs