nk 1.0.0
C++ Numerical Computing Runtime
Loading...
Searching...
No Matches
nk::builtin::RngContext Class Reference

Public Types

using result_type = MatlabMT19937::result_type

Public Member Functions

result_type operator() ()
double genRes53 ()
 MATLAB-canonical 53-bit double in [0, 1) — what rand uses.
void seed (std::uint64_t seed)
 Seed the stream. seed == 0 ≡ rng('default').
void shuffle ()
 rng('shuffle') — seed from a nondeterministic source.
Value state (std::pmr::memory_resource *mr=nullptr) const
 s = rng() — capture the stream state as a struct (.Type / .State).
void restore (const Value &s)
 rng(s) — restore a state struct captured by state().
void setLegacyV4 (std::uint64_t seed)
std::uint64_t legacySeed () const noexcept
 rand('seed') / randn('seed') — query the last legacy seed.
bool legacyV4 () const noexcept
double v4Uniform ()
double v4Normal ()
MatlabMT19937 & engine () noexcept
 Escape hatch: the underlying MT19937 (e.g. for getState/setState).
const MatlabMT19937 & engine () const noexcept

Static Public Member Functions

static constexpr result_type min ()
static constexpr result_type max ()

Detailed Description

Definition at line 28 of file rng_context.hpp.

Member Typedef Documentation

◆ result_type

using nk::ops::RngContext::result_type = MatlabMT19937::result_type

Definition at line 33 of file rng_context.hpp.

Member Function Documentation

◆ engine() [1/2]

const MatlabMT19937 & nk::ops::RngContext::engine ( ) const
inlinenoexcept

Definition at line 90 of file rng_context.hpp.

◆ engine() [2/2]

MatlabMT19937 & nk::ops::RngContext::engine ( )
inlinenoexcept

Escape hatch: the underlying MT19937 (e.g. for getState/setState).

Definition at line 89 of file rng_context.hpp.

◆ genRes53()

double nk::ops::RngContext::genRes53 ( )
inline

MATLAB-canonical 53-bit double in [0, 1) — what rand uses.

Definition at line 39 of file rng_context.hpp.

◆ legacySeed()

std::uint64_t nk::ops::RngContext::legacySeed ( ) const
inlinenoexcept

rand('seed') / randn('seed') — query the last legacy seed.

Definition at line 70 of file rng_context.hpp.

◆ legacyV4()

bool nk::ops::RngContext::legacyV4 ( ) const
inlinenoexcept

Definition at line 71 of file rng_context.hpp.

◆ max()

constexpr result_type nk::ops::RngContext::max ( )
inlinestaticconstexpr

Definition at line 35 of file rng_context.hpp.

◆ min()

constexpr result_type nk::ops::RngContext::min ( )
inlinestaticconstexpr

Definition at line 34 of file rng_context.hpp.

◆ operator()()

result_type nk::ops::RngContext::operator() ( )
inline

Definition at line 36 of file rng_context.hpp.

◆ seed()

void nk::ops::RngContext::seed ( std::uint64_t seed)
inline

Seed the stream. seed == 0 ≡ rng('default').

Definition at line 43 of file rng_context.hpp.

◆ setLegacyV4()

void nk::ops::RngContext::setLegacyV4 ( std::uint64_t seed)
inline

Definition at line 63 of file rng_context.hpp.

◆ v4Normal()

double nk::ops::RngContext::v4Normal ( )
inline

Definition at line 77 of file rng_context.hpp.

◆ v4Uniform()

double nk::ops::RngContext::v4Uniform ( )
inline

Definition at line 72 of file rng_context.hpp.


The documentation for this class was generated from the following file: