Class LdesStreamSeeds

java.lang.Object
jline.solvers.ldes.handlers.LdesStreamSeeds

public final class LdesStreamSeeds extends Object
The six MRG32k3a seeds of an LDES stream, derived from (run seed, stream offset) by splitmix64.

The offset only NAMES a stream. It used to be added to the seed directly, {seed+off, ..., seed+off+5}, and that is wrong for MRG32k3a: its two recurrences are linear, so streams whose seed vectors are equally spaced are linearly dependent, the draws of offsets o, o+10 and o+20 satisfying u1 - 2*u2 + u3 = 0 (mod 1) draw for draw. Sibling stations sit at exactly such offsets, so the branches of a 3-way fork drew in lockstep and E[max] of three Exp(1) branches came out 1.845 against 11/6.

The C++ engine's rng::SeedHash (cpp/include/line/util/rng_ssj.h) is the same function draw for draw, which is what keeps the two flat engines on one sample path. The arithmetic is unsigned 64-bit: Java's wrapping multiplication and addition agree with C++'s, the shifts are logical (>>>) and the reduction uses Long.remainderUnsigned(long, long).

  • Method Summary

    Modifier and Type
    Method
    Description
    static long[]
    mrg32k3a(long seed, long offset)
    The seed vector of the stream named offset in a run seeded seed: the first three in [1, m1), the last three in [1, m2), so neither component can start from the all-zero state SSJ rejects.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • mrg32k3a

      public static long[] mrg32k3a(long seed, long offset)
      The seed vector of the stream named offset in a run seeded seed: the first three in [1, m1), the last three in [1, m2), so neither component can start from the all-zero state SSJ rejects.
      Parameters:
      seed - the run seed
      offset - the stream's offset
      Returns:
      the six seeds, for MRG32k3a.setSeed