Random Stream Source<TRandom>.Seek Method
Sets the next stream index to the specified value.
Definition
Namespace: Numerics.NET.Random
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
C#
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
public abstract void Seek(
ulong index
)Parameters
- index UInt64
- The target index for the next stream.
Implements
IRandomStreamSource<TRandom>.Seek(UInt64)Remarks
This method sets NextIndex to index relative to the current hierarchical path prefix. It is useful for starting enumeration at a specific offset.
This is equivalent to calling Advance(index - NextIndex) when index is greater than or equal to NextIndex.
The cost of this operation depends on the implementation:
- RandomStreamTree<TRandom>: O(1) - just sets a counter
- RandomStreamPartition<TRandom>: O(index) - must perform jump operations from the prefix anchor