|
last update 20 Sep 2009 |
|
#include <cvrUnivariateDiscreteDistribution.h>


Public Member Functions | |
| univariateDiscreteDistribution () | |
| univariateDiscreteDistribution (const univariateDiscreteDistribution &othe) | |
| virtual | ~univariateDiscreteDistribution () |
| virtual bool | apply (int &rnd)=0 |
| virtual int | draw ()=0 |
| int | rand () |
| virtual int | max () const =0 |
| virtual int | min () const =0 |
| virtual univariateDiscreteDistribution * | clone () const =0 |
| virtual univariateDiscreteDistribution * | newInstance () const =0 |
All univariate continuous distributions return random numbers in a floating point format. This class establishes the basic interface to allow virtual inheritance of the apply methods.
| cvr::univariateDiscreteDistribution::univariateDiscreteDistribution | ( | ) |
Default constructor.
| cvr::univariateDiscreteDistribution::univariateDiscreteDistribution | ( | const univariateDiscreteDistribution & | othe | ) |
| virtual cvr::univariateDiscreteDistribution::~univariateDiscreteDistribution | ( | ) | [virtual] |
Destructor.
| virtual bool cvr::univariateDiscreteDistribution::apply | ( | int & | rnd | ) | [pure virtual] |
Get a random number.
Returns a random number distributed accordingly to the type of the current instance.
The univariateDiscreteDistribution can be used to obtain numbers in the interval [0,max()].
| rnd | double reference where the random number has to be left. |
Implemented in cvr::uniformDiscreteDistribution.
| virtual univariateDiscreteDistribution* cvr::univariateDiscreteDistribution::clone | ( | ) | const [pure virtual] |
Returns a pointer to a clone of this functor.
Reimplemented from cvr::randomDistribution.
Implemented in cvr::uniformDiscreteDistribution.
| virtual int cvr::univariateDiscreteDistribution::draw | ( | ) | [pure virtual] |
Virtual method to get a integer random number.
Returns a random number distributed accordingly to the type of the current instance.
The univariateDiscreteDistribution can be used to obtain numbers in the interval [0,max()], where max() is the method of this class.
Implemented in cvr::uniformDiscreteDistribution.
| virtual int cvr::univariateDiscreteDistribution::max | ( | ) | const [pure virtual] |
Virtual method to obtain the maximum possible number (inclusive) to be returned by this distribution.
Implemented in cvr::uniformDiscreteDistribution.
| virtual int cvr::univariateDiscreteDistribution::min | ( | ) | const [pure virtual] |
Virtual method to obtain the minimum possible number (inclusive) to be returned by this distribution.
Implemented in cvr::uniformDiscreteDistribution.
| virtual univariateDiscreteDistribution* cvr::univariateDiscreteDistribution::newInstance | ( | ) | const [pure virtual] |
Returns a pointer to a new instance of this functor.
Reimplemented from cvr::randomDistribution.
Implemented in cvr::uniformDiscreteDistribution.
| int cvr::univariateDiscreteDistribution::rand | ( | ) |
Non-virtual method to get a integer random number.
Returns a random number distributed accordingly to the type of the current instance.
The univariateDiscreteDistribution can be used to obtain numbers in the interval [0,max()], where max() is the method of this class.
Reimplemented in cvr::uniformDiscreteDistribution.