Constructs a XorshiftStarEngine generator seeded with x0.
A postblit is present on this object, but not explicitly documented in the source.
This is the jump function for the standard 1024-bit generator. It is equivalent to 2 ^^ 512 invocations of opCall(); it can be used to generate 2 ^^ 512 non-overlapping subsequences for parallel computations. This function will only be defined if the shifts are the same as for Xorshift1024StarPhi.
Advances the random sequence.
Marker for mir.random.isRandomEngine
Largest generated value.
Note that when StateUInt is the same size as OutputUInt the two lowest bits of this generator are LFSRs, and thus will fail binary rank tests. To provide some context, every bit of a Mersenne Twister generator (either the 32-bit or 64-bit variant) is an LFSR.
Word size of this xorshift generator.
The number of bits of state of this generator. This must be a positive multiple of the size in bits of UIntType. If nbits is large this struct may occupy slightly more memory than this so it can use a circular counter instead of shifting the entire array.
The direction and magnitude of the 1st shift. Positive means left, negative means right.
The direction and magnitude of the 2nd shift. Positive means left, negative means right.
The direction and magnitude of the 3rd shift. Positive means left, negative means right.
Output of the internal xorshift engine is multiplied by a constant to eliminate linear artifacts except in the low-order bits. This constant must be an odd number other than 1.
Return type of opCall. By default same as StateUInt but can be set to a narrower unsigned type in which case the high bits of the multiplication result are returned.
Note: If sa, sb, and sc are all positive (which if interpreted as same-direction shifts could not result in a full-period xorshift generator) the shift directions are instead implicitly right-left-right when bits == UIntType.sizeof * 8 and in all other cases left-right-right. This maintains full compatibility with older versions of XorshiftStarEngine that took all shifts as unsigned magnitudes.
Template for the xorshift* family of generators (Vigna, 2016; draft 2014).
<blockquote> xorshift* generators are very fast, high-quality PRNGs (pseudorandom number generators) obtained by scrambling the output of a Marsaglia xorshift generator with a 64-bit invertible multiplier (as suggested by Marsaglia in his paper). They are an excellent choice for all non-cryptographic applications, as they are incredibly fast, have long periods and their output passes strong statistical test suites. </blockquote>