CodeCogs
HomeForumsCart
Login



Forgotten Password?

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com

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)