Gfsr Engine.Seed Method
Definition
Namespace: Numerics.NET.Random.Engines
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
Overload List
| Seed( | Directly sets the GFSR state array. |
| Seed( | Initializes the engine state from a seed sequence. |
Seed(ReadOnlySpan<UInt32>)
Directly sets the GFSR state array.
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
| Argument | Thrown when state length is incorrect. |
Seed(SeedSequence)
Initializes the engine state from a seed sequence.
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
| Argument | Thrown when seed is null. |