RandomStreamSource<TRandom>.Branch Method

Creates a child stream source at the specified index without advancing this source.

Definition

Namespace: Numerics.NET.Random
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
C#
public IRandomStreamSource<TRandom> Branch(
	ulong index
)

Parameters

index  UInt64
The child index for the new scope.

Return Value

IRandomStreamSource<TRandom>
A new stream source with path Path + [index] and NextIndex = 0.

Implements

IRandomStreamSource<TRandom>.Branch(UInt64)

Remarks

This method creates a child scope without consuming the parent's next index. The parent's NextIndex remains unchanged.

Use this method when you need to create streams at specific indices in the hierarchy, such as for deterministic parallel workload distribution.

See Also