IRandomSource<TGenerator>.Generator Property

Gets a reference to the underlying Layer 2 generator.

Definition

Namespace: Numerics.NET.Random
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
C#
ref TGenerator Generator { get; }

Property Value

TGenerator
A ref to the stored generator instance.

Remarks

This property provides direct access to the Layer 2 generator struct, enabling zero-overhead operation in performance-critical code paths.

Important:

This property must return a reference to the actual stored generator, not a copy. Returning a copy would break the zero-overhead guarantee and cause state mutations to be lost.

Typical implementation:

private TGenerator _gen; public ref TGenerator Generator => ref _gen;

See Also