yat  0.8.3pre
Public Member Functions | Protected Attributes
theplu::yat::random::DiscreteGeneral Class Reference

General. More...

#include <yat/random/random.h>

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

List of all members.

Public Member Functions

 DiscreteGeneral (const statistics::Histogram &hist)
 Constructor.
 DiscreteGeneral (const DiscreteGeneral &)
 Copy constructor.
 ~DiscreteGeneral (void)
 Destructor.
unsigned long operator() (void) const
DiscreteGeneraloperator= (const DiscreteGeneral &)
 Assignment operator.
void seed (unsigned long s) const
 Set the seed to s.
unsigned long seed_from_devurandom (void)
 Set the seed using the /dev/urandom device.

Protected Attributes

RNGrng_
 GSL random gererator.

Detailed Description

General.


Constructor & Destructor Documentation

Constructor.

Parameters:
histis a Histogram defining the probability distribution

Copy constructor.

Since:
Explicitely implemented in yat 0.5

Member Function Documentation

unsigned long theplu::yat::random::DiscreteGeneral::operator() ( void  ) const
virtual

The generated number is an integer and proportinal to the frequency in the corresponding histogram bin. In other words, the probability that 0 is returned is proportinal to the size of the first bin.

Returns:
A random number.

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

DiscreteGeneral& theplu::yat::random::DiscreteGeneral::operator= ( const DiscreteGeneral )

Assignment operator.

Since:
Explicitely implemented in yat 0.5
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 Thu Dec 20 2012 03:12:59 for yat by  doxygen 1.8.0-20120409