IJumpable Interface
Definition
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
public interface IJumpable : IAdvanceable- Implements
- IAdvanceable
Remarks
A jumpable RNG can efficiently advance its state by large, algorithm-defined strides. This is particularly useful for:
- Creating independent parallel streams with guaranteed non-overlap
- Spawning subsequences for distributed computing
- Partitioning a single sequence across multiple processors
Jump Operations:
This interface exposes two canonical jump operations: Jump(UInt64) and LongJump(UInt64). Each advances the RNG by a fixed, algorithm-specific distance described by JumpSize and LongJumpSize respectively.
If an RNG only supports a single jump distance, both JumpSize and LongJumpSize will report the same value, and LongJump() will delegate to Jump().
Jump Sizes:
The JumpSize and LongJumpSize properties provide metadata about the jump distances. These are informational and fixed per algorithm.
Example
// Create a base RNG and inspect its jump capabilities
var rng = new Xoshiro256Plus(42);
var jumpable = (IJumpable)rng;
Console.WriteLine($"Jump size: {jumpable.JumpSize}");
Console.WriteLine($"Long jump size: {jumpable.LongJumpSize}");
// Spawn independent streams by jumping
var streams = new Xoshiro256Plus[4];
streams[0] = new Xoshiro256Plus(42);
for (int i = 1; i < 4; i++)
{
streams[i] = new Xoshiro256Plus(42);
((IJumpable)streams[i]).Jump((ulong)i);
}
// Use long jump for even greater separation
var distantStream = new Xoshiro256Plus(42);
((IJumpable)distantStream).LongJump();Properties
| Jump | Gets the size category of the primary jump operation. |
| Long | Gets the size category of the long jump operation. |
Methods
| Advance |
Advances the RNG state by the specified number of outputs.
(Inherited from IAdvanceable) |
| Jump | Jumps the RNG forward by the specified number of primary jump strides. |
| Long | Jumps the RNG forward by the specified number of long jump strides. |