Class LdesStreamSeeds
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 TypeMethodDescriptionstatic long[]mrg32k3a(long seed, long offset) The seed vector of the stream namedoffsetin a run seededseed: the first three in [1, m1), the last three in [1, m2), so neither component can start from the all-zero state SSJ rejects.
-
Method Details
-
mrg32k3a
public static long[] mrg32k3a(long seed, long offset) The seed vector of the stream namedoffsetin a run seededseed: 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 seedoffset- the stream's offset- Returns:
- the six seeds, for
MRG32k3a.setSeed
-