The OpenD Programming Language

SplitMixEngine.split

Produces a splitmix generator with a different counter-value and increment-value than the current generator. Only available when <a href="#.SplitMixEngine.increment_specifiable"> increment_specifiable == true</a>.

struct SplitMixEngine(alias mixer, bool split_enabled = false, OptionalArgs...)
@nogc nothrow pure @safe
typeof(this)
split
()
()
if (
(
__traits(compiles, ) ||
__traits(compiles, )
)
&&
(
OptionalArgs.length < 1 ||
(
is(typeof(OptionalArgs[1]) == ulong) &&
OptionalArgs[1] != DEFAULT_SPLITMIX_INCREMENT
)
)
&&
OptionalArgs.length < 2
)

Examples

auto rnd1 = SplitMixEngine!(staffordMix13,true)(1);
auto rnd2 = rnd1.split();
assert(rnd1.state != rnd2.state);
assert(rnd1.increment != rnd2.increment);
assert(rnd1() != rnd2());

Meta