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

Threefry RNG generator. More...

#include <vsmc/rng/threefry.hpp>

Public Types

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

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 ThreefryGenerator< T, K, Rounds > &gen1, const ThreefryGenerator< T, K, Rounds > &gen2)
 
template<typename CharT , typename Traits >
std::basic_ostream< CharT, Traits > & operator<< (std::basic_ostream< CharT, Traits > &os, const ThreefryGenerator< T, K, Rounds > &gen)
 
bool operator== (const ThreefryGenerator< T, K, Rounds > &gen1, const ThreefryGenerator< T, K, Rounds > &gen2)
 
template<typename CharT , typename Traits >
std::basic_istream< CharT, Traits > & operator>> (std::basic_istream< CharT, Traits > &is, ThreefryGenerator< T, K, Rounds > &gen)
 

Detailed Description

template<typename T, std::size_t K = 4, std::size_t Rounds = 20, typename Constants = ThreefryConstants<T, K>>
class vsmc::ThreefryGenerator< T, K, Rounds, Constants >

Threefry 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) or 8 or 16 (64-bit state)
RoundsNumber of SP rounds
ConstantsA trait class that defines algorithm constants, see ThreefryConstants

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

Definition at line 454 of file threefry.hpp.

Member Typedef Documentation

template<typename T, std::size_t K = 4, std::size_t Rounds = 20, typename Constants = ThreefryConstants<T, K>>
using vsmc::ThreefryGenerator< T, K, Rounds, Constants >::ctr_type = std::array<T, K>

Definition at line 466 of file threefry.hpp.

template<typename T, std::size_t K = 4, std::size_t Rounds = 20, typename Constants = ThreefryConstants<T, K>>
using vsmc::ThreefryGenerator< T, K, Rounds, Constants >::key_type = std::array<T, K>

Definition at line 467 of file threefry.hpp.

Member Function Documentation

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

Definition at line 480 of file threefry.hpp.

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

Definition at line 496 of file threefry.hpp.

template<typename T, std::size_t K = 4, std::size_t Rounds = 20, typename Constants = ThreefryConstants<T, K>>
void vsmc::ThreefryGenerator< T, K, Rounds, Constants >::reset ( const key_type key)
inline

Definition at line 471 of file threefry.hpp.

template<typename T, std::size_t K = 4, std::size_t Rounds = 20, typename Constants = ThreefryConstants<T, K>>
static constexpr std::size_t vsmc::ThreefryGenerator< T, K, Rounds, Constants >::size ( )
inlinestatic

Definition at line 469 of file threefry.hpp.

Friends And Related Function Documentation

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

Definition at line 519 of file threefry.hpp.

template<typename T, std::size_t K = 4, std::size_t Rounds = 20, typename Constants = ThreefryConstants<T, K>>
template<typename CharT , typename Traits >
std::basic_ostream<CharT, Traits>& operator<< ( std::basic_ostream< CharT, Traits > &  os,
const ThreefryGenerator< T, K, Rounds > &  gen 
)
friend

Definition at line 526 of file threefry.hpp.

template<typename T, std::size_t K = 4, std::size_t Rounds = 20, typename Constants = ThreefryConstants<T, K>>
bool operator== ( const ThreefryGenerator< T, K, Rounds > &  gen1,
const ThreefryGenerator< T, K, Rounds > &  gen2 
)
friend

Definition at line 513 of file threefry.hpp.

template<typename T, std::size_t K = 4, std::size_t Rounds = 20, typename Constants = ThreefryConstants<T, K>>
template<typename CharT , typename Traits >
std::basic_istream<CharT, Traits>& operator>> ( std::basic_istream< CharT, Traits > &  is,
ThreefryGenerator< T, K, Rounds > &  gen 
)
friend

Definition at line 539 of file threefry.hpp.