Assists in implementing block based RNGs.
- Namespace
- RandN
.Implementation - Interfaces
- Base Types
- object
Syntax
public sealed class BlockBuffer32<TBlockRng> : IRng where TBlockRng : IBlockRngCore<uint>Type Parameters
| Name | Description |
|---|---|
| TBlockRng |
Constructors
| Name | Summary |
|---|---|
| BlockBuffer32 | Constructs a new instance filled from rng. |
Properties
| Name | Property Type | Summary |
|---|---|---|
| Index | int | The index to the location within the current block. |
| Length | int | The length of the block. |
Methods
| Name | Return Value | Summary |
|---|---|---|
| Fill | void | Completely fills the span with random bytes. |
| GenerateAndSet | void | Generates and stores the next block and sets Index to index. |
| NextUInt32 | uint | Returns the next 32 bits in the sequence as a UInt32. |
| NextUInt64 | ulong | Returns the next 64 bits in the sequence as a UInt64. |
Extension Methods
| Name | Value | Summary |
|---|---|---|
| Sample | TResult | Samples the distribution from rng. From RngExtensions |
| Sample | TResult | Samples the distribution from rng. From RngExtensions |
| ShuffleInPlace | void | Shuffles a list using the in-place Fisher-Yates shuffling algorithm. From RngExtensions |