Mrg32k3aEngine.Seed Method

Definition

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

Overload List

Seed(ReadOnlySpan<UInt32>) Initializes the engine from 0 to 6 state words, filling omitted values with 1.
Seed(SeedSequence) Initializes the engine state from a seed sequence.
Seed(UInt32, UInt32, UInt32, UInt32, UInt32, UInt32) Directly sets the six MRG32k3a state words.

Seed(ReadOnlySpan<UInt32>)

Initializes the engine from 0 to 6 state words, filling omitted values with 1.
C#
public void Seed(
	ReadOnlySpan<uint> seed
)

Parameters

seed  ReadOnlySpan<UInt32>
A span of 0 to 6 unsigned 32-bit seed values. Values not supplied are treated as 1.

Exceptions

ArgumentException Thrown when seed has more than 6 elements, or when the resulting state would be invalid (all-zero component).
ArgumentOutOfRangeException Thrown when any seed value is out of range for its component.

Seed(SeedSequence)

Initializes the engine state from a seed sequence.
C#
public void Seed(
	SeedSequence seed
)

Parameters

seed  SeedSequence
The seed sequence providing a deterministic entropy stream of UInt32 values.

Implements

IRandomEngine.Seed(SeedSequence)

Remarks

The engine consumes as many UInt32 values from the seed sequence as needed to fully initialize its state. After seeding, subsequent output is deterministically defined and immediately well-defined without requiring an extra "priming" step.

Exceptions

ArgumentNullExceptionThrown when seed is null.
ArgumentNullException Thrown when seed is null.

Seed(UInt32, UInt32, UInt32, UInt32, UInt32, UInt32)

Directly sets the six MRG32k3a state words.
C#
public void Seed(
	uint s10,
	uint s11,
	uint s12,
	uint s20,
	uint s21,
	uint s22
)

Parameters

s10  UInt32
The first state word of the first recurrence component.
s11  UInt32
The second state word of the first recurrence component.
s12  UInt32
The third state word of the first recurrence component.
s20  UInt32
The first state word of the second recurrence component.
s21  UInt32
The second state word of the second recurrence component.
s22  UInt32
The third state word of the second recurrence component.

Remarks

The first component state words must be less than 4294967087. The second component state words must be less than 4294944443.

Exceptions

ArgumentException Thrown when either recurrence component would have an all-zero state.
ArgumentOutOfRangeException Thrown when any state word is greater than or equal to the modulus for its component.

See Also