Random Source<TGenerator>.Reinitialize Method
Reinitializes this random number generator using the specified initialization options.
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 void Reinitialize(
in RandomOptions options
)Parameters
- options RandomOptions
- The RandomOptions describing the seeding profile, seed material, stream identifiers, and other initialization parameters to apply.
Remarks
This method resets the generator's internal state by running the same initialization logic used during construction. It is equivalent to creating a new instance with the same options, but reuses the current object.
Typical use cases:
- Starting a new random stream with a new seed or spawn key sequence.
- Resetting an RNG instance inside long-running workflows without allocating a new object.
- Reproducing the same initialization behavior as the constructor using explicit options.
Any cached or buffered state associated with derived sampling methods (if applicable) is cleared as part of reinitialization.
Exceptions
| Argument | options is not valid or not supported by this generator. |