Discrete Zipf distribution. More...
#include <twister.h>
Public Member Functions | |
discreteZipf (ibis::uniformRandomNumber &ur, double a=2.0, unsigned long imax=ULONG_MAX) | |
unsigned long | next () |
unsigned long | operator() () |
Return a discrete random number in the range of [0, imax]. | |
Discrete Zipf distribution.
The value returned follow the probability distribution (1+k)^(-a) where a >= 0, k >= 0. For a > 1, it uses the rejection-inversion algorithm of W. Hormann and G. Derflinger. For a between 0 and 1, it uses a simple rejection method.