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

#include <yat/random/random.h>

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

Public Types

typedef unsigned long int result_type
 

Public Member Functions

 NegativeHyperGeometric (void)
 Default constructor.
 
 NegativeHyperGeometric (unsigned int n1, unsigned int n2, unsigned int t)
 Constructor. More...
 
unsigned long int operator() (void) const
 
unsigned long int operator() (unsigned int n1, unsigned int n2, unsigned int t) 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

We have n1 samples of type 1 and n2 samples of type 2. Samples are drawn with replacement until t samles of type 2 are drawn. Then k, number of drawn samples of type 1, follows negative hypergeometric distribution.

Since
New in yat 0.14
See Also
HyperGeometric

Member Typedef Documentation

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

type returned by operator()

Since
New in yat 0.10

Constructor & Destructor Documentation

theplu::yat::random::NegativeHyperGeometric::NegativeHyperGeometric ( unsigned int  n1,
unsigned int  n2,
unsigned int  t 
)

Constructor.

Parameters
n1number of samples of type 1
n2number of samples of type 2
tnumber of samples of type 2 to draw

Member Function Documentation

unsigned long int theplu::yat::random::NegativeHyperGeometric::operator() ( void  ) const
virtual
Returns
random number from negative hypergeometric distribution using parameters set in constructor.

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

unsigned long int theplu::yat::random::NegativeHyperGeometric::operator() ( unsigned int  n1,
unsigned int  n2,
unsigned int  t 
) const
Returns
random number from negative hypergeometric distribution using parameters passed.
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.
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 Tue Sep 26 2017 02:33:30 for yat by  doxygen 1.8.5