spot 2.3.4

- Main Page
- Related Pages
- Modules
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
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:

- spot/misc/random.hh

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.