Stream Address Structure
Represents a hierarchical stream address for random number generators.
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 readonly struct StreamAddress : IEquatable<StreamAddress>- Implements
- IEquatable<StreamAddress>
Remarks
StreamAddress encapsulates a hierarchical addressing scheme for RNG streams. It can represent:
- Empty address: No stream specification (root stream)
- Single-level address: One segment (e.g., stream 5)
- Multi-level address: Multiple segments (e.g., [3, 7, 2] for nested hierarchy)
Stream addresses are used by seed sequences to derive stream-specific entropy, enabling deterministic parallel stream generation and hierarchical spawning compatible with NumPy's SeedSequence.
Constructors
| Stream | Initializes a new instance of the StreamAddress struct with segments from a span. |
| Stream | Initializes a new instance of the StreamAddress struct with a single segment. |
Properties
| Empty | Gets an empty stream address representing the root stream. |
| IsEmpty | Gets a value indicating whether this stream address is empty (root stream). |
| Segments | Gets the segments of this stream address. |
Methods
| Append | Creates a new stream address with the specified index appended to the end. |
| Equals( | Indicates whether this instance and a specified object are equal. (Overrides ValueType.Equals(Object)) |
| Equals( | Indicates whether the current object is equal to another object of the same type. |
| Get | Returns the hash code for this instance. (Overrides ValueType.GetHashCode()) |
| Get | Gets the Type of the current instance. (Inherited from Object) |
| ToString |
Returns a string representation of this stream address.
(Overrides ValueType.ToString()) |
Operators
| Equality( | Determines whether two stream addresses are equal. |
| Implicit(Nullable<UInt64> to StreamAddress) | Implicitly converts a nullable UInt64 to a stream address. |
| Implicit(ReadOnlySpan<UInt64> to StreamAddress) | Implicitly converts a UInt64 array to a multi-segment stream address. |
| Implicit(UInt64 to StreamAddress) | Implicitly converts a UInt64 to a single-segment stream address. |
| Inequality( | Determines whether two stream addresses are not equal. |