Table of Contents

Class PCG64

Namespace
NumSharp
Assembly
NumSharp.dll

PCG64 (XSL-RR 128/64) bit generator — the default BitGenerator behind np.random.default_rng.

public sealed class PCG64 : BitGenerator
Inheritance
PCG64
Inherited Members

Remarks

Port of NumPy 2.4.2's PCG64 (numpy/random/src/pcg64/pcg64.h), a 128-bit LCG with the XSL-RR 128→64 output permutation. The 128-bit state arithmetic is expressed with .NET's native UInt128, so the raw stream is byte-for-byte identical to NumPy's (verified against bit_generator.random_raw). Seeding goes through SeedSequence exactly as NumPy does (generate_state(4, uint64)).

Constructors

PCG64(SeedSequence)

Constructs and seeds a PCG64 from the given seed sequence.

public PCG64(SeedSequence seedSeq)

Parameters

seedSeq SeedSequence

PCG64(long)

Constructs and seeds a PCG64 from a single integer seed.

public PCG64(long seed)

Parameters

seed long

Properties

seed_seq

The seed sequence this generator was constructed from (NumPy PCG64.seed_seq).

public SeedSequence seed_seq { get; }

Property Value

SeedSequence

state

Gets or sets the current internal state (NumPy's bit_generator.state property).

public PCG64.Pcg64StateData state { get; set; }

Property Value

PCG64.Pcg64StateData