last update 20 Sep 2009 |
#include <cvrUnivariateContinuousDistribution.h>
Public Member Functions | |
univariateContinuousDistribution (const bool initParams=true) | |
univariateContinuousDistribution (const parameters &par) | |
univariateContinuousDistribution (const univariateContinuousDistribution &o) | |
virtual | ~univariateContinuousDistribution () |
virtual bool | apply (float &rnd) |
virtual bool | apply (double &rnd) |
virtual float | fdraw () |
virtual double | draw () |
float | frand () |
double | rand () |
univariateContinuousDistribution & | copy (const univariateContinuousDistribution &other) |
univariateContinuousDistribution & | operator= (const univariateContinuousDistribution &other) |
virtual const std::string & | name () const |
virtual univariateContinuousDistribution * | clone () const |
virtual univariateContinuousDistribution * | newInstance () const |
bool | updateParameters () |
Protected Attributes | |
float | fnorm_ |
double | dnorm_ |
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::univariateContinuousDistribution::univariateContinuousDistribution | ( | const bool | initParams = true |
) |
Default constructor.
Inherited classes can turn off the parameter initialization, since they do the job.
cvr::univariateContinuousDistribution::univariateContinuousDistribution | ( | const parameters & | par | ) |
Construct a functor using the given parameters.
cvr::univariateContinuousDistribution::univariateContinuousDistribution | ( | const univariateContinuousDistribution & | o | ) |
virtual cvr::univariateContinuousDistribution::~univariateContinuousDistribution | ( | ) | [virtual] |
Destructor.
virtual bool cvr::univariateContinuousDistribution::apply | ( | double & | rnd | ) | [virtual] |
Get a random number.
Returns a random number distributed accordingly to the type of the current instance.
The univariateContinuousDistribution can be used to obtain numbers in the interval [0,1).
rnd | double reference where the random number has to be left. |
Reimplemented in cvr::normalDistribution, and cvr::uniformContinuousDistribution.
virtual bool cvr::univariateContinuousDistribution::apply | ( | float & | rnd | ) | [virtual] |
Get a random number.
Returns a random number distributed accordingly to the type of the current instance.
The univariateContinuousDistribution can be used to obtain numbers in the interval [0,1).
rnd | float reference where the random number has to be left. |
Reimplemented in cvr::normalDistribution, and cvr::uniformContinuousDistribution.
virtual univariateContinuousDistribution* cvr::univariateContinuousDistribution::clone | ( | ) | const [virtual] |
Returns a pointer to a clone of this functor.
Reimplemented from cvr::randomDistribution.
Reimplemented in cvr::normalDistribution, and cvr::uniformContinuousDistribution.
univariateContinuousDistribution& cvr::univariateContinuousDistribution::copy | ( | const univariateContinuousDistribution & | other | ) |
virtual double cvr::univariateContinuousDistribution::draw | ( | ) | [virtual] |
Get a double precision random number.
Returns a random number distributed accordingly to the type of the current instance.
The univariateContinuousDistribution can be used to obtain numbers in the interval [0,1).
Reimplemented in cvr::normalDistribution, and cvr::uniformContinuousDistribution.
virtual float cvr::univariateContinuousDistribution::fdraw | ( | ) | [virtual] |
Get a single precision random number.
Returns a random number distributed accordingly to the type of the current instance.
The univariateContinuousDistribution can be used to obtain numbers in the interval [0,1).
Reimplemented in cvr::normalDistribution, and cvr::uniformContinuousDistribution.
float cvr::univariateContinuousDistribution::frand | ( | ) |
Non-virtual method to get a single precision random number.
Returns a random number distributed accordingly to the type of the current instance.
The univariateContinuousDistribution can be used to obtain numbers in the interval [0,1).
Reimplemented in cvr::normalDistribution, and cvr::uniformContinuousDistribution.
virtual const std::string& cvr::univariateContinuousDistribution::name | ( | ) | const [virtual] |
Returns the complete name of the functor class.
Reimplemented from cvr::randomDistribution.
Reimplemented in cvr::normalDistribution, and cvr::uniformContinuousDistribution.
virtual univariateContinuousDistribution* cvr::univariateContinuousDistribution::newInstance | ( | ) | const [virtual] |
Returns a pointer to a new instance of this functor.
Reimplemented from cvr::randomDistribution.
Reimplemented in cvr::normalDistribution, and cvr::uniformContinuousDistribution.
univariateContinuousDistribution& cvr::univariateContinuousDistribution::operator= | ( | const univariateContinuousDistribution & | other | ) |
double cvr::univariateContinuousDistribution::rand | ( | ) |
Non-virtual method to get a double precision random number.
Returns a random number distributed accordingly to the type of the current instance.
The univariateContinuousDistribution can be used to obtain numbers in the interval [0,1).
Reimplemented in cvr::normalDistribution, and cvr::uniformContinuousDistribution.
bool cvr::univariateContinuousDistribution::updateParameters | ( | ) | [virtual] |
Returns used parameters.
Reimplemented from cvr::randomDistribution.
Reimplemented in cvr::normalDistribution, and cvr::uniformContinuousDistribution.
double cvr::univariateContinuousDistribution::dnorm_ [protected] |
Double normalizer.
float cvr::univariateContinuousDistribution::fnorm_ [protected] |
Float normalizer.