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

import std.algorithm : map;
class NormalRNG : DistributionRNG!double
{
	double front() @property
	{
		return rNormal();
	}
}

import std.range;
auto rng = new NormalRNG;
auto sigma = 4.0;
auto mu = 2.0;
auto sample = rng.map!(x => x * sigma + mu).take(9).array;

Meta