last update 20 Sep 2009 |
#include <cvrUniformContinuousDistribution.h>
This class generates (pseudo) random numbers uniformly distributed in an interval specified in the parameters.
cvr::uniformContinuousDistribution::uniformContinuousDistribution | ( | ) |
Default constructor.
cvr::uniformContinuousDistribution::uniformContinuousDistribution | ( | const double | min, | |
const double | max | |||
) |
cvr::uniformContinuousDistribution::uniformContinuousDistribution | ( | const parameters & | par | ) |
Construct a functor using the given parameters.
cvr::uniformContinuousDistribution::uniformContinuousDistribution | ( | const uniformContinuousDistribution & | other | ) |
virtual cvr::uniformContinuousDistribution::~uniformContinuousDistribution | ( | ) | [virtual] |
Destructor.
virtual bool cvr::uniformContinuousDistribution::apply | ( | double & | rnd | ) | [virtual] |
Get a random number.
Returns a random number distributed accordingly to the type of the current instance.
rnd | double reference where the random number has to be left. |
Reimplemented from cvr::univariateContinuousDistribution.
virtual bool cvr::uniformContinuousDistribution::apply | ( | float & | rnd | ) | [virtual] |
Get a random number.
Returns a random number distributed accordingly to the type of the current instance.
rnd | double reference where the random number has to be left. |
Reimplemented from cvr::univariateContinuousDistribution.
virtual uniformContinuousDistribution* cvr::uniformContinuousDistribution::clone | ( | ) | const [virtual] |
Returns a pointer to a clone of this functor.
Reimplemented from cvr::univariateContinuousDistribution.
uniformContinuousDistribution& cvr::uniformContinuousDistribution::copy | ( | const uniformContinuousDistribution & | other | ) |
virtual double cvr::uniformContinuousDistribution::draw | ( | ) | [virtual] |
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,max()], where max() is the method of this class.
Reimplemented from cvr::univariateContinuousDistribution.
virtual float cvr::uniformContinuousDistribution::fdraw | ( | ) | [virtual] |
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,max()], where max() is the method of this class.
Reimplemented from cvr::univariateContinuousDistribution.
float cvr::uniformContinuousDistribution::frand | ( | ) |
Non-virtual method to get a single precision random number.
Returns a random number distributed accordingly to the type of the current instance.
This method can be used to obtain numbers in the interval [min(),max()].
Reimplemented from cvr::univariateContinuousDistribution.
const parameters& cvr::uniformContinuousDistribution::getParameters | ( | ) | const |
double cvr::uniformContinuousDistribution::max | ( | ) |
Virtual method to obtain the maximum possible number (exclusive) to be returned by this distribution.
double cvr::uniformContinuousDistribution::min | ( | ) |
Virtual method to obtain the minimum possible number (inclusive) to be returned by this distribution.
virtual const std::string& cvr::uniformContinuousDistribution::name | ( | ) | const [virtual] |
Returns the complete name of the functor class.
Reimplemented from cvr::univariateContinuousDistribution.
virtual uniformContinuousDistribution* cvr::uniformContinuousDistribution::newInstance | ( | ) | const [virtual] |
Returns a pointer to a new instance of this functor.
Reimplemented from cvr::univariateContinuousDistribution.
uniformContinuousDistribution& cvr::uniformContinuousDistribution::operator= | ( | const uniformContinuousDistribution & | other | ) |
double cvr::uniformContinuousDistribution::rand | ( | ) |
Non-virtual method to get a double precision random number.
Returns a random number distributed accordingly to the type of the current instance.
This method can be used to obtain numbers in the interval [min(),max()].
Reimplemented from cvr::univariateContinuousDistribution.
bool cvr::uniformContinuousDistribution::updateParameters | ( | ) | [virtual] |
double cvr::uniformContinuousDistribution::delta_ [protected] |
delta_ = (maximum_ - minimum_)*dnorm_
float cvr::uniformContinuousDistribution::fdelta_ [protected] |
delta_ = (maximum_ - minimum_)*fnorm_
float cvr::uniformContinuousDistribution::fmaximum_ [protected] |
Shadow of the parameters.max;.
float cvr::uniformContinuousDistribution::fminimum_ [protected] |
Shadow of the parameters.min;.
double cvr::uniformContinuousDistribution::maximum_ [protected] |
Shadow of the parameters.max;.
double cvr::uniformContinuousDistribution::minimum_ [protected] |
Shadow of the parameters.min;.