38 namespace std _GLIBCXX_VISIBILITY(default)
40 _GLIBCXX_BEGIN_NAMESPACE_VERSION
54 #ifndef _GLIBCXX_USE_OLD_GENERATE_CANONICAL 55 _GLIBCXX_BEGIN_INLINE_ABI_NAMESPACE(_V2)
62 template<
typename _RealType,
size_t __bits,
63 typename _UniformRandomNumberGenerator>
66 #ifndef _GLIBCXX_USE_OLD_GENERATE_CANONICAL 67 _GLIBCXX_END_INLINE_ABI_NAMESPACE(_V2)
74 #pragma GCC diagnostic push 75 #pragma GCC diagnostic ignored "-Wc++17-extensions" 77 #ifndef __SIZEOF_INT128__ 83 using type = __rand_uint128;
85 __rand_uint128() =
default;
88 __rand_uint128(uint64_t __lo) noexcept : _M_lo(__lo) { }
90 __rand_uint128(
const __rand_uint128&) =
default;
91 __rand_uint128& operator=(
const __rand_uint128&) =
default;
93 _GLIBCXX14_CONSTEXPR type&
94 operator=(uint64_t __x) noexcept
95 {
return *
this = type(__x); }
97 _GLIBCXX14_CONSTEXPR type&
99 {
return *
this = *
this + 1; }
101 _GLIBCXX14_CONSTEXPR type&
102 operator--() noexcept
103 {
return *
this = *
this - 1; }
105 _GLIBCXX14_CONSTEXPR type
106 operator++(
int) noexcept
113 _GLIBCXX14_CONSTEXPR type
114 operator--(
int) noexcept
121 _GLIBCXX14_CONSTEXPR type&
122 operator+=(
const type& __r) noexcept
124 _M_hi += __r._M_hi + __builtin_add_overflow(_M_lo, __r._M_lo, &_M_lo);
128 friend _GLIBCXX14_CONSTEXPR type
129 operator+(type __l,
const type& __r) noexcept
130 {
return __l += __r; }
133 friend _GLIBCXX14_CONSTEXPR type
134 operator+(type __l, uint64_t __r) noexcept
135 {
return __l += type(__r); }
138 _GLIBCXX14_CONSTEXPR type&
139 operator-=(uint64_t __r) noexcept
141 _M_hi -= __builtin_sub_overflow(_M_lo, __r, &_M_lo);
145 friend _GLIBCXX14_CONSTEXPR type
146 operator-(type __l, uint64_t __r) noexcept
147 {
return __l -= __r; }
149 _GLIBCXX14_CONSTEXPR type&
150 operator*=(
const type& __x) noexcept
153 uint32_t(_M_lo), _M_lo >> 32,
154 uint32_t(_M_hi), _M_hi >> 32,
155 uint32_t(__x._M_lo), __x._M_lo >> 32,
156 uint32_t(__x._M_hi), __x._M_hi >> 32,
159 for (
int __i = 0; __i < 4; ++__i)
162 for (
int __j = __i; __j < 4; ++__j)
164 __c += __a[__i] * __a[4 + __j - __i] + __a[8 + __j];
165 __a[8 + __j] = uint32_t(__c);
169 _M_lo = __a[8] + (__a[9] << 32);
170 _M_hi = __a[10] + (__a[11] << 32);
176 _GLIBCXX14_CONSTEXPR type&
177 operator*=(uint64_t __x) noexcept
183 constexpr uint64_t __mask = 0xffffffff;
184 uint64_t __ll[2] = { _M_lo >> 32, _M_lo & __mask };
185 uint64_t __xx[2] = { __x >> 32, __x & __mask };
186 uint64_t __l0x0 = __ll[0] * __xx[0];
187 uint64_t __l0x1 = __ll[0] * __xx[1];
188 uint64_t __l1x0 = __ll[1] * __xx[0];
189 uint64_t __l1x1 = __ll[1] * __xx[1];
192 = (__l0x1 & __mask) + (__l1x0 & __mask) + (__l1x1 >> 32);
193 _M_hi = __l0x0 + (__l0x1 >> 32) + (__l1x0 >> 32) + (__mid >> 32);
194 _M_lo = (__mid << 32) + (__l1x1 & __mask);
198 _GLIBCXX14_CONSTEXPR type&
199 operator/=(
const type& __r) noexcept
204 _M_lo = _M_lo / __r._M_lo;
211 uint32_t(_M_lo), _M_lo >> 32,
212 uint32_t(_M_hi), _M_hi >> 32,
214 uint32_t(__r._M_lo), __r._M_lo >> 32,
215 uint32_t(__r._M_hi), __r._M_hi >> 32,
219 uint64_t __c = 0, __w = 0;
220 if (!__r._M_hi && __r._M_lo <= ~uint32_t(0))
221 for (
int __i = 3; ; --__i)
223 __w = __a[__i] + (__c << 32);
224 __a[9 + __i] = __w / __r._M_lo;
227 __c = __w % __r._M_lo;
232 int __n = 0, __d = 0;
233 uint64_t __q = 0, __s = 0;
234 for (__d = 3; __a[5 + __d] == 0; --__d)
236 __s = (uint64_t(1) << 32) / (__a[5 + __d] + 1);
239 for (
int __i = 0; __i <= 3; ++__i)
241 __w = __a[__i] * __s + __c;
242 __a[__i] = uint32_t(__w);
247 for (
int __i = 0; __i <= 3; ++__i)
249 __w = __a[5 + __i] * __s + __c;
250 __a[5 + __i] = uint32_t(__w);
257 for (
int __i = __n - __d - 1; __i >= 0; --__i)
260 __w = (__a[__n] << 32) + __a[__n - 1];
261 if (__a[__n] != __a[5 + __d])
262 __q = __w / __a[5 + __d];
265 uint64_t __t = __w - __q * __a[5 + __d];
266 if (__t <= ~uint32_t(0)
267 && __a[4 + __d] * __q > (__t << 32) + __a[__n - 2])
270 for (
int __j = 0; __j <= __d; ++__j)
272 __w = __q * __a[5 + __j] + __c;
274 __w = __a[__i + __j] - uint32_t(__w);
275 __a[__i + __j] = uint32_t(__w);
276 __c += (__w >> 32) != 0;
278 if (int64_t(__a[__n]) < int64_t(__c))
282 for (
int __j = 0; __j <= __d; ++__j)
284 __w = __a[__i + __j] + __a[5 + __j] + __c;
286 __a[__i + __j] = uint32_t(__w);
293 _M_lo = __a[9] + (__a[10] << 32);
294 _M_hi = __a[11] + (__a[12] << 32);
300 _GLIBCXX14_CONSTEXPR type&
301 operator%=(uint64_t __m) noexcept
309 int __shift = __builtin_clzll(__m) + 64 - __builtin_clzll(_M_hi);
313 __x._M_hi = __m << (__shift - 64);
318 __x._M_hi = __m >> (64 - __shift);
319 __x._M_lo = __m << __shift;
322 while (_M_hi != 0 || _M_lo >= __m)
327 _M_hi -= __builtin_sub_overflow(_M_lo, __x._M_lo,
330 __x._M_lo = (__x._M_lo >> 1) | (__x._M_hi << 63);
336 friend _GLIBCXX14_CONSTEXPR type
337 operator*(type __l,
const type& __r) noexcept
338 {
return __l *= __r; }
340 friend _GLIBCXX14_CONSTEXPR type
341 operator*(type __l, uint64_t __r) noexcept
342 {
return __l *= __r; }
344 friend _GLIBCXX14_CONSTEXPR type
345 operator/(type __l,
const type& __r) noexcept
346 {
return __l /= __r; }
348 friend _GLIBCXX14_CONSTEXPR type
349 operator%(type __l, uint64_t __m) noexcept
350 {
return __l %= __m; }
352 friend _GLIBCXX14_CONSTEXPR type
353 operator~(type __v) noexcept
355 __v._M_hi = ~__v._M_hi;
356 __v._M_lo = ~__v._M_lo;
360 _GLIBCXX14_CONSTEXPR type&
361 operator>>=(
unsigned __c) noexcept
365 _M_lo = _M_hi >>= (__c - 64);
370 _M_lo = (_M_lo >> __c) | (_M_hi << (64 - __c));
376 _GLIBCXX14_CONSTEXPR type&
377 operator<<=(
unsigned __c) noexcept
381 _M_hi = _M_lo << (__c - 64);
386 _M_hi = (_M_hi << __c) | (_M_lo >> (64 - __c));
392 friend _GLIBCXX14_CONSTEXPR type
394 {
return __x >>= __c; }
396 friend _GLIBCXX14_CONSTEXPR type
398 {
return __x <<= __c; }
400 _GLIBCXX14_CONSTEXPR type&
401 operator|=(
const type& __r) noexcept
408 _GLIBCXX14_CONSTEXPR type&
409 operator^=(
const type& __r) noexcept
416 _GLIBCXX14_CONSTEXPR type&
417 operator&=(
const type& __r) noexcept
424 friend _GLIBCXX14_CONSTEXPR type
425 operator|(type __l,
const type& __r) noexcept
426 {
return __l |= __r; }
428 friend _GLIBCXX14_CONSTEXPR type
429 operator^(type __l,
const type& __r) noexcept
430 {
return __l ^= __r; }
432 friend _GLIBCXX14_CONSTEXPR type
433 operator&(type __l,
const type& __r) noexcept
434 {
return __l &= __r; }
436 friend _GLIBCXX14_CONSTEXPR type
437 operator&(type __l, uint64_t __r) noexcept
444 #if __cpp_impl_three_way_comparison >= 201907L 445 friend std::strong_ordering
446 operator<=>(
const type&,
const type&) =
default;
449 operator==(
const type&,
const type&) =
default;
451 friend constexpr
bool 452 operator==(
const type& __l,
const type& __r) noexcept
453 {
return __l._M_hi == __r._M_hi && __l._M_lo == __r._M_lo; }
455 friend _GLIBCXX14_CONSTEXPR
bool 456 operator<(
const type& __l,
const type& __r) noexcept
458 if (__l._M_hi < __r._M_hi)
460 else if (__l._M_hi == __r._M_hi)
461 return __l._M_lo < __r._M_lo;
466 friend _GLIBCXX14_CONSTEXPR
bool 467 operator>(
const type& __l,
const type& __r) noexcept
468 {
return __r < __l; }
470 friend _GLIBCXX14_CONSTEXPR
bool 471 operator<=(
const type& __l,
const type& __r) noexcept
472 {
return !(__r < __l); }
474 friend _GLIBCXX14_CONSTEXPR
bool 475 operator>=(
const type& __l,
const type& __r) noexcept
476 {
return !(__l < __r); }
479 friend _GLIBCXX14_CONSTEXPR
bool 480 operator==(
const type& __l, uint64_t __r) noexcept
481 {
return __l == type(__r); }
483 template<
typename _RealT>
484 constexpr
explicit operator _RealT() const noexcept
487 "template argument must be a floating point type");
490 : _RealT(_M_hi) * _RealT(18446744073709551616.0)
495 constexpr
explicit operator uint64_t() const noexcept
501 #endif // ! __SIZEOF_INT128__ 503 template<
typename _UIntType,
size_t __w,
504 bool = __w < static_cast<size_t>
507 {
static constexpr _UIntType __value = 0; };
509 template<
typename _UIntType,
size_t __w>
510 struct _Shift<_UIntType, __w, true>
511 {
static constexpr _UIntType __value = _UIntType(1) << __w; };
514 int __which = ((__s <= __CHAR_BIT__ *
sizeof (int))
515 + (__s <= __CHAR_BIT__ *
sizeof (long))
516 + (__s <= __CHAR_BIT__ *
sizeof (
long long))
519 struct _Select_uint_least_t
521 static_assert(__which < 0,
522 "sorry, would be too much trouble for a slow result");
526 struct _Select_uint_least_t<__s, 4>
527 {
using type =
unsigned int; };
530 struct _Select_uint_least_t<__s, 3>
531 {
using type =
unsigned long; };
534 struct _Select_uint_least_t<__s, 2>
535 {
using type =
unsigned long long; };
537 #if __SIZEOF_INT128__ > __SIZEOF_LONG_LONG__ 539 struct _Select_uint_least_t<__s, 1>
540 { __extension__
using type =
unsigned __int128; };
541 #elif __has_builtin(__builtin_add_overflow) \ 542 && __has_builtin(__builtin_sub_overflow) \ 543 && defined __UINT64_TYPE__ 545 struct _Select_uint_least_t<__s, 1>
546 {
using type = __rand_uint128; };
550 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
551 bool __big_enough = (!(__m & (__m - 1))
552 || (_Tp(-1) - __c) / __a >= __m - 1),
553 bool __schrage_ok = __m % __a < __m / __a>
560 =
typename _Select_uint_least_t<
std::__lg(__a)
562 return static_cast<_Tp
>((_Tp2(__a) * __x + __c) % __m);
567 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c>
568 struct _Mod<_Tp, __m, __a, __c, false, true>
577 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
bool __s>
578 struct _Mod<_Tp, __m, __a, __c, true, __s>
583 _Tp __res = __a * __x + __c;
590 template<
typename _Tp, _Tp __m, _Tp __a = 1, _Tp __c = 0>
594 if constexpr (__a == 0)
597 return _Mod<_Tp, __m, __a, __c>::__calc(__x);
604 template<typename _Engine, typename _DInputType>
608 "template argument must be a floating point type");
611 _Adaptor(_Engine& __g)
616 {
return _DInputType(0); }
620 {
return _DInputType(1); }
644 template<
typename _Sseq>
645 using __seed_seq_generate_t = decltype(
646 std::declval<_Sseq&>().generate(std::declval<uint_least32_t*>(),
647 std::declval<uint_least32_t*>()));
649 template<
typename _Sseq,
typename _Engine,
typename _Res,
650 typename _GenerateCheck = __seed_seq_generate_t<_Sseq>>
651 using _If_seed_seq_for = _Require<
652 __not_<is_same<__remove_cvref_t<_Sseq>, _Engine>>,
653 is_unsigned<typename _Sseq::result_type>,
654 __not_<is_convertible<_Sseq, _Res>>
657 #pragma GCC diagnostic pop 702 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
706 "result_type must be an unsigned integral type");
707 static_assert(__m == 0u || (__a < __m && __c < __m),
708 "template argument substituting __m out of bounds");
710 template<
typename _Sseq>
720 static constexpr result_type multiplier = __a;
722 static constexpr result_type increment = __c;
725 static constexpr result_type default_seed = 1u;
751 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
763 seed(result_type __s = default_seed);
772 template<
typename _Sseq>
782 static constexpr result_type
784 {
return __c == 0u ? 1u : 0u; }
789 static constexpr result_type
799 for (; __z != 0ULL; --__z)
809 _M_x = __detail::__mod<_UIntType, __m, __a, __c>(_M_x);
826 const linear_congruential_engine& __rhs)
827 {
return __lhs._M_x == __rhs._M_x; }
837 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
838 _UIntType1 __m1,
typename _CharT,
typename _Traits>
840 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
842 __a1, __c1, __m1>& __lcr);
857 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
858 _UIntType1 __m1,
typename _CharT,
typename _Traits>
868 #if __cpp_impl_three_way_comparison < 201907L 880 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
886 {
return !(__lhs == __rhs); }
920 template<
typename _UIntType,
size_t __w,
921 size_t __n,
size_t __m,
size_t __r,
922 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
923 _UIntType __b,
size_t __t,
924 _UIntType __c,
size_t __l, _UIntType __f>
928 "result_type must be an unsigned integral type");
929 static_assert(1u <= __m && __m <= __n,
930 "template argument substituting __m out of bounds");
931 static_assert(__r <= __w,
"template argument substituting " 933 static_assert(__u <= __w,
"template argument substituting " 935 static_assert(__s <= __w,
"template argument substituting " 937 static_assert(__t <= __w,
"template argument substituting " 939 static_assert(__l <= __w,
"template argument substituting " 942 "template argument substituting __w out of bound");
943 static_assert(__a <= (__detail::_Shift<_UIntType, __w>::__value - 1),
944 "template argument substituting __a out of bound");
945 static_assert(__b <= (__detail::_Shift<_UIntType, __w>::__value - 1),
946 "template argument substituting __b out of bound");
947 static_assert(__c <= (__detail::_Shift<_UIntType, __w>::__value - 1),
948 "template argument substituting __c out of bound");
949 static_assert(__d <= (__detail::_Shift<_UIntType, __w>::__value - 1),
950 "template argument substituting __d out of bound");
951 static_assert(__f <= (__detail::_Shift<_UIntType, __w>::__value - 1),
952 "template argument substituting __f out of bound");
954 template<
typename _Sseq>
964 static constexpr
size_t word_size = __w;
965 static constexpr
size_t state_size = __n;
966 static constexpr
size_t shift_size = __m;
967 static constexpr
size_t mask_bits = __r;
968 static constexpr result_type xor_mask = __a;
969 static constexpr
size_t tempering_u = __u;
970 static constexpr result_type tempering_d = __d;
971 static constexpr
size_t tempering_s = __s;
972 static constexpr result_type tempering_b = __b;
973 static constexpr
size_t tempering_t = __t;
974 static constexpr result_type tempering_c = __c;
975 static constexpr
size_t tempering_l = __l;
976 static constexpr result_type initialization_multiplier = __f;
977 static constexpr result_type default_seed = 5489u;
981 mersenne_twister_engine() : mersenne_twister_engine(default_seed) { }
984 mersenne_twister_engine(result_type __sd)
993 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
999 seed(result_type __sd = default_seed);
1001 template<
typename _Sseq>
1008 static constexpr result_type
1015 static constexpr result_type
1017 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1023 discard(
unsigned long long __z);
1042 const mersenne_twister_engine& __rhs)
1043 {
return (
std::equal(__lhs._M_x, __lhs._M_x + state_size, __rhs._M_x)
1044 && __lhs._M_p == __rhs._M_p); }
1058 template<
typename _UIntType1,
1059 size_t __w1,
size_t __n1,
1060 size_t __m1,
size_t __r1,
1061 _UIntType1 __a1,
size_t __u1,
1062 _UIntType1 __d1,
size_t __s1,
1063 _UIntType1 __b1,
size_t __t1,
1064 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
1065 typename _CharT,
typename _Traits>
1067 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1069 __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
1084 template<
typename _UIntType1,
1085 size_t __w1,
size_t __n1,
1086 size_t __m1,
size_t __r1,
1087 _UIntType1 __a1,
size_t __u1,
1088 _UIntType1 __d1,
size_t __s1,
1089 _UIntType1 __b1,
size_t __t1,
1090 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
1091 typename _CharT,
typename _Traits>
1095 __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
1101 _UIntType _M_x[state_size];
1105 #if __cpp_impl_three_way_comparison < 201907L 1118 template<
typename _UIntType,
size_t __w,
1119 size_t __n,
size_t __m,
size_t __r,
1120 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
1121 _UIntType __b,
size_t __t,
1122 _UIntType __c,
size_t __l, _UIntType __f>
1125 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __lhs,
1127 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __rhs)
1128 {
return !(__lhs == __rhs); }
1149 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
1153 "result_type must be an unsigned integral type");
1154 static_assert(0u < __s && __s < __r,
1157 "template argument substituting __w out of bounds");
1159 template<
typename _Sseq>
1169 static constexpr
size_t word_size = __w;
1170 static constexpr
size_t short_lag = __s;
1171 static constexpr
size_t long_lag = __r;
1172 static constexpr uint_least32_t default_seed = 19780503u;
1174 subtract_with_carry_engine() : subtract_with_carry_engine(0u)
1191 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1209 seed(result_type __sd = 0u);
1215 template<
typename _Sseq>
1223 static constexpr result_type
1231 static constexpr result_type
1233 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1241 for (; __z != 0ULL; --__z)
1265 const subtract_with_carry_engine& __rhs)
1266 {
return (
std::equal(__lhs._M_x, __lhs._M_x + long_lag, __rhs._M_x)
1267 && __lhs._M_carry == __rhs._M_carry
1268 && __lhs._M_p == __rhs._M_p); }
1282 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
1283 typename _CharT,
typename _Traits>
1285 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1301 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
1302 typename _CharT,
typename _Traits>
1310 _UIntType _M_x[long_lag];
1315 #if __cpp_impl_three_way_comparison < 201907L 1328 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
1334 {
return !(__lhs == __rhs); }
1346 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
1349 static_assert(1 <= __r && __r <= __p,
1350 "template argument substituting __r out of bounds");
1354 typedef typename _RandomNumberEngine::result_type
result_type;
1356 template<
typename _Sseq>
1362 static constexpr
size_t block_size = __p;
1363 static constexpr
size_t used_block = __r;
1371 : _M_b(), _M_n(0) { }
1381 : _M_b(__rng), _M_n(0) { }
1391 : _M_b(
std::
move(__rng)), _M_n(0) { }
1401 : _M_b(__s), _M_n(0) { }
1408 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1411 : _M_b(__q), _M_n(0)
1441 template<
typename _Sseq>
1453 const _RandomNumberEngine&
1460 static constexpr result_type
1462 {
return _RandomNumberEngine::min(); }
1467 static constexpr result_type
1469 {
return _RandomNumberEngine::max(); }
1477 for (; __z != 0ULL; --__z)
1500 const discard_block_engine& __rhs)
1501 {
return __lhs._M_b == __rhs._M_b && __lhs._M_n == __rhs._M_n; }
1514 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1515 typename _CharT,
typename _Traits>
1517 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1532 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1533 typename _CharT,
typename _Traits>
1540 _RandomNumberEngine _M_b;
1544 #if __cpp_impl_three_way_comparison < 201907L 1556 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
1562 {
return !(__lhs == __rhs); }
1572 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1576 "result_type must be an unsigned integral type");
1578 "template argument substituting __w out of bounds");
1580 template<
typename _Sseq>
1632 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1659 template<
typename _Sseq>
1668 const _RandomNumberEngine&
1675 static constexpr result_type
1682 static constexpr result_type
1684 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1692 for (; __z != 0ULL; --__z)
1716 const independent_bits_engine& __rhs)
1717 {
return __lhs._M_b == __rhs._M_b; }
1731 template<
typename _CharT,
typename _Traits>
1735 __w, _UIntType>& __x)
1742 _RandomNumberEngine _M_b;
1745 #if __cpp_impl_three_way_comparison < 201907L 1758 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1764 {
return !(__lhs == __rhs); }
1777 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType,
1778 typename _CharT,
typename _Traits>
1780 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1782 __w, _UIntType>& __x)
1799 template<
typename _RandomNumberEngine,
size_t __k>
1802 static_assert(1u <= __k,
"template argument substituting " 1803 "__k out of bound");
1807 typedef typename _RandomNumberEngine::result_type
result_type;
1809 template<
typename _Sseq>
1814 static constexpr
size_t table_size = __k;
1823 { _M_initialize(); }
1834 { _M_initialize(); }
1845 { _M_initialize(); }
1856 { _M_initialize(); }
1863 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1867 { _M_initialize(); }
1896 template<
typename _Sseq>
1907 const _RandomNumberEngine&
1914 static constexpr result_type
1916 {
return _RandomNumberEngine::min(); }
1921 static constexpr result_type
1923 {
return _RandomNumberEngine::max(); }
1931 for (; __z != 0ULL; --__z)
1954 const shuffle_order_engine& __rhs)
1955 {
return (__lhs._M_b == __rhs._M_b
1956 &&
std::equal(__lhs._M_v, __lhs._M_v + __k, __rhs._M_v)
1957 && __lhs._M_y == __rhs._M_y); }
1970 template<
typename _RandomNumberEngine1,
size_t __k1,
1971 typename _CharT,
typename _Traits>
1973 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1988 template<
typename _RandomNumberEngine1,
size_t __k1,
1989 typename _CharT,
typename _Traits>
1995 void _M_initialize()
1997 for (
size_t __i = 0; __i < __k; ++__i)
2002 _RandomNumberEngine _M_b;
2003 result_type _M_v[__k];
2007 #if __cpp_impl_three_way_comparison < 201907L 2019 template<
typename _RandomNumberEngine,
size_t __k>
2025 {
return !(__lhs == __rhs); }
2028 #if __glibcxx_philox_engine // >= C++26 2057 template<
typename _UIntType,
size_t __w,
size_t __n,
size_t __r,
2058 _UIntType... __consts>
2061 static_assert(__n == 2 || __n == 4,
2062 "template argument N must be either 2 or 4");
2063 static_assert(
sizeof...(__consts) == __n,
2064 "length of consts array must match specified N");
2065 static_assert(0 < __r,
"a number of rounds must be specified");
2067 "specified bitlength must match input type");
2069 template<
typename _Sseq>
2070 static constexpr
bool __is_seed_seq = requires {
2071 typename __detail::_If_seed_seq_for<_Sseq, philox_engine, _UIntType>;
2074 template <
size_t __ind0,
size_t __ind1>
2076 array<_UIntType, __n / 2>
2079 if constexpr (__n == 4)
2080 return {__consts...[__ind0], __consts...[__ind1]};
2082 return {__consts...[__ind0]};
2088 static constexpr
size_t word_size = __w;
2089 static constexpr
size_t word_count = __n;
2090 static constexpr
size_t round_count = __r;
2092 = _S_popArray<0,2>();
2093 static constexpr
array<result_type, __n / 2> round_consts
2094 = _S_popArray<1,3>();
2097 static constexpr result_type
2102 static constexpr result_type
2105 return ((1ull << (__w - 1)) | ((1ull << (__w - 1)) - 1));
2108 static constexpr result_type default_seed = 20111115u;
2112 : philox_engine(default_seed)
2116 philox_engine(result_type __value)
2117 : _M_x{}, _M_k{}, _M_y{}, _M_i(__n - 1)
2118 { _M_k[0] = __value &
max(); }
2124 template<
typename _Sseq> requires __is_seed_seq<_Sseq>
2126 philox_engine(_Sseq& __q)
2132 seed(result_type __value = default_seed)
2137 _M_k[0] = __value &
max();
2145 template<
typename _Sseq>
2147 seed(_Sseq& __q) requires __is_seed_seq<_Sseq>;
2156 for (
size_t __j = 0; __j < __n; ++__j)
2157 _M_x[__j] = __counter[__n - 1 - __j] &
max();
2167 operator==(
const philox_engine&,
const philox_engine&) =
default;
2185 discard(
unsigned long long __z)
2198 template<
typename _CharT,
typename _Traits>
2200 operator<<(basic_ostream<_CharT, _Traits>& __os,
2201 const philox_engine& __x)
2203 const typename ios_base::fmtflags __flags = __os.
flags();
2204 const _CharT __fill = __os.
fill();
2206 _CharT __space = __os.
widen(
' ');
2208 for (
auto& __subkey : __x._M_k)
2209 __os << __subkey << __space;
2210 for (
auto& __ctr : __x._M_x)
2211 __os << __ctr << __space;
2213 __os.
flags(__flags);
2225 template <
typename _CharT,
typename _Traits>
2230 const typename ios_base::fmtflags __flags = __is.
flags();
2232 for (
auto& __subkey : __x._M_k)
2234 for (
auto& __ctr : __x._M_x)
2237 unsigned char __setIndex = 0;
2238 for (
size_t __j = 0; __j < __x._M_x.size(); ++__j)
2240 if (__x._M_x[__j] > 0)
2246 for (
size_t __j = 0; __j <= __setIndex; ++__j)
2248 if (__j != __setIndex)
2249 __x._M_x[__j] =
max();
2254 __x._M_x = __tmpCtr;
2256 __is.
flags(__flags);
2263 array<_UIntType, __n / 2> _M_k;
2265 unsigned long long _M_i = 0;
2269 _S_mulhi(_UIntType __a, _UIntType __b);
2273 _S_mullo(_UIntType __a, _UIntType __b);
2319 0xb5026f5aa96619e9ULL, 29,
2320 0x5555555555555555ULL, 17,
2321 0x71d67fffeda60000ULL, 37,
2322 0xfff7eee000000000ULL, 43,
2339 #if __glibcxx_philox_engine 2342 typedef philox_engine<
2345 0xCD9E8D57, 0x9E3779B9,
2346 0xD2511F53, 0xBB67AE85> philox4x32;
2349 typedef philox_engine<
2352 0xCA5A826395121157, 0x9E3779B97F4A7C15,
2353 0xD2E7470EE14C6C93, 0xBB67AE8584CAA73B> philox4x64;
2379 static constexpr result_type
2383 static constexpr result_type
2388 entropy()
const noexcept
2389 {
return this->_M_getentropy(); }
2393 {
return this->_M_getval(); }
2405 result_type _M_getval();
2406 result_type _M_getval_pretr1();
2407 double _M_getentropy()
const noexcept;
2409 void _M_init(
const char*,
size_t);
2416 result_type (*_M_func)(
void*);
2439 #if __cpp_impl_three_way_comparison < 201907L 2444 template<
typename _IntType>
2448 {
return !(__d1 == __d2); }
2461 template<
typename _IntType,
typename _CharT,
typename _Traits>
2463 operator<<(std::basic_ostream<_CharT, _Traits>&,
2475 template<
typename _IntType,
typename _CharT,
typename _Traits>
2491 template<
typename _RealType =
double>
2495 "result_type must be a floating point type");
2509 param_type(_RealType __a, _RealType __b = _RealType(1))
2510 : _M_a(__a), _M_b(__b)
2512 __glibcxx_assert(_M_a <= _M_b);
2525 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
2527 #if __cpp_impl_three_way_comparison < 201907L 2530 {
return !(__p1 == __p2); }
2554 : _M_param(__a, __b)
2572 {
return _M_param.a(); }
2576 {
return _M_param.b(); }
2583 {
return _M_param; }
2591 { _M_param = __param; }
2598 {
return this->a(); }
2605 {
return this->b(); }
2610 template<
typename _UniformRandomNumberGenerator>
2613 {
return this->operator()(__urng, _M_param); }
2615 template<
typename _UniformRandomNumberGenerator>
2617 operator()(_UniformRandomNumberGenerator& __urng,
2620 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
2622 return (__aurng() * (__p.b() - __p.a())) + __p.a();
2625 template<
typename _ForwardIterator,
2626 typename _UniformRandomNumberGenerator>
2628 __generate(_ForwardIterator __f, _ForwardIterator __t,
2629 _UniformRandomNumberGenerator& __urng)
2630 { this->__generate(__f, __t, __urng, _M_param); }
2632 template<
typename _ForwardIterator,
2633 typename _UniformRandomNumberGenerator>
2635 __generate(_ForwardIterator __f, _ForwardIterator __t,
2636 _UniformRandomNumberGenerator& __urng,
2638 { this->__generate_impl(__f, __t, __urng, __p); }
2640 template<
typename _UniformRandomNumberGenerator>
2642 __generate(result_type* __f, result_type* __t,
2643 _UniformRandomNumberGenerator& __urng,
2645 { this->__generate_impl(__f, __t, __urng, __p); }
2654 {
return __d1._M_param == __d2._M_param; }
2657 template<
typename _ForwardIterator,
2658 typename _UniformRandomNumberGenerator>
2660 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2661 _UniformRandomNumberGenerator& __urng,
2667 #if __cpp_impl_three_way_comparison < 201907L 2672 template<
typename _IntType>
2676 {
return !(__d1 == __d2); }
2689 template<
typename _RealType,
typename _CharT,
typename _Traits>
2691 operator<<(std::basic_ostream<_CharT, _Traits>&,
2703 template<
typename _RealType,
typename _CharT,
typename _Traits>
2728 template<
typename _RealType =
double>
2732 "result_type must be a floating point type");
2746 param_type(_RealType __mean, _RealType __stddev = _RealType(1))
2747 : _M_mean(__mean), _M_stddev(__stddev)
2749 __glibcxx_assert(_M_stddev > _RealType(0));
2758 {
return _M_stddev; }
2762 {
return (__p1._M_mean == __p2._M_mean
2763 && __p1._M_stddev == __p2._M_stddev); }
2765 #if __cpp_impl_three_way_comparison < 201907L 2768 {
return !(__p1 == __p2); }
2773 _RealType _M_stddev;
2785 result_type __stddev = result_type(1))
2786 : _M_param(__mean, __stddev)
2799 { _M_saved_available =
false; }
2806 {
return _M_param.mean(); }
2813 {
return _M_param.stddev(); }
2820 {
return _M_param; }
2828 { _M_param = __param; }
2847 template<
typename _UniformRandomNumberGenerator>
2850 {
return this->operator()(__urng, _M_param); }
2852 template<
typename _UniformRandomNumberGenerator>
2854 operator()(_UniformRandomNumberGenerator& __urng,
2855 const param_type& __p);
2857 template<
typename _ForwardIterator,
2858 typename _UniformRandomNumberGenerator>
2860 __generate(_ForwardIterator __f, _ForwardIterator __t,
2861 _UniformRandomNumberGenerator& __urng)
2862 { this->__generate(__f, __t, __urng, _M_param); }
2864 template<
typename _ForwardIterator,
2865 typename _UniformRandomNumberGenerator>
2867 __generate(_ForwardIterator __f, _ForwardIterator __t,
2868 _UniformRandomNumberGenerator& __urng,
2869 const param_type& __p)
2870 { this->__generate_impl(__f, __t, __urng, __p); }
2872 template<
typename _UniformRandomNumberGenerator>
2874 __generate(result_type* __f, result_type* __t,
2875 _UniformRandomNumberGenerator& __urng,
2876 const param_type& __p)
2877 { this->__generate_impl(__f, __t, __urng, __p); }
2884 template<
typename _RealType1>
2899 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2901 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2914 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2920 template<
typename _ForwardIterator,
2921 typename _UniformRandomNumberGenerator>
2923 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2924 _UniformRandomNumberGenerator& __urng,
2925 const param_type& __p);
2927 param_type _M_param;
2928 result_type _M_saved = 0;
2929 bool _M_saved_available =
false;
2932 #if __cpp_impl_three_way_comparison < 201907L 2936 template<
typename _RealType>
2940 {
return !(__d1 == __d2); }
2955 template<
typename _RealType =
double>
2959 "result_type must be a floating point type");
2973 param_type(_RealType __m, _RealType __s = _RealType(1))
2974 : _M_m(__m), _M_s(__s)
2987 {
return __p1._M_m == __p2._M_m && __p1._M_s == __p2._M_s; }
2989 #if __cpp_impl_three_way_comparison < 201907L 2992 {
return !(__p1 == __p2); }
3004 : _M_param(__m, __s), _M_nd()
3009 : _M_param(__p), _M_nd()
3024 {
return _M_param.m(); }
3028 {
return _M_param.s(); }
3035 {
return _M_param; }
3043 { _M_param = __param; }
3050 {
return result_type(0); }
3062 template<
typename _UniformRandomNumberGenerator>
3065 {
return this->operator()(__urng, _M_param); }
3067 template<
typename _UniformRandomNumberGenerator>
3069 operator()(_UniformRandomNumberGenerator& __urng,
3071 {
return std::exp(__p.s() * _M_nd(__urng) + __p.m()); }
3073 template<
typename _ForwardIterator,
3074 typename _UniformRandomNumberGenerator>
3076 __generate(_ForwardIterator __f, _ForwardIterator __t,
3077 _UniformRandomNumberGenerator& __urng)
3078 { this->__generate(__f, __t, __urng, _M_param); }
3080 template<
typename _ForwardIterator,
3081 typename _UniformRandomNumberGenerator>
3083 __generate(_ForwardIterator __f, _ForwardIterator __t,
3084 _UniformRandomNumberGenerator& __urng,
3086 { this->__generate_impl(__f, __t, __urng, __p); }
3088 template<
typename _UniformRandomNumberGenerator>
3090 __generate(result_type* __f, result_type* __t,
3091 _UniformRandomNumberGenerator& __urng,
3093 { this->__generate_impl(__f, __t, __urng, __p); }
3103 {
return (__d1._M_param == __d2._M_param
3104 && __d1._M_nd == __d2._M_nd); }
3116 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3118 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3131 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3137 template<
typename _ForwardIterator,
3138 typename _UniformRandomNumberGenerator>
3140 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3141 _UniformRandomNumberGenerator& __urng,
3149 #if __cpp_impl_three_way_comparison < 201907L 3153 template<
typename _RealType>
3157 {
return !(__d1 == __d2); }
3180 template<
typename _RealType =
double>
3184 "result_type must be a floating point type");
3199 param_type(_RealType __alpha_val, _RealType __beta_val = _RealType(1))
3200 : _M_alpha(__alpha_val), _M_beta(__beta_val)
3202 __glibcxx_assert(_M_alpha > _RealType(0));
3208 {
return _M_alpha; }
3215 operator==(
const param_type& __p1,
const param_type& __p2)
3216 {
return (__p1._M_alpha == __p2._M_alpha
3217 && __p1._M_beta == __p2._M_beta); }
3219 #if __cpp_impl_three_way_comparison < 201907L 3221 operator!=(
const param_type& __p1,
const param_type& __p2)
3222 {
return !(__p1 == __p2); }
3232 _RealType _M_malpha, _M_a2;
3247 _RealType __beta_val = _RealType(1))
3248 : _M_param(__alpha_val, __beta_val), _M_nd()
3253 : _M_param(__p), _M_nd()
3268 {
return _M_param.alpha(); }
3275 {
return _M_param.beta(); }
3282 {
return _M_param; }
3290 { _M_param = __param; }
3297 {
return result_type(0); }
3309 template<
typename _UniformRandomNumberGenerator>
3312 {
return this->operator()(__urng, _M_param); }
3314 template<
typename _UniformRandomNumberGenerator>
3316 operator()(_UniformRandomNumberGenerator& __urng,
3317 const param_type& __p);
3319 template<
typename _ForwardIterator,
3320 typename _UniformRandomNumberGenerator>
3322 __generate(_ForwardIterator __f, _ForwardIterator __t,
3323 _UniformRandomNumberGenerator& __urng)
3324 { this->__generate(__f, __t, __urng, _M_param); }
3326 template<
typename _ForwardIterator,
3327 typename _UniformRandomNumberGenerator>
3329 __generate(_ForwardIterator __f, _ForwardIterator __t,
3330 _UniformRandomNumberGenerator& __urng,
3331 const param_type& __p)
3332 { this->__generate_impl(__f, __t, __urng, __p); }
3334 template<
typename _UniformRandomNumberGenerator>
3336 __generate(result_type* __f, result_type* __t,
3337 _UniformRandomNumberGenerator& __urng,
3338 const param_type& __p)
3339 { this->__generate_impl(__f, __t, __urng, __p); }
3349 {
return (__d1._M_param == __d2._M_param
3350 && __d1._M_nd == __d2._M_nd); }
3362 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3364 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3376 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3382 template<
typename _ForwardIterator,
3383 typename _UniformRandomNumberGenerator>
3385 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3386 _UniformRandomNumberGenerator& __urng,
3387 const param_type& __p);
3389 param_type _M_param;
3394 #if __cpp_impl_three_way_comparison < 201907L 3398 template<
typename _RealType>
3402 {
return !(__d1 == __d2); }
3422 template<
typename _RealType =
double>
3426 "result_type must be a floating point type");
3450 {
return __p1._M_n == __p2._M_n; }
3452 #if __cpp_impl_three_way_comparison < 201907L 3455 {
return !(__p1 == __p2); }
3466 : _M_param(__n), _M_gd(__n / 2)
3471 : _M_param(__p), _M_gd(__p.n() / 2)
3486 {
return _M_param.n(); }
3493 {
return _M_param; }
3505 _M_gd.param(param_type{__param.n() / 2});
3513 {
return result_type(0); }
3525 template<
typename _UniformRandomNumberGenerator>
3528 {
return 2 * _M_gd(__urng); }
3530 template<
typename _UniformRandomNumberGenerator>
3532 operator()(_UniformRandomNumberGenerator& __urng,
3537 return 2 * _M_gd(__urng, param_type(__p.n() / 2));
3540 template<
typename _ForwardIterator,
3541 typename _UniformRandomNumberGenerator>
3543 __generate(_ForwardIterator __f, _ForwardIterator __t,
3544 _UniformRandomNumberGenerator& __urng)
3545 { this->__generate_impl(__f, __t, __urng); }
3547 template<
typename _ForwardIterator,
3548 typename _UniformRandomNumberGenerator>
3550 __generate(_ForwardIterator __f, _ForwardIterator __t,
3551 _UniformRandomNumberGenerator& __urng,
3555 this->__generate_impl(__f, __t, __urng, __p2); }
3557 template<
typename _UniformRandomNumberGenerator>
3559 __generate(result_type* __f, result_type* __t,
3560 _UniformRandomNumberGenerator& __urng)
3561 { this->__generate_impl(__f, __t, __urng); }
3563 template<
typename _UniformRandomNumberGenerator>
3565 __generate(result_type* __f, result_type* __t,
3566 _UniformRandomNumberGenerator& __urng,
3570 this->__generate_impl(__f, __t, __urng, __p2); }
3580 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
3592 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3594 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3607 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3613 template<
typename _ForwardIterator,
3614 typename _UniformRandomNumberGenerator>
3616 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3617 _UniformRandomNumberGenerator& __urng);
3619 template<
typename _ForwardIterator,
3620 typename _UniformRandomNumberGenerator>
3622 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3623 _UniformRandomNumberGenerator& __urng,
3632 #if __cpp_impl_three_way_comparison < 201907L 3636 template<
typename _RealType>
3640 {
return !(__d1 == __d2); }
3652 template<
typename _RealType =
double>
3656 "result_type must be a floating point type");
3670 param_type(_RealType __a, _RealType __b = _RealType(1))
3671 : _M_a(__a), _M_b(__b)
3684 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
3686 #if __cpp_impl_three_way_comparison < 201907L 3689 {
return !(__p1 == __p2); }
3701 : _M_param(__a, __b)
3721 {
return _M_param.a(); }
3725 {
return _M_param.b(); }
3732 {
return _M_param; }
3740 { _M_param = __param; }
3759 template<
typename _UniformRandomNumberGenerator>
3762 {
return this->operator()(__urng, _M_param); }
3764 template<
typename _UniformRandomNumberGenerator>
3766 operator()(_UniformRandomNumberGenerator& __urng,
3769 template<
typename _ForwardIterator,
3770 typename _UniformRandomNumberGenerator>
3772 __generate(_ForwardIterator __f, _ForwardIterator __t,
3773 _UniformRandomNumberGenerator& __urng)
3774 { this->__generate(__f, __t, __urng, _M_param); }
3776 template<
typename _ForwardIterator,
3777 typename _UniformRandomNumberGenerator>
3779 __generate(_ForwardIterator __f, _ForwardIterator __t,
3780 _UniformRandomNumberGenerator& __urng,
3782 { this->__generate_impl(__f, __t, __urng, __p); }
3784 template<
typename _UniformRandomNumberGenerator>
3786 __generate(result_type* __f, result_type* __t,
3787 _UniformRandomNumberGenerator& __urng,
3789 { this->__generate_impl(__f, __t, __urng, __p); }
3798 {
return __d1._M_param == __d2._M_param; }
3801 template<
typename _ForwardIterator,
3802 typename _UniformRandomNumberGenerator>
3804 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3805 _UniformRandomNumberGenerator& __urng,
3811 #if __cpp_impl_three_way_comparison < 201907L 3816 template<
typename _RealType>
3820 {
return !(__d1 == __d2); }
3833 template<
typename _RealType,
typename _CharT,
typename _Traits>
3835 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3848 template<
typename _RealType,
typename _CharT,
typename _Traits>
3867 template<
typename _RealType =
double>
3871 "result_type must be a floating point type");
3885 param_type(_RealType __m, _RealType __n = _RealType(1))
3886 : _M_m(__m), _M_n(__n)
3899 {
return __p1._M_m == __p2._M_m && __p1._M_n == __p2._M_n; }
3901 #if __cpp_impl_three_way_comparison < 201907L 3904 {
return !(__p1 == __p2); }
3916 _RealType __n = _RealType(1))
3917 : _M_param(__m, __n), _M_gd_x(__m / 2), _M_gd_y(__n / 2)
3922 : _M_param(__p), _M_gd_x(__p.m() / 2), _M_gd_y(__p.n() / 2)
3940 {
return _M_param.m(); }
3944 {
return _M_param.n(); }
3951 {
return _M_param; }
3959 { _M_param = __param; }
3966 {
return result_type(0); }
3978 template<
typename _UniformRandomNumberGenerator>
3981 {
return (_M_gd_x(__urng) * n()) / (_M_gd_y(__urng) * m()); }
3983 template<
typename _UniformRandomNumberGenerator>
3985 operator()(_UniformRandomNumberGenerator& __urng,
3990 return ((_M_gd_x(__urng, param_type(__p.m() / 2)) * n())
3991 / (_M_gd_y(__urng, param_type(__p.n() / 2)) * m()));
3994 template<
typename _ForwardIterator,
3995 typename _UniformRandomNumberGenerator>
3997 __generate(_ForwardIterator __f, _ForwardIterator __t,
3998 _UniformRandomNumberGenerator& __urng)
3999 { this->__generate_impl(__f, __t, __urng); }
4001 template<
typename _ForwardIterator,
4002 typename _UniformRandomNumberGenerator>
4004 __generate(_ForwardIterator __f, _ForwardIterator __t,
4005 _UniformRandomNumberGenerator& __urng,
4007 { this->__generate_impl(__f, __t, __urng, __p); }
4009 template<
typename _UniformRandomNumberGenerator>
4011 __generate(result_type* __f, result_type* __t,
4012 _UniformRandomNumberGenerator& __urng)
4013 { this->__generate_impl(__f, __t, __urng); }
4015 template<
typename _UniformRandomNumberGenerator>
4017 __generate(result_type* __f, result_type* __t,
4018 _UniformRandomNumberGenerator& __urng,
4020 { this->__generate_impl(__f, __t, __urng, __p); }
4030 {
return (__d1._M_param == __d2._M_param
4031 && __d1._M_gd_x == __d2._M_gd_x
4032 && __d1._M_gd_y == __d2._M_gd_y); }
4044 template<
typename _RealType1,
typename _CharT,
typename _Traits>
4046 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4059 template<
typename _RealType1,
typename _CharT,
typename _Traits>
4065 template<
typename _ForwardIterator,
4066 typename _UniformRandomNumberGenerator>
4068 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4069 _UniformRandomNumberGenerator& __urng);
4071 template<
typename _ForwardIterator,
4072 typename _UniformRandomNumberGenerator>
4074 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4075 _UniformRandomNumberGenerator& __urng,
4083 #if __cpp_impl_three_way_comparison < 201907L 4087 template<
typename _RealType>
4091 {
return !(__d1 == __d2); }
4106 template<
typename _RealType =
double>
4110 "result_type must be a floating point type");
4134 {
return __p1._M_n == __p2._M_n; }
4136 #if __cpp_impl_three_way_comparison < 201907L 4139 {
return !(__p1 == __p2); }
4150 : _M_param(__n), _M_nd(), _M_gd(__n / 2, 2)
4155 : _M_param(__p), _M_nd(), _M_gd(__p.n() / 2, 2)
4173 {
return _M_param.n(); }
4180 {
return _M_param; }
4188 { _M_param = __param; }
4207 template<
typename _UniformRandomNumberGenerator>
4210 {
return _M_nd(__urng) *
std::sqrt(n() / _M_gd(__urng)); }
4212 template<
typename _UniformRandomNumberGenerator>
4214 operator()(_UniformRandomNumberGenerator& __urng,
4220 const result_type __g = _M_gd(__urng, param_type(__p.n() / 2, 2));
4221 return _M_nd(__urng) *
std::sqrt(__p.n() / __g);
4224 template<
typename _ForwardIterator,
4225 typename _UniformRandomNumberGenerator>
4227 __generate(_ForwardIterator __f, _ForwardIterator __t,
4228 _UniformRandomNumberGenerator& __urng)
4229 { this->__generate_impl(__f, __t, __urng); }
4231 template<
typename _ForwardIterator,
4232 typename _UniformRandomNumberGenerator>
4234 __generate(_ForwardIterator __f, _ForwardIterator __t,
4235 _UniformRandomNumberGenerator& __urng,
4237 { this->__generate_impl(__f, __t, __urng, __p); }
4239 template<
typename _UniformRandomNumberGenerator>
4241 __generate(result_type* __f, result_type* __t,
4242 _UniformRandomNumberGenerator& __urng)
4243 { this->__generate_impl(__f, __t, __urng); }
4245 template<
typename _UniformRandomNumberGenerator>
4247 __generate(result_type* __f, result_type* __t,
4248 _UniformRandomNumberGenerator& __urng,
4250 { this->__generate_impl(__f, __t, __urng, __p); }
4260 {
return (__d1._M_param == __d2._M_param
4261 && __d1._M_nd == __d2._M_nd && __d1._M_gd == __d2._M_gd); }
4273 template<
typename _RealType1,
typename _CharT,
typename _Traits>
4275 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4288 template<
typename _RealType1,
typename _CharT,
typename _Traits>
4294 template<
typename _ForwardIterator,
4295 typename _UniformRandomNumberGenerator>
4297 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4298 _UniformRandomNumberGenerator& __urng);
4299 template<
typename _ForwardIterator,
4300 typename _UniformRandomNumberGenerator>
4302 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4303 _UniformRandomNumberGenerator& __urng,
4312 #if __cpp_impl_three_way_comparison < 201907L 4316 template<
typename _RealType>
4320 {
return !(__d1 == __d2); }
4357 __glibcxx_assert((_M_p >= 0.0) && (_M_p <= 1.0));
4366 {
return __p1._M_p == __p2._M_p; }
4368 #if __cpp_impl_three_way_comparison < 201907L 4371 {
return !(__p1 == __p2); }
4413 {
return _M_param.p(); }
4420 {
return _M_param; }
4428 { _M_param = __param; }
4447 template<
typename _UniformRandomNumberGenerator>
4450 {
return this->operator()(__urng, _M_param); }
4452 template<
typename _UniformRandomNumberGenerator>
4454 operator()(_UniformRandomNumberGenerator& __urng,
4457 __detail::_Adaptor<_UniformRandomNumberGenerator, double>
4459 if ((__aurng() - __aurng.min())
4460 < __p.p() * (__aurng.max() - __aurng.min()))
4465 template<
typename _ForwardIterator,
4466 typename _UniformRandomNumberGenerator>
4468 __generate(_ForwardIterator __f, _ForwardIterator __t,
4469 _UniformRandomNumberGenerator& __urng)
4470 { this->__generate(__f, __t, __urng, _M_param); }
4472 template<
typename _ForwardIterator,
4473 typename _UniformRandomNumberGenerator>
4475 __generate(_ForwardIterator __f, _ForwardIterator __t,
4476 _UniformRandomNumberGenerator& __urng,
const param_type& __p)
4477 { this->__generate_impl(__f, __t, __urng, __p); }
4479 template<
typename _UniformRandomNumberGenerator>
4481 __generate(result_type* __f, result_type* __t,
4482 _UniformRandomNumberGenerator& __urng,
4484 { this->__generate_impl(__f, __t, __urng, __p); }
4493 {
return __d1._M_param == __d2._M_param; }
4496 template<
typename _ForwardIterator,
4497 typename _UniformRandomNumberGenerator>
4499 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4500 _UniformRandomNumberGenerator& __urng,
4506 #if __cpp_impl_three_way_comparison < 201907L 4514 {
return !(__d1 == __d2); }
4527 template<
typename _CharT,
typename _Traits>
4529 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4541 template<
typename _CharT,
typename _Traits>
4563 template<
typename _IntType =
int>
4567 "result_type must be an integral type");
4582 param_type(_IntType __t,
double __p = 0.5)
4583 : _M_t(__t), _M_p(__p)
4585 __glibcxx_assert((_M_t >= _IntType(0))
4600 operator==(
const param_type& __p1,
const param_type& __p2)
4601 {
return __p1._M_t == __p2._M_t && __p1._M_p == __p2._M_p; }
4603 #if __cpp_impl_three_way_comparison < 201907L 4605 operator!=(
const param_type& __p1,
const param_type& __p2)
4606 {
return !(__p1 == __p2); }
4617 #if _GLIBCXX_USE_C99_MATH_FUNCS 4618 double _M_d1, _M_d2, _M_s1, _M_s2, _M_c,
4619 _M_a1, _M_a123, _M_s, _M_lf, _M_lp1p;
4630 : _M_param(__t, __p), _M_nd()
4635 : _M_param(__p), _M_nd()
4650 {
return _M_param.t(); }
4657 {
return _M_param.p(); }
4664 {
return _M_param; }
4672 { _M_param = __param; }
4686 {
return _M_param.t(); }
4691 template<
typename _UniformRandomNumberGenerator>
4694 {
return this->operator()(__urng, _M_param); }
4696 template<
typename _UniformRandomNumberGenerator>
4698 operator()(_UniformRandomNumberGenerator& __urng,
4701 template<
typename _ForwardIterator,
4702 typename _UniformRandomNumberGenerator>
4704 __generate(_ForwardIterator __f, _ForwardIterator __t,
4705 _UniformRandomNumberGenerator& __urng)
4706 { this->__generate(__f, __t, __urng, _M_param); }
4708 template<
typename _ForwardIterator,
4709 typename _UniformRandomNumberGenerator>
4711 __generate(_ForwardIterator __f, _ForwardIterator __t,
4712 _UniformRandomNumberGenerator& __urng,
4714 { this->__generate_impl(__f, __t, __urng, __p); }
4716 template<
typename _UniformRandomNumberGenerator>
4718 __generate(result_type* __f, result_type* __t,
4719 _UniformRandomNumberGenerator& __urng,
4721 { this->__generate_impl(__f, __t, __urng, __p); }
4731 #ifdef _GLIBCXX_USE_C99_MATH_FUNCS 4732 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
4734 {
return __d1._M_param == __d2._M_param; }
4747 template<
typename _IntType1,
4748 typename _CharT,
typename _Traits>
4750 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4763 template<
typename _IntType1,
4764 typename _CharT,
typename _Traits>
4770 template<
typename _ForwardIterator,
4771 typename _UniformRandomNumberGenerator>
4773 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4774 _UniformRandomNumberGenerator& __urng,
4777 template<
typename _UniformRandomNumberGenerator>
4779 _M_waiting(_UniformRandomNumberGenerator& __urng,
4780 _IntType __t,
double __q);
4788 #if __cpp_impl_three_way_comparison < 201907L 4792 template<
typename _IntType>
4796 {
return !(__d1 == __d2); }
4809 template<
typename _IntType =
int>
4813 "result_type must be an integral type");
4828 param_type(
double __p)
4831 __glibcxx_assert((_M_p > 0.0) && (_M_p < 1.0));
4840 operator==(
const param_type& __p1,
const param_type& __p2)
4841 {
return __p1._M_p == __p2._M_p; }
4843 #if __cpp_impl_three_way_comparison < 201907L 4845 operator!=(
const param_type& __p1,
const param_type& __p2)
4846 {
return !(__p1 == __p2); }
4852 { _M_log_1_p =
std::log(1.0 - _M_p); }
4886 {
return _M_param.p(); }
4893 {
return _M_param; }
4901 { _M_param = __param; }
4920 template<
typename _UniformRandomNumberGenerator>
4923 {
return this->operator()(__urng, _M_param); }
4925 template<
typename _UniformRandomNumberGenerator>
4927 operator()(_UniformRandomNumberGenerator& __urng,
4930 template<
typename _ForwardIterator,
4931 typename _UniformRandomNumberGenerator>
4933 __generate(_ForwardIterator __f, _ForwardIterator __t,
4934 _UniformRandomNumberGenerator& __urng)
4935 { this->__generate(__f, __t, __urng, _M_param); }
4937 template<
typename _ForwardIterator,
4938 typename _UniformRandomNumberGenerator>
4940 __generate(_ForwardIterator __f, _ForwardIterator __t,
4941 _UniformRandomNumberGenerator& __urng,
4943 { this->__generate_impl(__f, __t, __urng, __p); }
4945 template<
typename _UniformRandomNumberGenerator>
4947 __generate(result_type* __f, result_type* __t,
4948 _UniformRandomNumberGenerator& __urng,
4950 { this->__generate_impl(__f, __t, __urng, __p); }
4959 {
return __d1._M_param == __d2._M_param; }
4962 template<
typename _ForwardIterator,
4963 typename _UniformRandomNumberGenerator>
4965 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4966 _UniformRandomNumberGenerator& __urng,
4972 #if __cpp_impl_three_way_comparison < 201907L 4977 template<
typename _IntType>
4981 {
return !(__d1 == __d2); }
4994 template<
typename _IntType,
4995 typename _CharT,
typename _Traits>
4997 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5009 template<
typename _IntType,
5010 typename _CharT,
typename _Traits>
5026 template<
typename _IntType =
int>
5030 "result_type must be an integral type");
5045 : _M_k(__k), _M_p(__p)
5047 __glibcxx_assert((_M_k > 0) && (_M_p > 0.0) && (_M_p <= 1.0));
5060 {
return __p1._M_k == __p2._M_k && __p1._M_p == __p2._M_p; }
5062 #if __cpp_impl_three_way_comparison < 201907L 5065 {
return !(__p1 == __p2); }
5077 : _M_param(__k, __p), _M_gd(__k, (1.0 - __p) / __p)
5082 : _M_param(__p), _M_gd(__p.k(), (1.0 - __p.p()) / __p.p())
5097 {
return _M_param.k(); }
5104 {
return _M_param.p(); }
5111 {
return _M_param; }
5119 { _M_param = __param; }
5126 {
return result_type(0); }
5138 template<
typename _UniformRandomNumberGenerator>
5140 operator()(_UniformRandomNumberGenerator& __urng);
5142 template<
typename _UniformRandomNumberGenerator>
5144 operator()(_UniformRandomNumberGenerator& __urng,
5147 template<
typename _ForwardIterator,
5148 typename _UniformRandomNumberGenerator>
5150 __generate(_ForwardIterator __f, _ForwardIterator __t,
5151 _UniformRandomNumberGenerator& __urng)
5152 { this->__generate_impl(__f, __t, __urng); }
5154 template<
typename _ForwardIterator,
5155 typename _UniformRandomNumberGenerator>
5157 __generate(_ForwardIterator __f, _ForwardIterator __t,
5158 _UniformRandomNumberGenerator& __urng,
5160 { this->__generate_impl(__f, __t, __urng, __p); }
5162 template<
typename _UniformRandomNumberGenerator>
5164 __generate(result_type* __f, result_type* __t,
5165 _UniformRandomNumberGenerator& __urng)
5166 { this->__generate_impl(__f, __t, __urng); }
5168 template<
typename _UniformRandomNumberGenerator>
5170 __generate(result_type* __f, result_type* __t,
5171 _UniformRandomNumberGenerator& __urng,
5173 { this->__generate_impl(__f, __t, __urng, __p); }
5183 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
5196 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5198 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5211 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5217 template<
typename _ForwardIterator,
5218 typename _UniformRandomNumberGenerator>
5220 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5221 _UniformRandomNumberGenerator& __urng);
5222 template<
typename _ForwardIterator,
5223 typename _UniformRandomNumberGenerator>
5225 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5226 _UniformRandomNumberGenerator& __urng,
5234 #if __cpp_impl_three_way_comparison < 201907L 5238 template<
typename _IntType>
5242 {
return !(__d1 == __d2); }
5263 template<
typename _IntType =
int>
5267 "result_type must be an integral type");
5282 param_type(
double __mean)
5285 __glibcxx_assert(_M_mean > 0.0);
5294 operator==(
const param_type& __p1,
const param_type& __p2)
5295 {
return __p1._M_mean == __p2._M_mean; }
5297 #if __cpp_impl_three_way_comparison < 201907L 5299 operator!=(
const param_type& __p1,
const param_type& __p2)
5300 {
return !(__p1 == __p2); }
5311 #if _GLIBCXX_USE_C99_MATH_FUNCS 5312 double _M_lfm, _M_sm, _M_d, _M_scx, _M_1cx, _M_c2b, _M_cb;
5322 : _M_param(__mean), _M_nd()
5327 : _M_param(__p), _M_nd()
5342 {
return _M_param.mean(); }
5349 {
return _M_param; }
5357 { _M_param = __param; }
5376 template<
typename _UniformRandomNumberGenerator>
5379 {
return this->operator()(__urng, _M_param); }
5381 template<
typename _UniformRandomNumberGenerator>
5383 operator()(_UniformRandomNumberGenerator& __urng,
5386 template<
typename _ForwardIterator,
5387 typename _UniformRandomNumberGenerator>
5389 __generate(_ForwardIterator __f, _ForwardIterator __t,
5390 _UniformRandomNumberGenerator& __urng)
5391 { this->__generate(__f, __t, __urng, _M_param); }
5393 template<
typename _ForwardIterator,
5394 typename _UniformRandomNumberGenerator>
5396 __generate(_ForwardIterator __f, _ForwardIterator __t,
5397 _UniformRandomNumberGenerator& __urng,
5399 { this->__generate_impl(__f, __t, __urng, __p); }
5401 template<
typename _UniformRandomNumberGenerator>
5403 __generate(result_type* __f, result_type* __t,
5404 _UniformRandomNumberGenerator& __urng,
5406 { this->__generate_impl(__f, __t, __urng, __p); }
5416 #ifdef _GLIBCXX_USE_C99_MATH_FUNCS 5417 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
5419 {
return __d1._M_param == __d2._M_param; }
5432 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5434 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5447 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5453 template<
typename _ForwardIterator,
5454 typename _UniformRandomNumberGenerator>
5456 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5457 _UniformRandomNumberGenerator& __urng,
5466 #if __cpp_impl_three_way_comparison < 201907L 5470 template<
typename _IntType>
5474 {
return !(__d1 == __d2); }
5495 template<
typename _RealType =
double>
5499 "result_type must be a floating point type");
5514 : _M_lambda(__lambda)
5516 __glibcxx_assert(_M_lambda > _RealType(0));
5521 {
return _M_lambda; }
5525 {
return __p1._M_lambda == __p2._M_lambda; }
5527 #if __cpp_impl_three_way_comparison < 201907L 5530 {
return !(__p1 == __p2); }
5534 _RealType _M_lambda;
5550 : _M_param(__lambda)
5571 {
return _M_param.lambda(); }
5578 {
return _M_param; }
5586 { _M_param = __param; }
5593 {
return result_type(0); }
5605 template<
typename _UniformRandomNumberGenerator>
5608 {
return this->operator()(__urng, _M_param); }
5610 template<
typename _UniformRandomNumberGenerator>
5612 operator()(_UniformRandomNumberGenerator& __urng,
5615 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
5617 return -
std::log(result_type(1) - __aurng()) / __p.lambda();
5620 template<
typename _ForwardIterator,
5621 typename _UniformRandomNumberGenerator>
5623 __generate(_ForwardIterator __f, _ForwardIterator __t,
5624 _UniformRandomNumberGenerator& __urng)
5625 { this->__generate(__f, __t, __urng, _M_param); }
5627 template<
typename _ForwardIterator,
5628 typename _UniformRandomNumberGenerator>
5630 __generate(_ForwardIterator __f, _ForwardIterator __t,
5631 _UniformRandomNumberGenerator& __urng,
5633 { this->__generate_impl(__f, __t, __urng, __p); }
5635 template<
typename _UniformRandomNumberGenerator>
5637 __generate(result_type* __f, result_type* __t,
5638 _UniformRandomNumberGenerator& __urng,
5640 { this->__generate_impl(__f, __t, __urng, __p); }
5649 {
return __d1._M_param == __d2._M_param; }
5652 template<
typename _ForwardIterator,
5653 typename _UniformRandomNumberGenerator>
5655 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5656 _UniformRandomNumberGenerator& __urng,
5662 #if __cpp_impl_three_way_comparison < 201907L 5667 template<
typename _RealType>
5671 {
return !(__d1 == __d2); }
5684 template<
typename _RealType,
typename _CharT,
typename _Traits>
5686 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5699 template<
typename _RealType,
typename _CharT,
typename _Traits>
5717 template<
typename _RealType =
double>
5721 "result_type must be a floating point type");
5735 param_type(_RealType __a, _RealType __b = _RealType(1.0))
5736 : _M_a(__a), _M_b(__b)
5749 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
5751 #if __cpp_impl_three_way_comparison < 201907L 5754 {
return !(__p1 == __p2); }
5766 : _M_param(__a, __b)
5786 {
return _M_param.a(); }
5793 {
return _M_param.b(); }
5800 {
return _M_param; }
5808 { _M_param = __param; }
5815 {
return result_type(0); }
5827 template<
typename _UniformRandomNumberGenerator>
5830 {
return this->operator()(__urng, _M_param); }
5832 template<
typename _UniformRandomNumberGenerator>
5834 operator()(_UniformRandomNumberGenerator& __urng,
5837 template<
typename _ForwardIterator,
5838 typename _UniformRandomNumberGenerator>
5840 __generate(_ForwardIterator __f, _ForwardIterator __t,
5841 _UniformRandomNumberGenerator& __urng)
5842 { this->__generate(__f, __t, __urng, _M_param); }
5844 template<
typename _ForwardIterator,
5845 typename _UniformRandomNumberGenerator>
5847 __generate(_ForwardIterator __f, _ForwardIterator __t,
5848 _UniformRandomNumberGenerator& __urng,
5850 { this->__generate_impl(__f, __t, __urng, __p); }
5852 template<
typename _UniformRandomNumberGenerator>
5854 __generate(result_type* __f, result_type* __t,
5855 _UniformRandomNumberGenerator& __urng,
5857 { this->__generate_impl(__f, __t, __urng, __p); }
5866 {
return __d1._M_param == __d2._M_param; }
5869 template<
typename _ForwardIterator,
5870 typename _UniformRandomNumberGenerator>
5872 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5873 _UniformRandomNumberGenerator& __urng,
5879 #if __cpp_impl_three_way_comparison < 201907L 5884 template<
typename _RealType>
5888 {
return !(__d1 == __d2); }
5901 template<
typename _RealType,
typename _CharT,
typename _Traits>
5903 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5916 template<
typename _RealType,
typename _CharT,
typename _Traits>
5934 template<
typename _RealType =
double>
5938 "result_type must be a floating point type");
5952 param_type(_RealType __a, _RealType __b = _RealType(1.0))
5953 : _M_a(__a), _M_b(__b)
5966 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
5968 #if __cpp_impl_three_way_comparison < 201907L 5971 {
return !(__p1 == __p2); }
5983 : _M_param(__a, __b)
6003 {
return _M_param.a(); }
6010 {
return _M_param.b(); }
6017 {
return _M_param; }
6025 { _M_param = __param; }
6044 template<
typename _UniformRandomNumberGenerator>
6047 {
return this->operator()(__urng, _M_param); }
6049 template<
typename _UniformRandomNumberGenerator>
6051 operator()(_UniformRandomNumberGenerator& __urng,
6054 template<
typename _ForwardIterator,
6055 typename _UniformRandomNumberGenerator>
6057 __generate(_ForwardIterator __f, _ForwardIterator __t,
6058 _UniformRandomNumberGenerator& __urng)
6059 { this->__generate(__f, __t, __urng, _M_param); }
6061 template<
typename _ForwardIterator,
6062 typename _UniformRandomNumberGenerator>
6064 __generate(_ForwardIterator __f, _ForwardIterator __t,
6065 _UniformRandomNumberGenerator& __urng,
6067 { this->__generate_impl(__f, __t, __urng, __p); }
6069 template<
typename _UniformRandomNumberGenerator>
6071 __generate(result_type* __f, result_type* __t,
6072 _UniformRandomNumberGenerator& __urng,
6074 { this->__generate_impl(__f, __t, __urng, __p); }
6083 {
return __d1._M_param == __d2._M_param; }
6086 template<
typename _ForwardIterator,
6087 typename _UniformRandomNumberGenerator>
6089 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6090 _UniformRandomNumberGenerator& __urng,
6096 #if __cpp_impl_three_way_comparison < 201907L 6101 template<
typename _RealType>
6105 {
return !(__d1 == __d2); }
6118 template<
typename _RealType,
typename _CharT,
typename _Traits>
6120 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
6133 template<
typename _RealType,
typename _CharT,
typename _Traits>
6156 template<
typename _IntType =
int>
6160 "result_type must be an integral type");
6173 : _M_prob(), _M_cp()
6176 template<
typename _InputIterator>
6177 param_type(_InputIterator __wbegin,
6178 _InputIterator __wend)
6179 : _M_prob(__wbegin, __wend), _M_cp()
6180 { _M_initialize(); }
6183 : _M_prob(__wil.begin(), __wil.end()), _M_cp()
6184 { _M_initialize(); }
6186 template<
typename _Func>
6187 param_type(
size_t __nw,
double __xmin,
double __xmax,
6191 param_type(
const param_type&) =
default;
6192 param_type& operator=(
const param_type&) =
default;
6195 probabilities()
const 6199 operator==(
const param_type& __p1,
const param_type& __p2)
6200 {
return __p1._M_prob == __p2._M_prob; }
6202 #if __cpp_impl_three_way_comparison < 201907L 6204 operator!=(
const param_type& __p1,
const param_type& __p2)
6205 {
return !(__p1 == __p2); }
6220 template<
typename _InputIterator>
6222 _InputIterator __wend)
6223 : _M_param(__wbegin, __wend)
6230 template<
typename _Func>
6233 : _M_param(__nw, __xmin, __xmax, __fw)
6254 return _M_param._M_prob.
empty()
6263 {
return _M_param; }
6271 { _M_param = __param; }
6278 {
return result_type(0); }
6286 return _M_param._M_prob.empty()
6287 ? result_type(0) : result_type(_M_param._M_prob.size() - 1);
6293 template<
typename _UniformRandomNumberGenerator>
6296 {
return this->operator()(__urng, _M_param); }
6298 template<
typename _UniformRandomNumberGenerator>
6300 operator()(_UniformRandomNumberGenerator& __urng,
6303 template<
typename _ForwardIterator,
6304 typename _UniformRandomNumberGenerator>
6306 __generate(_ForwardIterator __f, _ForwardIterator __t,
6307 _UniformRandomNumberGenerator& __urng)
6308 { this->__generate(__f, __t, __urng, _M_param); }
6310 template<
typename _ForwardIterator,
6311 typename _UniformRandomNumberGenerator>
6313 __generate(_ForwardIterator __f, _ForwardIterator __t,
6314 _UniformRandomNumberGenerator& __urng,
6316 { this->__generate_impl(__f, __t, __urng, __p); }
6318 template<
typename _UniformRandomNumberGenerator>
6320 __generate(result_type* __f, result_type* __t,
6321 _UniformRandomNumberGenerator& __urng,
6323 { this->__generate_impl(__f, __t, __urng, __p); }
6332 {
return __d1._M_param == __d2._M_param; }
6344 template<
typename _IntType1,
typename _CharT,
typename _Traits>
6346 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
6360 template<
typename _IntType1,
typename _CharT,
typename _Traits>
6366 template<
typename _ForwardIterator,
6367 typename _UniformRandomNumberGenerator>
6369 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6370 _UniformRandomNumberGenerator& __urng,
6376 #if __cpp_impl_three_way_comparison < 201907L 6381 template<
typename _IntType>
6385 {
return !(__d1 == __d2); }
6404 template<
typename _RealType =
double>
6408 "result_type must be a floating point type");
6421 : _M_int(), _M_den(), _M_cp()
6424 template<
typename _InputIteratorB,
typename _InputIteratorW>
6425 param_type(_InputIteratorB __bfirst,
6426 _InputIteratorB __bend,
6427 _InputIteratorW __wbegin);
6429 template<
typename _Func>
6432 template<
typename _Func>
6433 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
6437 param_type(
const param_type&) =
default;
6438 param_type& operator=(
const param_type&) =
default;
6446 __tmp[1] = _RealType(1);
6458 operator==(
const param_type& __p1,
const param_type& __p2)
6459 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
6461 #if __cpp_impl_three_way_comparison < 201907L 6463 operator!=(
const param_type& __p1,
const param_type& __p2)
6464 {
return !(__p1 == __p2); }
6480 template<
typename _InputIteratorB,
typename _InputIteratorW>
6482 _InputIteratorB __bend,
6483 _InputIteratorW __wbegin)
6484 : _M_param(__bfirst, __bend, __wbegin)
6487 template<
typename _Func>
6490 : _M_param(__bl, __fw)
6493 template<
typename _Func>
6495 _RealType __xmin, _RealType __xmax,
6497 : _M_param(__nw, __xmin, __xmax, __fw)
6518 if (_M_param._M_int.empty())
6521 __tmp[1] = _RealType(1);
6525 return _M_param._M_int;
6534 return _M_param._M_den.
empty()
6543 {
return _M_param; }
6551 { _M_param = __param; }
6559 return _M_param._M_int.empty()
6560 ? result_type(0) : _M_param._M_int.front();
6569 return _M_param._M_int.empty()
6570 ? result_type(1) : _M_param._M_int.back();
6576 template<
typename _UniformRandomNumberGenerator>
6579 {
return this->operator()(__urng, _M_param); }
6581 template<
typename _UniformRandomNumberGenerator>
6583 operator()(_UniformRandomNumberGenerator& __urng,
6586 template<
typename _ForwardIterator,
6587 typename _UniformRandomNumberGenerator>
6589 __generate(_ForwardIterator __f, _ForwardIterator __t,
6590 _UniformRandomNumberGenerator& __urng)
6591 { this->__generate(__f, __t, __urng, _M_param); }
6593 template<
typename _ForwardIterator,
6594 typename _UniformRandomNumberGenerator>
6596 __generate(_ForwardIterator __f, _ForwardIterator __t,
6597 _UniformRandomNumberGenerator& __urng,
6599 { this->__generate_impl(__f, __t, __urng, __p); }
6601 template<
typename _UniformRandomNumberGenerator>
6603 __generate(result_type* __f, result_type* __t,
6604 _UniformRandomNumberGenerator& __urng,
6606 { this->__generate_impl(__f, __t, __urng, __p); }
6615 {
return __d1._M_param == __d2._M_param; }
6628 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6630 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
6644 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6650 template<
typename _ForwardIterator,
6651 typename _UniformRandomNumberGenerator>
6653 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6654 _UniformRandomNumberGenerator& __urng,
6660 #if __cpp_impl_three_way_comparison < 201907L 6665 template<
typename _RealType>
6669 {
return !(__d1 == __d2); }
6684 template<
typename _RealType =
double>
6688 "result_type must be a floating point type");
6701 : _M_int(), _M_den(), _M_cp(), _M_m()
6704 template<
typename _InputIteratorB,
typename _InputIteratorW>
6705 param_type(_InputIteratorB __bfirst,
6706 _InputIteratorB __bend,
6707 _InputIteratorW __wbegin);
6709 template<
typename _Func>
6712 template<
typename _Func>
6713 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
6717 param_type(
const param_type&) =
default;
6718 param_type& operator=(
const param_type&) =
default;
6726 __tmp[1] = _RealType(1);
6738 operator==(
const param_type& __p1,
const param_type& __p2)
6739 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
6741 #if __cpp_impl_three_way_comparison < 201907L 6743 operator!=(
const param_type& __p1,
const param_type& __p2)
6744 {
return !(__p1 == __p2); }
6761 template<
typename _InputIteratorB,
typename _InputIteratorW>
6763 _InputIteratorB __bend,
6764 _InputIteratorW __wbegin)
6765 : _M_param(__bfirst, __bend, __wbegin)
6768 template<
typename _Func>
6771 : _M_param(__bl, __fw)
6774 template<
typename _Func>
6776 _RealType __xmin, _RealType __xmax,
6778 : _M_param(__nw, __xmin, __xmax, __fw)
6799 if (_M_param._M_int.empty())
6802 __tmp[1] = _RealType(1);
6806 return _M_param._M_int;
6816 return _M_param._M_den.
empty()
6825 {
return _M_param; }
6833 { _M_param = __param; }
6841 return _M_param._M_int.empty()
6842 ? result_type(0) : _M_param._M_int.front();
6851 return _M_param._M_int.empty()
6852 ? result_type(1) : _M_param._M_int.back();
6858 template<
typename _UniformRandomNumberGenerator>
6861 {
return this->operator()(__urng, _M_param); }
6863 template<
typename _UniformRandomNumberGenerator>
6865 operator()(_UniformRandomNumberGenerator& __urng,
6868 template<
typename _ForwardIterator,
6869 typename _UniformRandomNumberGenerator>
6871 __generate(_ForwardIterator __f, _ForwardIterator __t,
6872 _UniformRandomNumberGenerator& __urng)
6873 { this->__generate(__f, __t, __urng, _M_param); }
6875 template<
typename _ForwardIterator,
6876 typename _UniformRandomNumberGenerator>
6878 __generate(_ForwardIterator __f, _ForwardIterator __t,
6879 _UniformRandomNumberGenerator& __urng,
6881 { this->__generate_impl(__f, __t, __urng, __p); }
6883 template<
typename _UniformRandomNumberGenerator>
6885 __generate(result_type* __f, result_type* __t,
6886 _UniformRandomNumberGenerator& __urng,
6888 { this->__generate_impl(__f, __t, __urng, __p); }
6897 {
return __d1._M_param == __d2._M_param; }
6910 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6912 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
6926 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6932 template<
typename _ForwardIterator,
6933 typename _UniformRandomNumberGenerator>
6935 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6936 _UniformRandomNumberGenerator& __urng,
6942 #if __cpp_impl_three_way_comparison < 201907L 6947 template<
typename _RealType>
6951 {
return !(__d1 == __d2); }
6982 template<
typename _IntType,
typename = _Require<is_
integral<_IntType>>>
6985 template<
typename _InputIterator>
6986 seed_seq(_InputIterator __begin, _InputIterator __end);
6989 template<
typename _RandomAccessIterator>
6991 generate(_RandomAccessIterator __begin, _RandomAccessIterator __end);
6994 size_t size()
const noexcept
6995 {
return _M_v.size(); }
6997 template<
typename _OutputIterator>
6999 param(_OutputIterator __dest)
const 7000 { std::copy(_M_v.begin(), _M_v.end(), __dest); }
7003 seed_seq(
const seed_seq&) =
delete;
7004 seed_seq& operator=(
const seed_seq&) =
delete;
7014 _GLIBCXX_END_NAMESPACE_VERSION
_RealType b() const
Return the parameter of the distribution.
_RealType stddev() const
Returns the standard deviation of the distribution.
friend bool operator==(const piecewise_constant_distribution &__d1, const piecewise_constant_distribution &__d2)
Return true if two piecewise constant distributions have the same parameters.
_RealType generate_canonical(_UniformRandomNumberGenerator &__g)
A function template for converting the output of a (integral) uniform random number generator to a fl...
result_type max() const
Returns the least upper bound value of the distribution.
friend bool operator==(const student_t_distribution &__d1, const student_t_distribution &__d2)
Return true if two Student t distributions have the same parameters and the sequences that would be g...
static const fmtflags skipws
Skips leading white space before certain input operations.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type min() const
Returns the greatest lower bound value of the distribution.
param_type param() const
Returns the parameter set of the distribution.
shuffle_order_engine(_Sseq &__q)
Generator construct a shuffle_order_engine engine.
constexpr const _Tp & max(const _Tp &, const _Tp &)
This does what you think it does.
_IntType k() const
Return the parameter of the distribution.
std::vector< double > probabilities() const
Returns the probabilities of the distribution.
Uniform discrete distribution for random numbers. A discrete random distribution on the range with e...
void param(const param_type &__param)
Sets the parameter set of the distribution.
param_type param() const
Returns the parameter set of the distribution.
friend bool operator==(const extreme_value_distribution &__d1, const extreme_value_distribution &__d2)
Return true if two extreme value distributions have the same parameters.
discard_block_engine(result_type __s)
Seed constructs a discard_block_engine engine.
result_type min() const
Returns the greatest lower bound value of the distribution.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
void reset()
Resets the distribution state.
constexpr bitset< _Nb > operator &(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
A model of a linear congruential random number generator.
param_type param() const
Returns the parameter set of the distribution.
std::vector< _RealType > intervals() const
Returns a vector of the intervals.
A Bernoulli random number distribution.
void reset()
Resets the distribution state.
static const fmtflags dec
Converts integer input or generates integer output in decimal base.
result_type max() const
Returns the least upper bound value of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
independent_bits_engine(_RandomNumberEngine &&__rng)
Move constructs a independent_bits_engine engine.
friend bool operator==(const shuffle_order_engine &__lhs, const shuffle_order_engine &__rhs)
void discard(unsigned long long __z)
Discard a sequence of random numbers.
friend bool operator==(const bernoulli_distribution &__d1, const bernoulli_distribution &__d2)
Return true if two Bernoulli distributions have the same parameters.
void param(const param_type &__param)
Sets the parameter set of the distribution.
static constexpr result_type max()
Gets the maximum value in the generated random number range.
void reset()
Resets the distribution state.
constexpr auto size(const _Container &__cont) noexcept(noexcept(__cont.size())) -> decltype(__cont.size())
Return the size of a container.
static constexpr result_type min()
Gets the smallest possible value in the output range.
param_type param() const
Returns the parameter set of the distribution.
_RealType beta() const
Returns the of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
_RealType a() const
Return the parameter of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
void reset()
Resets the distribution state.
Produces random numbers by reordering random numbers from some base engine.
_If_seed_seq< _Sseq > seed(_Sseq &__q)
Reseeds the independent_bits_engine object with the given seed sequence.
result_type min() const
Returns the greatest lower bound value of the distribution.
param_type param() const
Returns the parameter set of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void reset()
Resets the distribution state.
discard_block_engine(const _RandomNumberEngine &__rng)
Copy constructs a discard_block_engine engine.
One of the math functors.
_RandomNumberEngine::result_type result_type
independent_bits_engine(const _RandomNumberEngine &__rng)
Copy constructs a independent_bits_engine engine.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
linear_congruential_engine(result_type __s)
Constructs a linear_congruential_engine random number generator engine with seed __s. The default seed value is 1.
friend bool operator==(const negative_binomial_distribution &__d1, const negative_binomial_distribution &__d2)
Return true if two negative binomial distributions have the same parameters and the sequences that wo...
param_type param() const
Returns the parameter set of the distribution.
linear_congruential_engine< uint_fast32_t, 16807UL, 0UL, 2147483647UL > minstd_rand0
void reset()
Resets the distribution state.
param_type param() const
Returns the parameter set of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
constexpr bool empty() const noexcept
void seed(result_type __s)
Reseeds the discard_block_engine object with the default seed for the underlying base class generator...
friend bool operator==(const subtract_with_carry_engine &__lhs, const subtract_with_carry_engine &__rhs)
Compares two % subtract_with_carry_engine random number generator objects of the same type for equali...
The seed_seq class generates sequences of seeds for random number generators.
constexpr bool operator>=(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
linear_congruential_engine(_Sseq &__q)
Constructs a linear_congruential_engine random number generator engine seeded from the seed sequence ...
An exponential continuous distribution for random numbers.
fmtflags flags() const
Access to format flags.
constexpr _Tp __lg(_Tp __n)
This is a helper function for the sort routines and for random.tcc.
void seed(result_type __s)
Reseeds the shuffle_order_engine object with the default seed for the underlying base class generator...
static constexpr result_type max()
Gets the maximum value in the generated random number range.
constexpr bool operator<=(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
static constexpr result_type max()
Gets the inclusive maximum value of the range of random integers returned by this generator...
param_type param() const
Returns the parameter set of the distribution.
static constexpr result_type min()
Gets the minimum value in the generated random number range.
void reset()
Resets the distribution state.
param_type param() const
Returns the parameter set of the distribution.
_RealType b() const
Return the parameter of the distribution.
_IntType t() const
Returns the distribution t parameter.
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine object.
result_type min() const
Returns the greatest lower bound value of the distribution.
constexpr duration< __common_rep_t< _Rep1, __disable_if_is_duration< _Rep2 > >, _Period > operator%(const duration< _Rep1, _Period > &__d, const _Rep2 &__s)
friend bool operator==(const weibull_distribution &__d1, const weibull_distribution &__d2)
Return true if two Weibull distributions have the same parameters.
result_type max() const
Returns the least upper bound value of the distribution.
constexpr bitset< _Nb > operator^(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
void param(const param_type &__param)
Sets the parameter set of the distribution.
bernoulli_distribution(double __p)
Constructs a Bernoulli distribution with likelihood p.
The Marsaglia-Zaman generator.
friend bool operator==(const exponential_distribution &__d1, const exponential_distribution &__d2)
Return true if two exponential distributions have the same parameters.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
A discrete binomial random number distribution.
constexpr complex< _Tp > operator/(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x divided by y.
A gamma continuous distribution for random numbers.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type max() const
Returns the least upper bound value of the distribution.
void reset()
Resets the distribution state.
std::vector< double > densities() const
Return a vector of the probability densities of the distribution.
A fisher_f_distribution random number distribution.
result_type max() const
Returns the least upper bound value of the distribution.
double mean() const
Returns the distribution parameter mean.
result_type min() const
Returns the greatest lower bound value of the distribution.
friend bool operator==(const cauchy_distribution &__d1, const cauchy_distribution &__d2)
Return true if two Cauchy distributions have the same parameters.
Template class basic_ostream.
result_type max() const
Returns the least upper bound value of the distribution.
void reset()
Resets the distribution state.
result_type operator()()
Gets the next random number in the sequence.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
void reset()
Resets the distribution state.
result_type max() const
Returns the least upper bound value of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
void seed(result_type __s)
Reseeds the independent_bits_engine object with the default seed for the underlying base class genera...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend bool operator==(const uniform_real_distribution &__d1, const uniform_real_distribution &__d2)
Return true if two uniform real distributions have the same parameters.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
ISO C++ entities toplevel namespace is std.
_If_seed_seq< _Sseq > seed(_Sseq &__q)
Reseeds the shuffle_order_engine object with the given seed sequence.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type max() const
Returns the least upper bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
param_type param() const
Returns the parameter set of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
A discrete geometric random number distribution.
param_type param() const
Returns the parameter set of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
bernoulli_distribution()
Constructs a Bernoulli distribution with likelihood 0.5.
void param(const param_type &__param)
Sets the parameter set of the distribution.
mersenne_twister_engine< uint_fast32_t, 32, 624, 397, 31, 0x9908b0dfUL, 11, 0xffffffffUL, 7, 0x9d2c5680UL, 15, 0xefc60000UL, 18, 1812433253UL > mt19937
shuffle_order_engine(const _RandomNumberEngine &__rng)
Copy constructs a shuffle_order_engine engine.
A student_t_distribution random number distribution.
param_type param() const
Returns the parameter set of the distribution.
void seed()
Reseeds the discard_block_engine object with the default seed for the underlying base class generator...
complex< _Tp > exp(const complex< _Tp > &)
Return complex base e exponential of z.
void param(const param_type &__param)
Sets the parameter set of the distribution.
param_type param() const
Returns the parameter set of the distribution.
mersenne_twister_engine< uint_fast64_t, 64, 312, 156, 31, 0xb5026f5aa96619e9ULL, 29, 0x5555555555555555ULL, 17, 0x71d67fffeda60000ULL, 37, 0xfff7eee000000000ULL, 43, 6364136223846793005ULL > mt19937_64
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
A weibull_distribution random number distribution.
shuffle_order_engine(result_type __s)
Seed constructs a shuffle_order_engine engine.
_RealType alpha() const
Returns the of the distribution.
Uniform continuous distribution for random numbers.
double p() const
Returns the distribution p parameter.
subtract_with_carry_engine(_Sseq &__q)
Constructs a subtract_with_carry_engine random number engine seeded from the seed sequence __q...
param_type param() const
Returns the parameter set of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
static constexpr result_type min()
Gets the smallest possible value in the output range.
uint_least32_t result_type
static constexpr result_type max()
Gets the largest possible value in the output range.
A negative_binomial_distribution random number distribution.
constexpr bool equal(_IIter1 __first1, _IIter1 __last1, _IIter2 __first2, _IIter2 __last2, _BinaryPredicate __binary_pred)
Tests a range for element-wise equality.
normal_distribution(result_type __mean, result_type __stddev=result_type(1))
Properties of fundamental types.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type max() const
Returns the least upper bound value of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
friend bool operator==(const lognormal_distribution &__d1, const lognormal_distribution &__d2)
Return true if two lognormal distributions have the same parameters and the sequences that would be g...
void seed()
Reseeds the shuffle_order_engine object with the default seed for the underlying base class generator...
exponential_distribution(_RealType __lambda)
Constructs an exponential distribution with inverse scale parameter .
result_type min() const
Returns the greatest lower bound value of the distribution.
shuffle_order_engine()
Constructs a default shuffle_order_engine engine.
A chi_squared_distribution random number distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
friend bool operator==(const binomial_distribution &__d1, const binomial_distribution &__d2)
Return true if two binomial distributions have the same parameters and the sequences that would be ge...
static constexpr _Tp max() noexcept
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
_RealType a() const
Return the parameter of the distribution.
double p() const
Return the parameter of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
A extreme_value_distribution random number distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
subtract_with_carry_engine(result_type __sd)
Constructs an explicitly seeded subtract_with_carry_engine random number generator.
discard_block_engine()
Constructs a default discard_block_engine engine.
result_type max() const
Returns the least upper bound value of the distribution.
A normal continuous distribution for random numbers.
A standard container for storing a fixed size sequence of elements.
exponential_distribution()
Constructs an exponential distribution with inverse scale parameter 1.0.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
double p() const
Returns the distribution parameter p.
static const fmtflags left
Adds fill characters on the right (final positions) of certain generated output. (I.e., the thing you print is flush left.)
void reset()
Resets the distribution state.
friend bool operator==(const chi_squared_distribution &__d1, const chi_squared_distribution &__d2)
Return true if two Chi-squared distributions have the same parameters and the sequences that would be...
static constexpr _Tp lowest() noexcept
result_type max() const
Returns the least upper bound value of the distribution.
Template class basic_istream.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
A discrete Poisson random number distribution.
param_type param() const
Returns the parameter set of the distribution.
complex< _Tp > sqrt(const complex< _Tp > &)
Return complex square root of z.
discard_block_engine(_Sseq &__q)
Generator construct a discard_block_engine engine.
std::vector< double > densities() const
Returns a vector of the probability densities.
static constexpr _Tp min() noexcept
char_type widen(char __c) const
Widens characters.
complex< _Tp > log(const complex< _Tp > &)
Return complex natural logarithm of z.
mersenne_twister_engine(_Sseq &__q)
Constructs a mersenne_twister_engine random number generator engine seeded from the seed sequence __q...
linear_congruential_engine< uint_fast32_t, 48271UL, 0UL, 2147483647UL > minstd_rand
static constexpr result_type min()
Gets the minimum value in the generated random number range.
linear_congruential_engine()
Constructs a linear_congruential_engine random number generator engine with seed 1.
friend bool operator==(const discard_block_engine &__lhs, const discard_block_engine &__rhs)
Compares two discard_block_engine random number generator objects of the same type for equality...
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType > &__x)
Extracts the current state of a % subtract_with_carry_engine random number generator engine __x from ...
void param(const param_type &__param)
Sets the parameter set of the distribution.
A cauchy_distribution random number distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
constexpr complex< _Tp > operator+(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x plus y.
friend bool operator==(const linear_congruential_engine &__lhs, const linear_congruential_engine &__rhs)
Compares two linear congruential random number generator objects of the same type for equality...
result_type max() const
Returns the least upper bound value of the distribution.
void discard(unsigned long long __z)
void param(const param_type &__param)
Sets the parameter set of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
A discrete_distribution random number distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
constexpr complex< _Tp > operator*(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x times y.
A lognormal_distribution random number distribution.
friend bool operator==(const piecewise_linear_distribution &__d1, const piecewise_linear_distribution &__d2)
Return true if two piecewise linear distributions have the same parameters.
param_type param() const
Returns the parameter set of the distribution.
uniform_real_distribution()
Constructs a uniform_real_distribution object.
void reset()
Resets the distribution state.
independent_bits_engine()
Constructs a default independent_bits_engine engine.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
uniform_real_distribution(_RealType __a, _RealType __b=_RealType(1))
Constructs a uniform_real_distribution object.
friend bool operator==(const mersenne_twister_engine &__lhs, const mersenne_twister_engine &__rhs)
Compares two % mersenne_twister_engine random number generator objects of the same type for equality...
constexpr complex< _Tp > operator-(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x minus y.
constexpr bitset< _Nb > operator|(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
char_type fill() const
Retrieves the empty character.
__gnu_cxx::__promote_2< _Tpa, _Tpb >::__type beta(_Tpa __a, _Tpb __b)
param_type param() const
Returns the parameter set of the distribution.
void seed()
Reseeds the independent_bits_engine object with the default seed for the underlying base class genera...
std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const _Quoted_string< const _CharT *, _CharT > &__str)
Inserter for quoted strings.
friend bool operator==(const poisson_distribution &__d1, const poisson_distribution &__d2)
Return true if two Poisson distributions have the same parameters and the sequences that would be gen...
_RealType mean() const
Returns the mean of the distribution.
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine object.
void reset()
Resets the distribution state.
independent_bits_engine(result_type __s)
Seed constructs a independent_bits_engine engine.
static constexpr result_type min()
constexpr bool operator<(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
result_type min() const
Returns the inclusive lower bound of the distribution range.
gamma_distribution()
Constructs a gamma distribution with parameters 1 and 1.
independent_bits_engine(_Sseq &__q)
Generator construct a independent_bits_engine engine.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
_If_seed_seq< _Sseq > seed(_Sseq &__q)
Reseeds the discard_block_engine object with the given seed sequence.
static constexpr result_type max()
const _RandomNumberEngine & base() const noexcept
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
_RandomNumberEngine::result_type result_type
friend bool operator==(const independent_bits_engine &__lhs, const independent_bits_engine &__rhs)
Compares two independent_bits_engine random number generator objects of the same type for equality...
result_type max() const
Returns the least upper bound value of the distribution.
A piecewise_constant_distribution random number distribution.
void reset()
Resets the distribution state.
result_type min() const
Returns the greatest lower bound value of the distribution.
std::vector< _RealType > intervals() const
Return the intervals of the distribution.
friend bool operator==(const discrete_distribution &__d1, const discrete_distribution &__d2)
Return true if two discrete distributions have the same parameters.
discard_block_engine(_RandomNumberEngine &&__rng)
Move constructs a discard_block_engine engine.
void reset()
Resets the distribution state.
void param(const param_type &__param)
Sets the parameter set of the distribution.
param_type param() const
Returns the parameter set of the distribution.
static constexpr result_type min()
Gets the inclusive minimum value of the range of random integers returned by this generator...
result_type min() const
Returns the greatest lower bound value of the distribution.
friend bool operator==(const gamma_distribution &__d1, const gamma_distribution &__d2)
Return true if two gamma distributions have the same parameters and the sequences that would be gener...
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
constexpr bool operator>(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
shuffle_order_engine(_RandomNumberEngine &&__rng)
Move constructs a shuffle_order_engine engine.
double p() const
Returns the p parameter of the distribution.
param_type param() const
Returns the parameter set of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
static constexpr result_type max()
Gets the largest possible value in the output range.
void reset()
Resets the distribution state.
void reset()
Resets the distribution state.
std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, const _Quoted_string< basic_string< _CharT, _Traits, _Alloc > &, _CharT > &__str)
Extractor for delimited strings. The left and right delimiters can be different.
result_type max() const
Returns the inclusive upper bound of the distribution range.
friend bool operator==(const geometric_distribution &__d1, const geometric_distribution &__d2)
Return true if two geometric distributions have the same parameters.
constexpr const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
_RealType lambda() const
Returns the inverse scale parameter of the distribution.
A piecewise_linear_distribution random number distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
friend bool operator==(const fisher_f_distribution &__d1, const fisher_f_distribution &__d2)
Return true if two Fisher f distributions have the same parameters and the sequences that would be ge...
gamma_distribution(_RealType __alpha_val, _RealType __beta_val=_RealType(1))
Constructs a gamma distribution with parameters and .
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.