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

Generator of random numbers from an exponential distribution. More...

#include <yat/random/random.h>

Inheritance diagram for theplu::yat::random::Exponential:
theplu::yat::random::Continuous

List of all members.

Public Member Functions

 Exponential (const double m=1)
 Constructor.
double operator() (void) const
double operator() (const double m) const
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_
 pointer to GSL random generator

Detailed Description

Generator of random numbers from an exponential distribution.

The distribution function is $ f(x) = \frac{1}{m}\exp(-x/a) $ for $ x $ with the expectation value $ m $ and variance $ m^2 $


Constructor & Destructor Documentation

theplu::yat::random::Exponential::Exponential ( const double  m = 1)
explicit

Constructor.

Parameters:
mis the expectation value of the distribution.

Member Function Documentation

double theplu::yat::random::Exponential::operator() ( void  ) const
virtual
Returns:
A random number from exponential distribution.

Implements theplu::yat::random::Continuous.

double theplu::yat::random::Exponential::operator() ( const double  m) const
Returns:
A random number from exponential distribution, with expectation value m
Note:
This operator ignores parameters given in constructor.
void theplu::yat::random::Continuous::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::Continuous::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