RealRandom Class Reference

Inheritance diagram for RealRandom:

MTRand ExponentialRandom NormalRandom UniformRandom UniformRandomSimple List of all members.

Detailed Description

Base class for real-valued random number generators.

This class is the base for all of the real-valued random number generators.

Author:
Bill Smart
Date:
November 2001
Version:
1.0

Definition at line 123 of file Random.H.

Public Member Functions

 RealRandom (const unsigned long seed)
Generate samples
RealRandomoperator>> (double &random_number)
 Output stream operator.
double operator() ()
 Function operator.
 operator double ()
 Double precision cast operator.
virtual double number ()=0
 Generate a sample from the random variable.
Moments of the random variable
virtual double mean () const=0
virtual double variance () const=0
virtual double stdDev () const=0


Constructor & Destructor Documentation

RealRandom ( const unsigned long  seed  )  [inline]

Allocates the class instance and sets the random number seed.

Parameters:
seed Random number seed. Do not set this to zero.

Definition at line 128 of file Random.H.


Member Function Documentation

RealRandom& operator>> ( double &  random_number  )  [inline]

Output stream operator.

This generates a random number and loads it into a double precision floating point variable.

Returns:
A reference to the class instance, used for chaining multiple uses of the operator together.
Parameters:
random_number The variable to be assigned to.

Definition at line 139 of file Random.H.

References number().

double operator() (  )  [inline]

Function operator.

This allows an instance of the class to look like a function call.

Returns:
A sample from the random variable.

Definition at line 145 of file Random.H.

References number().

operator double (  )  [inline]

Double precision cast operator.

This allows an instance of the class to be treated as a double precision floating point number. Every access of this number will return a new sample from the random variable.

Returns:
A sample from the random variable.

Definition at line 152 of file Random.H.

References number().

virtual double number (  )  [pure 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.

Implemented in UniformRandomSimple, UniformRandom, NormalRandom, and ExponentialRandom.

Referenced by operator double(), operator()(), and operator>>().

virtual double mean (  )  const [pure virtual]

Returns:
The mean of the random variable.

Implements MTRand.

Implemented in UniformRandomSimple, UniformRandom, NormalRandom, and ExponentialRandom.

virtual double variance (  )  const [pure virtual]

Returns:
The variance of the random variable.

Implements MTRand.

Implemented in UniformRandomSimple, UniformRandom, NormalRandom, and ExponentialRandom.

virtual double stdDev (  )  const [pure virtual]

Returns:
The standard deviation of the random variable.

Implements MTRand.

Implemented in UniformRandomSimple, UniformRandom, NormalRandom, and ExponentialRandom.


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