RandomStreamSource<TRandom>.NextStreams Method

Definition

Namespace: Numerics.NET.Random
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0

Overload List

NextStreams(Int32) Returns an array of RNGs for the next N child streams and advances the index.
NextStreams(Span<TRandom>) Fills the specified span with the next child streams and advances the index.

NextStreams(Int32)

Returns an array of RNGs for the next N child streams and advances the index.
C#
public TRandom[] NextStreams(
	int count
)

Parameters

count  Int32
The number of streams to generate.

Return Value

TRandom[]
An array of count RNG instances.

Implements

IRandomStreamSource<TRandom>.NextStreams(Int32)

Remarks

This method is equivalent to calling NextStream()count times, but may be more efficient due to internal optimizations.

The NextIndex is incremented by count.

Exceptions

ArgumentOutOfRangeExceptioncount is negative.

NextStreams(Span<TRandom>)

Fills the specified span with the next child streams and advances the index.
C#
public void NextStreams(
	Span<TRandom> destination
)

Parameters

destination  Span<TRandom>
The span to fill with new RNG instances.

Remarks

This method is equivalent to calling NextStream()destination.Length times. The NextIndex is incremented by destination.Length.

See Also