tango.math.random.NormalSource

License:

BSD style: see license.txt

Version:

Initial release: July 2008

Author:

Fawzi Mohamed
class NormalSource(RandG, T) #
class that returns gaussian (normal) distributed numbers (f=exp(-0.5*x*x)/sqrt(2*pi))
real probDensityF(real x) [static] #
probability distribution (non normalized, should be divided by sqrt(2*PI))
real invProbDensityF(real x) [static] #
inverse probability distribution
real cumProbDensityFCompl(real x) [static] #
complement of the cumulative density distribution (integral x..infinity probDensityF)
T tailGenerator(RandG r, T dMin, int iNegative) [static] #
tail for normal distribution
SourceT source #
internal source of normal numbers
this(RandG r) #
initializes the probability distribution
NormalSource opCall(U, S...)(ref U a, S args) #
chainable call style initialization of variables (thorugh a call to randomize)
T getRandom() [final] #
returns a normal distribued number
T getRandom(T sigma) [final] #
returns a normal distribued number with the given sigma (standard deviation)
T getRandom(T sigma, T mu) [final] #
returns a normal distribued number with the given sigma (standard deviation) and mu (average)
U randomize(U)(ref U a) #
initializes a variable with normal distribued number and returns it
U randomize(U, V)(ref U a, V sigma) #
initializes a variable with normal distribued number with the given sigma and returns it
U randomize(U, V, S)(ref U el, V sigma, S mu) #
initializes a variable with normal distribued numbers with the given sigma and mu and returns it
U randomizeOp(U, S)(S delegate(T) op, ref U a) #
initializes the variable with the result of mapping op on the random numbers (of type T)
struct NormalDistribution #
normal distribution with different default sigma and mu f=exp(-x*x/(2*sigma^2))/(sqrt(2 pi)*sigma)
NormalDistribution create(NormalSource source, T sigma, T mu) [static] #
constructor
NormalDistribution opCall(U, S...)(ref U a, S args) #
chainable call style initialization of variables (thorugh a call to randomize)
T getRandom() #
returns a single number
U randomize(U)(ref U a) #
initialize a
U randomize(U, V)(ref U a, V s) #
initialize a (let s and m have different types??)
U randomize(U, V, S)(ref U a, V s, S m) #
initialize a (let s and m have different types??)
NormalDistribution normalD(T sigma = cast(T)1, T mu = cast(T)0) #
returns a normal distribution with a non-default sigma/mu