biu::RandomNumberGenerator Class Reference
#include <RandomNumberGenerator.hh>
Inheritance diagram for biu::RandomNumberGenerator:
Detailed Description
The abstract class works as a random number generator for unsigned integers.
Definition at line 12 of file RandomNumberGenerator.hh.
Public Member Functions | |
virtual RandomNumberGenerator * | copy (void)=0 |
virtual unsigned int | getMaxRN ()=0 |
virtual unsigned int | getRN ()=0 |
RandomNumberGenerator (RandomNumberGenerator &c) | |
RandomNumberGenerator (unsigned int seed_=1) | |
virtual void | setSeed (unsigned int seed)=0 |
virtual | ~RandomNumberGenerator () |
Protected Attributes | |
unsigned int | seed |
Constructor & Destructor Documentation
biu::RandomNumberGenerator::RandomNumberGenerator | ( | unsigned int | seed_ = 1 |
) | [inline] |
Creates a RandomNumberGenerator object and initialises the seed.
- Parameters:
-
seed_ the initial seed value defaults to 1.
Definition at line 22 of file RandomNumberGenerator.hh.
biu::RandomNumberGenerator::RandomNumberGenerator | ( | RandomNumberGenerator & | c | ) | [inline] |
Definition at line 23 of file RandomNumberGenerator.hh.
virtual biu::RandomNumberGenerator::~RandomNumberGenerator | ( | ) | [inline, virtual] |
Definition at line 24 of file RandomNumberGenerator.hh.
Member Function Documentation
virtual RandomNumberGenerator* biu::RandomNumberGenerator::copy | ( | void | ) | [pure virtual] |
virtual unsigned int biu::RandomNumberGenerator::getMaxRN | ( | ) | [pure virtual] |
Returns the largest value the rand function will return.
- Returns:
- larges possible random number
Implemented in biu::RNG_ISO, and biu::RNG_LCG.
virtual unsigned int biu::RandomNumberGenerator::getRN | ( | ) | [pure virtual] |
Returns the next random number in the series. It's value will be in [0, getMaxRN()].
- Returns:
- the next random number
Implemented in biu::RNG_ISO, and biu::RNG_LCG.
virtual void biu::RandomNumberGenerator::setSeed | ( | unsigned int | seed | ) | [pure virtual] |
Specifies the seed value used for random number generation.
- Parameters:
-
seed the new seed value to use
Implemented in biu::RNG_ISO, and biu::RNG_LCG.
Field Documentation
unsigned int biu::RandomNumberGenerator::seed [protected] |
Definition at line 15 of file RandomNumberGenerator.hh.
The documentation for this class was generated from the following file:
- src/biu/RandomNumberGenerator.hh