Pcg32 Constructor

Definition

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

Overload List

Pcg32() Initializes a new instance of the Pcg32 class using OS entropy.
Pcg32(RandomOptions) Initializes a new instance of the Pcg32 class with the specified options.
Pcg32(ReadOnlySpan<Byte>) Initializes a new instance of the Pcg32 class from saved state.
Pcg32(Int64, SeedProfile) Initializes a new instance of the Pcg32 class with the specified seed.
Pcg32(ReadOnlySpan<UInt32>, SeedProfile) Initializes a new instance of the Pcg32 class with the specified seed array.
Pcg32(UInt64, UInt64) Initializes a new instance of the Pcg32 class with direct state and stream initialization.
Pcg32(Int64, StreamAddress, SeedProfile) Initializes a new instance of the Pcg32 class with the specified seed.
Pcg32(ReadOnlySpan<UInt32>, StreamAddress, SeedProfile) Initializes a new instance of the Pcg32 class with the specified seed array.

Pcg32

Initializes a new instance of the Pcg32 class using OS entropy.
C#
public Pcg32()

Pcg32(RandomOptions)

Initializes a new instance of the Pcg32 class with the specified options.
C#
public Pcg32(
	RandomOptions options
)

Parameters

options  RandomOptions
The initialization options containing seed, stream ID, and seed profile.

Pcg32(ReadOnlySpan<Byte>)

Initializes a new instance of the Pcg32 class from saved state.
C#
public Pcg32(
	ReadOnlySpan<byte> state
)

Parameters

state  ReadOnlySpan<Byte>
The saved state to restore.

Exceptions

ArgumentExceptionThe length of state is less than the required state size.

Pcg32(Int64, SeedProfile)

Initializes a new instance of the Pcg32 class with the specified seed.
C#
public Pcg32(
	long seed,
	SeedProfile seedProfile = SeedProfile.Default
)

Parameters

seed  Int64
A number used to calculate a starting value for the pseudo-random number sequence.
seedProfile  SeedProfile  (Optional)
The seed profile to use for initialization.

Pcg32(ReadOnlySpan<UInt32>, SeedProfile)

Initializes a new instance of the Pcg32 class with the specified seed array.
C#
public Pcg32(
	ReadOnlySpan<uint> seedMaterial,
	SeedProfile seedProfile = SeedProfile.Default
)

Parameters

seedMaterial  ReadOnlySpan<UInt32>
An array of numbers used to calculate a starting value for the pseudo-random number sequence.
seedProfile  SeedProfile  (Optional)
The seed profile to use for initialization.

Exceptions

ArgumentNullExceptionseedMaterial is null.

Pcg32(UInt64, UInt64)

Initializes a new instance of the Pcg32 class with direct state and stream initialization.
C#
public Pcg32(
	ulong state,
	ulong stream
)

Parameters

state  UInt64
The 64-bit LCG state.
stream  UInt64
The stream selector.

Remarks

This constructor directly sets the internal state and stream, matching the canonical PCG32 initialization.

Pcg32(Int64, StreamAddress, SeedProfile)

Initializes a new instance of the Pcg32 class with the specified seed.
C#
public Pcg32(
	long seed,
	StreamAddress streamAddress,
	SeedProfile seedProfile = SeedProfile.Default
)

Parameters

seed  Int64
A number used to calculate a starting value for the pseudo-random number sequence.
streamAddress  StreamAddress
Optional stream identifier for stream selection.
seedProfile  SeedProfile  (Optional)
The seed profile to use for initialization.

Pcg32(ReadOnlySpan<UInt32>, StreamAddress, SeedProfile)

Initializes a new instance of the Pcg32 class with the specified seed array.
C#
public Pcg32(
	ReadOnlySpan<uint> seedMaterial,
	StreamAddress streamAddress,
	SeedProfile seedProfile = SeedProfile.Default
)

Parameters

seedMaterial  ReadOnlySpan<UInt32>
An array of numbers used to calculate a starting value for the pseudo-random number sequence.
streamAddress  StreamAddress
Optional stream identifier for stream selection.
seedProfile  SeedProfile  (Optional)
The seed profile to use for initialization.

Exceptions

ArgumentNullExceptionseedMaterial is null.

See Also