ExpSource

class that returns exponential distributed numbers (f=exp(-x) for x>0, 0 otherwise)

Constructors

this
this(RandG r)

initializes the probability distribution

Members

Aliases

SourceT
alias SourceT = Ziggurat!(RandG, T, probDensityF, tailGenerator, false)
Undocumented in source.

Functions

expD
ExpDistribution expD(T beta)

returns an exp distribution with a different beta

getRandom
T getRandom()

returns a exp distribued number

getRandom
T getRandom(T beta)

returns a exp distribued number with the given beta (survival rate, average) f=1/beta*exp(-x/beta)

opCall
ExpSource opCall(U a, S args)

chainable call style initialization of variables (thorugh a call to randomize)

randomize
U randomize(U x)

initializes the given variable with an exponentially distribued number

randomize
U randomize(U x, V beta)

initializes the given variable with an exponentially distribued number with scale parameter beta

randomizeOp
U randomizeOp(S delegate(T) op, U a)

initializes the given variable with an exponentially distribued number and maps op on it

Static functions

cumProbDensityFCompl
real cumProbDensityFCompl(real x)

complement of the cumulative density distribution (integral x..infinity probDensityF)

invProbDensityF
real invProbDensityF(real x)

inverse probability distribution

probDensityF
real probDensityF(real x)

probability distribution

tailGenerator
T tailGenerator(RandG r, T dMin)

tail for exponential distribution

Structs

ExpDistribution
struct ExpDistribution

exp distribution with different default scale parameter beta f=1/beta*exp(-x/beta) for x>0, 0 otherwise

Variables

source
SourceT source;

internal source of exp distribued numbers

Meta