cps::UniformRandomGenerator Class Reference

A random number generator generating uniform random numbers. More...

#include <random.h>

Inherits cps::RandomGenerator.

Inherited by cps::UGrandomGenerator.

List of all members.

Public Member Functions

 UniformRandomGenerator (IFloat high_limit=0.5, IFloat low_limit=-0.5)
IFloat Rand ()
IFloat Rand (Float high, Float low)

Static Public Member Functions

static void SetInterval (IFloat high_limit, IFloat low_limit)
 Sets the interval over which the uniform distribution is defined.


Detailed Description

A random number generator generating uniform random numbers.

The range is defined in the constructor.

This should be inherited by UGrandomGenerator class rather than used directly.

Definition at line 109 of file random.h.


Constructor & Destructor Documentation

cps::UniformRandomGenerator::UniformRandomGenerator IFloat  high_limit = 0.5,
IFloat  low_limit = -0.5
[inline]
 

The default range is (-0.5, 0.5).

Parameters:
high_limit the upper bound of the distribution range
low_limit the lower bound of the distribution range
Note:
The user must ensure that the lower bound is not greater than the upper bound.

Definition at line 124 of file random.h.


Member Function Documentation

IFloat cps::UniformRandomGenerator::Rand Float  high,
Float  low
 

Generates a uniform random number from a distribution determined by the function parameters.

Parameters:
high The upper distribution bound
low The lower distribution bound
Returns:
A random number from a uniform distribution.
Note:
The user must ensure that the lower bound is not greater than the upper bound.

Definition at line 125 of file random_asm.C.

References cps::RandomGenerator::Rand().

IFloat cps::UniformRandomGenerator::Rand void   ) 
 

Precondition:
Reset must have already been called.
Returns:
A random number from a uniform distribution.

Reimplemented from cps::RandomGenerator.

Definition at line 111 of file random_asm.C.

References cps::RandomGenerator::Rand().

Referenced by cps::QPropWRand::QPropWRand().

static void cps::UniformRandomGenerator::SetInterval IFloat  high_limit,
IFloat  low_limit
[inline, static]
 

Sets the interval over which the uniform distribution is defined.

The default range is (-0.5, 0.5).

Parameters:
high_limit the upper bound of the distribution range
lower_limit the lower bound of the distribution range
Postcondition:
This sets the interval for all instances of this class.
Note:
The user must ensure that the lower bound is not greater than the upper bound.

Reimplemented in cps::UGrandomGenerator.

Definition at line 137 of file random.h.

Referenced by cps::LatRanGen::SetInterval().


The documentation for this class was generated from the following files:
Generated on Tue Mar 6 10:58:19 2007 for Columbia Physics System by  doxygen 1.4.6