Library of Assembled Shared Sources
lass::num::DistributionNormal< T, RandomGenerator > Class Template Reference

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
 

Related Symbols

(Note that these are not member symbols.)

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:

  • T result type
  • RandomGenerator type of random number generator, see Random.

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

Definition at line 177 of file distribution.h.

Constructor & Destructor Documentation

◆ DistributionNormal() [1/2]

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

construct an empty distribution.

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

Definition at line 223 of file distribution.inl.

Referenced by distributeNormal().

◆ DistributionNormal() [2/2]

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

construct a normal distribution mapper

Parameters
generatorrandom number generator to be used as input. Lifespan of generator must be at least that of the distribution.
meanmean of distribution
standardDeviationstandard deviation of distribution

Definition at line 237 of file distribution.inl.


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