IBlock Random Generator Interface
Represents a block-based random number generator that produces fixed-size blocks of random data.
Definition
Namespace: Numerics.NET.Random
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
C#
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
public interface IBlockRandomGenerator : IRandomGenerator,
IStateful- Implements
- IRandomGenerator, IStateful
Remarks
This interface defines the minimal primitive API for random number generation:
- NextUInt32(): Generates a 32-bit unsigned integer.
- NextUInt64(): Generates a 64-bit unsigned integer.
- NextBytes(Span<Byte>): Fills a span with random bytes in little-endian order.
Little-Endian Promise:
All bytes written by NextBytes(Span<Byte>) are written in little-endian order, ensuring portable and predictable byte sequences across all platforms.
Tail Consumption Rule:
When NextBytes(Span<Byte>) ends with a remainder smaller than the generator's natural word write size, it consumes one additional word and writes only the required low-order bytes.
Properties
| Block | Gets the number of words per block produced by this generator. |
| State |
Gets the number of bytes required to save/load this engine's state.
(Inherited from IStateful) |
Methods
| Fill( |
Fills the specified span with random double-precision floating-point numbers.
(Inherited from IRandomGenerator) |
| Fill( |
Fills the specified span with random single-precision floating-point numbers.
(Inherited from IRandomGenerator) |
| Fill( |
Fills the specified span with random 32-bit unsigned integers.
(Inherited from IRandomGenerator) |
| Fill( |
Fills the specified span with random 64-bit unsigned integers.
(Inherited from IRandomGenerator) |
| Load |
Loads the engine's state from the source span in a stable little-endian format.
(Inherited from IStateful) |
| Next |
Fills the specified span with random bytes in little-endian order.
(Inherited from IRandomGenerator) |
| Next |
Generates the next double-precision floating-point number.
(Inherited from IRandomGenerator) |
| Next |
Generates the next single-precision floating-point number.
(Inherited from IRandomGenerator) |
| Next |
Generates the next 32-bit unsigned integer.
(Inherited from IRandomGenerator) |
| Next |
Generates the next 64-bit unsigned integer.
(Inherited from IRandomGenerator) |
| Save |
Saves the engine's state to the destination span in a stable little-endian format.
(Inherited from IStateful) |