yat  0.21pre
Public Types | Public Member Functions | Protected Attributes | List of all members
theplu::yat::random::Binomial Class Reference

Binomial distribution. More...

#include <yat/random/random.h>

Inheritance diagram for theplu::yat::random::Binomial:
theplu::yat::random::Discrete

Public Types

typedef unsigned long int result_type
 

Public Member Functions

 Binomial (double p, unsigned int n)
 Constructor. More...
 
unsigned long operator() (void) const
 
void seed (unsigned long s) const
 Set the seed to s. More...
 
unsigned long seed_from_devurandom (void)
 Set the seed using the /dev/urandom device. More...
 

Protected Attributes

RNGrng_
 GSL random gererator.
 

Detailed Description

Binomial distribution.

See also
gsl_ran_binomial
Since
New in yat 0.10

Member Typedef Documentation

◆ result_type

typedef unsigned long int theplu::yat::random::Discrete::result_type
inherited

type returned by operator()

Since
New in yat 0.10

Constructor & Destructor Documentation

◆ Binomial()

theplu::yat::random::Binomial::Binomial ( double  p,
unsigned int  n 
)

Constructor.

Create an object that generates random numbers from binomial distribution, the number of successes in
trials each with success probability p.

Member Function Documentation

◆ operator()()

unsigned long theplu::yat::random::Binomial::operator() ( void  ) const
virtual
Returns
number from binomial distrubtion as parametrized in constructor.

Implements theplu::yat::random::Discrete.

◆ seed()

void theplu::yat::random::Discrete::seed ( unsigned long  s) const
inherited

Set the seed to s.

Set the seed to s in the underlying rng. If s is zero, a default value from the rng's original implementation is used (cf. GSL documentation).

Deprecated:
Provided for backward compatibility with the 0.7 API. Use RNG::instance()->seed(s) instead.

◆ seed_from_devurandom()

unsigned long theplu::yat::random::Discrete::seed_from_devurandom ( void  )
inherited

Set the seed using the /dev/urandom device.

Returns
The seed acquired from /dev/urandom.
Deprecated:
Provided for backward compatibility with the 0.7 API. Use RNG::instance()->seed_from_devurandom() instead.

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

Generated on Wed Jan 25 2023 03:34:29 for yat by  doxygen 1.8.14