LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::uniformDistribution Class Reference

Uniform distributed random number class. More...

#include <ltiUniformDist.h>

Inheritance diagram for lti::uniformDistribution:
Inheritance graph
[legend]
Collaboration diagram for lti::uniformDistribution:
Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 parameters class for the uniform distribution More...

Public Member Functions

 uniformDistribution (const double &lower=0.0, const double &upper=1.0)
 uniformDistribution (const double &lower, const double &upper, const unsigned int seed)
 uniformDistribution (const parameters &theParams)
virtual ~uniformDistribution ()
const parametersgetParameters () const
virtual bool updateParameters ()
virtual double draw () const
virtual functorclone () const
virtual const char * getTypeName () const

Protected Attributes

double m
double b

Detailed Description

Uniform distributed random number class.


Constructor & Destructor Documentation

lti::uniformDistribution::uniformDistribution ( const double &  lower = 0.0,
const double &  upper = 1.0 
)

default constructor.

Sets lower (inclusive) and upper (exclusive) limit of the distribution.

Referenced by clone().

lti::uniformDistribution::uniformDistribution ( const double &  lower,
const double &  upper,
const unsigned int  seed 
)

Constructor.

Sets lower (inclusive) and upper (exclusive) limit of the distribution. Additionally, it initializes the random number generation with the given seed. This is sometimes necessary, when the algorithms that uses random number, still should behave "deterministically", in the sense that the results should always be the same.

The value of the seed follows the same rules as the C function srand.

If you don't know what to give, just give "1".

lti::uniformDistribution::uniformDistribution ( const parameters theParams  ) 

constructor, sets the parameters

virtual lti::uniformDistribution::~uniformDistribution (  )  [inline, virtual]

destructor


Member Function Documentation

virtual functor* lti::uniformDistribution::clone (  )  const [inline, virtual]

returns a pointer to a clone of the functor.

Reimplemented from lti::continuousRandomDistribution.

References uniformDistribution().

virtual double lti::uniformDistribution::draw (  )  const [virtual]

Draws a uniform distributed random number between lowerLimit (inclusive) and upperLimit (exclusive).

Use lowerLimit>upperLimit if you want to have numbers excluding the lower limit (=upperLimit) and including the upper limit (=lowerLimit).

Reimplemented from lti::continuousRandomDistribution.

const parameters& lti::uniformDistribution::getParameters (  )  const

returns the current parameters.

Reimplemented from lti::functor.

virtual const char* lti::uniformDistribution::getTypeName ( void   )  const [inline, virtual]

returns the name of this type

Reimplemented from lti::continuousRandomDistribution.

virtual bool lti::uniformDistribution::updateParameters (  )  [virtual]

set functor's parameters.

This member makes a copy of theParam: the functor will keep its own copy of the parameters!

Returns:
true if successful, false otherwise

Reimplemented from lti::functor.


Member Data Documentation

double lti::uniformDistribution::b [protected]

shift constant

double lti::uniformDistribution::m [protected]

scaling constant for random number generator


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

Generated on Sat Apr 10 15:28:51 2010 for LTI-Lib by Doxygen 1.6.1