RandomOptions Constructor

Definition

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

Overload List

RandomOptions(Int64, StreamAddress, SeedProfile) Constructs a new RandomOptions with the specified parameters.
RandomOptions(ReadOnlySpan<UInt32>, StreamAddress, SeedProfile) Constructs a new RandomOptions with a uint[] seed array.
RandomOptions(ReadOnlySpan<UInt64>, StreamAddress, SeedProfile) Constructs a new RandomOptions with the specified parameters.

RandomOptions(Int64, StreamAddress, SeedProfile)

Constructs a new RandomOptions with the specified parameters.
C#
public RandomOptions(
	long seed,
	StreamAddress streamAddress = default,
	SeedProfile seedProfile = SeedProfile.Default
)

Parameters

seed  Int64
The seed value used for initialization.
streamAddress  StreamAddress  (Optional)
Optional stream address (default: empty).
seedProfile  SeedProfile  (Optional)
The seed profile (default: Default).

Remarks

This constructor does not perform validation. Validation should be performed at public API boundaries by calling Validate.

The seed is stored as a scalar ulong (via unchecked cast), which will be flattened to uint[] internally.

Exceptions

ArgumentOutOfRangeException

seedProfile is not a valid SeedProfile value.

RandomOptions(ReadOnlySpan<UInt32>, StreamAddress, SeedProfile)

Constructs a new RandomOptions with a uint[] seed array.
C#
public RandomOptions(
	ReadOnlySpan<uint> seedArray,
	StreamAddress streamAddress = default,
	SeedProfile seedProfile = SeedProfile.Default
)

Parameters

seedArray  ReadOnlySpan<UInt32>
The 32-bit seed array values.
streamAddress  StreamAddress  (Optional)
Optional stream address (default: empty).
seedProfile  SeedProfile  (Optional)
The seed profile (default: Default).

Remarks

This constructor is primarily used by 32-bit RNGs.

The seed array is used as-is (cloned for immutability).

Exceptions

ArgumentNullException

seedArray is null.

ArgumentOutOfRangeException

seedProfile is not a valid SeedProfile value.

RandomOptions(ReadOnlySpan<UInt64>, StreamAddress, SeedProfile)

Constructs a new RandomOptions with the specified parameters.
C#
public RandomOptions(
	ReadOnlySpan<ulong> seedArray,
	StreamAddress streamAddress = default,
	SeedProfile seedProfile = SeedProfile.Default
)

Parameters

seedArray  ReadOnlySpan<UInt64>
The seed array values.
streamAddress  StreamAddress  (Optional)
Optional stream address (default: empty).
seedProfile  SeedProfile  (Optional)
The seed profile (default: Default).

Remarks

This constructor does not perform validation. Validation should be performed at public API boundaries by calling Validate.

The seed array is flattened to uint[] internally, with each ulong split into two uint values in little-endian order.

Exceptions

ArgumentNullException

seedArray is null.

ArgumentOutOfRangeException

seedProfile is not a valid SeedProfile value.

See Also