Mersenne Twister 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( | Initializes the generator with an array of keys (init_by_array). |
| Seed( | Initializes the engine state from a seed sequence. |
| Seed( | Initializes the generator with a single seed (init_genrand). |
Seed(ReadOnlySpan<UInt32>)
Initializes the generator with an array of keys (init_by_array).
public void Seed(
ReadOnlySpan<uint> initKey
)Parameters
- initKey ReadOnlySpan<UInt32>
- The initialization key array.
Remarks
This is the canonical MT19937 init-by-array initialization routine.
Mixes the key array into the state using the reference algorithm's two-phase mixing loops.
Exceptions
| Argument | Thrown when initKey is empty. |
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)Exceptions
| Argument | Thrown when seed is null. |
Seed(UInt32)
Initializes the generator with a single seed (init_genrand).
Remarks
This is the canonical MT19937 single-seed initialization routine (init_genrand).
Uses the standard Knuth multiplier 1812433253 to fill the state array.