library of assembled shared sources |
http://lass.cocamware.com |
#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 | |
TGenerator * | generator_ |
TValue | infimum_ |
TValue | supremum_ |
long double | scale_ |
Related Functions | |
(Note that these are not member functions.) | |
template<typename T , typename RandomGenerator > | |
T | distributeUniform (RandomGenerator &generator, T infimum, T supremum) |
draw a random number from generator and transform it by a uniform distribution |
template arguments:
Definition at line 95 of file distribution.h.
typedef RandomGenerator lass::num::DistributionUniform< T, RandomGenerator, rangeType >::TGenerator |
typedef num::NumTraits<T> lass::num::DistributionUniform< T, RandomGenerator, rangeType >::TNumTraits |
typedef util::CallTraits<T>::TValue lass::num::DistributionUniform< T, RandomGenerator, rangeType >::TValue |
typedef util::CallTraits<T>::TParam lass::num::DistributionUniform< T, RandomGenerator, rangeType >::TParam |
lass::num::DistributionUniform< T, RG, RT >::DistributionUniform | ( | ) | [inline] |
construct an empty distribution.
Definition at line 99 of file distribution.inl.
lass::num::DistributionUniform< T, RG, RT >::DistributionUniform | ( | TGenerator & | generator, | |
TParam | infimum = TNumTraits::zero , |
|||
TParam | supremum = TNumTraits::one | |||
) | [inline] |
construct a uniform distribution mapper
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.
DistributionUniform< T, RG, RT >::TValue lass::num::DistributionUniform< T, RG, RT >::operator() | ( | ) | const [inline] |
Definition at line 124 of file distribution.inl.
References lass::num::DistributionUniform< T, RandomGenerator, rangeType >::generator_, lass::num::DistributionUniform< T, RandomGenerator, rangeType >::infimum_, LASS_ASSERT, lass::num::DistributionUniform< T, RandomGenerator, rangeType >::scale_, and lass::num::DistributionUniform< T, RandomGenerator, rangeType >::supremum_.
T distributeUniform | ( | RandomGenerator & | generator, | |
T | infimum, | |||
T | supremum | |||
) | [related] |
draw a random number from generator and transform it by a uniform distribution
Definition at line 142 of file distribution.inl.
TGenerator* lass::num::DistributionUniform< T, RandomGenerator, rangeType >::generator_ [private] |
Definition at line 113 of file distribution.h.
Referenced by lass::num::DistributionUniform< T, RandomGenerator, rangeType >::operator()().
TValue lass::num::DistributionUniform< T, RandomGenerator, rangeType >::infimum_ [private] |
Definition at line 114 of file distribution.h.
Referenced by lass::num::DistributionUniform< T, RandomGenerator, rangeType >::operator()().
TValue lass::num::DistributionUniform< T, RandomGenerator, rangeType >::supremum_ [private] |
Definition at line 115 of file distribution.h.
Referenced by lass::num::DistributionUniform< T, RandomGenerator, rangeType >::operator()().
long double lass::num::DistributionUniform< T, RandomGenerator, rangeType >::scale_ [private] |
Definition at line 116 of file distribution.h.
Referenced by lass::num::DistributionUniform< T, RandomGenerator, rangeType >::operator()().
Generated on Mon Nov 10 14:22:10 2008 for Library of Assembled Shared Sources by 1.5.7.1 |