MCKL
Monte Carlo Kernel Library
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
mckl::PhiloxGenerator< T, K, Rounds, Constants > Class Template Reference

Philox RNG generator. More...

#include <mckl/random/philox.hpp>

Public Types

using ctr_type = Counter< T, K >
 
using key_type = std::array< T, K/2 >
 

Public Member Functions

key_type key () const
 
void operator() (const void *plain, void *cipher) const
 
template<typename ResultType >
void operator() (ctr_type &ctr, ResultType *r) const
 
template<typename ResultType >
void operator() (ctr_type &ctr, std::size_t n, ResultType *r) const
 
void reset (const key_type &key)
 

Static Public Member Functions

static constexpr std::size_t size ()
 

Friends

bool operator!= (const PhiloxGenerator< T, K, Rounds, Constants > &gen1, const PhiloxGenerator< T, K, Rounds, Constants > &gen2)
 
template<typename CharT , typename Traits >
std::basic_ostream< CharT, Traits > & operator<< (std::basic_ostream< CharT, Traits > &os, const PhiloxGenerator< T, K, Rounds, Constants > &gen)
 
bool operator== (const PhiloxGenerator< T, K, Rounds, Constants > &gen1, const PhiloxGenerator< T, K, Rounds, Constants > &gen2)
 
template<typename CharT , typename Traits >
std::basic_istream< CharT, Traits > & operator>> (std::basic_istream< CharT, Traits > &is, PhiloxGenerator< T, K, Rounds, Constants > &gen)
 

Detailed Description

template<typename T, std::size_t K, std::size_t Rounds = 10, typename Constants = PhiloxConstants<T, K>>
class mckl::PhiloxGenerator< T, K, Rounds, Constants >

Philox RNG generator.

Template Parameters
TState vector value type
KState vector length
RoundsThe number of rounds
ConstantsA trait class that defines algorithm constants

Definition at line 89 of file philox.hpp.

Member Typedef Documentation

◆ ctr_type

template<typename T, std::size_t K, std::size_t Rounds = 10, typename Constants = PhiloxConstants<T, K>>
using mckl::PhiloxGenerator< T, K, Rounds, Constants >::ctr_type = Counter<T, K>

Definition at line 101 of file philox.hpp.

◆ key_type

template<typename T, std::size_t K, std::size_t Rounds = 10, typename Constants = PhiloxConstants<T, K>>
using mckl::PhiloxGenerator< T, K, Rounds, Constants >::key_type = std::array<T, K / 2>

Definition at line 102 of file philox.hpp.

Member Function Documentation

◆ key()

template<typename T, std::size_t K, std::size_t Rounds = 10, typename Constants = PhiloxConstants<T, K>>
key_type mckl::PhiloxGenerator< T, K, Rounds, Constants >::key ( ) const
inline

Definition at line 106 of file philox.hpp.

◆ operator()() [1/3]

template<typename T, std::size_t K, std::size_t Rounds = 10, typename Constants = PhiloxConstants<T, K>>
void mckl::PhiloxGenerator< T, K, Rounds, Constants >::operator() ( const void *  plain,
void *  cipher 
) const
inline

Definition at line 110 of file philox.hpp.

◆ operator()() [2/3]

template<typename T, std::size_t K, std::size_t Rounds = 10, typename Constants = PhiloxConstants<T, K>>
template<typename ResultType >
void mckl::PhiloxGenerator< T, K, Rounds, Constants >::operator() ( ctr_type ctr,
ResultType *  r 
) const
inline

Definition at line 117 of file philox.hpp.

◆ operator()() [3/3]

template<typename T, std::size_t K, std::size_t Rounds = 10, typename Constants = PhiloxConstants<T, K>>
template<typename ResultType >
void mckl::PhiloxGenerator< T, K, Rounds, Constants >::operator() ( ctr_type ctr,
std::size_t  n,
ResultType *  r 
) const
inline

Definition at line 124 of file philox.hpp.

◆ reset()

template<typename T, std::size_t K, std::size_t Rounds = 10, typename Constants = PhiloxConstants<T, K>>
void mckl::PhiloxGenerator< T, K, Rounds, Constants >::reset ( const key_type key)
inline

Definition at line 108 of file philox.hpp.

◆ size()

template<typename T, std::size_t K, std::size_t Rounds = 10, typename Constants = PhiloxConstants<T, K>>
static constexpr std::size_t mckl::PhiloxGenerator< T, K, Rounds, Constants >::size ( )
inlinestatic

Definition at line 104 of file philox.hpp.

Friends And Related Function Documentation

◆ operator!=

template<typename T, std::size_t K, std::size_t Rounds = 10, typename Constants = PhiloxConstants<T, K>>
bool operator!= ( const PhiloxGenerator< T, K, Rounds, Constants > &  gen1,
const PhiloxGenerator< T, K, Rounds, Constants > &  gen2 
)
friend

Definition at line 137 of file philox.hpp.

◆ operator<<

template<typename T, std::size_t K, std::size_t Rounds = 10, typename Constants = PhiloxConstants<T, K>>
template<typename CharT , typename Traits >
std::basic_ostream<CharT, Traits>& operator<< ( std::basic_ostream< CharT, Traits > &  os,
const PhiloxGenerator< T, K, Rounds, Constants > &  gen 
)
friend

Definition at line 145 of file philox.hpp.

◆ operator==

template<typename T, std::size_t K, std::size_t Rounds = 10, typename Constants = PhiloxConstants<T, K>>
bool operator== ( const PhiloxGenerator< T, K, Rounds, Constants > &  gen1,
const PhiloxGenerator< T, K, Rounds, Constants > &  gen2 
)
friend

Definition at line 130 of file philox.hpp.

◆ operator>>

template<typename T, std::size_t K, std::size_t Rounds = 10, typename Constants = PhiloxConstants<T, K>>
template<typename CharT , typename Traits >
std::basic_istream<CharT, Traits>& operator>> ( std::basic_istream< CharT, Traits > &  is,
PhiloxGenerator< T, K, Rounds, Constants > &  gen 
)
friend

Definition at line 159 of file philox.hpp.