Skip to content

tenzr::random::PRNGKey

Functional pseudo-random key formed by two 32-bit words.

#include <prng_key.h>

Public Functions

Name
PRNGKey() =default
PRNGKey(uint64_t seed_val)
PRNGKey(uint32_t k0_val, uint32_t k1_val)
PRNGKey(const Array & arr)
Array ToArray() const
uint64_t ToU64() const
bool operator==(const PRNGKey & other) const
bool operator!=(const PRNGKey & other) const

Public Attributes

Name
uint32_t k0
uint32_t k1

Public Functions Documentation

function PRNGKey

PRNGKey() =default

function PRNGKey

inline explicit PRNGKey(
    uint64_t seed_val
)

function PRNGKey

inline PRNGKey(
    uint32_t k0_val,
    uint32_t k1_val
)

function PRNGKey

explicit PRNGKey(
    const Array & arr
)

Parameters:

  • arr Array whose first two elements supply k0 and k1.

Construct a key from a two-element integer array.

function ToArray

Array ToArray() const

Return:

  • The key as a length-2 UInt32 array.
  • Array holding {k0, k1}.

Export the key as a uint32[2] array.

function ToU64

inline uint64_t ToU64() const

Return: The key packed into a single 64-bit integer.

function operator==

inline bool operator==(
    const PRNGKey & other
) const

function operator!=

inline bool operator!=(
    const PRNGKey & other
) const

Public Attributes Documentation

variable k0

uint32_t k0 {0};

variable k1

uint32_t k1 {0};