I have forgotten
my Password

Discrete

Random Sample

Generates random numbers following a discrete distribution.
int sample (int N, double* p, bool normalise=true, double seed=0.1234)
Icon

Randomfast

Generates random numbers for a discrete distribution in constant time.
template<class T> void RandomFast<T>::init (int n, T *p, bool normalise)
int sampleFast (int N, double* p, bool normalise=true, double seed=0.1234)