ExponentialRandom Class Reference

Inheritance diagram for ExponentialRandom:

RealRandom MTRand List of all members.

Detailed Description

Exponential random number generator.

This class generates random numbers from an exponential distribution.

Author:
Bill Smart
Date:
November 2001
Version:
1.0

Definition at line 393 of file Random.H.

Public Member Functions

 ExponentialRandom (const double lambda=1.0, const unsigned long seed=1UL)
Generate samples
double number ()
 Generate a sample from the random variable.
Moments of the random variable
double mean () const
double variance () const
double stdDev () const
Parameters of the random variable
double lambda () const
Change parameters of the random variable
void setMean (const double mean)
void setVariance (const double variance)
void setStdDev (const double std_dev)
void setLambda (const double lambda)
void setParameters (const double mean, const double variance)

Private Attributes

double m_lambda


Constructor & Destructor Documentation

ExponentialRandom ( const double  lambda = 1.0,
const unsigned long  seed = 1UL 
) [inline]

This constructor sets the parameter of the random variable and the random number seed.

Parameters:
lambda Parameter of the random variable.
seed Random number seed. Do not set this to zero.

Definition at line 400 of file Random.H.


Member Function Documentation

double number (  )  [virtual]

Generate a sample from the random variable.

This function generates a sample from the random variable represented by the class instance.

Returns:
A sample from the random variable.

Implements RealRandom.

double mean (  )  const [inline, virtual]

Returns:
The mean of the random variable.

Implements RealRandom.

Definition at line 410 of file Random.H.

References m_lambda.

double variance (  )  const [inline, virtual]

Returns:
The variance of the random variable.

Implements RealRandom.

Definition at line 411 of file Random.H.

References m_lambda.

double stdDev (  )  const [inline, virtual]

Returns:
The standard deviation of the random variable.

Implements RealRandom.

Definition at line 412 of file Random.H.

References m_lambda.

double lambda (  )  const [inline]

Returns:
The parameter of the distribution.

Definition at line 418 of file Random.H.

References m_lambda.

void setMean ( const double  mean  )  [inline]

Set the mean of the random variable.

Parameters:
mean The new mean of the random variable.

Definition at line 425 of file Random.H.

References m_lambda.

Referenced by setParameters().

void setVariance ( const double  variance  )  [inline]

Set the variance of the random variable.

Parameters:
variance The new variance of the random variable.

Definition at line 428 of file Random.H.

References m_lambda.

Referenced by setParameters().

void setStdDev ( const double  std_dev  )  [inline]

Set the standard deviation of the random variable.

Parameters:
std_dev The new standard deviation of the random variable.

Definition at line 431 of file Random.H.

References m_lambda.

void setLambda ( const double  lambda  )  [inline]

Set the parameter value of the distribution.

Parameters:
lambda The new parameter of the distribution.

Definition at line 434 of file Random.H.

References m_lambda.

void setParameters ( const double  mean,
const double  variance 
) [inline]

Set the mean and variance of the random variable.

Parameters:
mean The new mean of the random variable.
variance The new variance of the random variable.

Definition at line 438 of file Random.H.

References setMean(), and setVariance().


Member Data Documentation

double m_lambda [private]

Definition at line 443 of file Random.H.

Referenced by lambda(), mean(), setLambda(), setMean(), setStdDev(), setVariance(), stdDev(), and variance().


The documentation for this class was generated from the following file:
Generated on Thu Feb 1 15:31:55 2007 for WURDE by  doxygen 1.5.1