spot  2.11.6
Public Member Functions | Protected Attributes | List of all members
spot::barand< gen > Class Template Reference

Compute pseudo-random integer value between 0 and n included, following a binomial distribution with probability p. More...

#include <spot/misc/random.hh>

Collaboration diagram for spot::barand< gen >:

Public Member Functions

 barand (int n, double p)
 
int rand () const
 

Protected Attributes

const int n_
 
const double m_
 
const double s_
 

Detailed Description

template<double(*)() gen>
class spot::barand< gen >

Compute pseudo-random integer value between 0 and n included, following a binomial distribution with probability p.

gen must be a random function computing a pseudo-random double value following a standard normal distribution. Use nrand() or bmrand().

Usually approximating a binomial distribution using a normal distribution and is accurate only if n*p and n*(1-p) are greater than 5.


The documentation for this class was generated from the following file:

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Fri Feb 27 2015 10:00:07 for spot by doxygen 1.9.1