RandomOptions Structure

Immutable initialization options for 64-bit random number generators.

Definition

Namespace: Numerics.NET.Random
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
C#
public readonly struct RandomOptions
Inheritance
Object  →  ValueType  →  RandomOptions

Remarks

RandomOptions is the sole carrier of initialization policy for 64-bit RNGs. It is used only during construction and is not stored in RNG instances.

All RNGs must accept a RandomOptions parameter in their advanced constructor and use it to initialize their internal state.

Key principles:

  • Immutable value type - cannot be modified after creation
  • Used only during initialization - not stored in RNG instances
  • No RNG-specific extensions allowed at this stage
  • Validation performed at public API boundaries

Constructors

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.

Properties

Seed Gets the canonical seed value used for initialization.
SeedIsScalar Gets whether the seed was provided as a scalar value (uint or ulong) rather than as an array.
SeedMaterial Gets the canonical seed material as 32-bit words.
SeedProfile Gets the seed profile used for initialization.
StreamAddress Gets the stream address used for stream selection.

Methods

EqualsIndicates whether this instance and a specified object are equal.
(Inherited from ValueType)
GetHashCodeReturns the hash code for this instance.
(Inherited from ValueType)
GetTypeGets the Type of the current instance.
(Inherited from Object)
ToStringReturns the fully qualified type name of this instance.
(Inherited from ValueType)
WithStreamAddress Creates a new RandomOptions with the specified stream address, preserving all other settings.

Extension Methods

WithChaChaRounds Creates a new RandomOptions configured for ChaCha with the specified number of rounds.
(Defined by RandomOptionsExtensions)
WithChaChaVariant Creates a new RandomOptions configured for ChaCha with the specified number of rounds.
(Defined by RandomOptionsExtensions)

See Also