biu::RNG_ISO Class Reference
#include <RandomNumberGenerator.hh>
Inheritance diagram for biu::RNG_ISO:
Detailed Description
An object of this class works as a random number generator. This implementation maps to the rand & srand ISO C random number functions. The random numbers derived from a particular seed value will differ on different CPU types and C librarys. For a defined set of random numbers, one of it's subclasses should be used.
Definition at line 61 of file RandomNumberGenerator.hh.
Public Member Functions | |
virtual RandomNumberGenerator * | copy (void) |
virtual unsigned int | getMaxRN () |
virtual unsigned int | getRN () |
RNG_ISO (unsigned int seed=1) | |
virtual void | setSeed (unsigned int _seed) |
virtual | ~RNG_ISO () |
Protected Attributes | |
unsigned int | seed |
Constructor & Destructor Documentation
biu::RNG_ISO::RNG_ISO | ( | unsigned int | seed = 1 |
) |
Creates a RandomNumberGenerator object.
- Parameters:
-
seed the initial seed value defaults to 1.
Definition at line 10 of file RandomNumberGenerator.cc.
biu::RNG_ISO::~RNG_ISO | ( | ) | [virtual] |
Definition at line 15 of file RandomNumberGenerator.cc.
Member Function Documentation
RandomNumberGenerator * biu::RNG_ISO::copy | ( | void | ) | [virtual] |
Creates a new Copy of this object.
Implements biu::RandomNumberGenerator.
Definition at line 37 of file RandomNumberGenerator.cc.
unsigned int biu::RNG_ISO::getMaxRN | ( | ) | [virtual] |
Returns the largest value the rand function will return.
Implements biu::RandomNumberGenerator.
Definition at line 32 of file RandomNumberGenerator.cc.
unsigned int biu::RNG_ISO::getRN | ( | ) | [virtual] |
Returns the next random number in the series. It's value will be in [0, getMaxRN()].
Implements biu::RandomNumberGenerator.
Definition at line 26 of file RandomNumberGenerator.cc.
void biu::RNG_ISO::setSeed | ( | unsigned int | _seed | ) | [virtual] |
Specifies the seed value used for random number generation. Because this implementation maps to ISO C rand & srand this will not be specific to an object, it will affect the "global" seed value.
Implements biu::RandomNumberGenerator.
Definition at line 19 of file RandomNumberGenerator.cc.
Field Documentation
unsigned int biu::RandomNumberGenerator::seed [protected, inherited] |
Definition at line 15 of file RandomNumberGenerator.hh.
The documentation for this class was generated from the following files:
- src/biu/RandomNumberGenerator.hh
- src/biu/RandomNumberGenerator.cc