CVR-Lib last update 20 Sep 2009

cvr::univariateContinuousDistribution Class Reference
[Continuous random distributions]

Class univariateContinuousDistribution. More...

#include <cvrUnivariateContinuousDistribution.h>

Inheritance diagram for cvr::univariateContinuousDistribution:

Inheritance graph
[legend]
Collaboration diagram for cvr::univariateContinuousDistribution:

Collaboration graph
[legend]

List of all members.

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 ()
univariateContinuousDistributioncopy (const univariateContinuousDistribution &other)
univariateContinuousDistributionoperator= (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_


Detailed Description

Class univariateContinuousDistribution.

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.

See also:
univariateContinuousDistribution::parameters.

Constructor & Destructor Documentation

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  ) 

Copy constructor.

Parameters:
o the object to be copied

virtual cvr::univariateContinuousDistribution::~univariateContinuousDistribution (  )  [virtual]

Destructor.


Member Function Documentation

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).

Parameters:
rnd double reference where the random number has to be left.
Returns:
true if apply successful or false otherwise.

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).

Parameters:
rnd float reference where the random number has to be left.
Returns:
true if apply successful or false otherwise.

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  ) 

Copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

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).

Returns:
a random double number.

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).

Returns:
a random float number.

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).

Returns:
a random float number.

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  ) 

Alias for copy member.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

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).

Returns:
a random double number.

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.


Member Data Documentation

Double normalizer.

Float normalizer.


The documentation for this class was generated from the following file:

Generated on Sun Sep 20 22:09:06 2009 for CVR-Lib by Doxygen 1.5.8