hops
Classes | Typedefs | Functions
pcg_extras Namespace Reference

Classes

class  seed_seq_from
 
struct  static_arbitrary_seed
 
class  uint_x4
 

Typedefs

typedef pcg_extras::uint_x4< uint32_t, uint64_t > pcg128_t
 
typedef uint8_t bitcount_t
 

Functions

template<typename CharT , typename Traits >
std::basic_ostream< CharT, Traits > & operator<< (std::basic_ostream< CharT, Traits > &out, pcg128_t value)
 
template<typename CharT , typename Traits >
std::basic_istream< CharT, Traits > & operator>> (std::basic_istream< CharT, Traits > &in, pcg128_t &value)
 
template<typename CharT , typename Traits >
std::basic_ostream< CharT, Traits > & operator<< (std::basic_ostream< CharT, Traits > &out, uint8_t value)
 
template<typename CharT , typename Traits >
std::basic_istream< CharT, Traits > & operator>> (std::basic_istream< CharT, Traits > &in, uint8_t &target)
 
std::ostream & operator<< (std::ostream &out, uint8_t value)
 
std::istream & operator>> (std::istream &in, uint8_t &value)
 
template<typename itype >
itype unxorshift (itype x, bitcount_t bits, bitcount_t shift)
 
template<typename itype >
itype rotl (itype value, bitcount_t rot)
 
template<typename itype >
itype rotr (itype value, bitcount_t rot)
 
template<class SrcIter , class DestIter >
SrcIter uneven_copy_impl (SrcIter src_first, DestIter dest_first, DestIter dest_last, std::true_type)
 
template<class SrcIter , class DestIter >
SrcIter uneven_copy_impl (SrcIter src_first, DestIter dest_first, DestIter dest_last, std::false_type)
 
template<class SrcIter , class DestIter >
SrcIter uneven_copy (SrcIter src_first, DestIter dest_first, DestIter dest_last)
 
template<size_t size, typename SeedSeq , typename DestIter >
void generate_to_impl (SeedSeq &&generator, DestIter dest, std::true_type)
 
template<size_t size, typename SeedSeq , typename DestIter >
void generate_to_impl (SeedSeq &&generator, DestIter dest, std::false_type)
 
template<size_t size, typename SeedSeq , typename DestIter >
void generate_to (SeedSeq &&generator, DestIter dest)
 
template<typename UInt , size_t i = 0UL, size_t N = i+1UL, typename SeedSeq >
UInt generate_one (SeedSeq &&generator)
 
template<typename RngType >
auto bounded_rand (RngType &rng, typename RngType::result_type upper_bound) -> typename RngType::result_type
 
template<typename Iter , typename RandType >
void shuffle (Iter from, Iter to, RandType &&rng)
 
bitcount_t flog2 (uint32_t v)
 
bitcount_t trailingzeros (uint32_t v)
 
bitcount_t flog2 (uint64_t v)
 
bitcount_t trailingzeros (uint64_t v)
 
template<typename UInt >
bitcount_t clog2 (UInt v)
 
template<typename UInt >
UInt addwithcarry (UInt x, UInt y, bool carryin, bool *carryout)
 
template<typename UInt >
UInt subwithcarry (UInt x, UInt y, bool carryin, bool *carryout)
 
template<typename U , typename V >
bitcount_t flog2 (const uint_x4< U, V > &v)
 
template<typename U , typename V >
bitcount_t trailingzeros (const uint_x4< U, V > &v)
 
template<typename UInt , typename UIntX2 >
std::pair< uint_x4< UInt, UIntX2 >, uint_x4< UInt, UIntX2 > > divmod (const uint_x4< UInt, UIntX2 > &orig_dividend, const uint_x4< UInt, UIntX2 > &divisor)
 
template<typename UInt , typename UIntX2 >
uint_x4< UInt, UIntX2 > operator/ (const uint_x4< UInt, UIntX2 > &dividend, const uint_x4< UInt, UIntX2 > &divisor)
 
template<typename UInt , typename UIntX2 >
uint_x4< UInt, UIntX2 > operator% (const uint_x4< UInt, UIntX2 > &dividend, const uint_x4< UInt, UIntX2 > &divisor)
 
template<typename UInt , typename UIntX2 >
uint_x4< UInt, UIntX2 > operator* (const uint_x4< UInt, UIntX2 > &a, const uint_x4< UInt, UIntX2 > &b)
 
template<typename UInt , typename UIntX2 >
uint_x4< UInt, UIntX2 > operator+ (const uint_x4< UInt, UIntX2 > &a, const uint_x4< UInt, UIntX2 > &b)
 
template<typename UInt , typename UIntX2 >
uint_x4< UInt, UIntX2 > operator- (const uint_x4< UInt, UIntX2 > &a, const uint_x4< UInt, UIntX2 > &b)
 
template<typename UInt , typename UIntX2 >
uint_x4< UInt, UIntX2 > operator& (const uint_x4< UInt, UIntX2 > &a, const uint_x4< UInt, UIntX2 > &b)
 
template<typename UInt , typename UIntX2 >
uint_x4< UInt, UIntX2 > operator| (const uint_x4< UInt, UIntX2 > &a, const uint_x4< UInt, UIntX2 > &b)
 
template<typename UInt , typename UIntX2 >
uint_x4< UInt, UIntX2 > operator^ (const uint_x4< UInt, UIntX2 > &a, const uint_x4< UInt, UIntX2 > &b)
 
template<typename UInt , typename UIntX2 >
uint_x4< UInt, UIntX2 > operator~ (const uint_x4< UInt, UIntX2 > &v)
 
template<typename UInt , typename UIntX2 >
uint_x4< UInt, UIntX2 > operator- (const uint_x4< UInt, UIntX2 > &v)
 
template<typename UInt , typename UIntX2 >
bool operator== (const uint_x4< UInt, UIntX2 > &a, const uint_x4< UInt, UIntX2 > &b)
 
template<typename UInt , typename UIntX2 >
bool operator!= (const uint_x4< UInt, UIntX2 > &a, const uint_x4< UInt, UIntX2 > &b)
 
template<typename UInt , typename UIntX2 >
bool operator< (const uint_x4< UInt, UIntX2 > &a, const uint_x4< UInt, UIntX2 > &b)
 
template<typename UInt , typename UIntX2 >
bool operator> (const uint_x4< UInt, UIntX2 > &a, const uint_x4< UInt, UIntX2 > &b)
 
template<typename UInt , typename UIntX2 >
bool operator<= (const uint_x4< UInt, UIntX2 > &a, const uint_x4< UInt, UIntX2 > &b)
 
template<typename UInt , typename UIntX2 >
bool operator>= (const uint_x4< UInt, UIntX2 > &a, const uint_x4< UInt, UIntX2 > &b)
 
template<typename UInt , typename UIntX2 >
uint_x4< UInt, UIntX2 > operator<< (const uint_x4< UInt, UIntX2 > &v, const bitcount_t shift)
 
template<typename UInt , typename UIntX2 >
uint_x4< UInt, UIntX2 > operator>> (const uint_x4< UInt, UIntX2 > &v, const bitcount_t shift)
 

Typedef Documentation

◆ bitcount_t

typedef uint8_t pcg_extras::bitcount_t

◆ pcg128_t

typedef pcg_extras::uint_x4<uint32_t,uint64_t> pcg_extras::pcg128_t

Function Documentation

◆ addwithcarry()

template<typename UInt >
UInt pcg_extras::addwithcarry ( UInt  x,
UInt  y,
bool  carryin,
bool *  carryout 
)
inline

◆ bounded_rand()

template<typename RngType >
auto pcg_extras::bounded_rand ( RngType &  rng,
typename RngType::result_type  upper_bound 
) -> typename RngType::result_type

◆ clog2()

template<typename UInt >
bitcount_t pcg_extras::clog2 ( UInt  v)
inline

◆ divmod()

template<typename UInt , typename UIntX2 >
std::pair< uint_x4<UInt,UIntX2>, uint_x4<UInt,UIntX2> > pcg_extras::divmod ( const uint_x4< UInt, UIntX2 > &  orig_dividend,
const uint_x4< UInt, UIntX2 > &  divisor 
)

◆ flog2() [1/3]

template<typename U , typename V >
bitcount_t pcg_extras::flog2 ( const uint_x4< U, V > &  v)

◆ flog2() [2/3]

bitcount_t pcg_extras::flog2 ( uint32_t  v)
inline

◆ flog2() [3/3]

bitcount_t pcg_extras::flog2 ( uint64_t  v)
inline

◆ generate_one()

template<typename UInt , size_t i = 0UL, size_t N = i+1UL, typename SeedSeq >
UInt pcg_extras::generate_one ( SeedSeq &&  generator)
inline

◆ generate_to()

template<size_t size, typename SeedSeq , typename DestIter >
void pcg_extras::generate_to ( SeedSeq &&  generator,
DestIter  dest 
)
inline

◆ generate_to_impl() [1/2]

template<size_t size, typename SeedSeq , typename DestIter >
void pcg_extras::generate_to_impl ( SeedSeq &&  generator,
DestIter  dest,
std::false_type   
)

◆ generate_to_impl() [2/2]

template<size_t size, typename SeedSeq , typename DestIter >
void pcg_extras::generate_to_impl ( SeedSeq &&  generator,
DestIter  dest,
std::true_type   
)
inline

◆ operator!=()

template<typename UInt , typename UIntX2 >
bool pcg_extras::operator!= ( const uint_x4< UInt, UIntX2 > &  a,
const uint_x4< UInt, UIntX2 > &  b 
)

◆ operator%()

template<typename UInt , typename UIntX2 >
uint_x4<UInt,UIntX2> pcg_extras::operator% ( const uint_x4< UInt, UIntX2 > &  dividend,
const uint_x4< UInt, UIntX2 > &  divisor 
)

◆ operator&()

template<typename UInt , typename UIntX2 >
uint_x4<UInt,UIntX2> pcg_extras::operator& ( const uint_x4< UInt, UIntX2 > &  a,
const uint_x4< UInt, UIntX2 > &  b 
)

◆ operator*()

template<typename UInt , typename UIntX2 >
uint_x4<UInt,UIntX2> pcg_extras::operator* ( const uint_x4< UInt, UIntX2 > &  a,
const uint_x4< UInt, UIntX2 > &  b 
)

◆ operator+()

template<typename UInt , typename UIntX2 >
uint_x4<UInt,UIntX2> pcg_extras::operator+ ( const uint_x4< UInt, UIntX2 > &  a,
const uint_x4< UInt, UIntX2 > &  b 
)

◆ operator-() [1/2]

template<typename UInt , typename UIntX2 >
uint_x4<UInt,UIntX2> pcg_extras::operator- ( const uint_x4< UInt, UIntX2 > &  a,
const uint_x4< UInt, UIntX2 > &  b 
)

◆ operator-() [2/2]

template<typename UInt , typename UIntX2 >
uint_x4<UInt,UIntX2> pcg_extras::operator- ( const uint_x4< UInt, UIntX2 > &  v)

◆ operator/()

template<typename UInt , typename UIntX2 >
uint_x4<UInt,UIntX2> pcg_extras::operator/ ( const uint_x4< UInt, UIntX2 > &  dividend,
const uint_x4< UInt, UIntX2 > &  divisor 
)

◆ operator<()

template<typename UInt , typename UIntX2 >
bool pcg_extras::operator< ( const uint_x4< UInt, UIntX2 > &  a,
const uint_x4< UInt, UIntX2 > &  b 
)

◆ operator<<() [1/4]

template<typename UInt , typename UIntX2 >
uint_x4<UInt,UIntX2> pcg_extras::operator<< ( const uint_x4< UInt, UIntX2 > &  v,
const bitcount_t  shift 
)

◆ operator<<() [2/4]

template<typename CharT , typename Traits >
std::basic_ostream<CharT,Traits>& pcg_extras::operator<< ( std::basic_ostream< CharT, Traits > &  out,
pcg128_t  value 
)

◆ operator<<() [3/4]

template<typename CharT , typename Traits >
std::basic_ostream<CharT,Traits>& pcg_extras::operator<< ( std::basic_ostream< CharT, Traits > &  out,
uint8_t  value 
)

◆ operator<<() [4/4]

std::ostream& pcg_extras::operator<< ( std::ostream &  out,
uint8_t  value 
)
inline

◆ operator<=()

template<typename UInt , typename UIntX2 >
bool pcg_extras::operator<= ( const uint_x4< UInt, UIntX2 > &  a,
const uint_x4< UInt, UIntX2 > &  b 
)

◆ operator==()

template<typename UInt , typename UIntX2 >
bool pcg_extras::operator== ( const uint_x4< UInt, UIntX2 > &  a,
const uint_x4< UInt, UIntX2 > &  b 
)

◆ operator>()

template<typename UInt , typename UIntX2 >
bool pcg_extras::operator> ( const uint_x4< UInt, UIntX2 > &  a,
const uint_x4< UInt, UIntX2 > &  b 
)

◆ operator>=()

template<typename UInt , typename UIntX2 >
bool pcg_extras::operator>= ( const uint_x4< UInt, UIntX2 > &  a,
const uint_x4< UInt, UIntX2 > &  b 
)

◆ operator>>() [1/4]

template<typename UInt , typename UIntX2 >
uint_x4<UInt,UIntX2> pcg_extras::operator>> ( const uint_x4< UInt, UIntX2 > &  v,
const bitcount_t  shift 
)

◆ operator>>() [2/4]

template<typename CharT , typename Traits >
std::basic_istream<CharT,Traits>& pcg_extras::operator>> ( std::basic_istream< CharT, Traits > &  in,
pcg128_t value 
)

◆ operator>>() [3/4]

template<typename CharT , typename Traits >
std::basic_istream<CharT,Traits>& pcg_extras::operator>> ( std::basic_istream< CharT, Traits > &  in,
uint8_t &  target 
)

◆ operator>>() [4/4]

std::istream& pcg_extras::operator>> ( std::istream &  in,
uint8_t &  value 
)
inline

◆ operator^()

template<typename UInt , typename UIntX2 >
uint_x4<UInt,UIntX2> pcg_extras::operator^ ( const uint_x4< UInt, UIntX2 > &  a,
const uint_x4< UInt, UIntX2 > &  b 
)

◆ operator|()

template<typename UInt , typename UIntX2 >
uint_x4<UInt,UIntX2> pcg_extras::operator| ( const uint_x4< UInt, UIntX2 > &  a,
const uint_x4< UInt, UIntX2 > &  b 
)

◆ operator~()

template<typename UInt , typename UIntX2 >
uint_x4<UInt,UIntX2> pcg_extras::operator~ ( const uint_x4< UInt, UIntX2 > &  v)

◆ rotl()

template<typename itype >
itype pcg_extras::rotl ( itype  value,
bitcount_t  rot 
)
inline

◆ rotr()

template<typename itype >
itype pcg_extras::rotr ( itype  value,
bitcount_t  rot 
)
inline

◆ shuffle()

template<typename Iter , typename RandType >
void pcg_extras::shuffle ( Iter  from,
Iter  to,
RandType &&  rng 
)

◆ subwithcarry()

template<typename UInt >
UInt pcg_extras::subwithcarry ( UInt  x,
UInt  y,
bool  carryin,
bool *  carryout 
)
inline

◆ trailingzeros() [1/3]

template<typename U , typename V >
bitcount_t pcg_extras::trailingzeros ( const uint_x4< U, V > &  v)

◆ trailingzeros() [2/3]

bitcount_t pcg_extras::trailingzeros ( uint32_t  v)
inline

◆ trailingzeros() [3/3]

bitcount_t pcg_extras::trailingzeros ( uint64_t  v)
inline

◆ uneven_copy()

template<class SrcIter , class DestIter >
SrcIter pcg_extras::uneven_copy ( SrcIter  src_first,
DestIter  dest_first,
DestIter  dest_last 
)
inline

◆ uneven_copy_impl() [1/2]

template<class SrcIter , class DestIter >
SrcIter pcg_extras::uneven_copy_impl ( SrcIter  src_first,
DestIter  dest_first,
DestIter  dest_last,
std::false_type   
)

◆ uneven_copy_impl() [2/2]

template<class SrcIter , class DestIter >
SrcIter pcg_extras::uneven_copy_impl ( SrcIter  src_first,
DestIter  dest_first,
DestIter  dest_last,
std::true_type   
)

◆ unxorshift()

template<typename itype >
itype pcg_extras::unxorshift ( itype  x,
bitcount_t  bits,
bitcount_t  shift 
)
inline