39namespace std _GLIBCXX_VISIBILITY(default)
41_GLIBCXX_BEGIN_NAMESPACE_VERSION
55#ifndef _GLIBCXX_USE_OLD_GENERATE_CANONICAL
56_GLIBCXX_BEGIN_INLINE_ABI_NAMESPACE(_V2)
63 template<
typename _RealType,
size_t __bits,
64 typename _UniformRandomNumberGenerator>
67#ifndef _GLIBCXX_USE_OLD_GENERATE_CANONICAL
68_GLIBCXX_END_INLINE_ABI_NAMESPACE(_V2)
72#pragma GCC diagnostic push
73#pragma GCC diagnostic ignored "-Wc++17-extensions"
75#ifndef __SIZEOF_INT128__
84 using type = __rand_uint128;
86 __rand_uint128() =
default;
89 __rand_uint128(uint64_t __lo) noexcept : _M_lo(__lo) { }
91 __rand_uint128(
const __rand_uint128&) =
default;
92 __rand_uint128& operator=(
const __rand_uint128&) =
default;
95 operator bool() const noexcept
96 {
return _M_lo || _M_hi; }
98 _GLIBCXX14_CONSTEXPR type&
99 operator=(uint64_t __x)
noexcept
100 {
return *
this = type(__x); }
102 _GLIBCXX14_CONSTEXPR type&
103 operator++() noexcept
104 {
return *
this = *
this + 1; }
106 _GLIBCXX14_CONSTEXPR type&
107 operator--() noexcept
108 {
return *
this = *
this - 1; }
110 _GLIBCXX14_CONSTEXPR type
111 operator++(
int)
noexcept
118 _GLIBCXX14_CONSTEXPR type
119 operator--(
int)
noexcept
126 _GLIBCXX14_CONSTEXPR type&
127 operator+=(
const type& __r)
noexcept
129 _M_hi += __r._M_hi + __builtin_add_overflow(_M_lo, __r._M_lo, &_M_lo);
133 friend _GLIBCXX14_CONSTEXPR type
134 operator+(type __l,
const type& __r)
noexcept
135 {
return __l += __r; }
138 friend _GLIBCXX14_CONSTEXPR type
139 operator+(type __l, uint64_t __r)
noexcept
140 {
return __l += type(__r); }
142 _GLIBCXX14_CONSTEXPR type&
143 operator-=(
const type& __r)
noexcept
145 _M_hi -= __r._M_hi + __builtin_sub_overflow(_M_lo, __r._M_lo, &_M_lo);
150 _GLIBCXX14_CONSTEXPR type&
151 operator-=(uint64_t __r)
noexcept
153 _M_hi -= __builtin_sub_overflow(_M_lo, __r, &_M_lo);
157 friend _GLIBCXX14_CONSTEXPR type
158 operator-(type __l,
const type& __r)
noexcept
159 {
return __l -= __r; }
161 friend _GLIBCXX14_CONSTEXPR type
162 operator-(type __l, uint64_t __r)
noexcept
163 {
return __l -= __r; }
165 _GLIBCXX14_CONSTEXPR type&
166 operator*=(
const type& __x)
noexcept
169 uint32_t(_M_lo), _M_lo >> 32,
170 uint32_t(_M_hi), _M_hi >> 32,
171 uint32_t(__x._M_lo), __x._M_lo >> 32,
172 uint32_t(__x._M_hi), __x._M_hi >> 32,
175 for (
int __i = 0; __i < 4; ++__i)
178 for (
int __j = __i; __j < 4; ++__j)
180 __c += __a[__i] * __a[4 + __j - __i] + __a[8 + __j];
181 __a[8 + __j] = uint32_t(__c);
185 _M_lo = __a[8] + (__a[9] << 32);
186 _M_hi = __a[10] + (__a[11] << 32);
191 _GLIBCXX14_CONSTEXPR type&
192 operator*=(uint64_t __x)
noexcept
198 constexpr uint64_t __mask = 0xffffffff;
199 uint64_t __ll[2] = { _M_lo >> 32, _M_lo & __mask };
200 uint64_t __xx[2] = { __x >> 32, __x & __mask };
201 uint64_t __l0x0 = __ll[0] * __xx[0];
202 uint64_t __l0x1 = __ll[0] * __xx[1];
203 uint64_t __l1x0 = __ll[1] * __xx[0];
204 uint64_t __l1x1 = __ll[1] * __xx[1];
207 = (__l0x1 & __mask) + (__l1x0 & __mask) + (__l1x1 >> 32);
210 _M_hi += __l0x0 + (__l0x1 >> 32) + (__l1x0 >> 32) + (__mid >> 32);
211 _M_lo = (__mid << 32) + (__l1x1 & __mask);
215 _GLIBCXX14_CONSTEXPR type&
216 operator/=(
const type& __r)
noexcept
221 _M_lo = _M_lo / __r._M_lo;
228 uint32_t(_M_lo), _M_lo >> 32,
229 uint32_t(_M_hi), _M_hi >> 32,
231 uint32_t(__r._M_lo), __r._M_lo >> 32,
232 uint32_t(__r._M_hi), __r._M_hi >> 32,
236 uint64_t __c = 0, __w = 0;
237 if (!__r._M_hi && __r._M_lo <= ~uint32_t(0))
238 for (
int __i = 3; ; --__i)
240 __w = __a[__i] + (__c << 32);
241 __a[9 + __i] = __w / __r._M_lo;
244 __c = __w % __r._M_lo;
249 int __n = 0, __d = 0;
250 uint64_t __q = 0, __s = 0;
251 for (__d = 3; __a[5 + __d] == 0; --__d)
253 __s = (uint64_t(1) << 32) / (__a[5 + __d] + 1);
256 for (
int __i = 0; __i <= 3; ++__i)
258 __w = __a[__i] * __s + __c;
259 __a[__i] = uint32_t(__w);
264 for (
int __i = 0; __i <= 3; ++__i)
266 __w = __a[5 + __i] * __s + __c;
267 __a[5 + __i] = uint32_t(__w);
274 for (
int __i = __n - __d - 1; __i >= 0; --__i)
277 __w = (__a[__n] << 32) + __a[__n - 1];
278 if (__a[__n] != __a[5 + __d])
279 __q = __w / __a[5 + __d];
282 uint64_t __t = __w - __q * __a[5 + __d];
283 if (__t <= ~uint32_t(0)
284 && __a[4 + __d] * __q > (__t << 32) + __a[__n - 2])
287 for (
int __j = 0; __j <= __d; ++__j)
289 __w = __q * __a[5 + __j] + __c;
291 __w = __a[__i + __j] - uint32_t(__w);
292 __a[__i + __j] = uint32_t(__w);
293 __c += (__w >> 32) != 0;
295 if (int64_t(__a[__n]) < int64_t(__c))
299 for (
int __j = 0; __j <= __d; ++__j)
301 __w = __a[__i + __j] + __a[5 + __j] + __c;
303 __a[__i + __j] = uint32_t(__w);
310 _M_lo = __a[9] + (__a[10] << 32);
311 _M_hi = __a[11] + (__a[12] << 32);
316 _GLIBCXX14_CONSTEXPR type&
317 operator/=(uint64_t __r)
noexcept
318 {
return *
this /= type(__r); }
321 _GLIBCXX14_CONSTEXPR type&
322 operator%=(uint64_t __m)
noexcept
330 int __shift = __builtin_clzll(__m) + 64 - __builtin_clzll(_M_hi);
334 __x._M_hi = __m << (__shift - 64);
339 __x._M_hi = __m >> (64 - __shift);
340 __x._M_lo = __m << __shift;
343 while (_M_hi != 0 || _M_lo >= __m)
348 _M_hi -= __builtin_sub_overflow(_M_lo, __x._M_lo,
351 __x._M_lo = (__x._M_lo >> 1) | (__x._M_hi << 63);
357 friend _GLIBCXX14_CONSTEXPR type
358 operator*(type __l,
const type& __r)
noexcept
359 {
return __l *= __r; }
361 friend _GLIBCXX14_CONSTEXPR type
362 operator*(type __l, uint64_t __r)
noexcept
363 {
return __l *= __r; }
365 friend _GLIBCXX14_CONSTEXPR type
366 operator/(type __l,
const type& __r)
noexcept
367 {
return __l /= __r; }
369 friend _GLIBCXX14_CONSTEXPR type
370 operator/(type __l, uint64_t __r)
noexcept
371 {
return __l /= __r; }
373 friend _GLIBCXX14_CONSTEXPR type
374 operator%(type __l, uint64_t __m)
noexcept
375 {
return __l %= __m; }
377 friend _GLIBCXX14_CONSTEXPR type
378 operator~(type __v)
noexcept
380 __v._M_hi = ~__v._M_hi;
381 __v._M_lo = ~__v._M_lo;
385 _GLIBCXX14_CONSTEXPR type&
386 operator>>=(
unsigned __c)
noexcept
390 _M_lo = _M_hi >>= (__c - 64);
395 _M_lo = (_M_lo >> __c) | (_M_hi << (64 - __c));
401 _GLIBCXX14_CONSTEXPR type&
402 operator<<=(
unsigned __c)
noexcept
406 _M_hi = _M_lo << (__c - 64);
411 _M_hi = (_M_hi << __c) | (_M_lo >> (64 - __c));
417 friend _GLIBCXX14_CONSTEXPR type
419 {
return __x >>= __c; }
421 friend _GLIBCXX14_CONSTEXPR type
423 {
return __x <<= __c; }
425 _GLIBCXX14_CONSTEXPR type&
426 operator|=(
const type& __r)
noexcept
433 _GLIBCXX14_CONSTEXPR type&
434 operator^=(
const type& __r)
noexcept
441 _GLIBCXX14_CONSTEXPR type&
442 operator&=(
const type& __r)
noexcept
449 friend _GLIBCXX14_CONSTEXPR type
450 operator|(type __l,
const type& __r)
noexcept
451 {
return __l |= __r; }
453 friend _GLIBCXX14_CONSTEXPR type
454 operator^(type __l,
const type& __r)
noexcept
455 {
return __l ^= __r; }
457 friend _GLIBCXX14_CONSTEXPR type
458 operator&(type __l,
const type& __r)
noexcept
459 {
return __l &= __r; }
461 friend _GLIBCXX14_CONSTEXPR type
462 operator&(type __l, uint64_t __r)
noexcept
469#if __cpp_impl_three_way_comparison >= 201907L
470 friend std::strong_ordering
471 operator<=>(
const type&,
const type&) =
default;
474 operator==(
const type&,
const type&) =
default;
476 friend constexpr bool
477 operator==(
const type& __l,
const type& __r)
noexcept
478 {
return __l._M_hi == __r._M_hi && __l._M_lo == __r._M_lo; }
480 friend _GLIBCXX14_CONSTEXPR
bool
481 operator<(
const type& __l,
const type& __r)
noexcept
483 if (__l._M_hi < __r._M_hi)
485 else if (__l._M_hi == __r._M_hi)
486 return __l._M_lo < __r._M_lo;
491 friend _GLIBCXX14_CONSTEXPR
bool
492 operator>(
const type& __l,
const type& __r)
noexcept
493 {
return __r < __l; }
495 friend _GLIBCXX14_CONSTEXPR
bool
496 operator<=(
const type& __l,
const type& __r)
noexcept
497 {
return !(__r < __l); }
499 friend _GLIBCXX14_CONSTEXPR
bool
500 operator>=(
const type& __l,
const type& __r)
noexcept
501 {
return !(__l < __r); }
504 friend _GLIBCXX14_CONSTEXPR
bool
505 operator==(
const type& __l, uint64_t __r)
noexcept
506 {
return __l == type(__r); }
508 template<
typename _RealT>
509 constexpr explicit operator _RealT() const noexcept
511 static_assert(std::is_floating_point<_RealT>::value,
512 "template argument must be a floating point type");
515 : _RealT(_M_hi) * _RealT(18446744073709551616.0)
520 constexpr explicit operator uint64_t() const noexcept
530 __countl_zero(__detail::__rand_uint128 __val)
noexcept
532 return __val._M_hi ? std::__countl_zero(__val._M_hi)
533 : std::__countl_zero(__val._M_lo) + 64;
538 __countr_zero(__detail::__rand_uint128 __val)
noexcept
540 return __val._M_lo ? std::__countr_zero(__val._M_lo)
541 : std::__countr_zero(__val._M_hi) + 64;
546 __popcount(__detail::__rand_uint128 __val)
noexcept
548 return std::__popcount(__val._M_hi) + std::__popcount(__val._M_lo);
553 __bit_width(__detail::__rand_uint128 __val)
noexcept
555 return __val._M_hi ? std::__bit_width(__val._M_hi) + 64
556 : std::__bit_width(__val._M_lo);
562 template<
typename _UIntType,
size_t __w,
563 bool = __w < static_cast<size_t>
566 {
static constexpr _UIntType __value = 0; };
568 template<
typename _UIntType,
size_t __w>
569 struct _Shift<_UIntType, __w, true>
570 {
static constexpr _UIntType __value = _UIntType(1) << __w; };
573#if __SIZEOF_INT128__ <= __SIZEOF_LONG_LONG__ \
574 && __has_builtin(__builtin_add_overflow) \
575 && __has_builtin(__builtin_sub_overflow) \
576 && defined __UINT64_TYPE__
578 struct _Select_uint_least_t<__s, 1>
579 {
using type = __rand_uint128; };
583 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
584 bool __big_enough = (!(__m & (__m - 1))
585 || (_Tp(-1) - __c) / __a >= __m - 1),
586 bool __schrage_ok = __m % __a < __m / __a>
593 =
typename _Select_uint_least_t<
std::__lg(__a)
595 return static_cast<_Tp
>((_Tp2(__a) * __x + __c) % __m);
600 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c>
601 struct _Mod<_Tp, __m, __a, __c, false, true>
610 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
bool __s>
611 struct _Mod<_Tp, __m, __a, __c, true, __s>
616 _Tp __res = __a * __x + __c;
623 template<
typename _Tp, _Tp __m, _Tp __a = 1, _Tp __c = 0>
627 if constexpr (__a == 0)
630 return _Mod<_Tp, __m, __a, __c>::__calc(__x);
637 template<
typename _Engine,
typename _DInputType>
640 static_assert(std::is_floating_point<_DInputType>::value,
641 "template argument must be a floating point type");
644 _Adaptor(_Engine& __g)
649 {
return _DInputType(0); }
653 {
return _DInputType(1); }
677 template<
typename _Sseq>
678 using __seed_seq_generate_t =
decltype(
682 template<
typename _Sseq,
typename _Engine,
typename _Res,
683 typename _GenerateCheck = __seed_seq_generate_t<_Sseq>>
684 using _If_seed_seq_for = _Require<
685 __not_<is_same<__remove_cvref_t<_Sseq>, _Engine>>,
686 is_unsigned<typename _Sseq::result_type>,
687 __not_<is_convertible<_Sseq, _Res>>
690#pragma GCC diagnostic pop
735 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
739 "result_type must be an unsigned integral type");
740 static_assert(__m == 0u || (__a < __m && __c < __m),
741 "template argument substituting __m out of bounds");
743 template<
typename _Sseq>
784 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
805 template<
typename _Sseq>
817 {
return __c == 0u ? 1u : 0u; }
830 discard(
unsigned long long __z)
832 for (; __z != 0ULL; --__z)
842 _M_x = __detail::__mod<_UIntType, __m, __a, __c>(_M_x);
860 {
return __lhs._M_x == __rhs._M_x; }
870 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
871 _UIntType1 __m1,
typename _CharT,
typename _Traits>
875 __a1, __c1, __m1>& __lcr);
890 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
891 _UIntType1 __m1,
typename _CharT,
typename _Traits>
901#if __cpp_impl_three_way_comparison < 201907L
913 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
919 {
return !(__lhs == __rhs); }
953 template<
typename _UIntType,
size_t __w,
954 size_t __n,
size_t __m,
size_t __r,
955 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
956 _UIntType __b,
size_t __t,
957 _UIntType __c,
size_t __l, _UIntType __f>
958 class mersenne_twister_engine
961 "result_type must be an unsigned integral type");
962 static_assert(1u <= __m && __m <= __n,
963 "template argument substituting __m out of bounds");
964 static_assert(__r <= __w,
"template argument substituting "
966 static_assert(__u <= __w,
"template argument substituting "
968 static_assert(__s <= __w,
"template argument substituting "
970 static_assert(__t <= __w,
"template argument substituting "
972 static_assert(__l <= __w,
"template argument substituting "
974 static_assert(__w <= std::numeric_limits<_UIntType>::digits,
975 "template argument substituting __w out of bound");
976 static_assert(__a <= (__detail::_Shift<_UIntType, __w>::__value - 1),
977 "template argument substituting __a out of bound");
978 static_assert(__b <= (__detail::_Shift<_UIntType, __w>::__value - 1),
979 "template argument substituting __b out of bound");
980 static_assert(__c <= (__detail::_Shift<_UIntType, __w>::__value - 1),
981 "template argument substituting __c out of bound");
982 static_assert(__d <= (__detail::_Shift<_UIntType, __w>::__value - 1),
983 "template argument substituting __d out of bound");
984 static_assert(__f <= (__detail::_Shift<_UIntType, __w>::__value - 1),
985 "template argument substituting __f out of bound");
987 template<
typename _Sseq>
989 = __detail::_If_seed_seq_for<_Sseq, mersenne_twister_engine,
997 static constexpr size_t word_size = __w;
998 static constexpr size_t state_size = __n;
999 static constexpr size_t shift_size = __m;
1000 static constexpr size_t mask_bits = __r;
1002 static constexpr size_t tempering_u = __u;
1004 static constexpr size_t tempering_s = __s;
1006 static constexpr size_t tempering_t = __t;
1008 static constexpr size_t tempering_l = __l;
1009 static constexpr result_type initialization_multiplier = __f;
1010 static constexpr result_type default_seed = 5489u;
1014 mersenne_twister_engine() : mersenne_twister_engine(default_seed) { }
1026 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1028 mersenne_twister_engine(_Sseq& __q)
1032 seed(result_type __sd = default_seed);
1034 template<
typename _Sseq>
1050 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1056 discard(
unsigned long long __z);
1074 operator==(
const mersenne_twister_engine& __lhs,
1075 const mersenne_twister_engine& __rhs)
1076 {
return (std::equal(__lhs._M_x, __lhs._M_x + state_size, __rhs._M_x)
1077 && __lhs._M_p == __rhs._M_p); }
1091 template<
typename _UIntType1,
1092 size_t __w1,
size_t __n1,
1093 size_t __m1,
size_t __r1,
1094 _UIntType1 __a1,
size_t __u1,
1095 _UIntType1 __d1,
size_t __s1,
1096 _UIntType1 __b1,
size_t __t1,
1097 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
1098 typename _CharT,
typename _Traits>
1102 __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
1117 template<
typename _UIntType1,
1118 size_t __w1,
size_t __n1,
1119 size_t __m1,
size_t __r1,
1120 _UIntType1 __a1,
size_t __u1,
1121 _UIntType1 __d1,
size_t __s1,
1122 _UIntType1 __b1,
size_t __t1,
1123 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
1124 typename _CharT,
typename _Traits>
1128 __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
1134 _UIntType _M_x[state_size];
1138#if __cpp_impl_three_way_comparison < 201907L
1151 template<
typename _UIntType,
size_t __w,
1152 size_t __n,
size_t __m,
size_t __r,
1153 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
1154 _UIntType __b,
size_t __t,
1155 _UIntType __c,
size_t __l, _UIntType __f>
1158 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __lhs,
1160 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __rhs)
1161 {
return !(__lhs == __rhs); }
1182 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
1183 class subtract_with_carry_engine
1186 "result_type must be an unsigned integral type");
1187 static_assert(0u < __s && __s < __r,
1189 static_assert(0u < __w && __w <= std::numeric_limits<_UIntType>::digits,
1190 "template argument substituting __w out of bounds");
1192 template<
typename _Sseq>
1194 = __detail::_If_seed_seq_for<_Sseq, subtract_with_carry_engine,
1202 static constexpr size_t word_size = __w;
1203 static constexpr size_t short_lag = __s;
1204 static constexpr size_t long_lag = __r;
1205 static constexpr uint_least32_t default_seed = 19780503u;
1207 subtract_with_carry_engine() : subtract_with_carry_engine(0u)
1224 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1226 subtract_with_carry_engine(_Sseq& __q)
1248 template<
typename _Sseq>
1266 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1272 discard(
unsigned long long __z)
1274 for (; __z != 0ULL; --__z)
1297 operator==(
const subtract_with_carry_engine& __lhs,
1298 const subtract_with_carry_engine& __rhs)
1299 {
return (std::equal(__lhs._M_x, __lhs._M_x + long_lag, __rhs._M_x)
1300 && __lhs._M_carry == __rhs._M_carry
1301 && __lhs._M_p == __rhs._M_p); }
1315 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
1316 typename _CharT,
typename _Traits>
1334 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
1335 typename _CharT,
typename _Traits>
1343 _UIntType _M_x[long_lag];
1348#if __cpp_impl_three_way_comparison < 201907L
1361 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
1367 {
return !(__lhs == __rhs); }
1379 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
1382 static_assert(1 <= __r && __r <= __p,
1383 "template argument substituting __r out of bounds");
1389 template<
typename _Sseq>
1395 static constexpr size_t block_size = __p;
1396 static constexpr size_t used_block = __r;
1404 : _M_b(), _M_n(0) { }
1414 : _M_b(__rng), _M_n(0) { }
1424 : _M_b(
std::
move(__rng)), _M_n(0) { }
1434 : _M_b(__s), _M_n(0) { }
1441 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1444 : _M_b(__q), _M_n(0)
1474 template<
typename _Sseq>
1486 const _RandomNumberEngine&
1487 base() const noexcept
1495 {
return _RandomNumberEngine::min(); }
1502 {
return _RandomNumberEngine::max(); }
1508 discard(
unsigned long long __z)
1510 for (; __z != 0ULL; --__z)
1534 {
return __lhs._M_b == __rhs._M_b && __lhs._M_n == __rhs._M_n; }
1547 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1548 typename _CharT,
typename _Traits>
1565 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1566 typename _CharT,
typename _Traits>
1573 _RandomNumberEngine _M_b;
1577#if __cpp_impl_three_way_comparison < 201907L
1589 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
1595 {
return !(__lhs == __rhs); }
1605 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1609 "result_type must be an unsigned integral type");
1610 static_assert(0u < __w && __w <= std::numeric_limits<_UIntType>::digits,
1611 "template argument substituting __w out of bounds");
1613 template<
typename _Sseq>
1665 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1692 template<
typename _Sseq>
1701 const _RandomNumberEngine&
1702 base() const noexcept
1717 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1723 discard(
unsigned long long __z)
1725 for (; __z != 0ULL; --__z)
1750 {
return __lhs._M_b == __rhs._M_b; }
1764 template<
typename _CharT,
typename _Traits>
1768 __w, _UIntType>& __x)
1775 _RandomNumberEngine _M_b;
1778#if __cpp_impl_three_way_comparison < 201907L
1791 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1797 {
return !(__lhs == __rhs); }
1810 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType,
1811 typename _CharT,
typename _Traits>
1812 std::basic_ostream<_CharT, _Traits>&
1813 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1814 const std::independent_bits_engine<_RandomNumberEngine,
1815 __w, _UIntType>& __x)
1832 template<
typename _RandomNumberEngine,
size_t __k>
1835 static_assert(1u <= __k,
"template argument substituting "
1836 "__k out of bound");
1842 template<
typename _Sseq>
1847 static constexpr size_t table_size = __k;
1856 { _M_initialize(); }
1867 { _M_initialize(); }
1878 { _M_initialize(); }
1889 { _M_initialize(); }
1896 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1900 { _M_initialize(); }
1929 template<
typename _Sseq>
1940 const _RandomNumberEngine&
1941 base() const noexcept
1949 {
return _RandomNumberEngine::min(); }
1956 {
return _RandomNumberEngine::max(); }
1962 discard(
unsigned long long __z)
1964 for (; __z != 0ULL; --__z)
1988 {
return (__lhs._M_b == __rhs._M_b
1989 && std::equal(__lhs._M_v, __lhs._M_v + __k, __rhs._M_v)
1990 && __lhs._M_y == __rhs._M_y); }
2003 template<
typename _RandomNumberEngine1,
size_t __k1,
2004 typename _CharT,
typename _Traits>
2021 template<
typename _RandomNumberEngine1,
size_t __k1,
2022 typename _CharT,
typename _Traits>
2028 void _M_initialize()
2030 for (
size_t __i = 0; __i < __k; ++__i)
2035 _RandomNumberEngine _M_b;
2036 result_type _M_v[__k];
2040#if __cpp_impl_three_way_comparison < 201907L
2052 template<
typename _RandomNumberEngine,
size_t __k>
2058 {
return !(__lhs == __rhs); }
2061#if __glibcxx_philox_engine
2090 template<
typename _UIntType,
size_t __w,
size_t __n,
size_t __r,
2091 _UIntType... __consts>
2094 static_assert(__n == 2 || __n == 4,
2095 "template argument N must be either 2 or 4");
2096 static_assert(
sizeof...(__consts) == __n,
2097 "length of consts array must match specified N");
2098 static_assert(0 < __r,
"a number of rounds must be specified");
2099 static_assert((0 < __w && __w <= numeric_limits<_UIntType>::digits),
2100 "specified bitlength must match input type");
2102 template<
typename _Sseq>
2103 static constexpr bool __is_seed_seq =
requires {
2104 typename __detail::_If_seed_seq_for<_Sseq, philox_engine, _UIntType>;
2107 template <
size_t __ind0,
size_t __ind1>
2109 array<_UIntType, __n / 2>
2112 if constexpr (__n == 4)
2113 return {__consts...[__ind0], __consts...[__ind1]};
2115 return {__consts...[__ind0]};
2119 using result_type = _UIntType;
2121 static constexpr size_t word_size = __w;
2122 static constexpr size_t word_count = __n;
2123 static constexpr size_t round_count = __r;
2124 static constexpr array<result_type, __n / 2> multipliers
2125 = _S_popArray<0,2>();
2126 static constexpr array<result_type, __n / 2> round_consts
2127 = _S_popArray<1,3>();
2130 static constexpr result_type
2135 static constexpr result_type
2138 return ((1ull << (__w - 1)) | ((1ull << (__w - 1)) - 1));
2141 static constexpr result_type default_seed = 20111115u;
2149 philox_engine(result_type __value)
2150 : _M_x{}, _M_k{}, _M_y{}, _M_i(__n - 1)
2151 { _M_k[0] = __value &
max(); }
2157 template<
typename _Sseq>
requires __is_seed_seq<_Sseq>
2165 seed(result_type __value = default_seed)
2170 _M_k[0] = __value &
max();
2178 template<
typename _Sseq>
2180 seed(_Sseq& __q)
requires __is_seed_seq<_Sseq>;
2189 for (
size_t __j = 0; __j < __n; ++__j)
2190 _M_x[__j] = __counter[__n - 1 - __j] &
max();
2200 operator==(
const philox_engine&,
const philox_engine&) =
default;
2231 template<
typename _CharT,
typename _Traits>
2234 const philox_engine& __x)
2237 const _CharT __fill = __os.
fill();
2239 _CharT __space = __os.
widen(
' ');
2241 for (
auto& __subkey : __x._M_k)
2242 __os << __subkey << __space;
2243 for (
auto& __ctr : __x._M_x)
2244 __os << __ctr << __space;
2246 __os.
flags(__flags);
2258 template <
typename _CharT,
typename _Traits>
2265 for (
auto& __subkey : __x._M_k)
2267 for (
auto& __ctr : __x._M_x)
2270 unsigned char __setIndex = 0;
2271 for (
size_t __j = 0; __j < __x._M_x.size(); ++__j)
2273 if (__x._M_x[__j] > 0)
2279 for (
size_t __j = 0; __j <= __setIndex; ++__j)
2281 if (__j != __setIndex)
2282 __x._M_x[__j] =
max();
2287 __x._M_x = __tmpCtr;
2289 __is.
flags(__flags);
2296 array<_UIntType, __n / 2> _M_k;
2298 unsigned long long _M_i = 0;
2302 _S_mulhi(_UIntType __a, _UIntType __b);
2306 _S_mullo(_UIntType __a, _UIntType __b);
2321 typedef linear_congruential_engine<uint_fast32_t, 16807UL, 0UL, 2147483647UL>
2352 0xb5026f5aa96619e9ULL, 29,
2353 0x5555555555555555ULL, 17,
2354 0x71d67fffeda60000ULL, 37,
2355 0xfff7eee000000000ULL, 43,
2372#if __glibcxx_philox_engine
2378 0xCD9E8D57, 0x9E3779B9,
2385 0xCA5A826395121157, 0x9E3779B97F4A7C15,
2404 random_device() { _M_init(
"default"); }
2421 entropy() const noexcept
2422 {
return this->_M_getentropy(); }
2426 {
return this->_M_getval(); }
2429 random_device(
const random_device&) =
delete;
2430 void operator=(
const random_device&) =
delete;
2440 double _M_getentropy() const noexcept;
2442 void _M_init(const
char*,
size_t);
2472#if __cpp_impl_three_way_comparison < 201907L
2477 template<
typename _IntType>
2479 operator!=(
const std::uniform_int_distribution<_IntType>& __d1,
2480 const std::uniform_int_distribution<_IntType>& __d2)
2481 {
return !(__d1 == __d2); }
2494 template<
typename _IntType,
typename _CharT,
typename _Traits>
2495 std::basic_ostream<_CharT, _Traits>&
2496 operator<<(std::basic_ostream<_CharT, _Traits>&,
2497 const std::uniform_int_distribution<_IntType>&);
2508 template<
typename _IntType,
typename _CharT,
typename _Traits>
2509 std::basic_istream<_CharT, _Traits>&
2510 operator>>(std::basic_istream<_CharT, _Traits>&,
2511 std::uniform_int_distribution<_IntType>&);
2524 template<
typename _RealType =
double>
2528 "result_type must be a floating point type");
2539 param_type() : param_type(0) { }
2542 param_type(_RealType __a, _RealType __b = _RealType(1))
2543 : _M_a(__a), _M_b(__b)
2545 __glibcxx_assert(_M_a <= _M_b);
2557 operator==(
const param_type& __p1,
const param_type& __p2)
2558 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
2560#if __cpp_impl_three_way_comparison < 201907L
2562 operator!=(
const param_type& __p1,
const param_type& __p2)
2563 {
return !(__p1 == __p2); }
2587 : _M_param(__a, __b)
2605 {
return _M_param.a(); }
2609 {
return _M_param.b(); }
2616 {
return _M_param; }
2624 { _M_param = __param; }
2631 {
return this->a(); }
2638 {
return this->b(); }
2643 template<
typename _UniformRandomNumberGenerator>
2646 {
return this->
operator()(__urng, _M_param); }
2648 template<
typename _UniformRandomNumberGenerator>
2650 operator()(_UniformRandomNumberGenerator& __urng,
2651 const param_type& __p)
2653 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
2655 return (__aurng() * (__p.b() - __p.a())) + __p.a();
2658 template<
typename _ForwardIterator,
2659 typename _UniformRandomNumberGenerator>
2661 __generate(_ForwardIterator __f, _ForwardIterator __t,
2662 _UniformRandomNumberGenerator& __urng)
2663 { this->__generate(__f, __t, __urng, _M_param); }
2665 template<
typename _ForwardIterator,
2666 typename _UniformRandomNumberGenerator>
2668 __generate(_ForwardIterator __f, _ForwardIterator __t,
2669 _UniformRandomNumberGenerator& __urng,
2671 { this->__generate_impl(__f, __t, __urng, __p); }
2673 template<
typename _UniformRandomNumberGenerator>
2676 _UniformRandomNumberGenerator& __urng,
2678 { this->__generate_impl(__f, __t, __urng, __p); }
2687 {
return __d1._M_param == __d2._M_param; }
2690 template<
typename _ForwardIterator,
2691 typename _UniformRandomNumberGenerator>
2693 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2694 _UniformRandomNumberGenerator& __urng,
2695 const param_type& __p);
2697 param_type _M_param;
2700#if __cpp_impl_three_way_comparison < 201907L
2705 template<
typename _IntType>
2709 {
return !(__d1 == __d2); }
2722 template<
typename _RealType,
typename _CharT,
typename _Traits>
2723 std::basic_ostream<_CharT, _Traits>&
2724 operator<<(std::basic_ostream<_CharT, _Traits>&,
2725 const std::uniform_real_distribution<_RealType>&);
2736 template<
typename _RealType,
typename _CharT,
typename _Traits>
2737 std::basic_istream<_CharT, _Traits>&
2738 operator>>(std::basic_istream<_CharT, _Traits>&,
2739 std::uniform_real_distribution<_RealType>&);
2761 template<
typename _RealType =
double>
2762 class normal_distribution
2765 "result_type must be a floating point type");
2774 typedef normal_distribution<_RealType> distribution_type;
2776 param_type() : param_type(0.0) { }
2779 param_type(_RealType __mean, _RealType __stddev = _RealType(1))
2780 : _M_mean(__mean), _M_stddev(__stddev)
2782 __glibcxx_assert(_M_stddev > _RealType(0));
2791 {
return _M_stddev; }
2794 operator==(
const param_type& __p1,
const param_type& __p2)
2795 {
return (__p1._M_mean == __p2._M_mean
2796 && __p1._M_stddev == __p2._M_stddev); }
2798#if __cpp_impl_three_way_comparison < 201907L
2800 operator!=(
const param_type& __p1,
const param_type& __p2)
2801 {
return !(__p1 == __p2); }
2806 _RealType _M_stddev;
2810 normal_distribution() : normal_distribution(0.0) { }
2819 : _M_param(__mean, __stddev)
2832 { _M_saved_available =
false; }
2839 {
return _M_param.mean(); }
2846 {
return _M_param.stddev(); }
2853 {
return _M_param; }
2861 { _M_param = __param; }
2880 template<
typename _UniformRandomNumberGenerator>
2883 {
return this->
operator()(__urng, _M_param); }
2885 template<
typename _UniformRandomNumberGenerator>
2888 const param_type& __p);
2890 template<
typename _ForwardIterator,
2891 typename _UniformRandomNumberGenerator>
2893 __generate(_ForwardIterator __f, _ForwardIterator __t,
2894 _UniformRandomNumberGenerator& __urng)
2895 { this->__generate(__f, __t, __urng, _M_param); }
2897 template<
typename _ForwardIterator,
2898 typename _UniformRandomNumberGenerator>
2900 __generate(_ForwardIterator __f, _ForwardIterator __t,
2901 _UniformRandomNumberGenerator& __urng,
2902 const param_type& __p)
2903 { this->__generate_impl(__f, __t, __urng, __p); }
2905 template<
typename _UniformRandomNumberGenerator>
2907 __generate(result_type* __f, result_type* __t,
2908 _UniformRandomNumberGenerator& __urng,
2909 const param_type& __p)
2910 { this->__generate_impl(__f, __t, __urng, __p); }
2917 template<
typename _RealType1>
2932 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2947 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2953 template<
typename _ForwardIterator,
2954 typename _UniformRandomNumberGenerator>
2956 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2957 _UniformRandomNumberGenerator& __urng,
2958 const param_type& __p);
2960 param_type _M_param;
2962 bool _M_saved_available =
false;
2965#if __cpp_impl_three_way_comparison < 201907L
2969 template<
typename _RealType>
2973 {
return !(__d1 == __d2); }
2988 template<
typename _RealType =
double>
2989 class lognormal_distribution
2992 "result_type must be a floating point type");
3001 typedef lognormal_distribution<_RealType> distribution_type;
3003 param_type() : param_type(0.0) { }
3006 param_type(_RealType __m, _RealType __s = _RealType(1))
3007 : _M_m(__m), _M_s(__s)
3019 operator==(
const param_type& __p1,
const param_type& __p2)
3020 {
return __p1._M_m == __p2._M_m && __p1._M_s == __p2._M_s; }
3022#if __cpp_impl_three_way_comparison < 201907L
3024 operator!=(
const param_type& __p1,
const param_type& __p2)
3025 {
return !(__p1 == __p2); }
3033 lognormal_distribution() : lognormal_distribution(0.0) { }
3037 : _M_param(__m, __s), _M_nd()
3041 lognormal_distribution(
const param_type& __p)
3042 : _M_param(__p), _M_nd()
3057 {
return _M_param.m(); }
3061 {
return _M_param.s(); }
3068 {
return _M_param; }
3076 { _M_param = __param; }
3095 template<
typename _UniformRandomNumberGenerator>
3098 {
return this->
operator()(__urng, _M_param); }
3100 template<
typename _UniformRandomNumberGenerator>
3102 operator()(_UniformRandomNumberGenerator& __urng,
3103 const param_type& __p)
3104 {
return std::exp(__p.s() * _M_nd(__urng) + __p.m()); }
3106 template<
typename _ForwardIterator,
3107 typename _UniformRandomNumberGenerator>
3109 __generate(_ForwardIterator __f, _ForwardIterator __t,
3110 _UniformRandomNumberGenerator& __urng)
3111 { this->__generate(__f, __t, __urng, _M_param); }
3113 template<
typename _ForwardIterator,
3114 typename _UniformRandomNumberGenerator>
3116 __generate(_ForwardIterator __f, _ForwardIterator __t,
3117 _UniformRandomNumberGenerator& __urng,
3119 { this->__generate_impl(__f, __t, __urng, __p); }
3121 template<
typename _UniformRandomNumberGenerator>
3124 _UniformRandomNumberGenerator& __urng,
3126 { this->__generate_impl(__f, __t, __urng, __p); }
3135 const lognormal_distribution& __d2)
3136 {
return (__d1._M_param == __d2._M_param
3137 && __d1._M_nd == __d2._M_nd); }
3149 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3164 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3170 template<
typename _ForwardIterator,
3171 typename _UniformRandomNumberGenerator>
3173 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3174 _UniformRandomNumberGenerator& __urng,
3175 const param_type& __p);
3177 param_type _M_param;
3182#if __cpp_impl_three_way_comparison < 201907L
3186 template<
typename _RealType>
3190 {
return !(__d1 == __d2); }
3213 template<
typename _RealType =
double>
3217 "result_type must be a floating point type");
3229 param_type() : param_type(1.0) { }
3232 param_type(_RealType __alpha_val, _RealType __beta_val = _RealType(1))
3233 : _M_alpha(__alpha_val), _M_beta(__beta_val)
3235 __glibcxx_assert(_M_alpha > _RealType(0));
3241 {
return _M_alpha; }
3248 operator==(
const param_type& __p1,
const param_type& __p2)
3249 {
return (__p1._M_alpha == __p2._M_alpha
3250 && __p1._M_beta == __p2._M_beta); }
3252#if __cpp_impl_three_way_comparison < 201907L
3254 operator!=(
const param_type& __p1,
const param_type& __p2)
3255 {
return !(__p1 == __p2); }
3265 _RealType _M_malpha, _M_a2;
3280 _RealType __beta_val = _RealType(1))
3281 : _M_param(__alpha_val, __beta_val), _M_nd()
3286 : _M_param(__p), _M_nd()
3301 {
return _M_param.alpha(); }
3308 {
return _M_param.beta(); }
3315 {
return _M_param; }
3323 { _M_param = __param; }
3342 template<
typename _UniformRandomNumberGenerator>
3345 {
return this->
operator()(__urng, _M_param); }
3347 template<
typename _UniformRandomNumberGenerator>
3350 const param_type& __p);
3352 template<
typename _ForwardIterator,
3353 typename _UniformRandomNumberGenerator>
3355 __generate(_ForwardIterator __f, _ForwardIterator __t,
3356 _UniformRandomNumberGenerator& __urng)
3357 { this->__generate(__f, __t, __urng, _M_param); }
3359 template<
typename _ForwardIterator,
3360 typename _UniformRandomNumberGenerator>
3362 __generate(_ForwardIterator __f, _ForwardIterator __t,
3363 _UniformRandomNumberGenerator& __urng,
3364 const param_type& __p)
3365 { this->__generate_impl(__f, __t, __urng, __p); }
3367 template<
typename _UniformRandomNumberGenerator>
3369 __generate(result_type* __f, result_type* __t,
3370 _UniformRandomNumberGenerator& __urng,
3371 const param_type& __p)
3372 { this->__generate_impl(__f, __t, __urng, __p); }
3382 {
return (__d1._M_param == __d2._M_param
3383 && __d1._M_nd == __d2._M_nd); }
3395 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3409 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3415 template<
typename _ForwardIterator,
3416 typename _UniformRandomNumberGenerator>
3418 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3419 _UniformRandomNumberGenerator& __urng,
3420 const param_type& __p);
3422 param_type _M_param;
3427#if __cpp_impl_three_way_comparison < 201907L
3431 template<
typename _RealType>
3435 {
return !(__d1 == __d2); }
3455 template<
typename _RealType =
double>
3456 class chi_squared_distribution
3459 "result_type must be a floating point type");
3468 typedef chi_squared_distribution<_RealType> distribution_type;
3470 param_type() : param_type(1) { }
3473 param_type(_RealType __n)
3482 operator==(
const param_type& __p1,
const param_type& __p2)
3483 {
return __p1._M_n == __p2._M_n; }
3485#if __cpp_impl_three_way_comparison < 201907L
3487 operator!=(
const param_type& __p1,
const param_type& __p2)
3488 {
return !(__p1 == __p2); }
3495 chi_squared_distribution() : chi_squared_distribution(1) { }
3499 : _M_param(__n), _M_gd(__n / 2)
3503 chi_squared_distribution(
const param_type& __p)
3504 : _M_param(__p), _M_gd(__p.n() / 2)
3519 {
return _M_param.n(); }
3526 {
return _M_param; }
3539 _M_gd.param(param_type(__param.n() / 2));
3559 template<
typename _UniformRandomNumberGenerator>
3562 {
return 2 * _M_gd(__urng); }
3564 template<
typename _UniformRandomNumberGenerator>
3566 operator()(_UniformRandomNumberGenerator& __urng,
3567 const param_type& __p)
3571 return 2 * _M_gd(__urng, param_type(__p.n() / 2));
3574 template<
typename _ForwardIterator,
3575 typename _UniformRandomNumberGenerator>
3577 __generate(_ForwardIterator __f, _ForwardIterator __t,
3578 _UniformRandomNumberGenerator& __urng)
3579 { this->__generate_impl(__f, __t, __urng); }
3581 template<
typename _ForwardIterator,
3582 typename _UniformRandomNumberGenerator>
3584 __generate(_ForwardIterator __f, _ForwardIterator __t,
3585 _UniformRandomNumberGenerator& __urng,
3587 {
typename std::gamma_distribution<result_type>::param_type
3589 this->__generate_impl(__f, __t, __urng, __p2); }
3591 template<
typename _UniformRandomNumberGenerator>
3594 _UniformRandomNumberGenerator& __urng)
3595 { this->__generate_impl(__f, __t, __urng); }
3597 template<
typename _UniformRandomNumberGenerator>
3600 _UniformRandomNumberGenerator& __urng,
3602 {
typename std::gamma_distribution<result_type>::param_type
3604 this->__generate_impl(__f, __t, __urng, __p2); }
3613 const chi_squared_distribution& __d2)
3614 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
3626 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3641 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3647 template<
typename _ForwardIterator,
3648 typename _UniformRandomNumberGenerator>
3650 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3651 _UniformRandomNumberGenerator& __urng);
3653 template<
typename _ForwardIterator,
3654 typename _UniformRandomNumberGenerator>
3656 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3657 _UniformRandomNumberGenerator& __urng,
3661 param_type _M_param;
3666#if __cpp_impl_three_way_comparison < 201907L
3670 template<
typename _RealType>
3674 {
return !(__d1 == __d2); }
3686 template<
typename _RealType =
double>
3687 class cauchy_distribution
3690 "result_type must be a floating point type");
3699 typedef cauchy_distribution<_RealType> distribution_type;
3701 param_type() : param_type(0) { }
3704 param_type(_RealType __a, _RealType __b = _RealType(1))
3705 : _M_a(__a), _M_b(__b)
3717 operator==(
const param_type& __p1,
const param_type& __p2)
3718 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
3720#if __cpp_impl_three_way_comparison < 201907L
3722 operator!=(
const param_type& __p1,
const param_type& __p2)
3723 {
return !(__p1 == __p2); }
3731 cauchy_distribution() : cauchy_distribution(0.0) { }
3735 : _M_param(__a, __b)
3739 cauchy_distribution(
const param_type& __p)
3755 {
return _M_param.a(); }
3759 {
return _M_param.b(); }
3766 {
return _M_param; }
3774 { _M_param = __param; }
3793 template<
typename _UniformRandomNumberGenerator>
3796 {
return this->
operator()(__urng, _M_param); }
3798 template<
typename _UniformRandomNumberGenerator>
3800 operator()(_UniformRandomNumberGenerator& __urng,
3801 const param_type& __p);
3803 template<
typename _ForwardIterator,
3804 typename _UniformRandomNumberGenerator>
3806 __generate(_ForwardIterator __f, _ForwardIterator __t,
3807 _UniformRandomNumberGenerator& __urng)
3808 { this->__generate(__f, __t, __urng, _M_param); }
3810 template<
typename _ForwardIterator,
3811 typename _UniformRandomNumberGenerator>
3813 __generate(_ForwardIterator __f, _ForwardIterator __t,
3814 _UniformRandomNumberGenerator& __urng,
3815 const param_type& __p)
3816 { this->__generate_impl(__f, __t, __urng, __p); }
3818 template<
typename _UniformRandomNumberGenerator>
3821 _UniformRandomNumberGenerator& __urng,
3823 { this->__generate_impl(__f, __t, __urng, __p); }
3831 const cauchy_distribution& __d2)
3832 {
return __d1._M_param == __d2._M_param; }
3835 template<
typename _ForwardIterator,
3836 typename _UniformRandomNumberGenerator>
3838 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3839 _UniformRandomNumberGenerator& __urng,
3840 const param_type& __p);
3842 param_type _M_param;
3845#if __cpp_impl_three_way_comparison < 201907L
3850 template<
typename _RealType>
3854 {
return !(__d1 == __d2); }
3867 template<
typename _RealType,
typename _CharT,
typename _Traits>
3868 std::basic_ostream<_CharT, _Traits>&
3869 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3870 const std::cauchy_distribution<_RealType>& __x);
3882 template<
typename _RealType,
typename _CharT,
typename _Traits>
3883 std::basic_istream<_CharT, _Traits>&
3884 operator>>(std::basic_istream<_CharT, _Traits>& __is,
3885 std::cauchy_distribution<_RealType>& __x);
3901 template<
typename _RealType =
double>
3902 class fisher_f_distribution
3905 "result_type must be a floating point type");
3914 typedef fisher_f_distribution<_RealType> distribution_type;
3916 param_type() : param_type(1) { }
3919 param_type(_RealType __m, _RealType __n = _RealType(1))
3920 : _M_m(__m), _M_n(__n)
3932 operator==(
const param_type& __p1,
const param_type& __p2)
3933 {
return __p1._M_m == __p2._M_m && __p1._M_n == __p2._M_n; }
3935#if __cpp_impl_three_way_comparison < 201907L
3937 operator!=(
const param_type& __p1,
const param_type& __p2)
3938 {
return !(__p1 == __p2); }
3946 fisher_f_distribution() : fisher_f_distribution(1.0) { }
3950 _RealType __n = _RealType(1))
3951 : _M_param(__m, __n), _M_gd_x(__m / 2), _M_gd_y(__n / 2)
3955 fisher_f_distribution(
const param_type& __p)
3956 : _M_param(__p), _M_gd_x(__p.m() / 2), _M_gd_y(__p.n() / 2)
3974 {
return _M_param.m(); }
3978 {
return _M_param.n(); }
3985 {
return _M_param; }
3998 _M_gd_x.param(param_type(__param.m() / 2));
3999 _M_gd_y.param(param_type(__param.n() / 2));
4019 template<
typename _UniformRandomNumberGenerator>
4022 {
return (_M_gd_x(__urng) * n()) / (_M_gd_y(__urng) * m()); }
4024 template<
typename _UniformRandomNumberGenerator>
4026 operator()(_UniformRandomNumberGenerator& __urng,
4027 const param_type& __p)
4031 return ((_M_gd_x(__urng, param_type(__p.m() / 2)) * n())
4032 / (_M_gd_y(__urng, param_type(__p.n() / 2)) * m()));
4035 template<
typename _ForwardIterator,
4036 typename _UniformRandomNumberGenerator>
4038 __generate(_ForwardIterator __f, _ForwardIterator __t,
4039 _UniformRandomNumberGenerator& __urng)
4040 { this->__generate_impl(__f, __t, __urng); }
4042 template<
typename _ForwardIterator,
4043 typename _UniformRandomNumberGenerator>
4045 __generate(_ForwardIterator __f, _ForwardIterator __t,
4046 _UniformRandomNumberGenerator& __urng,
4048 { this->__generate_impl(__f, __t, __urng, __p); }
4050 template<
typename _UniformRandomNumberGenerator>
4053 _UniformRandomNumberGenerator& __urng)
4054 { this->__generate_impl(__f, __t, __urng); }
4056 template<
typename _UniformRandomNumberGenerator>
4059 _UniformRandomNumberGenerator& __urng,
4061 { this->__generate_impl(__f, __t, __urng, __p); }
4070 const fisher_f_distribution& __d2)
4071 {
return (__d1._M_param == __d2._M_param
4072 && __d1._M_gd_x == __d2._M_gd_x
4073 && __d1._M_gd_y == __d2._M_gd_y); }
4085 template<
typename _RealType1,
typename _CharT,
typename _Traits>
4100 template<
typename _RealType1,
typename _CharT,
typename _Traits>
4106 template<
typename _ForwardIterator,
4107 typename _UniformRandomNumberGenerator>
4109 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4110 _UniformRandomNumberGenerator& __urng);
4112 template<
typename _ForwardIterator,
4113 typename _UniformRandomNumberGenerator>
4115 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4116 _UniformRandomNumberGenerator& __urng,
4117 const param_type& __p);
4119 param_type _M_param;
4124#if __cpp_impl_three_way_comparison < 201907L
4128 template<
typename _RealType>
4132 {
return !(__d1 == __d2); }
4147 template<
typename _RealType =
double>
4148 class student_t_distribution
4151 "result_type must be a floating point type");
4160 typedef student_t_distribution<_RealType> distribution_type;
4162 param_type() : param_type(1) { }
4165 param_type(_RealType __n)
4174 operator==(
const param_type& __p1,
const param_type& __p2)
4175 {
return __p1._M_n == __p2._M_n; }
4177#if __cpp_impl_three_way_comparison < 201907L
4179 operator!=(
const param_type& __p1,
const param_type& __p2)
4180 {
return !(__p1 == __p2); }
4187 student_t_distribution() : student_t_distribution(1.0) { }
4191 : _M_param(__n), _M_nd(), _M_gd(__n / 2, 2)
4195 student_t_distribution(
const param_type& __p)
4196 : _M_param(__p), _M_nd(), _M_gd(__p.n() / 2, 2)
4214 {
return _M_param.n(); }
4221 {
return _M_param; }
4234 _M_gd.param(param_type(__param.n() / 2, 2));
4254 template<
typename _UniformRandomNumberGenerator>
4257 {
return _M_nd(__urng) *
std::sqrt(n() / _M_gd(__urng)); }
4259 template<
typename _UniformRandomNumberGenerator>
4261 operator()(_UniformRandomNumberGenerator& __urng,
4262 const param_type& __p)
4267 const result_type __g = _M_gd(__urng, param_type(__p.n() / 2, 2));
4268 return _M_nd(__urng) *
std::sqrt(__p.n() / __g);
4271 template<
typename _ForwardIterator,
4272 typename _UniformRandomNumberGenerator>
4274 __generate(_ForwardIterator __f, _ForwardIterator __t,
4275 _UniformRandomNumberGenerator& __urng)
4276 { this->__generate_impl(__f, __t, __urng); }
4278 template<
typename _ForwardIterator,
4279 typename _UniformRandomNumberGenerator>
4281 __generate(_ForwardIterator __f, _ForwardIterator __t,
4282 _UniformRandomNumberGenerator& __urng,
4284 { this->__generate_impl(__f, __t, __urng, __p); }
4286 template<
typename _UniformRandomNumberGenerator>
4289 _UniformRandomNumberGenerator& __urng)
4290 { this->__generate_impl(__f, __t, __urng); }
4292 template<
typename _UniformRandomNumberGenerator>
4295 _UniformRandomNumberGenerator& __urng,
4297 { this->__generate_impl(__f, __t, __urng, __p); }
4306 const student_t_distribution& __d2)
4307 {
return (__d1._M_param == __d2._M_param
4308 && __d1._M_nd == __d2._M_nd && __d1._M_gd == __d2._M_gd); }
4320 template<
typename _RealType1,
typename _CharT,
typename _Traits>
4335 template<
typename _RealType1,
typename _CharT,
typename _Traits>
4341 template<
typename _ForwardIterator,
4342 typename _UniformRandomNumberGenerator>
4344 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4345 _UniformRandomNumberGenerator& __urng);
4346 template<
typename _ForwardIterator,
4347 typename _UniformRandomNumberGenerator>
4349 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4350 _UniformRandomNumberGenerator& __urng,
4351 const param_type& __p);
4353 param_type _M_param;
4359#if __cpp_impl_three_way_comparison < 201907L
4363 template<
typename _RealType>
4367 {
return !(__d1 == __d2); }
4398 param_type() : param_type(0.5) { }
4401 param_type(
double __p)
4404 __glibcxx_assert((_M_p >= 0.0) && (_M_p <= 1.0));
4412 operator==(
const param_type& __p1,
const param_type& __p2)
4413 {
return __p1._M_p == __p2._M_p; }
4415#if __cpp_impl_three_way_comparison < 201907L
4417 operator!=(
const param_type& __p1,
const param_type& __p2)
4418 {
return !(__p1 == __p2); }
4460 {
return _M_param.p(); }
4467 {
return _M_param; }
4475 { _M_param = __param; }
4494 template<
typename _UniformRandomNumberGenerator>
4497 {
return this->
operator()(__urng, _M_param); }
4499 template<
typename _UniformRandomNumberGenerator>
4501 operator()(_UniformRandomNumberGenerator& __urng,
4502 const param_type& __p)
4504 __detail::_Adaptor<_UniformRandomNumberGenerator, double>
4506 if ((__aurng() - __aurng.min())
4507 < __p.p() * (__aurng.max() - __aurng.min()))
4512 template<
typename _ForwardIterator,
4513 typename _UniformRandomNumberGenerator>
4515 __generate(_ForwardIterator __f, _ForwardIterator __t,
4516 _UniformRandomNumberGenerator& __urng)
4517 { this->__generate(__f, __t, __urng, _M_param); }
4519 template<
typename _ForwardIterator,
4520 typename _UniformRandomNumberGenerator>
4522 __generate(_ForwardIterator __f, _ForwardIterator __t,
4523 _UniformRandomNumberGenerator& __urng,
const param_type& __p)
4524 { this->__generate_impl(__f, __t, __urng, __p); }
4526 template<
typename _UniformRandomNumberGenerator>
4529 _UniformRandomNumberGenerator& __urng,
4531 { this->__generate_impl(__f, __t, __urng, __p); }
4540 {
return __d1._M_param == __d2._M_param; }
4543 template<
typename _ForwardIterator,
4544 typename _UniformRandomNumberGenerator>
4546 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4547 _UniformRandomNumberGenerator& __urng,
4548 const param_type& __p);
4550 param_type _M_param;
4553#if __cpp_impl_three_way_comparison < 201907L
4561 {
return !(__d1 == __d2); }
4574 template<
typename _CharT,
typename _Traits>
4575 std::basic_ostream<_CharT, _Traits>&
4576 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4577 const std::bernoulli_distribution& __x);
4588 template<
typename _CharT,
typename _Traits>
4589 inline std::basic_istream<_CharT, _Traits>&
4610 template<
typename _IntType =
int>
4611 class binomial_distribution
4614 "result_type must be an integral type");
4623 typedef binomial_distribution<_IntType> distribution_type;
4624 friend class binomial_distribution<_IntType>;
4626 param_type() : param_type(1) { }
4629 param_type(_IntType __t,
double __p = 0.5)
4630 : _M_t(__t), _M_p(__p)
4632 __glibcxx_assert((_M_t >= _IntType(0))
4647 operator==(
const param_type& __p1,
const param_type& __p2)
4648 {
return __p1._M_t == __p2._M_t && __p1._M_p == __p2._M_p; }
4650#if __cpp_impl_three_way_comparison < 201907L
4652 operator!=(
const param_type& __p1,
const param_type& __p2)
4653 {
return !(__p1 == __p2); }
4664#if _GLIBCXX_USE_C99_MATH_FUNCS
4665 double _M_d1, _M_d2, _M_s1, _M_s2, _M_c,
4666 _M_a1, _M_a123, _M_s, _M_lf, _M_lp1p;
4673 binomial_distribution() : binomial_distribution(1) { }
4677 : _M_param(__t, __p), _M_nd()
4681 binomial_distribution(
const param_type& __p)
4682 : _M_param(__p), _M_nd()
4697 {
return _M_param.t(); }
4704 {
return _M_param.p(); }
4711 {
return _M_param; }
4719 { _M_param = __param; }
4733 {
return _M_param.t(); }
4738 template<
typename _UniformRandomNumberGenerator>
4741 {
return this->
operator()(__urng, _M_param); }
4743 template<
typename _UniformRandomNumberGenerator>
4746 const param_type& __p);
4748 template<
typename _ForwardIterator,
4749 typename _UniformRandomNumberGenerator>
4751 __generate(_ForwardIterator __f, _ForwardIterator __t,
4752 _UniformRandomNumberGenerator& __urng)
4753 { this->__generate(__f, __t, __urng, _M_param); }
4755 template<
typename _ForwardIterator,
4756 typename _UniformRandomNumberGenerator>
4758 __generate(_ForwardIterator __f, _ForwardIterator __t,
4759 _UniformRandomNumberGenerator& __urng,
4760 const param_type& __p)
4761 { this->__generate_impl(__f, __t, __urng, __p); }
4763 template<
typename _UniformRandomNumberGenerator>
4765 __generate(result_type* __f, result_type* __t,
4766 _UniformRandomNumberGenerator& __urng,
4767 const param_type& __p)
4768 { this->__generate_impl(__f, __t, __urng, __p); }
4777 const binomial_distribution& __d2)
4778#ifdef _GLIBCXX_USE_C99_MATH_FUNCS
4779 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
4781 {
return __d1._M_param == __d2._M_param; }
4794 template<
typename _IntType1,
4795 typename _CharT,
typename _Traits>
4810 template<
typename _IntType1,
4811 typename _CharT,
typename _Traits>
4817 template<
typename _ForwardIterator,
4818 typename _UniformRandomNumberGenerator>
4820 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4821 _UniformRandomNumberGenerator& __urng,
4822 const param_type& __p);
4824 template<
typename _UniformRandomNumberGenerator>
4826 _M_waiting(_UniformRandomNumberGenerator& __urng,
4827 _IntType __t,
double __q);
4829 param_type _M_param;
4835#if __cpp_impl_three_way_comparison < 201907L
4839 template<
typename _IntType>
4843 {
return !(__d1 == __d2); }
4856 template<
typename _IntType =
int>
4857 class geometric_distribution
4860 "result_type must be an integral type");
4869 typedef geometric_distribution<_IntType> distribution_type;
4870 friend class geometric_distribution<_IntType>;
4872 param_type() : param_type(0.5) { }
4875 param_type(
double __p)
4878 __glibcxx_assert((_M_p > 0.0) && (_M_p < 1.0));
4887 operator==(
const param_type& __p1,
const param_type& __p2)
4888 {
return __p1._M_p == __p2._M_p; }
4890#if __cpp_impl_three_way_comparison < 201907L
4892 operator!=(
const param_type& __p1,
const param_type& __p2)
4893 {
return !(__p1 == __p2); }
4899 { _M_log_1_p =
std::log(1.0 - _M_p); }
4908 geometric_distribution() : geometric_distribution(0.5) { }
4916 geometric_distribution(
const param_type& __p)
4933 {
return _M_param.p(); }
4940 {
return _M_param; }
4948 { _M_param = __param; }
4967 template<
typename _UniformRandomNumberGenerator>
4970 {
return this->
operator()(__urng, _M_param); }
4972 template<
typename _UniformRandomNumberGenerator>
4974 operator()(_UniformRandomNumberGenerator& __urng,
4975 const param_type& __p);
4977 template<
typename _ForwardIterator,
4978 typename _UniformRandomNumberGenerator>
4980 __generate(_ForwardIterator __f, _ForwardIterator __t,
4981 _UniformRandomNumberGenerator& __urng)
4982 { this->__generate(__f, __t, __urng, _M_param); }
4984 template<
typename _ForwardIterator,
4985 typename _UniformRandomNumberGenerator>
4987 __generate(_ForwardIterator __f, _ForwardIterator __t,
4988 _UniformRandomNumberGenerator& __urng,
4989 const param_type& __p)
4990 { this->__generate_impl(__f, __t, __urng, __p); }
4992 template<
typename _UniformRandomNumberGenerator>
4995 _UniformRandomNumberGenerator& __urng,
4997 { this->__generate_impl(__f, __t, __urng, __p); }
5005 const geometric_distribution& __d2)
5006 {
return __d1._M_param == __d2._M_param; }
5009 template<
typename _ForwardIterator,
5010 typename _UniformRandomNumberGenerator>
5012 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5013 _UniformRandomNumberGenerator& __urng,
5014 const param_type& __p);
5016 param_type _M_param;
5019#if __cpp_impl_three_way_comparison < 201907L
5024 template<
typename _IntType>
5028 {
return !(__d1 == __d2); }
5041 template<
typename _IntType,
5042 typename _CharT,
typename _Traits>
5043 std::basic_ostream<_CharT, _Traits>&
5044 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5045 const std::geometric_distribution<_IntType>& __x);
5056 template<
typename _IntType,
5057 typename _CharT,
typename _Traits>
5058 std::basic_istream<_CharT, _Traits>&
5059 operator>>(std::basic_istream<_CharT, _Traits>& __is,
5060 std::geometric_distribution<_IntType>& __x);
5073 template<
typename _IntType =
int>
5074 class negative_binomial_distribution
5077 "result_type must be an integral type");
5086 typedef negative_binomial_distribution<_IntType> distribution_type;
5088 param_type() : param_type(1) { }
5091 param_type(_IntType __k,
double __p = 0.5)
5092 : _M_k(__k), _M_p(__p)
5094 __glibcxx_assert((_M_k > 0) && (_M_p > 0.0) && (_M_p <= 1.0));
5106 operator==(
const param_type& __p1,
const param_type& __p2)
5107 {
return __p1._M_k == __p2._M_k && __p1._M_p == __p2._M_p; }
5109#if __cpp_impl_three_way_comparison < 201907L
5111 operator!=(
const param_type& __p1,
const param_type& __p2)
5112 {
return !(__p1 == __p2); }
5120 negative_binomial_distribution() : negative_binomial_distribution(1) { }
5124 : _M_param(__k, __p), _M_gd(__k, (1.0 - __p) / __p)
5128 negative_binomial_distribution(
const param_type& __p)
5129 : _M_param(__p), _M_gd(__p.
k(), (1.0 - __p.
p()) / __p.
p())
5144 {
return _M_param.k(); }
5151 {
return _M_param.p(); }
5158 {
return _M_param; }
5171 _M_gd.param(param_type(__param.k(), (1.0 - __param.p()) / __param.p()));
5191 template<
typename _UniformRandomNumberGenerator>
5195 template<
typename _UniformRandomNumberGenerator>
5197 operator()(_UniformRandomNumberGenerator& __urng,
5198 const param_type& __p);
5200 template<
typename _ForwardIterator,
5201 typename _UniformRandomNumberGenerator>
5203 __generate(_ForwardIterator __f, _ForwardIterator __t,
5204 _UniformRandomNumberGenerator& __urng)
5205 { this->__generate_impl(__f, __t, __urng); }
5207 template<
typename _ForwardIterator,
5208 typename _UniformRandomNumberGenerator>
5210 __generate(_ForwardIterator __f, _ForwardIterator __t,
5211 _UniformRandomNumberGenerator& __urng,
5212 const param_type& __p)
5213 { this->__generate_impl(__f, __t, __urng, __p); }
5215 template<
typename _UniformRandomNumberGenerator>
5217 __generate(result_type* __f, result_type* __t,
5218 _UniformRandomNumberGenerator& __urng)
5219 { this->__generate_impl(__f, __t, __urng); }
5221 template<
typename _UniformRandomNumberGenerator>
5224 _UniformRandomNumberGenerator& __urng,
5226 { this->__generate_impl(__f, __t, __urng, __p); }
5235 const negative_binomial_distribution& __d2)
5236 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
5249 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5264 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5270 template<
typename _ForwardIterator,
5271 typename _UniformRandomNumberGenerator>
5273 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5274 _UniformRandomNumberGenerator& __urng);
5275 template<
typename _ForwardIterator,
5276 typename _UniformRandomNumberGenerator>
5278 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5279 _UniformRandomNumberGenerator& __urng,
5280 const param_type& __p);
5282 param_type _M_param;
5287#if __cpp_impl_three_way_comparison < 201907L
5291 template<
typename _IntType>
5295 {
return !(__d1 == __d2); }
5316 template<
typename _IntType =
int>
5317 class poisson_distribution
5320 "result_type must be an integral type");
5329 typedef poisson_distribution<_IntType> distribution_type;
5330 friend class poisson_distribution<_IntType>;
5332 param_type() : param_type(1.0) { }
5335 param_type(
double __mean)
5338 __glibcxx_assert(_M_mean > 0.0);
5347 operator==(
const param_type& __p1,
const param_type& __p2)
5348 {
return __p1._M_mean == __p2._M_mean; }
5350#if __cpp_impl_three_way_comparison < 201907L
5352 operator!=(
const param_type& __p1,
const param_type& __p2)
5353 {
return !(__p1 == __p2); }
5364#if _GLIBCXX_USE_C99_MATH_FUNCS
5365 double _M_lfm, _M_sm, _M_d, _M_scx, _M_1cx, _M_c2b, _M_cb;
5371 poisson_distribution() : poisson_distribution(1.0) { }
5375 : _M_param(__mean), _M_nd()
5379 poisson_distribution(
const param_type& __p)
5380 : _M_param(__p), _M_nd()
5395 {
return _M_param.mean(); }
5402 {
return _M_param; }
5410 { _M_param = __param; }
5429 template<
typename _UniformRandomNumberGenerator>
5432 {
return this->
operator()(__urng, _M_param); }
5434 template<
typename _UniformRandomNumberGenerator>
5437 const param_type& __p);
5439 template<
typename _ForwardIterator,
5440 typename _UniformRandomNumberGenerator>
5442 __generate(_ForwardIterator __f, _ForwardIterator __t,
5443 _UniformRandomNumberGenerator& __urng)
5444 { this->__generate(__f, __t, __urng, _M_param); }
5446 template<
typename _ForwardIterator,
5447 typename _UniformRandomNumberGenerator>
5449 __generate(_ForwardIterator __f, _ForwardIterator __t,
5450 _UniformRandomNumberGenerator& __urng,
5451 const param_type& __p)
5452 { this->__generate_impl(__f, __t, __urng, __p); }
5454 template<
typename _UniformRandomNumberGenerator>
5456 __generate(result_type* __f, result_type* __t,
5457 _UniformRandomNumberGenerator& __urng,
5458 const param_type& __p)
5459 { this->__generate_impl(__f, __t, __urng, __p); }
5468 const poisson_distribution& __d2)
5469#ifdef _GLIBCXX_USE_C99_MATH_FUNCS
5470 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
5472 {
return __d1._M_param == __d2._M_param; }
5485 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5500 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5506 template<
typename _ForwardIterator,
5507 typename _UniformRandomNumberGenerator>
5509 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5510 _UniformRandomNumberGenerator& __urng,
5511 const param_type& __p);
5513 param_type _M_param;
5519#if __cpp_impl_three_way_comparison < 201907L
5523 template<
typename _IntType>
5527 {
return !(__d1 == __d2); }
5548 template<
typename _RealType =
double>
5552 "result_type must be a floating point type");
5563 param_type() : param_type(1.0) { }
5566 param_type(_RealType __lambda)
5567 : _M_lambda(__lambda)
5569 __glibcxx_assert(_M_lambda > _RealType(0));
5574 {
return _M_lambda; }
5577 operator==(
const param_type& __p1,
const param_type& __p2)
5578 {
return __p1._M_lambda == __p2._M_lambda; }
5580#if __cpp_impl_three_way_comparison < 201907L
5582 operator!=(
const param_type& __p1,
const param_type& __p2)
5583 {
return !(__p1 == __p2); }
5587 _RealType _M_lambda;
5603 : _M_param(__lambda)
5624 {
return _M_param.lambda(); }
5631 {
return _M_param; }
5639 { _M_param = __param; }
5658 template<
typename _UniformRandomNumberGenerator>
5661 {
return this->
operator()(__urng, _M_param); }
5663 template<
typename _UniformRandomNumberGenerator>
5665 operator()(_UniformRandomNumberGenerator& __urng,
5666 const param_type& __p)
5668 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
5673 template<
typename _ForwardIterator,
5674 typename _UniformRandomNumberGenerator>
5676 __generate(_ForwardIterator __f, _ForwardIterator __t,
5677 _UniformRandomNumberGenerator& __urng)
5678 { this->__generate(__f, __t, __urng, _M_param); }
5680 template<
typename _ForwardIterator,
5681 typename _UniformRandomNumberGenerator>
5683 __generate(_ForwardIterator __f, _ForwardIterator __t,
5684 _UniformRandomNumberGenerator& __urng,
5686 { this->__generate_impl(__f, __t, __urng, __p); }
5688 template<
typename _UniformRandomNumberGenerator>
5691 _UniformRandomNumberGenerator& __urng,
5693 { this->__generate_impl(__f, __t, __urng, __p); }
5702 {
return __d1._M_param == __d2._M_param; }
5705 template<
typename _ForwardIterator,
5706 typename _UniformRandomNumberGenerator>
5708 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5709 _UniformRandomNumberGenerator& __urng,
5710 const param_type& __p);
5712 param_type _M_param;
5715#if __cpp_impl_three_way_comparison < 201907L
5720 template<
typename _RealType>
5724 {
return !(__d1 == __d2); }
5737 template<
typename _RealType,
typename _CharT,
typename _Traits>
5738 std::basic_ostream<_CharT, _Traits>&
5739 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5740 const std::exponential_distribution<_RealType>& __x);
5752 template<
typename _RealType,
typename _CharT,
typename _Traits>
5753 std::basic_istream<_CharT, _Traits>&
5754 operator>>(std::basic_istream<_CharT, _Traits>& __is,
5755 std::exponential_distribution<_RealType>& __x);
5770 template<
typename _RealType =
double>
5771 class weibull_distribution
5774 "result_type must be a floating point type");
5783 typedef weibull_distribution<_RealType> distribution_type;
5785 param_type() : param_type(1.0) { }
5788 param_type(_RealType __a, _RealType __b = _RealType(1.0))
5789 : _M_a(__a), _M_b(__b)
5801 operator==(
const param_type& __p1,
const param_type& __p2)
5802 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
5804#if __cpp_impl_three_way_comparison < 201907L
5806 operator!=(
const param_type& __p1,
const param_type& __p2)
5807 {
return !(__p1 == __p2); }
5815 weibull_distribution() : weibull_distribution(1.0) { }
5819 : _M_param(__a, __b)
5823 weibull_distribution(
const param_type& __p)
5839 {
return _M_param.a(); }
5846 {
return _M_param.b(); }
5853 {
return _M_param; }
5861 { _M_param = __param; }
5880 template<
typename _UniformRandomNumberGenerator>
5883 {
return this->
operator()(__urng, _M_param); }
5885 template<
typename _UniformRandomNumberGenerator>
5887 operator()(_UniformRandomNumberGenerator& __urng,
5888 const param_type& __p);
5890 template<
typename _ForwardIterator,
5891 typename _UniformRandomNumberGenerator>
5893 __generate(_ForwardIterator __f, _ForwardIterator __t,
5894 _UniformRandomNumberGenerator& __urng)
5895 { this->__generate(__f, __t, __urng, _M_param); }
5897 template<
typename _ForwardIterator,
5898 typename _UniformRandomNumberGenerator>
5900 __generate(_ForwardIterator __f, _ForwardIterator __t,
5901 _UniformRandomNumberGenerator& __urng,
5902 const param_type& __p)
5903 { this->__generate_impl(__f, __t, __urng, __p); }
5905 template<
typename _UniformRandomNumberGenerator>
5908 _UniformRandomNumberGenerator& __urng,
5910 { this->__generate_impl(__f, __t, __urng, __p); }
5918 const weibull_distribution& __d2)
5919 {
return __d1._M_param == __d2._M_param; }
5922 template<
typename _ForwardIterator,
5923 typename _UniformRandomNumberGenerator>
5925 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5926 _UniformRandomNumberGenerator& __urng,
5927 const param_type& __p);
5929 param_type _M_param;
5932#if __cpp_impl_three_way_comparison < 201907L
5937 template<
typename _RealType>
5941 {
return !(__d1 == __d2); }
5954 template<
typename _RealType,
typename _CharT,
typename _Traits>
5955 std::basic_ostream<_CharT, _Traits>&
5956 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5957 const std::weibull_distribution<_RealType>& __x);
5969 template<
typename _RealType,
typename _CharT,
typename _Traits>
5970 std::basic_istream<_CharT, _Traits>&
5971 operator>>(std::basic_istream<_CharT, _Traits>& __is,
5972 std::weibull_distribution<_RealType>& __x);
5987 template<
typename _RealType =
double>
5988 class extreme_value_distribution
5991 "result_type must be a floating point type");
6000 typedef extreme_value_distribution<_RealType> distribution_type;
6002 param_type() : param_type(0.0) { }
6005 param_type(_RealType __a, _RealType __b = _RealType(1.0))
6006 : _M_a(__a), _M_b(__b)
6018 operator==(
const param_type& __p1,
const param_type& __p2)
6019 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
6021#if __cpp_impl_three_way_comparison < 201907L
6023 operator!=(
const param_type& __p1,
const param_type& __p2)
6024 {
return !(__p1 == __p2); }
6032 extreme_value_distribution() : extreme_value_distribution(0.0) { }
6036 : _M_param(__a, __b)
6040 extreme_value_distribution(
const param_type& __p)
6056 {
return _M_param.a(); }
6063 {
return _M_param.b(); }
6070 {
return _M_param; }
6078 { _M_param = __param; }
6097 template<
typename _UniformRandomNumberGenerator>
6100 {
return this->
operator()(__urng, _M_param); }
6102 template<
typename _UniformRandomNumberGenerator>
6104 operator()(_UniformRandomNumberGenerator& __urng,
6105 const param_type& __p);
6107 template<
typename _ForwardIterator,
6108 typename _UniformRandomNumberGenerator>
6110 __generate(_ForwardIterator __f, _ForwardIterator __t,
6111 _UniformRandomNumberGenerator& __urng)
6112 { this->__generate(__f, __t, __urng, _M_param); }
6114 template<
typename _ForwardIterator,
6115 typename _UniformRandomNumberGenerator>
6117 __generate(_ForwardIterator __f, _ForwardIterator __t,
6118 _UniformRandomNumberGenerator& __urng,
6119 const param_type& __p)
6120 { this->__generate_impl(__f, __t, __urng, __p); }
6122 template<
typename _UniformRandomNumberGenerator>
6125 _UniformRandomNumberGenerator& __urng,
6127 { this->__generate_impl(__f, __t, __urng, __p); }
6135 const extreme_value_distribution& __d2)
6136 {
return __d1._M_param == __d2._M_param; }
6139 template<
typename _ForwardIterator,
6140 typename _UniformRandomNumberGenerator>
6142 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6143 _UniformRandomNumberGenerator& __urng,
6144 const param_type& __p);
6146 param_type _M_param;
6149#if __cpp_impl_three_way_comparison < 201907L
6154 template<
typename _RealType>
6158 {
return !(__d1 == __d2); }
6171 template<
typename _RealType,
typename _CharT,
typename _Traits>
6172 std::basic_ostream<_CharT, _Traits>&
6173 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
6174 const std::extreme_value_distribution<_RealType>& __x);
6186 template<
typename _RealType,
typename _CharT,
typename _Traits>
6187 std::basic_istream<_CharT, _Traits>&
6188 operator>>(std::basic_istream<_CharT, _Traits>& __is,
6189 std::extreme_value_distribution<_RealType>& __x);
6209 template<
typename _IntType =
int>
6210 class discrete_distribution
6213 "result_type must be an integral type");
6222 typedef discrete_distribution<_IntType> distribution_type;
6223 friend class discrete_distribution<_IntType>;
6226 : _M_prob(), _M_cp()
6229 template<
typename _InputIterator>
6230 param_type(_InputIterator __wbegin,
6231 _InputIterator __wend)
6232 : _M_prob(__wbegin, __wend), _M_cp()
6233 { _M_initialize(); }
6236 : _M_prob(__wil.begin(), __wil.end()), _M_cp()
6237 { _M_initialize(); }
6239 template<
typename _Func>
6240 param_type(
size_t __nw,
double __xmin,
double __xmax,
6244 param_type(
const param_type&) =
default;
6245 param_type& operator=(
const param_type&) =
default;
6252 operator==(
const param_type& __p1,
const param_type& __p2)
6253 {
return __p1._M_prob == __p2._M_prob; }
6255#if __cpp_impl_three_way_comparison < 201907L
6257 operator!=(
const param_type& __p1,
const param_type& __p2)
6258 {
return !(__p1 == __p2); }
6269 discrete_distribution()
6273 template<
typename _InputIterator>
6275 _InputIterator __wend)
6276 : _M_param(__wbegin, __wend)
6279 discrete_distribution(initializer_list<double> __wl)
6283 template<
typename _Func>
6284 discrete_distribution(
size_t __nw,
double __xmin,
double __xmax,
6286 : _M_param(__nw, __xmin, __xmax, __fw)
6307 return _M_param._M_prob.
empty()
6316 {
return _M_param; }
6324 { _M_param = __param; }
6339 return _M_param._M_prob.empty()
6346 template<
typename _UniformRandomNumberGenerator>
6349 {
return this->
operator()(__urng, _M_param); }
6351 template<
typename _UniformRandomNumberGenerator>
6353 operator()(_UniformRandomNumberGenerator& __urng,
6354 const param_type& __p);
6356 template<
typename _ForwardIterator,
6357 typename _UniformRandomNumberGenerator>
6359 __generate(_ForwardIterator __f, _ForwardIterator __t,
6360 _UniformRandomNumberGenerator& __urng)
6361 { this->__generate(__f, __t, __urng, _M_param); }
6363 template<
typename _ForwardIterator,
6364 typename _UniformRandomNumberGenerator>
6366 __generate(_ForwardIterator __f, _ForwardIterator __t,
6367 _UniformRandomNumberGenerator& __urng,
6368 const param_type& __p)
6369 { this->__generate_impl(__f, __t, __urng, __p); }
6371 template<
typename _UniformRandomNumberGenerator>
6374 _UniformRandomNumberGenerator& __urng,
6376 { this->__generate_impl(__f, __t, __urng, __p); }
6384 const discrete_distribution& __d2)
6385 {
return __d1._M_param == __d2._M_param; }
6397 template<
typename _IntType1,
typename _CharT,
typename _Traits>
6413 template<
typename _IntType1,
typename _CharT,
typename _Traits>
6419 template<
typename _ForwardIterator,
6420 typename _UniformRandomNumberGenerator>
6422 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6423 _UniformRandomNumberGenerator& __urng,
6424 const param_type& __p);
6426 param_type _M_param;
6429#if __cpp_impl_three_way_comparison < 201907L
6434 template<
typename _IntType>
6438 {
return !(__d1 == __d2); }
6443#if _GLIBCXX_USE_NEW_PIECEWISE_DISTRIBUTIONS == 0
6444 template<
typename _Tp>
6445 using __piecewise_distributions_storage_t = double;
6446#elif _GLIBCXX_USE_NEW_PIECEWISE_DISTRIBUTIONS == 2
6447 template<
typename _Tp>
6448 using __piecewise_distributions_storage_t = _Tp;
6450 template<
typename _Tp>
6451 struct __piecewise_distributions_storage
6452 {
using type = _Tp; };
6455 struct __piecewise_distributions_storage<float>
6456 {
using type = double; };
6458# ifdef _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT
6460 struct __piecewise_distributions_storage<__ibm128>
6461 {
using type = double; };
6464 struct __piecewise_distributions_storage<__ieee128>
6465 {
using type = double; };
6466# elif __LDBL_MANT_DIG__ != __DBL_MANT_DIG__
6468 struct __piecewise_distributions_storage<long double>
6469 {
using type = double; };
6472 template<
typename _Tp>
6473 using __piecewise_distributions_storage_t
6474 =
typename __piecewise_distributions_storage<_Tp>::type;
6494 template<
typename _RealType =
double>
6495 class piecewise_constant_distribution
6498 "result_type must be a floating point type");
6501 = __detail::__piecewise_distributions_storage_t<_RealType>;
6502#if _GLIBCXX_USE_NEW_PIECEWISE_DISTRIBUTIONS
6503 using _CalcType = _RealType;
6505 using _CalcType = double;
6515 typedef piecewise_constant_distribution<_RealType> distribution_type;
6516 friend class piecewise_constant_distribution<_RealType>;
6519 : _M_int(), _M_den(), _M_cp()
6522 template<
typename _InputIteratorB,
typename _InputIteratorW>
6523 param_type(_InputIteratorB __bfirst,
6524 _InputIteratorB __bend,
6525 _InputIteratorW __wbegin);
6527 template<
typename _Func>
6530 template<
typename _Func>
6531 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
6535 param_type(
const param_type&) =
default;
6536 param_type& operator=(
const param_type&) =
default;
6544 __tmp[1] = _RealType(1);
6551#if _GLIBCXX_USE_NEW_PIECEWISE_DISTRIBUTIONS
6554 [[__gnu__::__abi_tag__(
"__rt")]]
6558#pragma GCC diagnostic push
6559#pragma GCC diagnostic ignored "-Wc++17-extensions"
6566#pragma GCC diagnostic pop
6575 operator==(
const param_type& __p1,
const param_type& __p2)
6576 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
6578#if __cpp_impl_three_way_comparison < 201907L
6580 operator!=(
const param_type& __p1,
const param_type& __p2)
6581 {
return !(__p1 == __p2); }
6589 _M_initialize2(
const _RealType* __ints, _CalcType __den);
6595 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6601 piecewise_constant_distribution()
6605 template<
typename _InputIteratorB,
typename _InputIteratorW>
6607 _InputIteratorB __bend,
6608 _InputIteratorW __wbegin)
6609 : _M_param(__bfirst, __bend, __wbegin)
6612 template<
typename _Func>
6613 piecewise_constant_distribution(initializer_list<_RealType> __bl,
6615 : _M_param(__bl, __fw)
6618 template<
typename _Func>
6619 piecewise_constant_distribution(
size_t __nw,
6620 _RealType __xmin, _RealType __xmax,
6622 : _M_param(__nw, __xmin, __xmax, __fw)
6626 piecewise_constant_distribution(
const param_type& __p)
6642 {
return _M_param.intervals(); }
6647#if _GLIBCXX_USE_NEW_PIECEWISE_DISTRIBUTIONS
6648 [[__gnu__::__always_inline__]]
6651 {
return _M_param.densities(); }
6655 {
return _M_param.densities(); }
6663 {
return _M_param; }
6670 param(
const param_type& __param)
6671 { _M_param = __param; }
6679 return _M_param._M_int.empty()
6689 return _M_param._M_int.empty()
6696 template<
typename _UniformRandomNumberGenerator>
6698 operator()(_UniformRandomNumberGenerator& __urng)
6699 {
return this->
operator()(__urng, _M_param); }
6701 template<
typename _UniformRandomNumberGenerator>
6703 operator()(_UniformRandomNumberGenerator& __urng,
6704 const param_type& __p);
6706 template<
typename _ForwardIterator,
6707 typename _UniformRandomNumberGenerator>
6709 __generate(_ForwardIterator __f, _ForwardIterator __t,
6710 _UniformRandomNumberGenerator& __urng)
6711 { this->__generate(__f, __t, __urng, _M_param); }
6713 template<
typename _ForwardIterator,
6714 typename _UniformRandomNumberGenerator>
6716 __generate(_ForwardIterator __f, _ForwardIterator __t,
6717 _UniformRandomNumberGenerator& __urng,
6718 const param_type& __p)
6719 { this->__generate_impl(__f, __t, __urng, __p); }
6721 template<
typename _UniformRandomNumberGenerator>
6724 _UniformRandomNumberGenerator& __urng,
6726 { this->__generate_impl(__f, __t, __urng, __p); }
6733 operator==(
const piecewise_constant_distribution& __d1,
6734 const piecewise_constant_distribution& __d2)
6735 {
return __d1._M_param == __d2._M_param; }
6748 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6764 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6770 template<
typename _AdaptedUniformRandomNumberGenerator>
6772 __generate_one(_AdaptedUniformRandomNumberGenerator& __aurng,
6773 const param_type& __param);
6775 template<
typename _ForwardIterator,
6776 typename _UniformRandomNumberGenerator>
6778 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6779 _UniformRandomNumberGenerator& __urng,
6780 const param_type& __p);
6782 param_type _M_param;
6785#if __cpp_impl_three_way_comparison < 201907L
6790 template<
typename _RealType>
6794 {
return !(__d1 == __d2); }
6809 template<
typename _RealType =
double>
6810 class piecewise_linear_distribution
6813 "result_type must be a floating point type");
6816 = __detail::__piecewise_distributions_storage_t<_RealType>;
6817#if _GLIBCXX_USE_NEW_PIECEWISE_DISTRIBUTIONS
6818 using _CalcType = _RealType;
6820 using _CalcType = double;
6830 typedef piecewise_linear_distribution<_RealType> distribution_type;
6831 friend class piecewise_linear_distribution<_RealType>;
6834 : _M_int(), _M_den(), _M_cp(), _M_m()
6837 template<
typename _InputIteratorB,
typename _InputIteratorW>
6838 param_type(_InputIteratorB __bfirst,
6839 _InputIteratorB __bend,
6840 _InputIteratorW __wbegin);
6842 template<
typename _Func>
6845 template<
typename _Func>
6846 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
6850 param_type(
const param_type&) =
default;
6851 param_type& operator=(
const param_type&) =
default;
6859 __tmp[1] = _RealType(1);
6866#if _GLIBCXX_USE_NEW_PIECEWISE_DISTRIBUTIONS
6869 [[__gnu__::__abi_tag__(
"__rt")]]
6873#pragma GCC diagnostic push
6874#pragma GCC diagnostic ignored "-Wc++17-extensions"
6881#pragma GCC diagnostic pop
6890 operator==(
const param_type& __p1,
const param_type& __p2)
6891 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
6893#if __cpp_impl_three_way_comparison < 201907L
6895 operator!=(
const param_type& __p1,
const param_type& __p2)
6896 {
return !(__p1 == __p2); }
6904 _M_initialize2(
const _RealType* __ints,
const _CalcType* __dens);
6911 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6917 piecewise_linear_distribution()
6921 template<
typename _InputIteratorB,
typename _InputIteratorW>
6923 _InputIteratorB __bend,
6924 _InputIteratorW __wbegin)
6925 : _M_param(__bfirst, __bend, __wbegin)
6928 template<
typename _Func>
6929 piecewise_linear_distribution(initializer_list<_RealType> __bl,
6931 : _M_param(__bl, __fw)
6934 template<
typename _Func>
6935 piecewise_linear_distribution(
size_t __nw,
6936 _RealType __xmin, _RealType __xmax,
6938 : _M_param(__nw, __xmin, __xmax, __fw)
6942 piecewise_linear_distribution(
const param_type& __p)
6958 {
return _M_param.intervals(); }
6964#if _GLIBCXX_USE_NEW_PIECEWISE_DISTRIBUTIONS
6965 [[__gnu__::__always_inline__]]
6968 {
return _M_param.densities(); }
6972 {
return _M_param.densities(); }
6980 {
return _M_param; }
6987 param(
const param_type& __param)
6988 { _M_param = __param; }
6996 return _M_param._M_int.empty()
7006 return _M_param._M_int.empty()
7013 template<
typename _UniformRandomNumberGenerator>
7015 operator()(_UniformRandomNumberGenerator& __urng)
7016 {
return this->
operator()(__urng, _M_param); }
7018 template<
typename _UniformRandomNumberGenerator>
7020 operator()(_UniformRandomNumberGenerator& __urng,
7021 const param_type& __p);
7023 template<
typename _ForwardIterator,
7024 typename _UniformRandomNumberGenerator>
7026 __generate(_ForwardIterator __f, _ForwardIterator __t,
7027 _UniformRandomNumberGenerator& __urng)
7028 { this->__generate(__f, __t, __urng, _M_param); }
7030 template<
typename _ForwardIterator,
7031 typename _UniformRandomNumberGenerator>
7033 __generate(_ForwardIterator __f, _ForwardIterator __t,
7034 _UniformRandomNumberGenerator& __urng,
7035 const param_type& __p)
7036 { this->__generate_impl(__f, __t, __urng, __p); }
7038 template<
typename _UniformRandomNumberGenerator>
7041 _UniformRandomNumberGenerator& __urng,
7043 { this->__generate_impl(__f, __t, __urng, __p); }
7050 operator==(
const piecewise_linear_distribution& __d1,
7051 const piecewise_linear_distribution& __d2)
7052 {
return __d1._M_param == __d2._M_param; }
7065 template<
typename _RealType1,
typename _CharT,
typename _Traits>
7081 template<
typename _RealType1,
typename _CharT,
typename _Traits>
7087 template<
typename _AdaptedUniformRandomNumberGenerator>
7089 __generate_one(_AdaptedUniformRandomNumberGenerator& __aurng,
7090 const param_type& __param);
7092 template<
typename _ForwardIterator,
7093 typename _UniformRandomNumberGenerator>
7095 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
7096 _UniformRandomNumberGenerator& __urng,
7097 const param_type& __p);
7099 param_type _M_param;
7102#if __cpp_impl_three_way_comparison < 201907L
7107 template<
typename _RealType>
7111 {
return !(__d1 == __d2); }
7142 template<
typename _IntType,
typename = _Require<is_
integral<_IntType>>>
7145 template<
typename _InputIterator>
7146 seed_seq(_InputIterator __begin, _InputIterator __end);
7149 template<
typename _RandomAccessIterator>
7151 generate(_RandomAccessIterator __begin, _RandomAccessIterator __end);
7154 size_t size() const noexcept
7155 {
return _M_v.
size(); }
7157 template<
typename _OutputIterator>
7159 param(_OutputIterator __dest)
const
7160 { std::copy(_M_v.
begin(), _M_v.
end(), __dest); }
7167 std::vector<result_type> _M_v;
7174_GLIBCXX_END_NAMESPACE_VERSION
constexpr bool operator<=(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr bool operator>=(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr duration< __common_rep_t< _Rep1, __disable_if_is_duration< _Rep2 > >, _Period > operator%(const duration< _Rep1, _Period > &__d, const _Rep2 &__s)
constexpr bool operator<(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr bool operator>(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr complex< _Tp > operator*(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x times y.
constexpr complex< _Tp > operator-(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x minus y.
complex< _Tp > log(const complex< _Tp > &)
Return complex natural logarithm of z.
constexpr complex< _Tp > operator+(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x plus y.
complex< _Tp > exp(const complex< _Tp > &)
Return complex base e exponential of z.
constexpr complex< _Tp > operator/(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x divided by y.
complex< _Tp > sqrt(const complex< _Tp > &)
Return complex square root of z.
auto declval() noexcept -> decltype(__declval< _Tp >(0))
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
_RealType generate_canonical(_UniformRandomNumberGenerator &__g)
A function template for converting the output of a (integral) uniform random number generator to a fl...
basic_string< char > string
A string of char.
linear_congruential_engine< uint_fast32_t, 48271UL, 0UL, 2147483647UL > minstd_rand
philox_engine< uint_fast32_t, 32, 4, 10, 0xCD9E8D57, 0x9E3779B9, 0xD2511F53, 0xBB67AE85 > philox4x32
32-bit four-word Philox engine.
linear_congruential_engine< uint_fast32_t, 16807UL, 0UL, 2147483647UL > minstd_rand0
mersenne_twister_engine< uint_fast32_t, 32, 624, 397, 31, 0x9908b0dfUL, 11, 0xffffffffUL, 7, 0x9d2c5680UL, 15, 0xefc60000UL, 18, 1812433253UL > mt19937
mersenne_twister_engine< uint_fast64_t, 64, 312, 156, 31, 0xb5026f5aa96619e9ULL, 29, 0x5555555555555555ULL, 17, 0x71d67fffeda60000ULL, 37, 0xfff7eee000000000ULL, 43, 6364136223846793005ULL > mt19937_64
philox_engine< uint_fast64_t, 64, 4, 10, 0xCA5A826395121157, 0x9E3779B97F4A7C15, 0xD2E7470EE14C6C93, 0xBB67AE8584CAA73B > philox4x64
64-bit four-word Philox engine.
ISO C++ entities toplevel namespace is std.
constexpr _Tp __lg(_Tp __n)
This is a helper function for the sort routines and for random.tcc.
constexpr auto size(const _Container &__cont) noexcept(noexcept(__cont.size())) -> decltype(__cont.size())
Return the size of a container.
constexpr bitset< _Nb > operator^(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, bitset< _Nb > &__x)
Global I/O operators for bitsets.
std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const bitset< _Nb > &__x)
Global I/O operators for bitsets.
constexpr bitset< _Nb > operator|(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
constexpr bitset< _Nb > operator&(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
Implementation details not part of the namespace std interface.
A standard container for storing a fixed size sequence of elements.
Template class basic_istream.
static constexpr int digits
static constexpr _Tp max() noexcept
static constexpr _Tp lowest() noexcept
static constexpr _Tp min() noexcept
char_type widen(char __c) const
Widens characters.
char_type fill() const
Retrieves the empty character.
static const fmtflags skipws
Skips leading white space before certain input operations.
_Ios_Fmtflags fmtflags
This is a bitmask type.
static const fmtflags dec
Converts integer input or generates integer output in decimal base.
fmtflags flags() const
Access to format flags.
static const fmtflags left
Adds fill characters on the right (final positions) of certain generated output. (I....
Template class basic_ostream.
A model of a linear congruential random number generator.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::linear_congruential_engine< _UIntType1, __a1, __c1, __m1 > &__lcr)
Sets the state of the engine by reading its textual representation from __is.
static constexpr result_type min()
Gets the smallest possible value in the output range.
static constexpr result_type multiplier
void discard(unsigned long long __z)
Discard a sequence of random numbers.
static constexpr result_type modulus
linear_congruential_engine()
Constructs a linear_congruential_engine random number generator engine with seed 1.
void seed(result_type __s=default_seed)
Reseeds the linear_congruential_engine random number generator engine sequence to the seed __s.
static constexpr result_type increment
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.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::linear_congruential_engine< _UIntType1, __a1, __c1, __m1 > &__lcr)
Writes the textual representation of the state x(i) of x to __os.
result_type operator()()
Gets the next random number in the sequence.
static constexpr result_type max()
Gets the largest possible value in the output range.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::mersenne_twister_engine< _UIntType1, __w1, __n1, __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1, __l1, __f1 > &__x)
Extracts the current state of a % mersenne_twister_engine random number generator engine __x from the...
static constexpr result_type max()
Gets the largest possible value in the output range.
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.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::mersenne_twister_engine< _UIntType1, __w1, __n1, __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1, __l1, __f1 > &__x)
Inserts the current state of a % mersenne_twister_engine random number generator engine __x into the ...
static constexpr result_type min()
Gets the smallest possible value in the output range.
The Marsaglia-Zaman generator.
void seed(result_type __sd=0u)
Seeds the initial state of the random number generator.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::subtract_with_carry_engine< _UIntType1, __w1, __s1, __r1 > &__x)
Inserts the current state of a % subtract_with_carry_engine random number generator engine __x into t...
void discard(unsigned long long __z)
Discard a sequence of random numbers.
result_type operator()()
Gets the next random number in the sequence.
static constexpr result_type min()
Gets the inclusive minimum value of the range of random integers returned by this generator.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::subtract_with_carry_engine< _UIntType1, __w1, __s1, __r1 > &__x)
Extracts the current state of a % subtract_with_carry_engine random number generator engine __x from ...
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...
static constexpr result_type max()
Gets the inclusive maximum value of the range of random integers returned by this generator.
static constexpr result_type min()
Gets the minimum value in the generated random number range.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::discard_block_engine< _RandomNumberEngine1, __p1, __r1 > &__x)
Inserts the current state of a discard_block_engine random number generator engine __x into the outpu...
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine object.
void seed()
Reseeds the discard_block_engine object with the default seed for the underlying base class generator...
void discard(unsigned long long __z)
Discard a sequence of random numbers.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::discard_block_engine< _RandomNumberEngine1, __p1, __r1 > &__x)
Extracts the current state of a % subtract_with_carry_engine random number generator engine __x from ...
static constexpr result_type max()
Gets the maximum value in the generated random number range.
discard_block_engine()
Constructs a default discard_block_engine engine.
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.
result_type operator()()
Gets the next value in the generated random number sequence.
_RandomNumberEngine::result_type result_type
static constexpr result_type min()
Gets the minimum value in the generated random number range.
result_type operator()()
Gets the next value in the generated random number sequence.
void seed()
Reseeds the independent_bits_engine object with the default seed for the underlying base class genera...
void discard(unsigned long long __z)
Discard a sequence of random numbers.
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 ...
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.
static constexpr result_type max()
Gets the maximum value in the generated random number range.
independent_bits_engine()
Constructs a default independent_bits_engine engine.
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine object.
Produces random numbers by reordering random numbers from some base engine.
static constexpr result_type min()
shuffle_order_engine()
Constructs a default shuffle_order_engine engine.
static constexpr result_type max()
const _RandomNumberEngine & base() const noexcept
void seed()
Reseeds the shuffle_order_engine object with the default seed for the underlying base class generator...
_RandomNumberEngine::result_type result_type
friend bool operator==(const shuffle_order_engine &__lhs, const shuffle_order_engine &__rhs)
void discard(unsigned long long __z)
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::shuffle_order_engine< _RandomNumberEngine1, __k1 > &__x)
Inserts the current state of a shuffle_order_engine random number generator engine __x into the outpu...
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::shuffle_order_engine< _RandomNumberEngine1, __k1 > &__x)
Extracts the current state of a % subtract_with_carry_engine random number generator engine __x from ...
A discrete pseudorandom number generator with weak cryptographic properties.
void set_counter(const array< result_type, __n > &__counter)
sets the internal counter "cleartext"
friend basic_istream< _CharT, _Traits > & operator>>(basic_istream< _CharT, _Traits > &__is, philox_engine &__x)
takes input to set the state of the philox_engine object
void discard(unsigned long long __z)
discards __z numbers
void seed(_Sseq &__q)
seeds philox_engine by seed sequence
static constexpr result_type max()
The maximum value that this engine can return.
result_type operator()()
outputs a single w-bit number and handles state advancement
friend bool operator==(const philox_engine &, const philox_engine &)=default
compares two philox_engine objects
static constexpr result_type min()
The minimum value that this engine can return.
philox_engine(_Sseq &__q)
seed sequence constructor for philox_engine
friend basic_ostream< _CharT, _Traits > & operator<<(basic_ostream< _CharT, _Traits > &__os, const philox_engine &__x)
outputs the state of the generator
Uniform continuous distribution for random numbers.
param_type param() const
Returns the parameter set of the distribution.
void reset()
Resets the distribution state.
uniform_real_distribution(_RealType __a, _RealType __b=_RealType(1))
Constructs a uniform_real_distribution object.
result_type min() const
Returns the inclusive lower bound of the distribution range.
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 max() const
Returns the inclusive upper bound of the distribution range.
uniform_real_distribution()
Constructs a uniform_real_distribution object.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void param(const param_type &__param)
Sets the parameter set of the distribution.
A normal continuous distribution for random numbers.
result_type operator()(_UniformRandomNumberGenerator &__urng, const param_type &__p)
_RealType stddev() const
Returns the standard deviation of the distribution.
param_type param() const
Returns the parameter set of the distribution.
void reset()
Resets the distribution state.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::normal_distribution< _RealType1 > &__x)
Extracts a normal_distribution random number distribution __x from the input stream __is.
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.
_RealType mean() const
Returns the mean of the distribution.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::normal_distribution< _RealType1 > &__x)
Inserts a normal_distribution random number distribution __x into the output stream __os.
normal_distribution(result_type __mean, result_type __stddev=result_type(1))
result_type max() const
Returns the least upper bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend bool operator==(const std::normal_distribution< _RealType1 > &__d1, const std::normal_distribution< _RealType1 > &__d2)
Return true if two normal distributions have the same parameters and the sequences that would be gene...
A lognormal_distribution random number 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...
param_type param() const
Returns the parameter set of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::lognormal_distribution< _RealType1 > &__x)
Extracts a lognormal_distribution random number distribution __x from the input stream __is.
result_type min() const
Returns the greatest lower bound value of the distribution.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::lognormal_distribution< _RealType1 > &__x)
Inserts a lognormal_distribution random number distribution __x into the output stream __os.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
A gamma continuous distribution for random numbers.
result_type operator()(_UniformRandomNumberGenerator &__urng, const param_type &__p)
gamma_distribution(_RealType __alpha_val, _RealType __beta_val=_RealType(1))
Constructs a gamma distribution with parameters and .
void reset()
Resets the distribution state.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::gamma_distribution< _RealType1 > &__x)
Inserts a gamma_distribution random number distribution __x into the output stream __os.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type min() const
Returns the greatest lower bound value of the distribution.
_RealType alpha() const
Returns the of the distribution.
gamma_distribution()
Constructs a gamma distribution with parameters 1 and 1.
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.
_RealType beta() const
Returns the of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::gamma_distribution< _RealType1 > &__x)
Extracts a gamma_distribution random number distribution __x from the input stream __is.
param_type param() const
Returns the parameter set of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
A chi_squared_distribution random number distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
param_type param() const
Returns the parameter set of the distribution.
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...
result_type min() const
Returns the greatest lower bound value of the distribution.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::chi_squared_distribution< _RealType1 > &__x)
Inserts a chi_squared_distribution random number distribution __x into the output stream __os.
void reset()
Resets the distribution state.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::chi_squared_distribution< _RealType1 > &__x)
Extracts a chi_squared_distribution random number distribution __x from the input stream __is.
A cauchy_distribution random number distribution.
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.
void reset()
Resets the distribution state.
param_type param() const
Returns 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 param(const param_type &__param)
Sets the parameter set of the distribution.
A fisher_f_distribution random number distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
void reset()
Resets the distribution state.
param_type param() const
Returns 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...
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::fisher_f_distribution< _RealType1 > &__x)
Inserts a fisher_f_distribution random number distribution __x into the output stream __os.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::fisher_f_distribution< _RealType1 > &__x)
Extracts a fisher_f_distribution random number distribution __x from the input stream __is.
A student_t_distribution random number distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
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 reset()
Resets the distribution state.
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...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::student_t_distribution< _RealType1 > &__x)
Inserts a student_t_distribution random number distribution __x into the output stream __os.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::student_t_distribution< _RealType1 > &__x)
Extracts a student_t_distribution random number distribution __x from the input stream __is.
param_type param() const
Returns the parameter set of the distribution.
A Bernoulli random number distribution.
void reset()
Resets the distribution state.
result_type max() const
Returns the least upper bound value of the distribution.
friend bool operator==(const bernoulli_distribution &__d1, const bernoulli_distribution &__d2)
Return true if two Bernoulli distributions have the same parameters.
param_type param() const
Returns the parameter set of the distribution.
bernoulli_distribution()
Constructs a Bernoulli distribution with likelihood 0.5.
bernoulli_distribution(double __p)
Constructs a Bernoulli distribution with likelihood p.
result_type min() const
Returns the greatest lower bound value of the distribution.
double p() const
Returns the p parameter of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
A discrete binomial random number distribution.
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.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
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...
param_type param() const
Returns the parameter set of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::binomial_distribution< _IntType1 > &__x)
Extracts a binomial_distribution random number distribution __x from the input stream __is.
_IntType t() const
Returns the distribution t parameter.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::binomial_distribution< _IntType1 > &__x)
Inserts a binomial_distribution random number distribution __x into the output stream __os.
void reset()
Resets the distribution state.
double p() const
Returns the distribution p parameter.
result_type operator()(_UniformRandomNumberGenerator &__urng, const param_type &__p)
A discrete geometric random number distribution.
double p() const
Returns the distribution parameter p.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type max() const
Returns the least upper bound value of the distribution.
friend bool operator==(const geometric_distribution &__d1, const geometric_distribution &__d2)
Return true if two geometric distributions have the same parameters.
param_type param() const
Returns the parameter set of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
void reset()
Resets the distribution state.
result_type min() const
Returns the greatest lower bound value of the distribution.
A negative_binomial_distribution random number distribution.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::negative_binomial_distribution< _IntType1 > &__x)
Inserts a negative_binomial_distribution random number distribution __x into the output stream __os.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::negative_binomial_distribution< _IntType1 > &__x)
Extracts a negative_binomial_distribution random number distribution __x from the input stream __is.
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.
result_type max() const
Returns the least upper bound value of the distribution.
double p() const
Return the parameter of the distribution.
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.
_IntType k() const
Return the parameter of the distribution.
void reset()
Resets the distribution state.
A discrete Poisson random number distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng, const param_type &__p)
void reset()
Resets the distribution state.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
double mean() const
Returns the distribution parameter mean.
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...
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.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::poisson_distribution< _IntType1 > &__x)
Inserts a poisson_distribution random number distribution __x into the output stream __os.
param_type param() const
Returns the parameter set of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::poisson_distribution< _IntType1 > &__x)
Extracts a poisson_distribution random number distribution __x from the input stream __is.
result_type min() const
Returns the greatest lower bound value of the distribution.
An exponential continuous distribution for random numbers.
_RealType lambda() const
Returns the inverse scale parameter of the distribution.
exponential_distribution()
Constructs an exponential distribution with inverse scale parameter 1.0.
exponential_distribution(_RealType __lambda)
Constructs an exponential distribution with inverse scale parameter .
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void reset()
Resets the distribution state.
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 max() const
Returns the least upper bound value of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
friend bool operator==(const exponential_distribution &__d1, const exponential_distribution &__d2)
Return true if two exponential distributions have the same parameters.
A weibull_distribution random number 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.
void reset()
Resets the distribution state.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend bool operator==(const weibull_distribution &__d1, const weibull_distribution &__d2)
Return true if two Weibull distributions have the same parameters.
void param(const param_type &__param)
Sets the parameter set of the distribution.
_RealType b() const
Return the parameter of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
_RealType a() const
Return the parameter of the distribution.
A extreme_value_distribution random number distribution.
void reset()
Resets the distribution state.
_RealType b() const
Return the parameter of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
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.
result_type max() const
Returns the least upper bound value of the distribution.
_RealType a() const
Return the parameter 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.
param_type param() const
Returns the parameter set of the distribution.
A discrete_distribution random number distribution.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::discrete_distribution< _IntType1 > &__x)
Inserts a discrete_distribution random number distribution __x into the output stream __os.
result_type min() const
Returns the greatest lower bound value of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::discrete_distribution< _IntType1 > &__x)
Extracts a discrete_distribution random number distribution __x from the input stream __is.
result_type max() const
Returns the least upper bound value of the distribution.
void reset()
Resets the distribution state.
param_type param() const
Returns the parameter set of the distribution.
friend bool operator==(const discrete_distribution &__d1, const discrete_distribution &__d2)
Return true if two discrete distributions have the same parameters.
std::vector< double > probabilities() const
Returns the probabilities of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void param(const param_type &__param)
Sets the parameter set of the distribution.
A piecewise_constant_distribution random number distribution.
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.
void reset()
Resets the distribution state.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::piecewise_constant_distribution< _RealType1 > &__x)
Inserts a piecewise_constant_distribution random number distribution __x into the output stream __os.
param_type param() const
Returns the parameter set 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.
std::vector< result_type > intervals() const
Returns a vector of the intervals.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
std::vector< result_type > densities() const
Returns a vector of the probability densities.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::piecewise_constant_distribution< _RealType1 > &__x)
Extracts a piecewise_constant_distribution random number distribution __x from the input stream __is.
A piecewise_linear_distribution random number distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type max() const
Returns the least upper bound value of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::piecewise_linear_distribution< _RealType1 > &__x)
Extracts a piecewise_linear_distribution random number distribution __x from the input stream __is.
std::vector< result_type > densities() const
Return a vector of the probability densities of the distribution.
param_type param() const
Returns the parameter set of the 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.
std::vector< result_type > intervals() const
Return the intervals of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::piecewise_linear_distribution< _RealType1 > &__x)
Inserts a piecewise_linear_distribution random number distribution __x into the output stream __os.
uint_least32_t result_type
A standard container which offers fixed time access to individual elements in any order.
constexpr iterator end() noexcept
constexpr iterator begin() noexcept
constexpr bool empty() const noexcept
constexpr size_type size() const noexcept