SeedSequences Class

Provides factory methods for creating SeedSequence instances with well-defined, cross-platform reproducible behavior.

Definition

Namespace: Numerics.NET.Random
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
C#
public static class SeedSequences
Inheritance
Object  →  SeedSequences

Remarks

Use the SeedSequences class to create SeedSequence instances that match the seeding behavior of other scientific computing libraries and languages, enabling bit-identical cross-platform reproducibility.

Each factory method produces a deterministic entropy stream based on documented reference algorithms from established implementations (NumPy, Java, legacy .NET, MT19937 reference code).

64-bit Seed Flattening Policy: When a ulong seed value is provided to a seed sequence, it is split into two 32-bit words in little-endian order: lo = (uint)seed and hi = (uint)(seed >> 32). This ensures no entropy loss and provides stable, portable mapping from 64-bit inputs into the 32-bit seed-sequence domain. For ulong[] arrays, each element is flattened in the same manner, producing 2 * seedArray.Length 32-bit words.

Methods

CPlusPlus(Int64, StreamAddress) Creates a SeedSequence compatible with C++11 std::seed_seq.
CPlusPlus(ReadOnlySpan<UInt32>, StreamAddress) Creates a SeedSequence compatible with C++11 std::seed_seq using 32-bit seed words.
CPlusPlus(ReadOnlySpan<UInt64>, StreamAddress) Creates a SeedSequence compatible with C++11 std::seed_seq using multiple seed values.
Default(Int64, StreamAddress) Creates a SeedSequence using the SFC64 algorithm with optional streaming.
Default(ReadOnlySpan<UInt32>, StreamAddress) Creates a SeedSequence using the SFC64 algorithm with 32-bit seed words.
Default(ReadOnlySpan<UInt64>, StreamAddress) Creates a SeedSequence using the SFC64 algorithm with multiple seed values and optional streaming.
Direct(ReadOnlySpan<UInt32>) Creates a SeedSequence that emits provided 32-bit values verbatim.
Direct(ReadOnlySpan<UInt64>) Creates a SeedSequence that emits provided values verbatim.
Direct(UInt64) Creates a SeedSequence that emits a single provided value verbatim.
Independent Creates a new seed sequence that is independent from other sequences generated by this method.
NumPy(Int64, StreamAddress) Creates a SeedSequence compatible with NumPy's SeedSequence (v1.17+).
NumPy(ReadOnlySpan<UInt32>, StreamAddress) Creates a SeedSequence compatible with NumPy's SeedSequence using 32-bit seed words.
NumPy(ReadOnlySpan<UInt64>, StreamAddress) Creates a SeedSequence compatible with NumPy's SeedSequence (v1.17+) using multiple seed values.
SplitMix64(Int64, StreamAddress) Creates a SeedSequence using the SplitMix64 algorithm with optional streaming.
SplitMix64(ReadOnlySpan<UInt32>, StreamAddress) Creates a SeedSequence using the SplitMix64 algorithm with 32-bit seed words.
SplitMix64(ReadOnlySpan<UInt64>, StreamAddress) Creates a SeedSequence using the SplitMix64 algorithm with multiple seed values and optional streaming.

See Also