LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::rng::SeedHash Class Reference

splitmix64 keyed by (run seed, stream offset): where every LDES stream's seeds come from. More...

#include <line/util/rng_ssj.h>

Public Member Functions

 SeedHash (long long seed, long long offset)
std::uint64_t next ()
 The next splitmix64 output.
void mrg_seeds (long long s[6])
 Six MRG32k3a seeds: the first three in [1, m1), the last three in [1, m2), so neither component can start from the all-zero state SSJ rejects.

Detailed Description

splitmix64 keyed by (run seed, stream offset): where every LDES stream's seeds come from.

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) came out 1.845 against 11/6 (|t| = 14 over 8 seeds).

Java's jline.solvers.ldes.handlers.LdesStreamSeeds is the same function, draw for draw, which is what keeps the flat engines on one sample path. The layered engine (engine::ln_rng) keeps drawing from the same hash after the six MRG seeds for its java.util.Random and McRng.

Definition at line 79 of file rng_ssj.h.

Constructor & Destructor Documentation

◆ SeedHash()

line::rng::SeedHash::SeedHash ( long long seed,
long long offset )
inline

Definition at line 81 of file rng_ssj.h.

Referenced by line::rng::Mrg32k3a::set_seed_offset().

Member Function Documentation

◆ mrg_seeds()

void line::rng::SeedHash::mrg_seeds ( long long s[6])
inline

Six MRG32k3a seeds: the first three in [1, m1), the last three in [1, m2), so neither component can start from the all-zero state SSJ rejects.

Definition at line 97 of file rng_ssj.h.

References next().

Referenced by line::ldes::engine::ln_rng().

◆ next()

std::uint64_t line::rng::SeedHash::next ( )
inline

The next splitmix64 output.

Definition at line 85 of file rng_ssj.h.

Referenced by line::ldes::engine::ln_rng(), and mrg_seeds().


The documentation for this class was generated from the following file: