IntegerRandom Class Reference

Inheritance diagram for IntegerRandom:

MTRand BernoulliRandom DiscreteUniformRandom List of all members.

Detailed Description

Base class for integer-valued random number generators.

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

Author:
Bill Smart
Date:
November 2001
Version:
1.0

Definition at line 179 of file Random.H.

Public Member Functions

 IntegerRandom (const unsigned long seed)
Generate samples
IntegerRandomoperator>> (int &random_number)
 Output stream operator.
int operator() ()
 Function operator.
 operator int ()
 Integer cast operator.
virtual int 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

IntegerRandom ( 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 184 of file Random.H.


Member Function Documentation

IntegerRandom& operator>> ( int &  random_number  )  [inline]

Output stream operator.

This generates a random number and loads it into a integer 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 194 of file Random.H.

References number().

int 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 200 of file Random.H.

References number().

operator int (  )  [inline]

Integer cast operator.

This allows an instance of the class to be treated as an integer 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 207 of file Random.H.

References number().

virtual int 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 DiscreteUniformRandom, and BernoulliRandom.

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

virtual double mean (  )  const [pure virtual]

Returns:
The mean of the random variable.

Implements MTRand.

Implemented in DiscreteUniformRandom, and BernoulliRandom.

virtual double variance (  )  const [pure virtual]

Returns:
The variance of the random variable.

Implements MTRand.

Implemented in DiscreteUniformRandom, and BernoulliRandom.

virtual double stdDev (  )  const [pure virtual]

Returns:
The standard deviation of the random variable.

Implements MTRand.

Implemented in DiscreteUniformRandom, and BernoulliRandom.


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