yat  0.20.3pre
Public Types | Public Member Functions | Protected Attributes | List of all members
theplu::yat::random::Discrete Class Referenceabstract

Discrete random number distributions. More...

#include <yat/random/random.h>

Inheritance diagram for theplu::yat::random::Discrete:
theplu::yat::random::Binomial theplu::yat::random::DiscreteGeneral theplu::yat::random::DiscreteUniform theplu::yat::random::Geometric theplu::yat::random::HyperGeometric theplu::yat::random::NegativeBinomial theplu::yat::random::NegativeHyperGeometric theplu::yat::random::Poisson

Public Types

typedef unsigned long int result_type
 

Public Member Functions

 Discrete (void)
 Constructor.
 
virtual ~Discrete (void)
 The destructor.
 
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...
 
virtual result_type operator() (void) const =0
 

Protected Attributes

RNGrng_
 GSL random gererator.
 

Detailed Description

Discrete random number distributions.

Abstract base class for discrete random number distributions. Given K discrete events with different probabilities $ P[k] $, produce a random value k consistent with its probability.

Member Typedef Documentation

◆ result_type

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

type returned by operator()

Since
New in yat 0.10

Member Function Documentation

◆ operator()()

virtual result_type theplu::yat::random::Discrete::operator() ( void  ) const
pure virtual

◆ seed()

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

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  )

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 Sat Feb 18 2023 03:31:45 for yat by  doxygen 1.8.14