Default constructor and copy constructor are disabled.
Forward constructor arguments to Engine.
Default constructor and copy constructor are disabled.
Retain support for Mir-style random interface.
Phobos-style random interface.
Phobos-style random interface.
Retain support for Mir-style random interface.
Phobos-style random interface.
Retain support for Mir-style random interface.
import mir.random.engine.xorshift: Xorshift1024StarPhi; import std.random: isSeedable, isPhobosUniformRNG = isUniformRNG; import std.range.primitives: isForwardRange; alias RNG = PhobosRandom!Xorshift1024StarPhi; //Phobos interface static assert(isPhobosUniformRNG!(RNG, ulong)); static assert(isSeedable!(RNG, ulong)); static assert(isForwardRange!RNG); //Mir interface static assert(isSaturatedRandomEngine!RNG); static assert(is(EngineReturnType!RNG == ulong)); auto gen = Xorshift1024StarPhi(1); auto rng = RNG(1); assert(gen() == rng.front); rng.popFront(); assert(gen() == rng.front); rng.popFront(); assert(gen() == rng()); gen.__ctor(1); rng.seed(1); assert(gen() == rng());
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.