Template Class PhiloxT

Class Documentation

template<class W>
class PhiloxT

Philox4xW-10, the counter-based UniformRandomBitGenerator of words of W bits (32 or 64) of Salmon, Moraes, Dror and Shaw, with the sequence of std::philox4x32 and std::philox4x64 of C++26.

Public Types

using result_type = W
using Block = std::array<W, 4>

a counter, or its 4 outputs

using Key = std::array<W, 2>

a key

Public Functions

explicit constexpr PhiloxT(W seed = default_seed)

the key ( seed , 0 ) and the counter 0

constexpr W operator()(void)
constexpr void discard(unsigned long long z)

advances by z outputs, in O( 1 ) blocks

constexpr void setCounter(const Block &c)

the counter of the next output, which will be the first word of its block

bool operator==(const PhiloxT&) const = default

Public Static Functions

static constexpr Block block(Block c, Key k)

the block of the counter c under the key k: 10 rounds of the products of 2W bits by the multipliers, with the key bumped by the Weyl constants between the rounds

static inline constexpr W min(void)
static inline constexpr W max(void)

Public Static Attributes

static constexpr W default_seed = 20111115u