GfsrEngine.Seed Method

Definition

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

Overload List

Seed(ReadOnlySpan<UInt32>) Directly sets the GFSR state array.
Seed(SeedSequence) Initializes the engine state from a seed sequence.

Seed(ReadOnlySpan<UInt32>)

Directly sets the GFSR state array.
C#
public void Seed(
	ReadOnlySpan<uint> state
)

Parameters

state  ReadOnlySpan<UInt32>
The state values (must be exactly 16384 elements).

Remarks

This is the author-defined seeding routine for GFSR that directly populates the feedback register state array. No orthogonalization or mixing is performed. The state is copied directly and the index is reset.

Exceptions

ArgumentExceptionThrown when state length is incorrect.

Seed(SeedSequence)

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

Parameters

seed  SeedSequence
The seed sequence providing entropy.

Implements

IRandomEngine.Seed(SeedSequence)

Remarks

GFSR requires a large state array (16384 words). The seed sequence is used to fill the entire state, followed by an orthogonalization step to ensure good initial distribution. This initialization can be slow but is necessary for quality output.

Exceptions

ArgumentNullExceptionThrown when seed is null.

See Also