Philox 4x 64.Create Stream Tree 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#
A new RandomStreamTree<TRandom> instance.
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
public static RandomStreamTree<Philox4x64> 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<Philox4x64>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
var options = new RandomOptions(42);
var tree = Philox4x64.CreateStreamTree(in options, startIndex: 5);
var rng5 = tree.NextStream(); // Stream at index 5
var rng6 = tree.NextStream(); // Stream at index 6