vSMC  v3.0.0
Scalable Monte Carlo
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
vsmc::MKLEngine< BRNG, Bits > Class Template Reference

MKL RNG C++11 engine. More...

#include <vsmc/rng/internal/common.hpp>

Public Types

using result_type = internal::MKLResultType< Bits >
 

Public Member Functions

 MKLEngine (result_type s=1)
 
template<typename SeedSeq >
 MKLEngine (SeedSeq &seq, typename std::enable_if< internal::is_seed_seq< SeedSeq, MKL_INT, result_type, MKLEngine< BRNG, Bits >>::value >::type *=nullptr)
 
 MKLEngine (MKL_INT offset, result_type s)
 
template<typename SeedSeq >
 MKLEngine (MKL_INT offset, SeedSeq &seq, typename std::enable_if< internal::is_seed_seq< SeedSeq, MKL_INT, MKL_UINT, MKLEngine< BRNG, Bits >>::value >::type *=nullptr)
 
std::size_t discard ()
 Discard the buffer. More...
 
void discard (long long nskip)
 
result_type operator() ()
 
void operator() (std::size_t n, result_type *r)
 
void seed (result_type s)
 
template<typename SeedSeq >
void seed (SeedSeq &seq, typename std::enable_if< internal::is_seed_seq< SeedSeq, MKL_INT, result_type >::value >::type *=nullptr)
 
void seed (MKL_INT offset, result_type s)
 
template<typename SeedSeq >
void seed (MKL_INT offset, SeedSeq &seq, typename std::enable_if< internal::is_seed_seq< SeedSeq, MKL_UINT >::value >::type *=nullptr)
 
MKLStreamstream ()
 
const MKLStreamstream () const
 

Static Public Member Functions

static constexpr result_type max ()
 
static constexpr result_type min ()
 

Friends

bool operator!= (const MKLEngine< BRNG, Bits > &eng1, const MKLEngine< BRNG, Bits > &eng2)
 eng1 != eng2 is a necessary condition for subsequent call of operator() output different results. But it is not a sufficient condition. More...
 
template<typename CharT , typename Traits >
std::basic_ostream< CharT, Traits > & operator<< (std::basic_ostream< CharT, Traits > &os, const MKLEngine< BRNG, Bits > &eng)
 
bool operator== (const MKLEngine< BRNG, Bits > &eng1, const MKLEngine< BRNG, Bits > &eng2)
 eng1 == eng2 is a sufficent condition for subsequent call of operator() output the same results. But it is not a necessary condition. More...
 
template<typename CharT , typename Traits >
std::basic_istream< CharT, Traits > & operator>> (std::basic_istream< CharT, Traits > &is, MKLEngine< BRNG, Bits > &eng)
 

Detailed Description

template<MKL_INT BRNG, int Bits>
class vsmc::MKLEngine< BRNG, Bits >

MKL RNG C++11 engine.

Template Parameters
BRNGA MKL BRNG. It need to support either viRngUniformBits32 or viRngUniformBits64.
BitsThe number of bits in the output unsigned integer
  • It can be 32 if and only if viRngUniformBits32 is supported
  • It can be 64 if and only if viRngUniformBits64 is supported

Definition at line 1308 of file rng/internal/common.hpp.

Member Typedef Documentation

template<MKL_INT BRNG, int Bits>
using vsmc::MKLEngine< BRNG, Bits >::result_type = internal::MKLResultType<Bits>

Definition at line 797 of file mkl.hpp.

Constructor & Destructor Documentation

template<MKL_INT BRNG, int Bits>
vsmc::MKLEngine< BRNG, Bits >::MKLEngine ( result_type  s = 1)
inlineexplicit

Definition at line 799 of file mkl.hpp.

template<MKL_INT BRNG, int Bits>
template<typename SeedSeq >
vsmc::MKLEngine< BRNG, Bits >::MKLEngine ( SeedSeq &  seq,
typename std::enable_if< internal::is_seed_seq< SeedSeq, MKL_INT, result_type, MKLEngine< BRNG, Bits >>::value >::type *  = nullptr 
)
inlineexplicit

Definition at line 802 of file mkl.hpp.

template<MKL_INT BRNG, int Bits>
vsmc::MKLEngine< BRNG, Bits >::MKLEngine ( MKL_INT  offset,
result_type  s 
)
inline

Definition at line 810 of file mkl.hpp.

template<MKL_INT BRNG, int Bits>
template<typename SeedSeq >
vsmc::MKLEngine< BRNG, Bits >::MKLEngine ( MKL_INT  offset,
SeedSeq &  seq,
typename std::enable_if< internal::is_seed_seq< SeedSeq, MKL_INT, MKL_UINT, MKLEngine< BRNG, Bits >>::value >::type *  = nullptr 
)
inlineexplicit

Definition at line 819 of file mkl.hpp.

Member Function Documentation

template<MKL_INT BRNG, int Bits>
std::size_t vsmc::MKLEngine< BRNG, Bits >::discard ( )
inline

Discard the buffer.

Definition at line 915 of file mkl.hpp.

template<MKL_INT BRNG, int Bits>
void vsmc::MKLEngine< BRNG, Bits >::discard ( long long  nskip)
inline

Definition at line 923 of file mkl.hpp.

template<MKL_INT BRNG, int Bits>
static constexpr result_type vsmc::MKLEngine< BRNG, Bits >::max ( )
inlinestatic

Definition at line 973 of file mkl.hpp.

template<MKL_INT BRNG, int Bits>
static constexpr result_type vsmc::MKLEngine< BRNG, Bits >::min ( )
inlinestatic

Definition at line 968 of file mkl.hpp.

template<MKL_INT BRNG, int Bits>
result_type vsmc::MKLEngine< BRNG, Bits >::operator() ( )
inline

Definition at line 876 of file mkl.hpp.

template<MKL_INT BRNG, int Bits>
void vsmc::MKLEngine< BRNG, Bits >::operator() ( std::size_t  n,
result_type r 
)
inline

Definition at line 886 of file mkl.hpp.

template<MKL_INT BRNG, int Bits>
void vsmc::MKLEngine< BRNG, Bits >::seed ( result_type  s)
inline

Definition at line 830 of file mkl.hpp.

template<MKL_INT BRNG, int Bits>
template<typename SeedSeq >
void vsmc::MKLEngine< BRNG, Bits >::seed ( SeedSeq &  seq,
typename std::enable_if< internal::is_seed_seq< SeedSeq, MKL_INT, result_type >::value >::type *  = nullptr 
)
inline

Definition at line 839 of file mkl.hpp.

template<MKL_INT BRNG, int Bits>
void vsmc::MKLEngine< BRNG, Bits >::seed ( MKL_INT  offset,
result_type  s 
)
inline

Definition at line 850 of file mkl.hpp.

template<MKL_INT BRNG, int Bits>
template<typename SeedSeq >
void vsmc::MKLEngine< BRNG, Bits >::seed ( MKL_INT  offset,
SeedSeq &  seq,
typename std::enable_if< internal::is_seed_seq< SeedSeq, MKL_UINT >::value >::type *  = nullptr 
)
inline

Definition at line 862 of file mkl.hpp.

template<MKL_INT BRNG, int Bits>
MKLStream& vsmc::MKLEngine< BRNG, Bits >::stream ( )
inline

Definition at line 978 of file mkl.hpp.

template<MKL_INT BRNG, int Bits>
const MKLStream& vsmc::MKLEngine< BRNG, Bits >::stream ( ) const
inline

Definition at line 979 of file mkl.hpp.

Friends And Related Function Documentation

template<MKL_INT BRNG, int Bits>
bool operator!= ( const MKLEngine< BRNG, Bits > &  eng1,
const MKLEngine< BRNG, Bits > &  eng2 
)
friend

eng1 != eng2 is a necessary condition for subsequent call of operator() output different results. But it is not a sufficient condition.

Definition at line 999 of file mkl.hpp.

template<MKL_INT BRNG, int Bits>
template<typename CharT , typename Traits >
std::basic_ostream<CharT, Traits>& operator<< ( std::basic_ostream< CharT, Traits > &  os,
const MKLEngine< BRNG, Bits > &  eng 
)
friend

Definition at line 1006 of file mkl.hpp.

template<MKL_INT BRNG, int Bits>
bool operator== ( const MKLEngine< BRNG, Bits > &  eng1,
const MKLEngine< BRNG, Bits > &  eng2 
)
friend

eng1 == eng2 is a sufficent condition for subsequent call of operator() output the same results. But it is not a necessary condition.

Definition at line 984 of file mkl.hpp.

template<MKL_INT BRNG, int Bits>
template<typename CharT , typename Traits >
std::basic_istream<CharT, Traits>& operator>> ( std::basic_istream< CharT, Traits > &  is,
MKLEngine< BRNG, Bits > &  eng 
)
friend

Definition at line 1021 of file mkl.hpp.