MersenneTwister64Engine.Seed Method

Definition

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

Overload List

Seed(ReadOnlySpan<UInt64>) Initializes the generator with an array of keys (init_by_array64).
Seed(SeedSequence) Initializes the engine state from a seed sequence.
Seed(UInt64) Initializes the generator with a single seed (init_genrand64).

Seed(ReadOnlySpan<UInt64>)

Initializes the generator with an array of keys (init_by_array64).
C#
public void Seed(
	ReadOnlySpan<ulong> initKey
)

Parameters

initKey  ReadOnlySpan<UInt64>
The initialization key array.

Remarks

This is the canonical MT19937-64 init-by-array initialization routine. Mixes the key array into the state using the reference algorithm's two-phase mixing loops.

Exceptions

ArgumentExceptionThrown when initKey is empty.

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)

Exceptions

ArgumentNullExceptionThrown when seed is null.

Seed(UInt64)

Initializes the generator with a single seed (init_genrand64).
C#
public void Seed(
	ulong seed
)

Parameters

seed  UInt64
The seed value.

Remarks

This is the canonical MT19937-64 single-seed initialization routine (init_genrand64). Uses the standard multiplier 6364136223846793005 to fill the state array.

See Also