vSMC
vSMC: Scalable Monte Carlo
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
vsmc::CounterEngine< Generator > Class Template Reference

Counter based RNG engine. More...

#include <vsmc/rng/counter.hpp>

Public Types

using ctr_type = typename Generator::ctr_type
 
using key_type = typename Generator::key_type
 
using result_type = typename Generator::result_type
 

Public Member Functions

 CounterEngine (result_type s=0)
 
template<typename SeedSeq >
 CounterEngine (SeedSeq &seq, typename std::enable_if< internal::is_seed_seq< SeedSeq, result_type, key_type, CounterEngine< Generator >>::value >::type *=nullptr)
 
 CounterEngine (const key_type &k)
 
const ctr_typectr () const
 
void ctr (const ctr_type &c)
 
void discard (result_type nskip)
 
const key_typekey () const
 
void key (const key_type &k)
 
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, result_type, key_type >::value >::type *=nullptr)
 
void seed (const key_type &k)
 

Static Public Member Functions

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

Friends

bool operator!= (const CounterEngine< Generator > &eng1, const CounterEngine< Generator > &eng2)
 
template<typename CharT , typename Traits >
std::basic_ostream< CharT, Traits > & operator<< (std::basic_ostream< CharT, Traits > &os, const CounterEngine< Generator > &eng)
 
bool operator== (const CounterEngine< Generator > &eng1, const CounterEngine< Generator > &eng2)
 
template<typename CharT , typename Traits >
std::basic_istream< CharT, Traits > & operator>> (std::basic_istream< CharT, Traits > &is, CounterEngine< Generator > &eng)
 

Detailed Description

template<typename Generator>
class vsmc::CounterEngine< Generator >

Counter based RNG engine.

Definition at line 290 of file counter.hpp.

Member Typedef Documentation

template<typename Generator>
using vsmc::CounterEngine< Generator >::ctr_type = typename Generator::ctr_type

Definition at line 294 of file counter.hpp.

template<typename Generator>
using vsmc::CounterEngine< Generator >::key_type = typename Generator::key_type

Definition at line 295 of file counter.hpp.

template<typename Generator>
using vsmc::CounterEngine< Generator >::result_type = typename Generator::result_type

Definition at line 293 of file counter.hpp.

Constructor & Destructor Documentation

template<typename Generator>
vsmc::CounterEngine< Generator >::CounterEngine ( result_type  s = 0)
inlineexplicit

Definition at line 297 of file counter.hpp.

template<typename Generator>
template<typename SeedSeq >
vsmc::CounterEngine< Generator >::CounterEngine ( SeedSeq &  seq,
typename std::enable_if< internal::is_seed_seq< SeedSeq, result_type, key_type, CounterEngine< Generator >>::value >::type *  = nullptr 
)
inlineexplicit

Definition at line 300 of file counter.hpp.

template<typename Generator>
vsmc::CounterEngine< Generator >::CounterEngine ( const key_type k)
inlineexplicit

Definition at line 308 of file counter.hpp.

Member Function Documentation

template<typename Generator>
const ctr_type& vsmc::CounterEngine< Generator >::ctr ( ) const
inline

Definition at line 332 of file counter.hpp.

template<typename Generator>
void vsmc::CounterEngine< Generator >::ctr ( const ctr_type c)
inline

Definition at line 336 of file counter.hpp.

template<typename Generator>
void vsmc::CounterEngine< Generator >::discard ( result_type  nskip)
inline

Definition at line 392 of file counter.hpp.

template<typename Generator>
const key_type& vsmc::CounterEngine< Generator >::key ( ) const
inline

Definition at line 334 of file counter.hpp.

template<typename Generator>
void vsmc::CounterEngine< Generator >::key ( const key_type k)
inline

Definition at line 342 of file counter.hpp.

template<typename Generator>
static constexpr result_type vsmc::CounterEngine< Generator >::max ( )
inlinestatic

Definition at line 419 of file counter.hpp.

template<typename Generator>
static constexpr result_type vsmc::CounterEngine< Generator >::min ( )
inlinestatic

Definition at line 414 of file counter.hpp.

template<typename Generator>
result_type vsmc::CounterEngine< Generator >::operator() ( )
inline

Definition at line 348 of file counter.hpp.

template<typename Generator>
void vsmc::CounterEngine< Generator >::operator() ( std::size_t  n,
result_type r 
)
inline

Definition at line 358 of file counter.hpp.

template<typename Generator>
void vsmc::CounterEngine< Generator >::seed ( result_type  s)
inline

Definition at line 310 of file counter.hpp.

template<typename Generator>
template<typename SeedSeq >
void vsmc::CounterEngine< Generator >::seed ( SeedSeq &  seq,
typename std::enable_if< internal::is_seed_seq< SeedSeq, result_type, key_type >::value >::type *  = nullptr 
)
inline

Definition at line 318 of file counter.hpp.

template<typename Generator>
void vsmc::CounterEngine< Generator >::seed ( const key_type k)
inline

Definition at line 326 of file counter.hpp.

Friends And Related Function Documentation

template<typename Generator>
bool operator!= ( const CounterEngine< Generator > &  eng1,
const CounterEngine< Generator > &  eng2 
)
friend

Definition at line 438 of file counter.hpp.

template<typename Generator>
template<typename CharT , typename Traits >
std::basic_ostream<CharT, Traits>& operator<< ( std::basic_ostream< CharT, Traits > &  os,
const CounterEngine< Generator > &  eng 
)
friend

Definition at line 445 of file counter.hpp.

template<typename Generator>
bool operator== ( const CounterEngine< Generator > &  eng1,
const CounterEngine< Generator > &  eng2 
)
friend

Definition at line 424 of file counter.hpp.

template<typename Generator>
template<typename CharT , typename Traits >
std::basic_istream<CharT, Traits>& operator>> ( std::basic_istream< CharT, Traits > &  is,
CounterEngine< Generator > &  eng 
)
friend

Definition at line 461 of file counter.hpp.