CVR-Lib last update 20 Sep 2009

cvr::univariateDiscreteDistribution Class Reference
[Discrete random distributions]

Class univariateDiscreteDistribution. More...

#include <cvrUnivariateDiscreteDistribution.h>

Inheritance diagram for cvr::univariateDiscreteDistribution:

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

Collaboration graph
[legend]

List of all members.

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


Detailed Description

Class univariateDiscreteDistribution.

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:
univariateDiscreteDistribution::parameters.

Constructor & Destructor Documentation

cvr::univariateDiscreteDistribution::univariateDiscreteDistribution (  ) 

Default constructor.

cvr::univariateDiscreteDistribution::univariateDiscreteDistribution ( const univariateDiscreteDistribution othe  ) 

Copy constructor.

Parameters:
othe the object to be copied

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

Destructor.


Member Function Documentation

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

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

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.

Returns:
a random float number.

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.

Returns:
a random float number.

Reimplemented in cvr::uniformDiscreteDistribution.


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