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

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
 

Related Symbols

(Note that these are not member symbols.)

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:

  • T result type
  • RandomGenerator type of random number generator, see Random.
  • rangeType value of RangeType declaring if the range must be open or closed.

Definition at line 95 of file distribution.h.

Constructor & Destructor Documentation

◆ DistributionUniform() [1/2]

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

construct an empty distribution.

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

Definition at line 108 of file distribution.inl.

Referenced by distributeUniform().

◆ DistributionUniform() [2/2]

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

construct a uniform distribution mapper

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

Definition at line 120 of file distribution.inl.


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