CVR-Lib last update 20 Sep 2009

cvr::uniformContinuousDistribution Class Reference
[Continuous random distributions]

Class uniformContinuousDistribution. More...

#include <cvrUniformContinuousDistribution.h>

Inheritance diagram for cvr::uniformContinuousDistribution:

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

Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 The parameters for the class uniformContinuousDistribution. More...

Public Member Functions

 uniformContinuousDistribution ()
 uniformContinuousDistribution (const double min, const double max)
 uniformContinuousDistribution (const parameters &par)
 uniformContinuousDistribution (const uniformContinuousDistribution &other)
virtual ~uniformContinuousDistribution ()
virtual bool apply (float &rnd)
virtual bool apply (double &rnd)
virtual float fdraw ()
virtual double draw ()
float frand ()
double rand ()
double min ()
double max ()
uniformContinuousDistributioncopy (const uniformContinuousDistribution &other)
uniformContinuousDistributionoperator= (const uniformContinuousDistribution &other)
virtual const std::string & name () const
virtual
uniformContinuousDistribution
clone () const
virtual
uniformContinuousDistribution
newInstance () const
const parametersgetParameters () const
bool updateParameters ()

Protected Attributes

double minimum_
double maximum_
float fminimum_
float fmaximum_
double delta_
float fdelta_


Detailed Description

Class uniformContinuousDistribution.

This class generates (pseudo) random numbers uniformly distributed in an interval specified in the parameters.

See also:
uniformContinuousDistribution::parameters.

Constructor & Destructor Documentation

cvr::uniformContinuousDistribution::uniformContinuousDistribution (  ) 

Default constructor.

cvr::uniformContinuousDistribution::uniformContinuousDistribution ( const double  min,
const double  max 
)

Constructor with a given interval.

Parameters:
min lower interval bound.
max higher interval bound.

cvr::uniformContinuousDistribution::uniformContinuousDistribution ( const parameters par  ) 

Construct a functor using the given parameters.

cvr::uniformContinuousDistribution::uniformContinuousDistribution ( const uniformContinuousDistribution other  ) 

Copy constructor.

Parameters:
other the object to be copied

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

Destructor.


Member Function Documentation

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.

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

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.

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

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  ) 

Copy data of "other" functor.

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

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.

Returns:
a random float number.

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.

Returns:
a random float number.

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

Returns:
a random float number.

Reimplemented from cvr::univariateContinuousDistribution.

const parameters& cvr::uniformContinuousDistribution::getParameters (  )  const

Returns used parameters.

Reimplemented from cvr::randomDistribution.

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  ) 

Alias for copy member.

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

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

Returns:
a random double number.

Reimplemented from cvr::univariateContinuousDistribution.

bool cvr::uniformContinuousDistribution::updateParameters (  )  [virtual]


Member Data Documentation

delta_ = (maximum_ - minimum_)*dnorm_

delta_ = (maximum_ - minimum_)*fnorm_

Shadow of the parameters.max;.

Shadow of the parameters.min;.

Shadow of the parameters.max;.

Shadow of the parameters.min;.


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