Go to the documentation of this file.
73 #ifndef PCG_RAND_HPP_INCLUDED
74 #define PCG_RAND_HPP_INCLUDED 1
85 #include <type_traits>
92 #pragma warning(disable:4146)
96 #define PCG_ALWAYS_INLINE __forceinline
98 #define PCG_ALWAYS_INLINE __attribute__((always_inline))
100 #define PCG_ALWAYS_INLINE inline
131 template <
typename T>
136 template <
typename T>
141 #define PCG_DEFINE_CONSTANT(type, what, kind, constant) \
143 struct what ## _ ## kind<type> { \
144 static constexpr type kind() { \
191 template <typename itype>
192 class unique_stream {
194 static constexpr
bool is_mcg =
false;
203 typedef itype state_type;
206 return itype(
reinterpret_cast<uintptr_t
>(
this) | 1);
209 constexpr itype stream()
const
214 static constexpr
bool can_specify_stream =
false;
216 static constexpr
size_t streams_pow2()
218 return (
sizeof(itype) <
sizeof(
size_t) ?
sizeof(itype)
219 :
sizeof(
size_t))*8 - 1u;
223 constexpr unique_stream() =
default;
231 template <
typename itype>
234 static constexpr
bool is_mcg =
true;
249 static constexpr
bool can_specify_stream =
false;
265 template <
typename itype>
268 static constexpr
bool is_mcg =
false;
284 static constexpr
bool can_specify_stream =
false;
300 template <
typename itype>
303 static constexpr
bool is_mcg =
false;
322 inc_ = (specific_seq << 1) | 1;
325 static constexpr
bool can_specify_stream =
true;
329 return (
sizeof(itype)*8) - 1u;
336 : inc_(itype(specific_seq << 1) | itype(1U))
359 template <
typename xtype,
typename itype,
360 typename output_mixin,
361 bool output_previous =
true,
362 typename stream_mixin = oneseq_stream<itype>,
363 typename multiplier_mixin = default_multiplier<itype> >
366 protected multiplier_mixin {
374 using multiplier_mixin::multiplier;
382 return sizeof(
state_type)*8 - 2*stream_mixin::is_mcg;
401 return state * multiplier() +
increment();
406 return state_ = bump(state_);
411 itype old_state = state_;
412 state_ = bump(state_);
420 return this->output(base_generate0());
422 return this->output(base_generate());
431 static itype advance(itype state, itype delta,
432 itype cur_mult, itype cur_plus);
434 static itype distance(itype cur_state, itype newstate, itype cur_mult,
435 itype cur_plus, itype mask = ~itype(0U));
437 itype
distance(itype newstate, itype mask = itype(~itype(0U)))
const
439 return distance(state_, newstate, multiplier(),
increment(), mask);
445 state_ = advance(state_, delta, this->multiplier(), this->
increment());
460 if (stream_mixin::is_mcg) {
470 engine(itype state = itype(0xcafef00dd15ea5e5ULL))
480 template <
typename sm = stream_mixin>
481 engine(itype state,
typename sm::stream_state stream_seed)
482 : stream_mixin(stream_seed),
489 template<
typename SeedSeq>
490 engine(SeedSeq&& seedSeq,
typename std::enable_if<
491 !stream_mixin::can_specify_stream
492 && !std::is_convertible<SeedSeq, itype>::value
493 && !std::is_convertible<SeedSeq, engine>::value,
495 :
engine(generate_one<itype>(std::forward<SeedSeq>(seedSeq)))
500 template<
typename SeedSeq>
501 engine(SeedSeq&& seedSeq,
typename std::enable_if<
502 stream_mixin::can_specify_stream
503 && !std::is_convertible<SeedSeq, itype>::value
504 && !std::is_convertible<SeedSeq, engine>::value,
506 :
engine(generate_one<itype,1,2>(seedSeq),
507 generate_one<itype,0,2>(seedSeq))
513 template<
typename... Args>
516 new (
this)
engine(std::forward<Args>(args)...);
519 template <
typename xtype1,
typename itype1,
520 typename output_mixin1,
bool output_previous1,
521 typename stream_mixin_lhs,
typename multiplier_mixin_lhs,
522 typename stream_mixin_rhs,
typename multiplier_mixin_rhs>
524 output_mixin1,output_previous1,
525 stream_mixin_lhs, multiplier_mixin_lhs>&,
526 const engine<xtype1,itype1,
527 output_mixin1,output_previous1,
528 stream_mixin_rhs, multiplier_mixin_rhs>&);
530 template <
typename xtype1,
typename itype1,
531 typename output_mixin1,
bool output_previous1,
532 typename stream_mixin_lhs,
typename multiplier_mixin_lhs,
533 typename stream_mixin_rhs,
typename multiplier_mixin_rhs>
535 output_mixin1,output_previous1,
536 stream_mixin_lhs, multiplier_mixin_lhs>&,
537 const engine<xtype1,itype1,
538 output_mixin1,output_previous1,
539 stream_mixin_rhs, multiplier_mixin_rhs>&);
541 template <
typename CharT,
typename Traits,
542 typename xtype1,
typename itype1,
543 typename output_mixin1,
bool output_previous1,
544 typename stream_mixin1,
typename multiplier_mixin1>
545 friend std::basic_ostream<CharT,Traits>&
546 operator<<(std::basic_ostream<CharT,Traits>& out,
547 const engine<xtype1,itype1,
548 output_mixin1,output_previous1,
549 stream_mixin1, multiplier_mixin1>&);
551 template <
typename CharT,
typename Traits,
552 typename xtype1,
typename itype1,
553 typename output_mixin1,
bool output_previous1,
554 typename stream_mixin1,
typename multiplier_mixin1>
555 friend std::basic_istream<CharT,Traits>&
556 operator>>(std::basic_istream<CharT,Traits>& in,
558 output_mixin1, output_previous1,
559 stream_mixin1, multiplier_mixin1>& rng);
562 template <
typename CharT,
typename Traits,
563 typename xtype,
typename itype,
564 typename output_mixin,
bool output_previous,
565 typename stream_mixin,
typename multiplier_mixin>
566 std::basic_ostream<CharT,Traits>&
569 output_mixin,output_previous,
570 stream_mixin, multiplier_mixin>& rng)
572 auto orig_flags = out.flags(std::ios_base::dec | std::ios_base::left);
573 auto space = out.widen(
' ');
574 auto orig_fill = out.fill();
576 out << rng.multiplier() << space
577 << rng.increment() << space
580 out.flags(orig_flags);
586 template <
typename CharT,
typename Traits,
587 typename xtype,
typename itype,
588 typename output_mixin,
bool output_previous,
589 typename stream_mixin,
typename multiplier_mixin>
590 std::basic_istream<CharT,Traits>&
593 output_mixin,output_previous,
594 stream_mixin, multiplier_mixin>& rng)
596 auto orig_flags = in.flags(std::ios_base::dec | std::ios_base::skipws);
603 if (multiplier != rng.multiplier()) {
605 }
else if (rng.can_specify_stream) {
607 }
else if (
increment != rng.increment()) {
613 in.clear(std::ios::failbit);
617 in.flags(orig_flags);
622 template <
typename xtype,
typename itype,
623 typename output_mixin,
bool output_previous,
624 typename stream_mixin,
typename multiplier_mixin>
625 itype engine<xtype,itype,output_mixin,output_previous,stream_mixin,
626 multiplier_mixin>::advance(
627 itype state, itype delta, itype cur_mult, itype cur_plus)
637 constexpr itype ZERO = 0u;
638 constexpr itype ONE = 1u;
641 while (delta > ZERO) {
643 acc_mult *= cur_mult;
644 acc_plus = acc_plus*cur_mult + cur_plus;
646 cur_plus = (cur_mult+ONE)*cur_plus;
647 cur_mult *= cur_mult;
650 return acc_mult * state + acc_plus;
653 template <
typename xtype,
typename itype,
654 typename output_mixin,
bool output_previous,
655 typename stream_mixin,
typename multiplier_mixin>
656 itype
engine<xtype,itype,output_mixin,output_previous,stream_mixin,
657 multiplier_mixin>::distance(
658 itype cur_state, itype newstate, itype cur_mult, itype cur_plus, itype mask)
660 constexpr itype ONE = 1u;
661 itype the_bit = stream_mixin::is_mcg ? itype(4u) : itype(1u);
663 while ((cur_state & mask) != (newstate & mask)) {
664 if ((cur_state & the_bit) != (newstate & the_bit)) {
665 cur_state = cur_state * cur_mult + cur_plus;
668 assert((cur_state & the_bit) == (newstate & the_bit));
670 cur_plus = (cur_mult+ONE)*cur_plus;
671 cur_mult *= cur_mult;
673 return stream_mixin::is_mcg ? distance >> 2 : distance;
676 template <
typename xtype,
typename itype,
677 typename output_mixin,
bool output_previous,
678 typename stream_mixin_lhs,
typename multiplier_mixin_lhs,
679 typename stream_mixin_rhs,
typename multiplier_mixin_rhs>
681 output_mixin,output_previous,
682 stream_mixin_lhs, multiplier_mixin_lhs>& lhs,
684 output_mixin,output_previous,
685 stream_mixin_rhs, multiplier_mixin_rhs>& rhs)
688 std::is_same<stream_mixin_lhs, stream_mixin_rhs>::value &&
689 std::is_same<multiplier_mixin_lhs, multiplier_mixin_rhs>::value,
690 "Incomparable generators");
691 return rhs.distance(lhs.state_);
695 template <
typename xtype,
typename itype,
696 typename output_mixin,
bool output_previous,
697 typename stream_mixin_lhs,
typename multiplier_mixin_lhs,
698 typename stream_mixin_rhs,
typename multiplier_mixin_rhs>
700 output_mixin,output_previous,
701 stream_mixin_lhs, multiplier_mixin_lhs>& lhs,
703 output_mixin,output_previous,
704 stream_mixin_rhs, multiplier_mixin_rhs>& rhs)
706 return (lhs.multiplier() == rhs.multiplier())
707 && (lhs.increment() == rhs.increment())
708 && (lhs.state_ == rhs.state_);
711 template <
typename xtype,
typename itype,
712 typename output_mixin,
bool output_previous,
713 typename stream_mixin_lhs,
typename multiplier_mixin_lhs,
714 typename stream_mixin_rhs,
typename multiplier_mixin_rhs>
716 output_mixin,output_previous,
717 stream_mixin_lhs, multiplier_mixin_lhs>& lhs,
719 output_mixin,output_previous,
720 stream_mixin_rhs, multiplier_mixin_rhs>& rhs)
726 template <
typename xtype,
typename itype,
727 template<
typename XT,
typename IT>
class output_mixin,
728 bool output_previous = (
sizeof(itype) <= 8)>
730 output_mixin<xtype, itype>, output_previous,
733 template <
typename xtype,
typename itype,
734 template<
typename XT,
typename IT>
class output_mixin,
735 bool output_previous = (
sizeof(itype) <= 8)>
737 output_mixin<xtype, itype>, output_previous,
738 unique_stream<itype> >;
740 template <
typename xtype,
typename itype,
741 template<
typename XT,
typename IT>
class output_mixin,
742 bool output_previous = (
sizeof(itype) <= 8)>
744 output_mixin<xtype, itype>, output_previous,
747 template <
typename xtype,
typename itype,
748 template<
typename XT,
typename IT>
class output_mixin,
749 bool output_previous = (
sizeof(itype) <= 8)>
751 output_mixin<xtype, itype>, output_previous,
774 template <
typename xtype,
typename itype>
780 constexpr
bitcount_t sparebits = bits - xtypebits;
782 sparebits-5 >= 64 ? 5
783 : sparebits-4 >= 32 ? 4
784 : sparebits-3 >= 16 ? 3
785 : sparebits-2 >= 4 ? 2
786 : sparebits-1 >= 1 ? 1
788 constexpr
bitcount_t mask = (1 << opbits) - 1;
791 constexpr
bitcount_t bottomspare = sparebits - topspare;
792 constexpr
bitcount_t xshift = topspare + (xtypebits+maxrandshift)/2;
794 opbits ?
bitcount_t(
internal >> (bits - opbits)) & mask : 0;
795 internal ^=
internal >> xshift;
796 xtype result = xtype(
internal >> (bottomspare - maxrandshift + rshift));
807 template <
typename xtype,
typename itype>
813 constexpr
bitcount_t sparebits = bits - xtypebits;
816 : xtypebits >= 64 ? 6
817 : xtypebits >= 32 ? 5
818 : xtypebits >= 16 ? 4
821 sparebits >= wantedopbits ? wantedopbits
823 constexpr
bitcount_t amplifier = wantedopbits - opbits;
824 constexpr
bitcount_t mask = (1 << opbits) - 1;
826 constexpr
bitcount_t bottomspare = sparebits - topspare;
827 constexpr
bitcount_t xshift = (topspare + xtypebits)/2;
830 bitcount_t amprot = (rot << amplifier) & mask;
831 internal ^=
internal >> xshift;
832 xtype result = xtype(
internal >> bottomspare);
833 result =
rotr(result, amprot);
842 template <
typename xtype,
typename itype>
848 constexpr
bitcount_t shift = bits - xtypebits;
849 constexpr
bitcount_t extrashift = (xtypebits - shift)/2;
850 bitcount_t rshift = shift > 64+8 ? (
internal >> (bits - 6)) & 63
851 : shift > 32+4 ? (
internal >> (bits - 5)) & 31
852 : shift > 16+2 ? (
internal >> (bits - 4)) & 15
853 : shift > 8+1 ? (
internal >> (bits - 3)) & 7
854 : shift > 4+1 ? (
internal >> (bits - 2)) & 3
855 : shift > 2+1 ? (
internal >> (bits - 1)) & 1
857 internal ^=
internal >> (shift + extrashift - rshift);
858 xtype result =
internal >> rshift;
880 template <
typename T>
885 template <
typename T>
908 template <typename xtype, typename itype>
914 constexpr
bitcount_t opbits = xtypebits >= 128 ? 6
915 : xtypebits >= 64 ? 5
916 : xtypebits >= 32 ? 4
917 : xtypebits >= 16 ? 3
919 constexpr
bitcount_t shift = bits - xtypebits;
920 constexpr
bitcount_t mask = (1 << opbits) - 1;
922 opbits ?
bitcount_t(
internal >> (bits - opbits)) & mask : 0;
923 internal ^=
internal >> (opbits + rshift);
925 xtype result =
internal >> shift;
926 result ^= result >> ((2U*xtypebits+2U)/3U);
938 constexpr
bitcount_t mask = (1 << opbits) - 1;
940 internal =
unxorshift(
internal, bits, (2U*bits+2U)/3U);
944 bitcount_t rshift = opbits ? (
internal >> (bits - opbits)) & mask : 0;
945 internal =
unxorshift(
internal, bits, opbits + rshift);
956 template <
typename xtype,
typename itype>
962 constexpr
bitcount_t opbits = xtypebits >= 128 ? 6
963 : xtypebits >= 64 ? 5
964 : xtypebits >= 32 ? 4
965 : xtypebits >= 16 ? 3
967 constexpr
bitcount_t shift = bits - xtypebits;
968 constexpr
bitcount_t mask = (1 << opbits) - 1;
969 bitcount_t rshift = opbits ? (
internal >> (bits - opbits)) & mask : 0;
970 internal ^=
internal >> (opbits + rshift);
972 xtype result =
internal >> shift;
983 template <
typename xtype,
typename itype>
989 constexpr
bitcount_t sparebits = bits - xtypebits;
990 constexpr
bitcount_t wantedopbits = xtypebits >= 128 ? 7
991 : xtypebits >= 64 ? 6
992 : xtypebits >= 32 ? 5
993 : xtypebits >= 16 ? 4
995 constexpr
bitcount_t opbits = sparebits >= wantedopbits ? wantedopbits
997 constexpr
bitcount_t amplifier = wantedopbits - opbits;
998 constexpr
bitcount_t mask = (1 << opbits) - 1;
1000 constexpr
bitcount_t bottomspare = sparebits - topspare;
1001 constexpr
bitcount_t xshift = (topspare + xtypebits) / 2;
1004 opbits ?
bitcount_t(
internal >> (bits - opbits)) & mask : 0;
1005 bitcount_t amprot = (rot << amplifier) & mask;
1006 internal ^=
internal >> xshift;
1007 xtype result = xtype(
internal >> bottomspare);
1008 result =
rotr(result, amprot);
1027 template <
typename xtype,
typename itype>
1035 constexpr
bitcount_t sparebits = bits - htypebits;
1036 constexpr
bitcount_t wantedopbits = htypebits >= 128 ? 7
1037 : htypebits >= 64 ? 6
1038 : htypebits >= 32 ? 5
1039 : htypebits >= 16 ? 4
1041 constexpr
bitcount_t opbits = sparebits >= wantedopbits ? wantedopbits
1043 constexpr
bitcount_t amplifier = wantedopbits - opbits;
1044 constexpr
bitcount_t mask = (1 << opbits) - 1;
1046 constexpr
bitcount_t xshift = (topspare + htypebits) / 2;
1049 opbits ?
bitcount_t(
internal >> (bits - opbits)) & mask : 0;
1050 bitcount_t amprot = (rot << amplifier) & mask;
1051 internal ^=
internal >> xshift;
1053 lowbits =
rotr(lowbits, amprot);
1054 htype highbits =
htype(
internal >> topspare);
1056 bitcount_t amprot2 = (rot2 << amplifier) & mask;
1057 highbits =
rotr(highbits, amprot2);
1058 return (itype(highbits) << topspare) ^ itype(lowbits);
1069 template <
typename xtype,
typename itype>
1075 constexpr
bitcount_t sparebits = bits - xtypebits;
1077 constexpr
bitcount_t bottomspare = sparebits - topspare;
1078 constexpr
bitcount_t xshift = (topspare + xtypebits) / 2;
1080 internal ^=
internal >> xshift;
1081 xtype result =
internal >> bottomspare;
1092 template <
typename xtype,
typename itype>
1098 constexpr
bitcount_t sparebits = bits - xtypebits;
1100 constexpr
bitcount_t bottomspare = sparebits - topspare;
1101 constexpr
bitcount_t xshift = (topspare + xtypebits) / 2;
1103 internal ^=
internal >> xshift;
1104 xtype result =
internal >> bottomspare;
1112 template <
typename base
class>
1119 "Require a RNG whose output function is a permutation");
1123 state_type state = baseclass::unoutput(randval);
1130 return result == zero;
1136 state_type state = baseclass::unoutput(randval);
1141 state_type dist_to_zero = baseclass::distance(state, zero, mult, inc);
1143 forwards ? dist_to_zero <= delta
1144 : (-dist_to_zero) <= delta;
1147 state = baseclass::advance(state, delta, mult, inc);
1148 randval = baseclass::output(state);
1149 return crosses_zero;
1154 template <bitcount_t table_pow2, bitcount_t advance_pow2,
typename base
class,
typename extval
class,
bool kdd = true>
1165 static constexpr
bitcount_t tick_limit_pow2 = 64U;
1167 static constexpr
size_t table_size = 1UL << table_pow2;
1168 static constexpr
size_t table_shift = stypebits - table_pow2;
1172 static constexpr
bool may_tick =
1173 (advance_pow2 < stypebits) && (advance_pow2 < tick_limit_pow2);
1174 static constexpr
size_t tick_shift = stypebits - advance_pow2;
1177 (uint64_t(1) << (advance_pow2*may_tick)) - 1)
1181 static constexpr
bool may_tock = stypebits < tick_limit_pow2;
1192 if (kdd && baseclass::is_mcg) {
1196 size_t index = kdd ? state & table_mask
1197 : state >> table_shift;
1200 bool tick = kdd ? (state & tick_mask) == state_type(0u)
1201 : (state >> tick_shift) == state_type(0u);
1206 bool tock = state == state_type(0u);
1210 return data_[index];
1216 return baseclass::period_pow2() + table_size*extvalclass::period_pow2();
1238 void advance(state_type distance,
bool forwards =
true);
1242 advance(distance,
false);
1260 template <
typename bc = base
class>
1262 typename bc::stream_state stream_seed)
1263 : baseclass(seed, stream_seed)
1283 template <
typename bc = base
class>
1285 : baseclass(seed, stream_seed)
1292 void datainit(
const result_type* data);
1296 template<
typename SeedSeq,
typename =
typename std::enable_if<
1297 !std::is_convertible<SeedSeq, result_type>::value
1298 && !std::is_convertible<SeedSeq, extended>::value>::type>
1300 : baseclass(seedSeq)
1302 generate_to<table_size>(seedSeq, data_);
1305 template<
typename... Args>
1308 new (
this)
extended(std::forward<Args>(args)...);
1312 typename baseclass_,
typename extvalclass_,
bool kdd_>
1314 baseclass_, extvalclass_, kdd_>&,
1315 const extended<table_pow2_, advance_pow2_,
1316 baseclass_, extvalclass_, kdd_>&);
1318 template <
typename CharT,
typename Traits,
1320 typename baseclass_,
typename extvalclass_,
bool kdd_>
1321 friend std::basic_ostream<CharT,Traits>&
1322 operator<<(std::basic_ostream<CharT,Traits>& out,
1323 const extended<table_pow2_, advance_pow2_,
1324 baseclass_, extvalclass_, kdd_>&);
1326 template <
typename CharT,
typename Traits,
1328 typename baseclass_,
typename extvalclass_,
bool kdd_>
1329 friend std::basic_istream<CharT,Traits>&
1330 operator>>(std::basic_istream<CharT,Traits>& in,
1331 extended<table_pow2_, advance_pow2_,
1332 baseclass_, extvalclass_, kdd_>&);
1338 typename baseclass,
typename extvalclass,
bool kdd>
1339 void extended<table_pow2,advance_pow2,baseclass,extvalclass,kdd>::datainit(
1340 const result_type* data)
1342 for (
size_t i = 0; i < table_size; ++i)
1347 typename baseclass,
typename extvalclass,
bool kdd>
1348 void extended<table_pow2,advance_pow2,baseclass,extvalclass,kdd>::selfinit()
1360 result_type lhs = baseclass::operator()();
1361 result_type rhs = baseclass::operator()();
1362 result_type xdiff = lhs - rhs;
1363 for (
size_t i = 0; i < table_size; ++i) {
1364 data_[i] = baseclass::operator()() ^ xdiff;
1369 typename baseclass,
typename extvalclass,
bool kdd>
1371 baseclass, extvalclass, kdd>& lhs,
1372 const extended<table_pow2, advance_pow2,
1373 baseclass, extvalclass, kdd>& rhs)
1375 auto& base_lhs =
static_cast<const baseclass&
>(lhs);
1376 auto& base_rhs =
static_cast<const baseclass&
>(rhs);
1377 return base_lhs == base_rhs
1379 std::begin(lhs.data_), std::end(lhs.data_),
1380 std::begin(rhs.data_)
1385 typename baseclass,
typename extvalclass,
bool kdd>
1387 baseclass, extvalclass, kdd>& lhs,
1388 const extended<table_pow2, advance_pow2,
1389 baseclass, extvalclass, kdd>& rhs)
1394 template <
typename CharT,
typename Traits,
1396 typename baseclass,
typename extvalclass,
bool kdd>
1397 std::basic_ostream<CharT,Traits>&
1399 const extended<table_pow2, advance_pow2,
1400 baseclass, extvalclass, kdd>& rng)
1402 auto orig_flags = out.flags(std::ios_base::dec | std::ios_base::left);
1403 auto space = out.widen(
' ');
1404 auto orig_fill = out.fill();
1406 out << rng.multiplier() << space
1407 << rng.increment() << space
1410 for (
const auto& datum : rng.data_)
1411 out << space << datum;
1413 out.flags(orig_flags);
1414 out.fill(orig_fill);
1418 template <
typename CharT,
typename Traits,
1420 typename baseclass,
typename extvalclass,
bool kdd>
1421 std::basic_istream<CharT,Traits>&
1424 baseclass, extvalclass, kdd>& rng)
1427 auto& base_rng =
static_cast<baseclass&
>(new_rng);
1433 auto orig_flags = in.flags(std::ios_base::dec | std::ios_base::skipws);
1435 for (
auto& datum : new_rng.data_) {
1444 in.flags(orig_flags);
1451 typename baseclass,
typename extvalclass,
bool kdd>
1453 extended<table_pow2,advance_pow2,baseclass,extvalclass,kdd>::advance_table()
1456 for (
size_t i = 0; i < table_size; ++i) {
1458 carry = insideout::external_step(data_[i],i+1);
1460 bool carry2 = insideout::external_step(data_[i],i+1);
1461 carry = carry || carry2;
1466 typename baseclass,
typename extvalclass,
bool kdd>
1468 extended<table_pow2,advance_pow2,baseclass,extvalclass,kdd>::advance_table(
1469 state_type delta,
bool isForwards)
1471 typedef typename baseclass::state_type base_state_t;
1472 typedef typename extvalclass::state_type ext_state_t;
1473 constexpr
bitcount_t basebits =
sizeof(base_state_t)*8;
1474 constexpr
bitcount_t extbits =
sizeof(ext_state_t)*8;
1475 static_assert(basebits <= extbits || advance_pow2 > 0,
1476 "Current implementation might overflow its carry");
1478 base_state_t carry = 0;
1479 for (
size_t i = 0; i < table_size; ++i) {
1480 base_state_t total_delta = carry + delta;
1481 ext_state_t trunc_delta = ext_state_t(total_delta);
1482 if (basebits > extbits) {
1483 carry = total_delta >> extbits;
1488 insideout::external_advance(data_[i],i+1, trunc_delta, isForwards);
1493 typename baseclass,
typename extvalclass,
bool kdd>
1498 "Efficient advance is too hard for non-kdd extension. "
1499 "For a weak advance, cast to base class");
1503 state_type ticks = distance >> (advance_pow2*may_tick);
1507 baseclass::is_mcg ? tick_mask << 2 : tick_mask;
1508 state_type next_advance_distance = this->distance(zero, adv_mask);
1510 next_advance_distance = (-next_advance_distance) & tick_mask;
1511 if (next_advance_distance < (distance & tick_mask)) {
1515 advance_table(ticks, forwards);
1518 if (may_tock && this->distance(zero) <= distance)
1520 baseclass::advance(distance);
1522 if (may_tock && -(this->distance(zero)) <= distance)
1524 baseclass::advance(-distance);
1638 typename BaseRNG,
bool kdd =
true>
1643 typename BaseRNG,
bool kdd =
true>
1648 typename BaseRNG,
bool kdd =
true>
1653 typename BaseRNG,
bool kdd =
true>
1658 template <bitcount_t table_pow2, bitcount_t advance_pow2,
bool kdd = true>
1662 template <bitcount_t table_pow2, bitcount_t advance_pow2,
bool kdd = true>
1666 template <bitcount_t table_pow2, bitcount_t advance_pow2,
bool kdd = true>
1670 template <bitcount_t table_pow2, bitcount_t advance_pow2,
bool kdd = true>
1674 template <bitcount_t table_pow2, bitcount_t advance_pow2,
bool kdd = true>
1678 template <bitcount_t table_pow2, bitcount_t advance_pow2,
bool kdd = true>
1682 template <bitcount_t table_pow2, bitcount_t advance_pow2,
bool kdd = true>
1770 #pragma warning(default:4146)
1773 #endif // PCG_RAND_HPP_INCLUDED
xtype result_type
Definition: pcg_random.hpp:377
Definition: pcg_random.hpp:957
void set_stream(...)
Definition: pcg_random.hpp:271
mcg_base< uint16_t, uint32_t, xsh_rs_mixin > mcg_xsh_rs_32_16
Definition: pcg_random.hpp:1552
itype distance(itype newstate, itype mask=itype(~itype(0U))) const
Definition: pcg_random.hpp:437
baseclass::result_type result_type
Definition: pcg_random.hpp:1116
pcg_engines::ext_setseq_xsl_rr_128_64< 5, 16, true > pcg64_k32
Definition: pcg_random.hpp:1734
PCG_128BIT_CONSTANT(6364136223846793005ULL, 1442695040888963407ULL)) template< typename itype > class unique_stream
Definition: pcg_random.hpp:164
setseq_base< uint64_t, uint64_t, xsl_rr_rr_mixin > setseq_xsl_rr_rr_64_64
Definition: pcg_random.hpp:1629
setseq_base< uint8_t, uint16_t, xsh_rr_mixin > setseq_xsh_rr_16_8
Definition: pcg_random.hpp:1568
setseq_base< uint64_t, pcg128_t, xsl_rr_mixin > setseq_xsl_rr_128_64
Definition: pcg_random.hpp:1610
result_type operator()(result_type upper_bound)
Definition: pcg_random.hpp:425
pcg_engines::ext_mcg_xsl_rr_128_64< 5, 128, true > pcg64_k32_fast
Definition: pcg_random.hpp:1736
itype stream()
Definition: pcg_random.hpp:315
setseq_base< uint8_t, uint8_t, rxs_m_xs_mixin > setseq_rxs_m_xs_8_8
Definition: pcg_random.hpp:1593
inside_out< extvalclass > insideout
Definition: pcg_random.hpp:1159
unique_base< uint16_t, uint32_t, xsh_rs_mixin > unique_xsh_rs_32_16
Definition: pcg_random.hpp:1542
oneseq_base< uint64_t, uint64_t, xsl_rr_rr_mixin > oneseq_xsl_rr_rr_64_64
Definition: pcg_random.hpp:1619
unique_base< uint8_t, uint8_t, rxs_m_xs_mixin > unique_rxs_m_xs_8_8
Definition: pcg_random.hpp:1587
pcg_engines::mcg_xsl_rr_128_64 pcg64_fast
Definition: pcg_random.hpp:1696
Definition: pcg_random.hpp:266
oneseq_base< uint32_t, uint64_t, xsh_rr_mixin > oneseq_xsh_rr_64_32
Definition: pcg_random.hpp:1560
Definition: pcg_random.hpp:984
Definition: pcg_random.hpp:1155
static xtype output(itype internal)
Definition: pcg_random.hpp:1071
unique_base< uint8_t, uint16_t, xsh_rs_mixin > unique_xsh_rs_16_8
Definition: pcg_random.hpp:1541
static bool external_advance(result_type &randval, size_t i, result_type delta, bool forwards=true)
Definition: pcg_random.hpp:1133
extended(const result_type *data, state_type seed, typename bc::stream_state stream_seed)
Definition: pcg_random.hpp:1261
itype state_type
Definition: pcg_random.hpp:378
mcg_base< uint64_t, pcg128_t, xsh_rr_mixin > mcg_xsh_rr_128_64
Definition: pcg_random.hpp:1576
void backstep(state_type distance)
Definition: pcg_random.hpp:1240
itype bump(itype state)
Definition: pcg_random.hpp:399
PCG_DEFINE_CONSTANT(pcg128_t, default, multiplier, PCG_128BIT_CONSTANT(2549297995355413924ULL, 4865540595714422341ULL)) PCG_DEFINE_CONSTANT(pcg128_t
baseclass::state_type state_type
Definition: pcg_random.hpp:1157
setseq_base< pcg128_t, pcg128_t, xsl_rr_rr_mixin > setseq_xsl_rr_rr_128_128
Definition: pcg_random.hpp:1631
static constexpr size_t streams_pow2()
Definition: pcg_random.hpp:286
unique_base< uint32_t, uint64_t, xsl_rr_mixin > unique_xsl_rr_64_32
Definition: pcg_random.hpp:1606
static constexpr itype stream()
Definition: pcg_random.hpp:279
itype base_generate()
Definition: pcg_random.hpp:404
extended()
Definition: pcg_random.hpp:1268
pcg_engines::oneseq_rxs_m_xs_64_64 pcg64_oneseq_once_insecure
Definition: pcg_random.hpp:1707
Definition: pcg_random.hpp:1113
Definition: pcg_random.hpp:137
void backstep(itype delta)
Definition: pcg_random.hpp:448
unique_base< uint16_t, uint32_t, xsh_rr_mixin > unique_xsh_rr_32_16
Definition: pcg_random.hpp:1564
setseq_base< uint64_t, uint64_t, rxs_m_xs_mixin > setseq_rxs_m_xs_64_64
Definition: pcg_random.hpp:1596
unique_base< uint32_t, uint32_t, rxs_m_xs_mixin > unique_rxs_m_xs_32_32
Definition: pcg_random.hpp:1589
pcg_engines::ext_setseq_xsh_rr_64_32< 6, 16, false > pcg32_c64
Definition: pcg_random.hpp:1730
extended(SeedSeq &&seedSeq)
Definition: pcg_random.hpp:1299
void advance(state_type distance, bool forwards=true)
Definition: pcg_random.hpp:1494
Definition: pcg_random.hpp:775
void set_stream(itype specific_seq)
Definition: pcg_random.hpp:320
pcg_engines::ext_oneseq_xsl_rr_128_64< 5, 128, true > pcg64_k32_oneseq
Definition: pcg_random.hpp:1735
Definition: pcg_random.hpp:371
unique_base< uint16_t, uint16_t, rxs_m_xs_mixin > unique_rxs_m_xs_16_16
Definition: pcg_random.hpp:1588
pcg_engines::ext_oneseq_xsh_rs_64_32< 10, 32, false > pcg32_c1024_fast
Definition: pcg_random.hpp:1753
pcg_engines::unique_xsl_rr_128_64 pcg64_unique
Definition: pcg_random.hpp:1695
bool wrapped()
Definition: pcg_random.hpp:458
Definition: pcg_random.hpp:364
pcg_engines::oneseq_xsl_rr_rr_128_128 pcg128_oneseq_once_insecure
Definition: pcg_random.hpp:1708
pcg_engines::setseq_rxs_m_xs_32_32 pcg32_once_insecure
Definition: pcg_random.hpp:1700
pcg_engines::ext_oneseq_xsl_rr_128_64< 5, 128, false > pcg64_c32_oneseq
Definition: pcg_random.hpp:1739
setseq_base< uint8_t, uint16_t, xsh_rs_mixin > setseq_xsh_rs_16_8
Definition: pcg_random.hpp:1546
mcg_base< uint8_t, uint16_t, xsh_rs_mixin > mcg_xsh_rs_16_8
Definition: pcg_random.hpp:1551
bool operator==(const engine< xtype, itype, output_mixin, output_previous, stream_mixin_lhs, multiplier_mixin_lhs > &lhs, const engine< xtype, itype, output_mixin, output_previous, stream_mixin_rhs, multiplier_mixin_rhs > &rhs)
Definition: pcg_random.hpp:699
itype state_
Definition: pcg_random.hpp:368
static xtype output(itype internal)
Definition: pcg_random.hpp:809
static xtype output_rxs(itype internal)
Definition: pcg_random.hpp:844
mcg_base< uint32_t, uint64_t, xsh_rr_mixin > mcg_xsh_rr_64_32
Definition: pcg_random.hpp:1575
itype stream_state
Definition: pcg_random.hpp:309
oneseq_base< uint64_t, pcg128_t, xsh_rs_mixin > oneseq_xsh_rs_128_64
Definition: pcg_random.hpp:1539
mcg_base< uint32_t, uint64_t, xsl_rr_mixin > mcg_xsl_rr_64_32
Definition: pcg_random.hpp:1612
constexpr itype increment() const
Definition: pcg_random.hpp:311
pcg_engines::setseq_xsh_rr_64_32 pcg32
Definition: pcg_random.hpp:1688
bool operator!=(const engine< xtype, itype, output_mixin, output_previous, stream_mixin_lhs, multiplier_mixin_lhs > &lhs, const engine< xtype, itype, output_mixin, output_previous, stream_mixin_rhs, multiplier_mixin_rhs > &rhs)
Definition: pcg_random.hpp:715
unique_base< pcg128_t, pcg128_t, xsl_rr_rr_mixin > unique_xsl_rr_rr_128_128
Definition: pcg_random.hpp:1626
pcg_engines::ext_mcg_xsl_rr_128_64< 5, 128, false > pcg64_c32_fast
Definition: pcg_random.hpp:1740
unique_base< uint32_t, uint64_t, xsh_rs_mixin > unique_xsh_rs_64_32
Definition: pcg_random.hpp:1543
unmultiplier
Definition: pcg_random.hpp:904
pcg_engines::unique_xsh_rr_64_32 pcg32_unique
Definition: pcg_random.hpp:1690
void advance(itype delta)
Definition: pcg_random.hpp:443
static constexpr size_t streams_pow2()
Definition: pcg_random.hpp:251
oneseq_base< uint16_t, uint16_t, rxs_m_xs_mixin > oneseq_rxs_m_xs_16_16
Definition: pcg_random.hpp:1582
#define PCG_ALWAYS_INLINE
Definition: pcg_random.hpp:100
uint8_t type
Definition: pcg_random.hpp:1025
static itype unoutput(itype internal)
Definition: pcg_random.hpp:930
static constexpr size_t streams_pow2()
Definition: pcg_random.hpp:327
static constexpr result_type max()
Definition: pcg_random.hpp:393
halfsize_trait< itype >::type htype
Definition: pcg_random.hpp:1029
static xtype output(itype internal)
Definition: pcg_random.hpp:910
oneseq_base< uint8_t, uint16_t, xsh_rs_mixin > oneseq_xsh_rs_16_8
Definition: pcg_random.hpp:1536
specific_stream(itype specific_seq)
Definition: pcg_random.hpp:335
void set_stream(...)
Definition: pcg_random.hpp:237
itype state_type
Definition: pcg_random.hpp:277
unique_base< uint32_t, uint64_t, xsh_rr_mixin > unique_xsh_rr_64_32
Definition: pcg_random.hpp:1565
Definition: pcg_random.hpp:132
oneseq_base< uint8_t, uint8_t, rxs_m_xs_mixin > oneseq_rxs_m_xs_8_8
Definition: pcg_random.hpp:1581
pcg_engines::ext_setseq_xsh_rr_64_32< 14, 16, true > pcg32_k16384
Definition: pcg_random.hpp:1766
itype base_generate0()
Definition: pcg_random.hpp:409
oneseq_base< uint64_t, uint64_t, rxs_m_xs_mixin > oneseq_rxs_m_xs_64_64
Definition: pcg_random.hpp:1584
static bool external_step(result_type &randval, size_t i)
Definition: pcg_random.hpp:1121
pcg_engines::setseq_xsl_rr_rr_128_128 pcg128_once_insecure
Definition: pcg_random.hpp:1702
pcg_engines::ext_oneseq_xsh_rs_64_32< 10, 32, true > pcg32_k1024_fast
Definition: pcg_random.hpp:1750
itype operator-(const engine< xtype, itype, output_mixin, output_previous, stream_mixin_lhs, multiplier_mixin_lhs > &lhs, const engine< xtype, itype, output_mixin, output_previous, stream_mixin_rhs, multiplier_mixin_rhs > &rhs)
Definition: pcg_random.hpp:680
Definition: pcg_random.hpp:232
PCG_ALWAYS_INLINE result_type operator()()
Definition: pcg_random.hpp:1219
static constexpr result_type min()
Definition: pcg_random.hpp:388
pcg_engines::ext_setseq_xsl_rr_128_64< 5, 16, false > pcg64_c32
Definition: pcg_random.hpp:1738
pcg_engines::ext_oneseq_xsl_rr_128_64< 10, 128, false > pcg64_c1024_fast
Definition: pcg_random.hpp:1759
Definition: pcg_random.hpp:1530
std::basic_ostream< CharT, Traits > & operator<<(std::basic_ostream< CharT, Traits > &out, const engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin > &rng)
Definition: pcg_random.hpp:567
setseq_base< uint32_t, uint64_t, xsh_rr_mixin > setseq_xsh_rr_64_32
Definition: pcg_random.hpp:1570
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={})
Definition: pcg_random.hpp:501
default
Definition: pcg_random.hpp:163
Definition: pcg_random.hpp:909
setseq_base< uint32_t, uint64_t, xsh_rs_mixin > setseq_xsh_rs_64_32
Definition: pcg_random.hpp:1548
mcg_base< uint64_t, pcg128_t, xsh_rs_mixin > mcg_xsh_rs_128_64
Definition: pcg_random.hpp:1554
setseq_base< uint16_t, uint32_t, xsh_rr_mixin > setseq_xsh_rr_32_16
Definition: pcg_random.hpp:1569
static xtype output(itype internal)
Definition: pcg_random.hpp:958
oneseq_base< pcg128_t, pcg128_t, xsl_rr_rr_mixin > oneseq_xsl_rr_rr_128_128
Definition: pcg_random.hpp:1621
extended(state_type seed, typename bc::stream_state stream_seed)
Definition: pcg_random.hpp:1284
static constexpr size_t period_pow2()
Definition: pcg_random.hpp:1214
Definition: pcg_random.hpp:886
pcg_engines::ext_oneseq_xsh_rs_64_32< 1, 32, true > pcg32_k2_fast
Definition: pcg_random.hpp:1717
mcg
Definition: pcg_random.hpp:904
extended(const result_type *data, state_type seed)
Definition: pcg_random.hpp:1251
setseq_base< uint64_t, pcg128_t, xsh_rr_mixin > setseq_xsh_rr_128_64
Definition: pcg_random.hpp:1571
Definition: pcg_random.hpp:843
pcg_engines::setseq_rxs_m_xs_8_8 pcg8_once_insecure
Definition: pcg_random.hpp:1698
pcg_engines::oneseq_xsl_rr_128_64 pcg64_oneseq
Definition: pcg_random.hpp:1694
pcg_engines::oneseq_rxs_m_xs_16_16 pcg16_oneseq_once_insecure
Definition: pcg_random.hpp:1705
Definition: pcg_random.hpp:301
baseclass::result_type result_type
Definition: pcg_random.hpp:1158
itype state_type
Definition: pcg_random.hpp:243
extended(state_type seed)
Definition: pcg_random.hpp:1274
oneseq_base< uint16_t, uint32_t, xsh_rs_mixin > oneseq_xsh_rs_32_16
Definition: pcg_random.hpp:1537
oneseq_base< uint64_t, pcg128_t, xsh_rr_mixin > oneseq_xsh_rr_128_64
Definition: pcg_random.hpp:1561
oneseq_base< uint8_t, uint16_t, xsh_rr_mixin > oneseq_xsh_rr_16_8
Definition: pcg_random.hpp:1558
pcg_engines::ext_setseq_xsl_rr_128_64< 10, 16, false > pcg64_c1024
Definition: pcg_random.hpp:1758
mcg_base< uint8_t, uint16_t, xsh_rr_mixin > mcg_xsh_rr_16_8
Definition: pcg_random.hpp:1573
setseq_base< uint32_t, uint64_t, xsl_rr_mixin > setseq_xsl_rr_64_32
Definition: pcg_random.hpp:1609
setseq_base< pcg128_t, pcg128_t, rxs_m_xs_mixin > setseq_rxs_m_xs_128_128
Definition: pcg_random.hpp:1597
setseq_base< uint16_t, uint32_t, xsh_rs_mixin > setseq_xsh_rs_32_16
Definition: pcg_random.hpp:1547
setseq_base< uint16_t, uint16_t, rxs_m_xs_mixin > setseq_rxs_m_xs_16_16
Definition: pcg_random.hpp:1594
setseq_base< uint64_t, pcg128_t, xsh_rs_mixin > setseq_xsh_rs_128_64
Definition: pcg_random.hpp:1549
static xtype output(itype internal)
Definition: pcg_random.hpp:776
unique_base< uint64_t, pcg128_t, xsh_rs_mixin > unique_xsh_rs_128_64
Definition: pcg_random.hpp:1544
pcg_engines::ext_mcg_xsh_rs_64_32< 6, 32, false > pcg32_c64_fast
Definition: pcg_random.hpp:1732
pcg_engines::ext_oneseq_xsh_rs_64_32< 6, 32, true > pcg32_k64_fast
Definition: pcg_random.hpp:1728
uint32_t type
Definition: pcg_random.hpp:1023
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={})
Definition: pcg_random.hpp:490
Definition: pcg_random.hpp:1021
pcg_engines::setseq_rxs_m_xs_16_16 pcg16_once_insecure
Definition: pcg_random.hpp:1699
Definition: pcg_random.hpp:808
unique_base< uint64_t, uint64_t, xsl_rr_rr_mixin > unique_xsl_rr_rr_64_64
Definition: pcg_random.hpp:1624
pcg_engines::oneseq_rxs_m_xs_8_8 pcg8_oneseq_once_insecure
Definition: pcg_random.hpp:1704
pcg_engines::ext_mcg_xsh_rs_64_32< 6, 32, true > pcg32_k64_oneseq
Definition: pcg_random.hpp:1727
pcg_engines::setseq_rxs_m_xs_64_64 pcg64_once_insecure
Definition: pcg_random.hpp:1701
std::basic_istream< CharT, Traits > & operator>>(std::basic_istream< CharT, Traits > &in, engine< xtype, itype, output_mixin, output_previous, stream_mixin, multiplier_mixin > &rng)
Definition: pcg_random.hpp:591
void discard(itype delta)
Definition: pcg_random.hpp:453
Definition: pcg_random.hpp:370
oneseq_base< uint32_t, uint32_t, rxs_m_xs_mixin > oneseq_rxs_m_xs_32_32
Definition: pcg_random.hpp:1583
pcg_engines::oneseq_rxs_m_xs_32_32 pcg32_oneseq_once_insecure
Definition: pcg_random.hpp:1706
Definition: pcg_random.hpp:881
pcg_engines::mcg_xsh_rs_64_32 pcg32_fast
Definition: pcg_random.hpp:1691
result_type operator()(result_type upper_bound)
Definition: pcg_random.hpp:1226
oneseq_base< pcg128_t, pcg128_t, rxs_m_xs_mixin > oneseq_rxs_m_xs_128_128
Definition: pcg_random.hpp:1585
mcg_base< uint16_t, uint32_t, xsh_rr_mixin > mcg_xsh_rr_32_16
Definition: pcg_random.hpp:1574
pcg_engines::ext_setseq_xsh_rr_64_32< 6, 16, true > pcg32_k64
Definition: pcg_random.hpp:1726
void set(result_type wanted)
Definition: pcg_random.hpp:1231
baseclass::state_type state_type
Definition: pcg_random.hpp:1117
increment
Definition: pcg_random.hpp:163
pcg_engines::oneseq_xsh_rr_64_32 pcg32_oneseq
Definition: pcg_random.hpp:1689
itype state_type
Definition: pcg_random.hpp:308
Definition: pcg_random.hpp:1093
static itype output(itype internal)
Definition: pcg_random.hpp:1031
unique_base< pcg128_t, pcg128_t, rxs_m_xs_mixin > unique_rxs_m_xs_128_128
Definition: pcg_random.hpp:1591
static constexpr size_t period_pow2()
Definition: pcg_random.hpp:380
uint16_t type
Definition: pcg_random.hpp:1024
pcg_engines::setseq_xsl_rr_128_64 pcg64
Definition: pcg_random.hpp:1693
engine(itype state=itype(0xcafef00dd15ea5e5ULL))
Definition: pcg_random.hpp:470
pcg_engines::ext_setseq_xsl_rr_128_64< 10, 16, true > pcg64_k1024
Definition: pcg_random.hpp:1755
unique_base< uint64_t, uint64_t, rxs_m_xs_mixin > unique_rxs_m_xs_64_64
Definition: pcg_random.hpp:1590
unique_base< uint64_t, pcg128_t, xsh_rr_mixin > unique_xsh_rr_128_64
Definition: pcg_random.hpp:1566
pcg_engines::ext_oneseq_xsh_rs_64_32< 14, 32, true > pcg32_k16384_fast
Definition: pcg_random.hpp:1767
oneseq_base< uint32_t, uint64_t, xsl_rr_mixin > oneseq_xsl_rr_64_32
Definition: pcg_random.hpp:1603
extended(const result_type *data)
Definition: pcg_random.hpp:1245
static xtype output(itype internal)
Definition: pcg_random.hpp:985
pcg_engines::ext_setseq_xsh_rr_64_32< 10, 16, true > pcg32_k1024
Definition: pcg_random.hpp:1749
pcg_engines::ext_setseq_xsh_rr_64_32< 1, 16, true > pcg32_k2
Definition: pcg_random.hpp:1716
unique_base< uint64_t, pcg128_t, xsl_rr_mixin > unique_xsl_rr_128_64
Definition: pcg_random.hpp:1607
void seed(Args &&... args)
Definition: pcg_random.hpp:514
oneseq_base< uint64_t, pcg128_t, xsl_rr_mixin > oneseq_xsl_rr_128_64
Definition: pcg_random.hpp:1604
mcg_base< uint32_t, uint64_t, xsh_rs_mixin > mcg_xsh_rs_64_32
Definition: pcg_random.hpp:1553
engine< xtype, itype, output_mixin< xtype, itype >, output_previous, oneseq_stream< itype > > oneseq_base
Definition: pcg_random.hpp:731
setseq_base< uint32_t, uint32_t, rxs_m_xs_mixin > setseq_rxs_m_xs_32_32
Definition: pcg_random.hpp:1595
pcg_engines::ext_oneseq_xsh_rs_64_32< 6, 32, false > pcg32_c64_oneseq
Definition: pcg_random.hpp:1731
uint64_t type
Definition: pcg_random.hpp:1022
pcg_engines::ext_oneseq_xsl_rr_128_64< 10, 128, true > pcg64_k1024_fast
Definition: pcg_random.hpp:1756
mcg_base< uint64_t, pcg128_t, xsl_rr_mixin > mcg_xsl_rr_128_64
Definition: pcg_random.hpp:1613
xtype output(itype internal)
Definition: pcg_random.hpp:1094
pcg_engines::ext_setseq_xsh_rr_64_32< 10, 16, false > pcg32_c1024
Definition: pcg_random.hpp:1752
Definition: pcg_random.hpp:116
result_type operator()()
Definition: pcg_random.hpp:417
Definition: pcg_random.hpp:1028
oneseq_base< uint32_t, uint64_t, xsh_rs_mixin > oneseq_xsh_rs_64_32
Definition: pcg_random.hpp:1538
void seed(Args &&... args)
Definition: pcg_random.hpp:1306
static constexpr itype increment()
Definition: pcg_random.hpp:245
Definition: pcg_random.hpp:1070
unique_base< uint8_t, uint16_t, xsh_rr_mixin > unique_xsh_rr_16_8
Definition: pcg_random.hpp:1563
oneseq_base< uint16_t, uint32_t, xsh_rr_mixin > oneseq_xsh_rr_32_16
Definition: pcg_random.hpp:1559
engine(itype state, typename sm::stream_state stream_seed)
Definition: pcg_random.hpp:481