The OpenD Programming Language

mir.random

Basic API to construct non-uniform random number generators and stochastic algorithms. Non-uniform and uniform random variable can be found at mir.random.variable.

Generation functions

,

Function NameDescription
randGenerates real, integral, boolean, and enumerated uniformly distributed values.
randIndexGenerates uniformly distributed index.
randGeometricGenerates geometric distribution with p = 1/2.
randExponential2Generates scaled Exponential distribution.

Phobos Compatibility

,

Template NameDescription
PhobosRandomExtends a Mir random number engine to meet Phobos std.random interface
isPhobosUniformRNGTests if type is a Phobos-style uniform RNG

Publicly includes mir.random.engine.

Modules

algorithm
module mir.random.algorithm
engine
module mir.random.engine

Uniform random engines.

flex
module mir.random.flex

Flex module that allows to sample from arbitrary random distributions.

ndvariable
module mir.random.ndvariable
variable
module mir.random.variable

Public Imports

mir.random.engine
public import mir.random.engine;
Undocumented in source.

Members

Functions

rand
T rand(G gen)
T rand(G* gen)
T rand()
rand
bool rand(G gen)
bool rand(G* gen)
bool rand()
rand
T rand(G gen)
rand
T rand(G gen, sizediff_t boundExp)
T rand(G* gen, sizediff_t boundExp)
T rand(sizediff_t boundExp)
randExponential2
T randExponential2(G gen)
T randExponential2(G* gen)
T randExponential2()
randGeometric
size_t randGeometric(G gen)
size_t randGeometric(G* gen)
size_t randGeometric()
randIndex
T randIndex(G gen, T _m)
T randIndex(G* gen, T m)
T randIndex(T m)

Structs

PhobosRandom
struct PhobosRandom(Engine)
template PhobosRandom(Engine)

Extends a Mir-style random number generator to also be a Phobos-style uniform RNG. If Engine is already a Phobos-style uniform RNG, PhobosRandom is just an alias for Engine.

Templates

isPhobosUniformRNG
template isPhobosUniformRNG(T)

Tests if T is a Phobos-style uniform RNG.

Meta

Authors

Ilya Yaroshenko, Nathan Sashihara