mir.random.engine.xorshift

$(TR $(TDNW $(LREF Xorshift1024StarPhi)) $(TD <tt class="inline-code">xorshift1024*&#966;</tt>: when something larger than <tt class="inline-code">xoroshiro128+</tt> is needed)) $(TR $(TDNW $(LREF Xorshift64Star32)) $(TD <tt class="inline-code">xorshift64*/32</tt>: internal state of 64 bits and output of 32 bits))

$(TR $(TDNW $(LREF Xorshift192)) $(TD Generator from Marsaglia's paper combining 160-bit xorshift with a counter)) $(TR $(TDNW $(LREF Xorshift)) $(TD An alias to one of the generators in this package))

Generators

Generator nameDescription
Xorshift32 .. Xorshift160Basic xorshift generator with n bits of state (32, 64, 96, 128, 160)

$(TR $(TDNW $(LREF XorshiftStarEngine)) $(TD <tt class="inline-code">xorshift*</tt> generator with any word size and any number of bits of state.)) $(TR $(TDNW $(LREF XorshiftEngine)) $(TD <tt class="inline-code">xorshift</tt> generator with any word size and any number of bits of state.))

Generic Templates

Template nameDescription

Public Imports

mir.random.engine.xoshiro
public import mir.random.engine.xoshiro : Xoshiro256StarStar, Xoshiro128StarStar_32, XoshiroEngine, Xoroshiro128Plus;

Members

Aliases

Xorshift
alias Xorshift = Xorshift128
Undocumented in source.
Xorshift1024StarPhi
alias Xorshift1024StarPhi = XorshiftStarEngine!(ulong, 1024, 31, 11, 30, 0x9e3779b97f4a7c13uL)

Define XorshiftStarEngine with well-chosen parameters for large simulations on 64-bit machines.

Xorshift128
alias Xorshift128 = XorshiftEngine!(128, 11, 8, 19)
Undocumented in source.
Xorshift160
alias Xorshift160 = XorshiftEngine!(160, 2, 1, 4)
Undocumented in source.
Xorshift192
alias Xorshift192 = XorshiftEngine!(192, 2, 1, 4)
Undocumented in source.
Xorshift32
alias Xorshift32 = XorshiftEngine!(32, 13, 17, 15)

Define XorshiftEngine generators with well-chosen parameters for 32-bit architectures. Xorshift is an alias of one of the generators in this module.

Xorshift64
alias Xorshift64 = XorshiftEngine!(64, 10, 13, 10)
Undocumented in source.
Xorshift64Star32
alias Xorshift64Star32 = XorshiftStarEngine!(ulong, 64, 12, 25, 27, 2685821657736338717uL, uint)

Generates 32 bits of output from 64 bits of state. A fast generator with excellent statistical properties for memory-constrained situations where more than 64 bits of state would be too much and generating only 32 bits with each opCall will not cause a slowdown. If you need a generator with 64 bits of state that produces output 64 bits at a time SplitMix64 is an option.

Xorshift96
alias Xorshift96 = XorshiftEngine!(96, 10, 5, 26)
Undocumented in source.

Structs

XorshiftEngine
struct XorshiftEngine(UIntType, uint bits, int sa, int sb, int sc)

Xorshift generator. Implemented according to Xorshift RNGs (Marsaglia, 2003) with Sebastino Vigna's optimization for large arrays.

XorshiftStarEngine
struct XorshiftStarEngine(StateUInt, uint nbits, int sa, int sb, int sc, StateUInt multiplier, OutputUInt = StateUInt)

Template for the xorshift* family of generators (Vigna, 2016; draft 2014).

Templates

XorshiftEngine
template XorshiftEngine(uint bits, uint a, uint b, uint c)
Undocumented in source.
XorshiftStarEngine
template XorshiftStarEngine(StateUInt, uint nbits, int sa, int sb, int sc, StateUInt multiplier, OutputUInt = StateUInt)

Template for the xorshift* family of generators (Vigna, 2016; draft 2014).

Meta

Authors

Masahiro Nakagawa, Ilya Yaroshenko (rework), Nathan Sashihara