hops
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin > Class Template Reference

#include <pcg_random.hpp>

Inheritance diagram for pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin >:
Inheritance graph
Collaboration diagram for pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin >:
Collaboration graph

Classes

struct  can_specify_stream_tag
 
struct  no_specifiable_stream_tag
 

Public Types

typedef xtype result_type
 
typedef itype state_type
 
- Public Types inherited from pcg_detail::oneseq_stream< itype >
typedef itype state_type
 

Public Member Functions

result_type operator() ()
 
result_type operator() (result_type upper_bound)
 
void advance (itype delta)
 
void backstep (itype delta)
 
void discard (itype delta)
 
bool wrapped ()
 
 engine (itype state=itype(0xcafef00dd15ea5e5ULL))
 
template<typename sm = stream_mixin>
 engine (itype state, typename sm::stream_state stream_seed)
 
template<typename SeedSeq >
 engine (SeedSeq &&seedSeq, typename std::enable_if< !stream_mixin::can_specify_stream &&!std::is_convertible< SeedSeq, itype >::value &&!std::is_convertible< SeedSeq, engine >::value, no_specifiable_stream_tag >::type={})
 
template<typename SeedSeq >
 engine (SeedSeq &&seedSeq, typename std::enable_if< stream_mixin::can_specify_stream &&!std::is_convertible< SeedSeq, itype >::value &&!std::is_convertible< SeedSeq, engine >::value, can_specify_stream_tag >::type={})
 
template<typename... Args>
void seed (Args &&... args)
 

Static Public Member Functions

static constexpr size_t period_pow2 ()
 
static constexpr result_type min ()
 
static constexpr result_type max ()
 
- Static Public Member Functions inherited from pcg_detail::oneseq_stream< itype >
static constexpr itype stream ()
 
static constexpr size_t streams_pow2 ()
 

Protected Member Functions

itype bump (itype state)
 
itype base_generate ()
 
itype base_generate0 ()
 
itype distance (itype newstate, itype mask=itype(~itype(0U))) const
 
- Protected Member Functions inherited from pcg_detail::oneseq_stream< itype >
void set_stream (...)
 
constexpr oneseq_stream ()=default
 

Static Protected Member Functions

static itype advance (itype state, itype delta, itype cur_mult, itype cur_plus)
 
static itype distance (itype cur_state, itype newstate, itype cur_mult, itype cur_plus, itype mask=~itype(0U))
 

Protected Attributes

itype state_
 

Friends

template<typename xtype1 , typename itype1 , typename output_mixin1 , bool output_previous1, typename stream_mixin_lhs , typename multiplier_mixin_lhs , typename stream_mixin_rhs , typename multiplier_mixin_rhs >
bool operator== (const engine< xtype1, itype1, output_mixin1, output_previous1, stream_mixin_lhs, multiplier_mixin_lhs > &, const engine< xtype1, itype1, output_mixin1, output_previous1, stream_mixin_rhs, multiplier_mixin_rhs > &)
 
template<typename xtype1 , typename itype1 , typename output_mixin1 , bool output_previous1, typename stream_mixin_lhs , typename multiplier_mixin_lhs , typename stream_mixin_rhs , typename multiplier_mixin_rhs >
itype1 operator- (const engine< xtype1, itype1, output_mixin1, output_previous1, stream_mixin_lhs, multiplier_mixin_lhs > &, const engine< xtype1, itype1, output_mixin1, output_previous1, stream_mixin_rhs, multiplier_mixin_rhs > &)
 
template<typename CharT , typename Traits , typename xtype1 , typename itype1 , typename output_mixin1 , bool output_previous1, typename stream_mixin1 , typename multiplier_mixin1 >
std::basic_ostream< CharT, Traits > & operator<< (std::basic_ostream< CharT, Traits > &out, const engine< xtype1, itype1, output_mixin1, output_previous1, stream_mixin1, multiplier_mixin1 > &)
 
template<typename CharT , typename Traits , typename xtype1 , typename itype1 , typename output_mixin1 , bool output_previous1, typename stream_mixin1 , typename multiplier_mixin1 >
std::basic_istream< CharT, Traits > & operator>> (std::basic_istream< CharT, Traits > &in, engine< xtype1, itype1, output_mixin1, output_previous1, stream_mixin1, multiplier_mixin1 > &rng)
 

Additional Inherited Members

- Static Public Attributes inherited from pcg_detail::oneseq_stream< itype >
static constexpr bool can_specify_stream = false
 
- Static Protected Attributes inherited from pcg_detail::oneseq_stream< itype >
static constexpr bool is_mcg = false
 

Member Typedef Documentation

◆ result_type

template<typename xtype , typename itype , typename output_mixin , bool output_previous = true, typename stream_mixin = oneseq_stream<itype>, typename multiplier_mixin = default_multiplier<itype>>
typedef xtype pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin >::result_type

◆ state_type

template<typename xtype , typename itype , typename output_mixin , bool output_previous = true, typename stream_mixin = oneseq_stream<itype>, typename multiplier_mixin = default_multiplier<itype>>
typedef itype pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin >::state_type

Constructor & Destructor Documentation

◆ engine() [1/4]

template<typename xtype , typename itype , typename output_mixin , bool output_previous = true, typename stream_mixin = oneseq_stream<itype>, typename multiplier_mixin = default_multiplier<itype>>
pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin >::engine ( itype  state = itype(0xcafef00dd15ea5e5ULL))
inline

◆ engine() [2/4]

template<typename xtype , typename itype , typename output_mixin , bool output_previous = true, typename stream_mixin = oneseq_stream<itype>, typename multiplier_mixin = default_multiplier<itype>>
template<typename sm = stream_mixin>
pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin >::engine ( itype  state,
typename sm::stream_state  stream_seed 
)
inline

◆ engine() [3/4]

template<typename xtype , typename itype , typename output_mixin , bool output_previous = true, typename stream_mixin = oneseq_stream<itype>, typename multiplier_mixin = default_multiplier<itype>>
template<typename SeedSeq >
pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin >::engine ( SeedSeq &&  seedSeq,
typename std::enable_if< !stream_mixin::can_specify_stream &&!std::is_convertible< SeedSeq, itype >::value &&!std::is_convertible< SeedSeq, engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin > >::value, no_specifiable_stream_tag >::type  = {} 
)
inline

◆ engine() [4/4]

template<typename xtype , typename itype , typename output_mixin , bool output_previous = true, typename stream_mixin = oneseq_stream<itype>, typename multiplier_mixin = default_multiplier<itype>>
template<typename SeedSeq >
pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin >::engine ( SeedSeq &&  seedSeq,
typename std::enable_if< stream_mixin::can_specify_stream &&!std::is_convertible< SeedSeq, itype >::value &&!std::is_convertible< SeedSeq, engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin > >::value, can_specify_stream_tag >::type  = {} 
)
inline

Member Function Documentation

◆ advance() [1/2]

template<typename xtype , typename itype , typename output_mixin , bool output_previous = true, typename stream_mixin = oneseq_stream<itype>, typename multiplier_mixin = default_multiplier<itype>>
void pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin >::advance ( itype  delta)
inline

◆ advance() [2/2]

template<typename xtype , typename itype , typename output_mixin , bool output_previous, typename stream_mixin , typename multiplier_mixin >
itype pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin >::advance ( itype  state,
itype  delta,
itype  cur_mult,
itype  cur_plus 
)
staticprotected

◆ backstep()

template<typename xtype , typename itype , typename output_mixin , bool output_previous = true, typename stream_mixin = oneseq_stream<itype>, typename multiplier_mixin = default_multiplier<itype>>
void pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin >::backstep ( itype  delta)
inline

◆ base_generate()

template<typename xtype , typename itype , typename output_mixin , bool output_previous = true, typename stream_mixin = oneseq_stream<itype>, typename multiplier_mixin = default_multiplier<itype>>
itype pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin >::base_generate ( )
inlineprotected

◆ base_generate0()

template<typename xtype , typename itype , typename output_mixin , bool output_previous = true, typename stream_mixin = oneseq_stream<itype>, typename multiplier_mixin = default_multiplier<itype>>
itype pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin >::base_generate0 ( )
inlineprotected

◆ bump()

template<typename xtype , typename itype , typename output_mixin , bool output_previous = true, typename stream_mixin = oneseq_stream<itype>, typename multiplier_mixin = default_multiplier<itype>>
itype pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin >::bump ( itype  state)
inlineprotected

◆ discard()

template<typename xtype , typename itype , typename output_mixin , bool output_previous = true, typename stream_mixin = oneseq_stream<itype>, typename multiplier_mixin = default_multiplier<itype>>
void pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin >::discard ( itype  delta)
inline

◆ distance() [1/2]

template<typename xtype , typename itype , typename output_mixin , bool output_previous, typename stream_mixin , typename multiplier_mixin >
itype pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin >::distance ( itype  cur_state,
itype  newstate,
itype  cur_mult,
itype  cur_plus,
itype  mask = ~itype(0U) 
)
staticprotected

◆ distance() [2/2]

template<typename xtype , typename itype , typename output_mixin , bool output_previous = true, typename stream_mixin = oneseq_stream<itype>, typename multiplier_mixin = default_multiplier<itype>>
itype pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin >::distance ( itype  newstate,
itype  mask = itype(~itype(0U)) 
) const
inlineprotected

◆ max()

template<typename xtype , typename itype , typename output_mixin , bool output_previous = true, typename stream_mixin = oneseq_stream<itype>, typename multiplier_mixin = default_multiplier<itype>>
static constexpr result_type pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin >::max ( )
inlinestaticconstexpr

◆ min()

template<typename xtype , typename itype , typename output_mixin , bool output_previous = true, typename stream_mixin = oneseq_stream<itype>, typename multiplier_mixin = default_multiplier<itype>>
static constexpr result_type pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin >::min ( )
inlinestaticconstexpr

◆ operator()() [1/2]

template<typename xtype , typename itype , typename output_mixin , bool output_previous = true, typename stream_mixin = oneseq_stream<itype>, typename multiplier_mixin = default_multiplier<itype>>
result_type pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin >::operator() ( )
inline

◆ operator()() [2/2]

template<typename xtype , typename itype , typename output_mixin , bool output_previous = true, typename stream_mixin = oneseq_stream<itype>, typename multiplier_mixin = default_multiplier<itype>>
result_type pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin >::operator() ( result_type  upper_bound)
inline

◆ period_pow2()

template<typename xtype , typename itype , typename output_mixin , bool output_previous = true, typename stream_mixin = oneseq_stream<itype>, typename multiplier_mixin = default_multiplier<itype>>
static constexpr size_t pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin >::period_pow2 ( )
inlinestaticconstexpr

◆ seed()

template<typename xtype , typename itype , typename output_mixin , bool output_previous = true, typename stream_mixin = oneseq_stream<itype>, typename multiplier_mixin = default_multiplier<itype>>
template<typename... Args>
void pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin >::seed ( Args &&...  args)
inline

◆ wrapped()

template<typename xtype , typename itype , typename output_mixin , bool output_previous = true, typename stream_mixin = oneseq_stream<itype>, typename multiplier_mixin = default_multiplier<itype>>
bool pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin >::wrapped ( )
inline

Friends And Related Function Documentation

◆ operator-

template<typename xtype , typename itype , typename output_mixin , bool output_previous = true, typename stream_mixin = oneseq_stream<itype>, typename multiplier_mixin = default_multiplier<itype>>
template<typename xtype1 , typename itype1 , typename output_mixin1 , bool output_previous1, typename stream_mixin_lhs , typename multiplier_mixin_lhs , typename stream_mixin_rhs , typename multiplier_mixin_rhs >
itype1 operator- ( const engine< xtype1, itype1, output_mixin1, output_previous1, stream_mixin_lhs, multiplier_mixin_lhs > &  ,
const engine< xtype1, itype1, output_mixin1, output_previous1, stream_mixin_rhs, multiplier_mixin_rhs > &   
)
friend

◆ operator<<

template<typename xtype , typename itype , typename output_mixin , bool output_previous = true, typename stream_mixin = oneseq_stream<itype>, typename multiplier_mixin = default_multiplier<itype>>
template<typename CharT , typename Traits , typename xtype1 , typename itype1 , typename output_mixin1 , bool output_previous1, typename stream_mixin1 , typename multiplier_mixin1 >
std::basic_ostream<CharT,Traits>& operator<< ( std::basic_ostream< CharT, Traits > &  out,
const engine< xtype1, itype1, output_mixin1, output_previous1, stream_mixin1, multiplier_mixin1 > &   
)
friend

◆ operator==

template<typename xtype , typename itype , typename output_mixin , bool output_previous = true, typename stream_mixin = oneseq_stream<itype>, typename multiplier_mixin = default_multiplier<itype>>
template<typename xtype1 , typename itype1 , typename output_mixin1 , bool output_previous1, typename stream_mixin_lhs , typename multiplier_mixin_lhs , typename stream_mixin_rhs , typename multiplier_mixin_rhs >
bool operator== ( const engine< xtype1, itype1, output_mixin1, output_previous1, stream_mixin_lhs, multiplier_mixin_lhs > &  ,
const engine< xtype1, itype1, output_mixin1, output_previous1, stream_mixin_rhs, multiplier_mixin_rhs > &   
)
friend

◆ operator>>

template<typename xtype , typename itype , typename output_mixin , bool output_previous = true, typename stream_mixin = oneseq_stream<itype>, typename multiplier_mixin = default_multiplier<itype>>
template<typename CharT , typename Traits , typename xtype1 , typename itype1 , typename output_mixin1 , bool output_previous1, typename stream_mixin1 , typename multiplier_mixin1 >
std::basic_istream<CharT,Traits>& operator>> ( std::basic_istream< CharT, Traits > &  in,
engine< xtype1, itype1, output_mixin1, output_previous1, stream_mixin1, multiplier_mixin1 > &  rng 
)
friend

Member Data Documentation

◆ state_

template<typename xtype , typename itype , typename output_mixin , bool output_previous = true, typename stream_mixin = oneseq_stream<itype>, typename multiplier_mixin = default_multiplier<itype>>
itype pcg_detail::engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin >::state_
protected

The documentation for this class was generated from the following file: