SplitMix64.CreateStreamTree Method

Creates a hierarchical stream tree for generating independent RNG streams.

Definition

Namespace: Numerics.NET.Random
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
C#
public static RandomStreamTree<SplitMix64> CreateStreamTree(
	 in RandomOptions options,
	ulong startIndex = 0
)

Parameters

options  RandomOptions
The base initialization options for the stream tree.
startIndex  UInt64  (Optional)
The starting index for stream enumeration (default is 0).

Return Value

RandomStreamTree<SplitMix64>
A new RandomStreamTree<TRandom> instance.

Remarks

This method creates a mixing-based hierarchical stream source (NumPy-style) that supports unlimited-depth branching and deterministic stream derivation.

The startIndex parameter sets the initial enumeration offset, allowing streams to start at a specific position in the sequence.

Use NextStream() or NextStreams(Int32) to generate streams, and Branch(UInt64) for hierarchical scopes.

Example

C#
var options = new RandomOptions(42);
var tree = SplitMix64.CreateStreamTree(in options, startIndex: 5);
var rng5 = tree.NextStream(); // Stream at index 5
var rng6 = tree.NextStream(); // Stream at index 6

See Also