Struct NativeRandomState
- Namespace
- NumSharp
- Assembly
- NumSharp.dll
Represents the stored state of MT19937 random number generator. This format is compatible with NumPy's random state.
public struct NativeRandomState
- Inherited Members
- Extension Methods
Remarks
NumPy state format: ('MT19937', array([...624...]), pos, has_gauss, cached_gaussian)
Constructors
NativeRandomState(byte[])
Backward compatibility constructor for legacy byte[] state. This will throw if called with old-format state.
[Obsolete("Legacy Randomizer state format is no longer supported. Use new MT19937-based state.")]
public NativeRandomState(byte[] state)
Parameters
statebyte[]
NativeRandomState(uint[], int, int, double)
Creates a new NativeRandomState with default values.
public NativeRandomState(uint[] key, int pos, int hasGauss = 0, double cachedGaussian = 0)
Parameters
Fields
Algorithm
Algorithm identifier. Always "MT19937" for NumPy-compatible state.
public string Algorithm
Field Value
CachedGaussian
The cached Gaussian value from Box-Muller transform.
public double CachedGaussian
Field Value
HasGauss
Whether there is a cached Gaussian value (0 or 1).
public int HasGauss
Field Value
Key
The MT19937 state array (624 uint32 values).
public uint[] Key
Field Value
- uint[]
Pos
Current position in the state array (0-624).
public int Pos