latest version v1.9 - last update 10 Apr 2010 |
Base random number class. More...
#include <ltiRandDist.h>
Classes | |
class | parameters |
parameters of the random distribution More... | |
Public Member Functions | |
randomDistribution (bool reInit=false) | |
randomDistribution (const unsigned int theValue) | |
virtual | ~randomDistribution () |
void | init () const |
void | init (const unsigned int theValue) const |
virtual functor * | clone () const |
virtual const char * | getTypeName () const |
randomDistribution & | copy (const randomDistribution &other) |
Protected Member Functions | |
double | rand () const |
Base random number class.
You can use an instance of this class to initialize the random number generator.
lti::randomDistribution::randomDistribution | ( | bool | reInit = false |
) |
default constructor.
Initializes the pseudo-random number generator using system time. If reInit is false, the generator is initialized only when instantiating the first randomDistribution object.
Referenced by clone().
lti::randomDistribution::randomDistribution | ( | const unsigned int | theValue | ) |
this constructor initializes the pseudo-random number generator using the given value
virtual lti::randomDistribution::~randomDistribution | ( | ) | [virtual] |
destructor
virtual functor* lti::randomDistribution::clone | ( | ) | const [inline, virtual] |
returns a pointer to a clone of the functor.
Implements lti::functor.
Reimplemented in lti::binomialDistribution, lti::continuousRandomDistribution, lti::discreteRandomDistribution, lti::exponentialDistribution, lti::gammaDistribution, lti::gaussianDistribution, lti::multivariateGaussian, lti::poissonDistribution, and lti::uniformDistribution.
References randomDistribution().
randomDistribution& lti::randomDistribution::copy | ( | const randomDistribution & | other | ) |
copy member
Reimplemented from lti::functor.
Reimplemented in lti::binomialDistribution, lti::continuousRandomDistribution, lti::discreteRandomDistribution, lti::gaussianDistribution, lti::multivariateGaussian, and lti::poissonDistribution.
virtual const char* lti::randomDistribution::getTypeName | ( | void | ) | const [inline, virtual] |
returns the name of this type
Reimplemented from lti::functor.
Reimplemented in lti::binomialDistribution, lti::continuousRandomDistribution, lti::discreteRandomDistribution, lti::exponentialDistribution, lti::gammaDistribution, lti::gaussianDistribution, lti::multivariateGaussian, lti::poissonDistribution, and lti::uniformDistribution.
void lti::randomDistribution::init | ( | const unsigned int | theValue | ) | const |
re-initializes the random number generator using the given value
void lti::randomDistribution::init | ( | ) | const |
re-initializes the random number generator using system time
double lti::randomDistribution::rand | ( | ) | const [inline, protected] |
This is a wrapper for the rand() function that returns a value between 0.0 (inclusive) and 1.0 (exclusive).