Pcg32Engine.Seed Method

Definition

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

Overload List

Seed(SeedSequence) Initializes the engine state from a seed sequence.
Seed(UInt64, UInt64) Directly sets the PCG32 state and stream.

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, UInt64)

Directly sets the PCG32 state and stream.
C#
public void Seed(
	ulong state,
	ulong stream
)

Parameters

state  UInt64
The initial LCG state value.
stream  UInt64
The stream/sequence selector (selects the LCG increment).

Remarks

This is the canonical PCG seeding routine that sets state + stream directly. The internal increment is derived as: inc = (stream << 1) | 1 (must be odd).

Uses the standard PCG initialization sequence: set inc, set state=0, advance once, add state parameter, advance once more to thoroughly mix.

See Also