StreamAddress 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#
public readonly struct StreamAddress : IEquatable<StreamAddress>
Inheritance
Object  →  ValueType  →  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

StreamAddress(ReadOnlySpan<UInt64>) Initializes a new instance of the StreamAddress struct with segments from a span.
StreamAddress(UInt64) 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(Object)Indicates whether this instance and a specified object are equal.
(Overrides ValueType.Equals(Object))
Equals(StreamAddress)Indicates whether the current object is equal to another object of the same type.
GetHashCodeReturns the hash code for this instance.
(Overrides ValueType.GetHashCode())
GetTypeGets the Type of the current instance.
(Inherited from Object)
ToString Returns a string representation of this stream address.
(Overrides ValueType.ToString())

Operators

Equality(StreamAddress, StreamAddress) 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(StreamAddress, StreamAddress) Determines whether two stream addresses are not equal.

See Also