RandomStreamSource<TRandom> Class

Provides a base implementation for hierarchical random stream sources.

Definition

Namespace: Numerics.NET.Random
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
C#
public abstract class RandomStreamSource<TRandom> : IRandomStreamSource<TRandom>
where TRandom : Object, IRandomSourceFactory<TRandom>
Inheritance
Object  →  RandomStreamSource<TRandom>
Derived
Implements
IRandomStreamSource<TRandom>

Type Parameters

TRandom
The type of random number generator produced by this source.

Remarks

RandomStreamSource<TRandom> implements the common mechanics for managing hierarchical stream sources, including:

  • Path storage and management
  • Next index tracking
  • Base options storage
  • Branching logic

Derived classes must implement the stream generation logic specific to their model (mixing-based or jump-based).

Constructors

RandomStreamSource<TRandom> Initializes a new instance of the RandomStreamSource<TRandom> class.

Properties

NextIndex Gets the index of the next stream to be consumed at this scope.
Path Gets the hierarchical path identifying the current scope.
Prefix Gets the hierarchical prefix path from root to this scope.

Methods

Advance Advances the next index by the specified count without generating streams.
Branch Creates a child stream source at the specified index without advancing this source.
BranchAndAdvance Creates a child stream source at the current next index and advances this source.
CreateChild Creates a child stream source with the specified index.
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
NextStream Returns an RNG for the next child stream and advances the index.
NextStreams(Int32) Returns an array of RNGs for the next N child streams and advances the index.
NextStreams(Span<TRandom>) Fills the specified span with the next child streams and advances the index.
PrefixStream Returns an RNG corresponding to the current path prefix only.
Seek Sets the next stream index to the specified value.
ToStringReturns a string that represents the current object.
(Inherited from Object)

Fields

_baseOptions The base initialization options used as a template for derived streams.

See Also