Table of Contents

Class PCG64DXSM.State

Namespace
NumSharp
Assembly
NumSharp.dll

The PCG64DXSM state — NumPy's {'bit_generator': 'PCG64DXSM', 'state': {'state': int, 'inc': int}, 'has_uint32': int, 'uinteger': int} with the nested 'state' dict flattened.

public class PCG64DXSM.State : BitGeneratorState
Inheritance
PCG64DXSM.State
Inherited Members

Remarks

Unsealed, so a subclass engine that adds state of its own derives its snapshot from this class. Its GetStateCore() override returns the derived snapshot, which passes the typed state getter (a cast to PCG64DXSM.State) and SetStateCore(BitGeneratorState) (an is State test); its SetStateCore(BitGeneratorState) override restores its own fields and calls the base for the engine's. Footgun: the bit_generator label stays "PCG64DXSM" and the base SetStateCore(BitGeneratorState) takes any PCG64DXSM.State, where NumPy labels a subclass's state with the subclass's class name and refuses another class's state.

Constructors

State()

Creates an all-zero state (fill the members before assigning it).

public State()

State(UInt128, UInt128, int, uint)

Creates a state from its four members.

public State(UInt128 state, UInt128 inc, int has_uint32 = 0, uint uinteger = 0)

Parameters

state UInt128

The 128-bit LCG state.

inc UInt128

The 128-bit LCG increment.

has_uint32 int

Non-zero when a buffered 32-bit half is pending.

uinteger uint

The buffered 32-bit half.

Properties

bit_generator

NumPy's 'bit_generator' key: the name of the bit generator class this state belongs to.

public override string bit_generator { get; }

Property Value

string

has_uint32

Non-zero when a buffered 32-bit half is pending.

public int has_uint32 { get; set; }

Property Value

int

inc

The 128-bit LCG increment (NumPy state['state']['inc']).

public UInt128 inc { get; set; }

Property Value

UInt128

state

The 128-bit LCG state (NumPy state['state']['state']).

public UInt128 state { get; set; }

Property Value

UInt128

uinteger

The buffered 32-bit half.

public uint uinteger { get; set; }

Property Value

uint