Random Source<TGenerator>.Uncached Property
Gets an uncached facade for this random number generator.
Definition
Namespace: Numerics.NET.Random
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
C#
An RandomSource<TGenerator>.UncachedFacade instance that forces full 64-bit consumption per value for 32-bit and smaller outputs.
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
public RandomSource<TGenerator>.UncachedFacade Uncached { get; }Property Value
RandomSource<TGenerator>.UncachedFacadeAn RandomSource<TGenerator>.UncachedFacade instance that forces full 64-bit consumption per value for 32-bit and smaller outputs.
Remarks
The uncached facade is only available for 64-bit word RNGs (BitsPerWord = 64). It provides methods that consume a full 64-bit random value for each call, even when returning smaller types like UInt32, Int32, or Single.
Use Cases:
- Compatibility modes requiring strict 64-bit consumption per value
- Testing and validation against reference implementations that use full-width values
- Scenarios where caching behavior must be avoided for reproducibility
Example
var rng = new Xoshiro256StarStar(42);
// Standard API uses caching - efficient but may consume partial values
uint v1 = rng.NextUInt32(); // May cache lower bits
// Uncached API always consumes full 64-bit values
uint v2 = rng.Uncached.NextUInt32(); // Discards lower 32 bits