Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

generators::RNG Class Reference

Outline of a basic RNG. More...

#include <generators.h>

Inheritance diagram for generators::RNG:

generators::LC_RNG generators::STD_RANDOM generators::QUICK generators::RANDU List of all members.

Public Member Functions

virtual unsigned int nextInt ()=0
 Returns the next pseudo-random number from this RNG.
virtual double nextDouble ()
 Returns the next normalised pseudo-random number from this RNG.
virtual void setSeed (unsigned int seed)
 Sets the current seed to a given number.
virtual unsigned int getMaximum ()
 Returns the maximum number that this RNG can produce, used for normalisation of the integer numbers.
virtual ~RNG ()
 Base deconstructor.

Protected Attributes

unsigned int _seed
 The current seed of this RNG.

Detailed Description

Outline of a basic RNG.

Derived classes should define the now virtual methods with specific steps to generate random numbers and normalise them.


Member Function Documentation

unsigned int generators::RNG::getMaximum  )  [inline, virtual]
 

Returns the maximum number that this RNG can produce, used for normalisation of the integer numbers.

Returns:
The maximum number which can be returned by this RNG.

Reimplemented in generators::STD_RANDOM, and generators::LC_RNG.

double generators::RNG::nextDouble  )  [virtual]
 

Returns the next normalised pseudo-random number from this RNG.

Normalisation is done automatically, as well as updating the current seed.

Returns:
The normalised version of the next pseudo-random number.

virtual unsigned int generators::RNG::nextInt  )  [pure virtual]
 

Returns the next pseudo-random number from this RNG.

Seed updating is done automatically.

Returns:
The next pseudo-random number.

Implemented in generators::STD_RANDOM, and generators::LC_RNG.

void generators::RNG::setSeed unsigned int  seed  )  [virtual]
 

Sets the current seed to a given number.

Parameters:
seed The new seed.

Reimplemented in generators::STD_RANDOM.


The documentation for this class was generated from the following files:
Generated on Fri Sep 4 18:03:46 2009 for LabSci RNG/MC generators by  doxygen 1.3.9.1