library of assembled shared sources

http://lass.cocamware.com

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

a normal distribution mapper (aka guassian distribution) 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

 DistributionNormal ()
 construct an empty distribution.
 DistributionNormal (TGenerator &generator, TParam mean=TNumTraits::zero, TParam standardDeviation=TNumTraits::one)
 construct a normal distribution mapper
TValue operator() () const

Private Attributes

TGeneratorgenerator_
TValue mean_
TValue standardDeviation_
TValue gset_
bool iset_

Related Functions

(Note that these are not member functions.)

template<typename T , typename RandomGenerator >
distributeNormal (RandomGenerator &generator, T mean, T standardDeviation)
 draw a random number from generator and transform it by a normal distribution


Detailed Description

template<typename T, class RandomGenerator>
class lass::num::DistributionNormal< T, RandomGenerator >

a normal distribution mapper (aka guassian distribution)

template arguments:

reference: Numerical Recipes in C: The Art of Scientific Computing, section 7.2

Definition at line 171 of file distribution.h.


Member Typedef Documentation

template<typename T , class RandomGenerator >
typedef RandomGenerator lass::num::DistributionNormal< T, RandomGenerator >::TGenerator

generator type

Definition at line 175 of file distribution.h.

template<typename T , class RandomGenerator >
typedef num::NumTraits<T> lass::num::DistributionNormal< T, RandomGenerator >::TNumTraits

numeric traits of value type

Definition at line 177 of file distribution.h.

template<typename T , class RandomGenerator >
typedef util::CallTraits<T>::TValue lass::num::DistributionNormal< T, RandomGenerator >::TValue

value type

Definition at line 178 of file distribution.h.

template<typename T , class RandomGenerator >
typedef util::CallTraits<T>::TParam lass::num::DistributionNormal< T, RandomGenerator >::TParam

parameter value type

Definition at line 179 of file distribution.h.


Constructor & Destructor Documentation

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

construct an empty distribution.

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

Definition at line 214 of file distribution.inl.

template<typename T , class RG >
lass::num::DistributionNormal< T, RG >::DistributionNormal ( TGenerator generator,
TParam  mean = TNumTraits::zero,
TParam  standardDeviation = TNumTraits::one 
) [inline]

construct a normal distribution mapper

Parameters:
generator random number generator to be used as input. Lifespan of generator must be at least that of the distribution.
mean mean of distribution
standardDeviation standard deviation of distribution

Definition at line 228 of file distribution.inl.


Member Function Documentation

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


Friends And Related Function Documentation

template<typename T , typename RandomGenerator >
T distributeNormal ( RandomGenerator &  generator,
mean,
standardDeviation 
) [related]

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

Definition at line 273 of file distribution.inl.


Field Documentation

template<typename T , class RandomGenerator >
TGenerator* lass::num::DistributionNormal< T, RandomGenerator >::generator_ [private]

template<typename T , class RandomGenerator >
TValue lass::num::DistributionNormal< T, RandomGenerator >::mean_ [private]

template<typename T , class RandomGenerator >
TValue lass::num::DistributionNormal< T, RandomGenerator >::standardDeviation_ [private]

template<typename T , class RandomGenerator >
TValue lass::num::DistributionNormal< T, RandomGenerator >::gset_ [mutable, private]

template<typename T , class RandomGenerator >
bool lass::num::DistributionNormal< T, RandomGenerator >::iset_ [mutable, 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