DistributionRNG

Interface for infinity input range of random numbers.

interface DistributionRNG (
T
) {}

Members

Functions

front
T front()

Manifest constants

empty
enum empty;

always false

Static functions

popFront
void popFront()

do nothing

Examples

1 import std.algorithm : map;
2 class NormalRNG : DistributionRNG!double
3 {
4 	double front() @property
5 	{
6 		return rNormal();
7 	}
8 }
9 
10 import std.range;
11 auto rng = new NormalRNG;
12 auto sigma = 4.0;
13 auto mu = 2.0;
14 auto sample = rng.map!(x => x * sigma + mu).take(9).array;

Meta