34 assert(
m_s > 0 &&
m_s < 1);
double m_s
The 's' of the zipfian algorithm.
Discrete Random Generator creating a zipfian distribution.
uint64_t m_value_count
Number of values in the range.
double m_norm
Helper for calculating the probability in pmf()
bool m_initialized
true if m_norm was initialized
Generates samples from a discrete probability distribution in the range [0, max_val] by transforming ...
DiscreteRandomGeneratorZipf(double s=0.8)
Constructor; sets the "s" of the algorithm.
double pmf(uint64_t val)
Returns the probability of generating val + 1 from this distribution Uses val + 1 because dist...