Class NumPyRandom.State
- Namespace
- NumSharp
- Assembly
- NumSharp.dll
NumPy's RandomState.get_state(legacy=False) dict: the bit generator's state plus RandomState's cached
Gaussian — the one state form every bit generator supports.
public sealed class NumPyRandom.State
- Inheritance
-
NumPyRandom.State
- Inherited Members
Remarks
NumPy's dict is {'bit_generator': name, 'state': {...}, [generator-specific keys], 'has_gauss': int,
'gauss': float}; here the bit generator's part is its typed BitGeneratorState (whose own members
already flatten 'state' and the generator-specific keys), and has_gauss/gauss
are the two keys RandomState adds. The object is plain mutable data: edit it and pass it to
set_state(State).
Constructors
State()
Creates an empty state (set state before passing it to set_state(State)).
public State()
State(BitGeneratorState, int, double)
Creates a state from its parts.
public State(BitGeneratorState state, int has_gauss = 0, double gauss = 0)
Parameters
stateBitGeneratorStateThe bit generator's state (NumPy's
'bit_generator'/'state'entries).has_gaussintNon-zero when a Gaussian is cached.
gaussdoubleThe cached Gaussian (0.0 when none).
Properties
bit_generator
NumPy's 'bit_generator' key: the bit generator's class name (null when state is unset).
public string bit_generator { get; }
Property Value
gauss
NumPy's 'gauss': the cached Gaussian (0.0 when none — a consumed cache is zeroed).
public double gauss { get; set; }
Property Value
has_gauss
NumPy's 'has_gauss': non-zero when a Gaussian is cached.
public int has_gauss { get; set; }
Property Value
state
The bit generator's state — NumPy's 'state' sub-dict together with the generator's own keys.
public BitGeneratorState state { get; set; }