IRandomEngine Interface

Represents the base contract for all random number generator engines.

Definition

Namespace: Numerics.NET.Random.Engines
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
C#
public interface IRandomEngine : IStateful
Implements
IStateful

Remarks

Random number generator engines are the lowest-level RNG components in the Numerics.NET architecture. They own algorithm state and expose mathematical primitives for state transition and output mapping with a stable, portable state format.

Core Responsibilities:

  • State ownership: Engines hold the complete algorithm state.
  • Seeding: Engines initialize from a SeedSequence that provides a deterministic entropy stream.
  • State persistence: Engines support portable save/load operations via IStateful.
  • Metadata: Engines expose their name and native word size for introspection.

Engine Types:

Concrete engines implement either IScalarEngine<T> (for 1:1 topology) or IBlockEngine<T> (for 1:N block-based topology). Counter-based engines implement the specialized ICounterBased<T> interface.

Properties

BitsPerWord Gets the native word size in bits.
Name Gets a human-readable name for this engine.
StateSize Gets the number of bytes required to save/load this engine's state.
(Inherited from IStateful)

Methods

LoadState Loads the engine's state from the source span in a stable little-endian format.
(Inherited from IStateful)
SaveState Saves the engine's state to the destination span in a stable little-endian format.
(Inherited from IStateful)
Seed Initializes the engine state from a seed sequence.

See Also