Table of Contents

Class RandomStreamState

Namespace
Mrg32k3a.NET
Assembly
Mrg32k3a.NET.dll

A transferable snapshot of everything a RandomStream needs in order to resume: its initial state, the start of its current substream, its current state, the index of that substream, and its two output flags.

public sealed class RandomStreamState
Inheritance
RandomStreamState
Inherited Members

Remarks

The type is a plain mutable object with a parameterless constructor and public properties, so any general purpose serializer can handle it. The library deliberately takes no serialization dependency, which means the property names are used verbatim unless the caller applies a naming policy of their own.

Version identifies the shape of the snapshot. LoadState(RandomStreamState) accepts only CurrentVersion and rejects every other value. Version 2 added SubstreamIndex, which cannot be recovered from the state vectors, so a version 1 snapshot is rejected rather than loaded with a substituted index.

Fields

CurrentVersion

The snapshot version this build writes.

public const int CurrentVersion = 2

Field Value

int

Properties

Antithetic

Gets or sets whether the stream returns antithetic variates.

public bool Antithetic { get; set; }

Property Value

bool

Current

Gets or sets the current state of the stream, six unsigned integers.

public uint[] Current { get; set; }

Property Value

uint[]

HighPrecision

Gets or sets whether the stream returns high-precision variates.

public bool HighPrecision { get; set; }

Property Value

bool

Name

Gets or sets the label carried by the stream.

public string Name { get; set; }

Property Value

string

StreamStart

Gets or sets the initial state of the stream, six unsigned integers.

public uint[] StreamStart { get; set; }

Property Value

uint[]

SubstreamIndex

Gets or sets the zero-based index of the substream the stream is inside.

public long SubstreamIndex { get; set; }

Property Value

long

Remarks

Must be below the 2^51 substreams a stream holds, or the snapshot is refused.

SubstreamStart

Gets or sets the state at the start of the current substream, six unsigned integers.

public uint[] SubstreamStart { get; set; }

Property Value

uint[]

Version

Gets or sets the snapshot version.

public int Version { get; set; }

Property Value

int