vSMC  v3.0.0
Scalable Monte Carlo
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
vsmc::PhiloxGenerator< T, K, Rounds, Constants > Class Template Reference

Philox RNG generator. More...

#include <vsmc/rng/philox.hpp>

Public Types

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

Public Member Functions

template<typename ResultType >
void operator() (ctr_type &ctr, std::array< ResultType, size()/sizeof(ResultType)> &buffer) const
 
template<typename ResultType >
void operator() (ctr_type &ctr, std::size_t n, std::array< ResultType, size()/sizeof(ResultType)> *buffer) 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 > &gen1, const PhiloxGenerator< T, K, Rounds > &gen2)
 
template<typename CharT , typename Traits >
std::basic_ostream< CharT, Traits > & operator<< (std::basic_ostream< CharT, Traits > &os, const PhiloxGenerator< T, K, Rounds > &gen)
 
bool operator== (const PhiloxGenerator< T, K, Rounds > &gen1, const PhiloxGenerator< T, K, Rounds > &gen2)
 
template<typename CharT , typename Traits >
std::basic_istream< CharT, Traits > & operator>> (std::basic_istream< CharT, Traits > &is, PhiloxGenerator< T, K, Rounds > &gen)
 

Detailed Description

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

Philox RNG generator.

Template Parameters
TState type, must be 32- or 64-bit unsigned integers
KState vector length, must be 2 or 4 (for 32- or 64-bit states)
RoundsNumber of SP rounds
ConstantsA trait class that defines algorithm constants, see PhiloxConstants

This generator implement the Philox algorithm in Random123, developed John K. Salmon, Mark A. Moraes, Ron O. Dror, and David E. Shaw.

Definition at line 402 of file philox.hpp.

Member Typedef Documentation

template<typename T, std::size_t K = 4, std::size_t Rounds = 10, typename Constants = PhiloxConstants<T, K>>
using vsmc::PhiloxGenerator< T, K, Rounds, Constants >::ctr_type = std::array<T, K>

Definition at line 414 of file philox.hpp.

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

Definition at line 415 of file philox.hpp.

Member Function Documentation

template<typename T, std::size_t K = 4, std::size_t Rounds = 10, typename Constants = PhiloxConstants<T, K>>
template<typename ResultType >
void vsmc::PhiloxGenerator< T, K, Rounds, Constants >::operator() ( ctr_type ctr,
std::array< ResultType, size()/sizeof(ResultType)> &  buffer 
) const
inline

Definition at line 422 of file philox.hpp.

template<typename T, std::size_t K = 4, std::size_t Rounds = 10, typename Constants = PhiloxConstants<T, K>>
template<typename ResultType >
void vsmc::PhiloxGenerator< T, K, Rounds, Constants >::operator() ( ctr_type ctr,
std::size_t  n,
std::array< ResultType, size()/sizeof(ResultType)> *  buffer 
) const
inline

Definition at line 441 of file philox.hpp.

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

Definition at line 419 of file philox.hpp.

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

Definition at line 417 of file philox.hpp.

Friends And Related Function Documentation

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

Definition at line 467 of file philox.hpp.

template<typename T, std::size_t K = 4, 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 > &  gen 
)
friend

Definition at line 474 of file philox.hpp.

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

Definition at line 461 of file philox.hpp.

template<typename T, std::size_t K = 4, 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 > &  gen 
)
friend

Definition at line 487 of file philox.hpp.