Xoshiro 256Plus.Create Stream Partition Method
Creates a jump-based stream partition for generating independent RNG streams.
Definition
Namespace: Numerics.NET.Random
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
C#
A new RandomStreamPartition<TRandom> instance.
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
public static RandomStreamPartition<Xoshiro256Plus> CreateStreamPartition(
in RandomOptions options,
JumpStride stride,
ulong startIndex = 0
)Parameters
- options RandomOptions
- The base initialization options for the stream partition.
- stride JumpStride
- The jump stride to use for spacing between streams.
- startIndex UInt64 (Optional)
- The starting index for stream enumeration (default is 0).
Return Value
RandomStreamPartition<Xoshiro256Plus>A new RandomStreamPartition<TRandom> instance.
Remarks
This method creates a jump-based hierarchical stream source (RngStreams-style) that uses jump operations to partition the RNG sequence into disjoint segments.
The startIndex parameter sets the initial enumeration offset, allowing streams to start at a specific jump position in the sequence.
Use NextStream() or NextStreams(Int32) to generate streams. Stream generation is O(N) for N streams.
Example
var options = new RandomOptions(42);
var partition = Xoshiro256Plus.CreateStreamPartition(in options, JumpStride.Jump, startIndex: 5);
var rng5 = partition.NextStream(); // Stream at jump position 5
var rng6 = partition.NextStream(); // Stream at jump position 6