source/Random.h
/**
     * Generate a random variable drawn from a Poisson distribution.
     *
     * @param mean The mean of the distribution.
     **/
Generate a random variable drawn from a Poisson distribution.
@param mean The mean of the distribution.
Generate a random variable drawn from a Poisson distribution . @param mean The mean of the distribution .
inline uint32_t GetRandPoisson(const double mean) {
      const double a = exp(-mean);
      if (a <= 0) return UINT_MAX; 
      uint32_t k = 0;
      double u = GetDouble();
      while (u >= a) {
        u *= GetDouble();
        ++k;
      }
      return k;
    }
inline uint32_t GetRandPoisson ( const double mean ) { const double a = exp ( - mean ) ; if ( a <= 0 ) return UINT_MAX ; uint32_t k = 0 ; double u = GetDouble ( ) ; while ( u >= a ) { u *= GetDouble ( ) ; ++ k ; } return k ; }
Generate a random variable drawn from a Poisson distribution.
Generate a random variable drawn from a Poisson distribution .
// Draw from a Poisson Dist with mean; if cannot calculate, return UINT_MAX. // Uses Rejection Method // cannot calculate, so return UINT_MAX