library of assembled shared sources

http://lass.cocamware.com

lass::num::DistributionUniform< T, RandomGenerator, rangeType > Class Template Reference
[Distribution]

a uniform distribution mapper. More...

#include <distribution.h>


Public Types

typedef RandomGenerator TGenerator
 generator type
typedef num::NumTraits< T > TNumTraits
 numeric traits of value type
typedef util::CallTraits< T >
::TValue 
TValue
 value type
typedef util::CallTraits< T >
::TParam 
TParam
 parameter value type

Public Member Functions

 DistributionUniform ()
 construct an empty distribution.
 DistributionUniform (TGenerator &generator, TParam infimum=TNumTraits::zero, TParam supremum=TNumTraits::one)
 construct a uniform distribution mapper
TValue operator() () const

Private Attributes

TGeneratorgenerator_
TValue infimum_
TValue supremum_
long double scale_

Related Functions

(Note that these are not member functions.)

template<typename T , typename RandomGenerator >
distributeUniform (RandomGenerator &generator, T infimum, T supremum)
 draw a random number from generator and transform it by a uniform distribution


Detailed Description

template<typename T, class RandomGenerator, RangeType rangeType = rtClosed>
class lass::num::DistributionUniform< T, RandomGenerator, rangeType >

a uniform distribution mapper.

template arguments:

Definition at line 95 of file distribution.h.


Member Typedef Documentation

template<typename T , class RandomGenerator , RangeType rangeType = rtClosed>
typedef RandomGenerator lass::num::DistributionUniform< T, RandomGenerator, rangeType >::TGenerator

generator type

Definition at line 99 of file distribution.h.

template<typename T , class RandomGenerator , RangeType rangeType = rtClosed>
typedef num::NumTraits<T> lass::num::DistributionUniform< T, RandomGenerator, rangeType >::TNumTraits

numeric traits of value type

Definition at line 101 of file distribution.h.

template<typename T , class RandomGenerator , RangeType rangeType = rtClosed>
typedef util::CallTraits<T>::TValue lass::num::DistributionUniform< T, RandomGenerator, rangeType >::TValue

value type

Definition at line 102 of file distribution.h.

template<typename T , class RandomGenerator , RangeType rangeType = rtClosed>
typedef util::CallTraits<T>::TParam lass::num::DistributionUniform< T, RandomGenerator, rangeType >::TParam

parameter value type

Definition at line 103 of file distribution.h.


Constructor & Destructor Documentation

template<typename T , class RG , RangeType RT>
lass::num::DistributionUniform< T, RG, RT >::DistributionUniform (  )  [inline]

construct an empty distribution.

Warning:
drawing numbers from an empty distribution results in undefined behaviour, probably causing an access violation.

Definition at line 99 of file distribution.inl.

template<typename T , class RG , RangeType RT>
lass::num::DistributionUniform< T, RG, RT >::DistributionUniform ( TGenerator generator,
TParam  infimum = TNumTraits::zero,
TParam  supremum = TNumTraits::one 
) [inline]

construct a uniform distribution mapper

Parameters:
generator random number generator to be used as input. Lifespan of generator must be at least that of the distribution.
infimum infimum of the output range: [inf, sup], or (inf, sup] if range is left open.
supremum supremum of the output range: [inf, sup], or [inf, sup) if range is right open.

Definition at line 111 of file distribution.inl.


Member Function Documentation

template<typename T , class RG , RangeType RT>
DistributionUniform< T, RG, RT >::TValue lass::num::DistributionUniform< T, RG, RT >::operator() (  )  const [inline]


Friends And Related Function Documentation

template<typename T , typename RandomGenerator >
T distributeUniform ( RandomGenerator &  generator,
infimum,
supremum 
) [related]

draw a random number from generator and transform it by a uniform distribution

Definition at line 142 of file distribution.inl.


Field Documentation

template<typename T , class RandomGenerator , RangeType rangeType = rtClosed>
TGenerator* lass::num::DistributionUniform< T, RandomGenerator, rangeType >::generator_ [private]

template<typename T , class RandomGenerator , RangeType rangeType = rtClosed>
TValue lass::num::DistributionUniform< T, RandomGenerator, rangeType >::infimum_ [private]

template<typename T , class RandomGenerator , RangeType rangeType = rtClosed>
TValue lass::num::DistributionUniform< T, RandomGenerator, rangeType >::supremum_ [private]

template<typename T , class RandomGenerator , RangeType rangeType = rtClosed>
long double lass::num::DistributionUniform< T, RandomGenerator, rangeType >::scale_ [private]


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

Generated on Mon Nov 10 14:22:10 2008 for Library of Assembled Shared Sources by doxygen 1.5.7.1
SourceForge.net Logo