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 int __which = ((__s <= __CHAR_BIT__ *
sizeof (int))
574 + (__s <= __CHAR_BIT__ *
sizeof (long))
575 + (__s <= __CHAR_BIT__ *
sizeof (
long long))
578 struct _Select_uint_least_t
580 static_assert(__which < 0,
581 "sorry, would be too much trouble for a slow result");
585 struct _Select_uint_least_t<__s, 4>
586 {
using type =
unsigned int; };
589 struct _Select_uint_least_t<__s, 3>
590 {
using type =
unsigned long; };
593 struct _Select_uint_least_t<__s, 2>
594 {
using type =
unsigned long long; };
596#if __SIZEOF_INT128__ > __SIZEOF_LONG_LONG__
598 struct _Select_uint_least_t<__s, 1>
599 { __extension__
using type =
unsigned __int128; };
600#elif __has_builtin(__builtin_add_overflow) \
601 && __has_builtin(__builtin_sub_overflow) \
602 && defined __UINT64_TYPE__
604 struct _Select_uint_least_t<__s, 1>
605 {
using type = __rand_uint128; };
609 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
610 bool __big_enough = (!(__m & (__m - 1))
611 || (_Tp(-1) - __c) / __a >= __m - 1),
612 bool __schrage_ok = __m % __a < __m / __a>
619 =
typename _Select_uint_least_t<
std::__lg(__a)
621 return static_cast<_Tp
>((_Tp2(__a) * __x + __c) % __m);
626 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c>
627 struct _Mod<_Tp, __m, __a, __c, false, true>
636 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
bool __s>
637 struct _Mod<_Tp, __m, __a, __c, true, __s>
642 _Tp __res = __a * __x + __c;
649 template<
typename _Tp, _Tp __m, _Tp __a = 1, _Tp __c = 0>
653 if constexpr (__a == 0)
656 return _Mod<_Tp, __m, __a, __c>::__calc(__x);
663 template<
typename _Engine,
typename _DInputType>
666 static_assert(std::is_floating_point<_DInputType>::value,
667 "template argument must be a floating point type");
670 _Adaptor(_Engine& __g)
675 {
return _DInputType(0); }
679 {
return _DInputType(1); }
703 template<
typename _Sseq>
704 using __seed_seq_generate_t =
decltype(
708 template<
typename _Sseq,
typename _Engine,
typename _Res,
709 typename _GenerateCheck = __seed_seq_generate_t<_Sseq>>
710 using _If_seed_seq_for = _Require<
711 __not_<is_same<__remove_cvref_t<_Sseq>, _Engine>>,
712 is_unsigned<typename _Sseq::result_type>,
713 __not_<is_convertible<_Sseq, _Res>>
716#pragma GCC diagnostic pop
761 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
765 "result_type must be an unsigned integral type");
766 static_assert(__m == 0u || (__a < __m && __c < __m),
767 "template argument substituting __m out of bounds");
769 template<
typename _Sseq>
810 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
831 template<
typename _Sseq>
843 {
return __c == 0u ? 1u : 0u; }
856 discard(
unsigned long long __z)
858 for (; __z != 0ULL; --__z)
868 _M_x = __detail::__mod<_UIntType, __m, __a, __c>(_M_x);
886 {
return __lhs._M_x == __rhs._M_x; }
896 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
897 _UIntType1 __m1,
typename _CharT,
typename _Traits>
901 __a1, __c1, __m1>& __lcr);
916 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
917 _UIntType1 __m1,
typename _CharT,
typename _Traits>
927#if __cpp_impl_three_way_comparison < 201907L
939 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
945 {
return !(__lhs == __rhs); }
979 template<
typename _UIntType,
size_t __w,
980 size_t __n,
size_t __m,
size_t __r,
981 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
982 _UIntType __b,
size_t __t,
983 _UIntType __c,
size_t __l, _UIntType __f>
984 class mersenne_twister_engine
987 "result_type must be an unsigned integral type");
988 static_assert(1u <= __m && __m <= __n,
989 "template argument substituting __m out of bounds");
990 static_assert(__r <= __w,
"template argument substituting "
992 static_assert(__u <= __w,
"template argument substituting "
994 static_assert(__s <= __w,
"template argument substituting "
996 static_assert(__t <= __w,
"template argument substituting "
998 static_assert(__l <= __w,
"template argument substituting "
1000 static_assert(__w <= std::numeric_limits<_UIntType>::digits,
1001 "template argument substituting __w out of bound");
1002 static_assert(__a <= (__detail::_Shift<_UIntType, __w>::__value - 1),
1003 "template argument substituting __a out of bound");
1004 static_assert(__b <= (__detail::_Shift<_UIntType, __w>::__value - 1),
1005 "template argument substituting __b out of bound");
1006 static_assert(__c <= (__detail::_Shift<_UIntType, __w>::__value - 1),
1007 "template argument substituting __c out of bound");
1008 static_assert(__d <= (__detail::_Shift<_UIntType, __w>::__value - 1),
1009 "template argument substituting __d out of bound");
1010 static_assert(__f <= (__detail::_Shift<_UIntType, __w>::__value - 1),
1011 "template argument substituting __f out of bound");
1013 template<
typename _Sseq>
1015 = __detail::_If_seed_seq_for<_Sseq, mersenne_twister_engine,
1023 static constexpr size_t word_size = __w;
1024 static constexpr size_t state_size = __n;
1025 static constexpr size_t shift_size = __m;
1026 static constexpr size_t mask_bits = __r;
1028 static constexpr size_t tempering_u = __u;
1030 static constexpr size_t tempering_s = __s;
1032 static constexpr size_t tempering_t = __t;
1034 static constexpr size_t tempering_l = __l;
1035 static constexpr result_type initialization_multiplier = __f;
1036 static constexpr result_type default_seed = 5489u;
1040 mersenne_twister_engine() : mersenne_twister_engine(default_seed) { }
1052 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1054 mersenne_twister_engine(_Sseq& __q)
1058 seed(result_type __sd = default_seed);
1060 template<
typename _Sseq>
1076 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1082 discard(
unsigned long long __z);
1100 operator==(
const mersenne_twister_engine& __lhs,
1101 const mersenne_twister_engine& __rhs)
1102 {
return (std::equal(__lhs._M_x, __lhs._M_x + state_size, __rhs._M_x)
1103 && __lhs._M_p == __rhs._M_p); }
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 __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
1143 template<
typename _UIntType1,
1144 size_t __w1,
size_t __n1,
1145 size_t __m1,
size_t __r1,
1146 _UIntType1 __a1,
size_t __u1,
1147 _UIntType1 __d1,
size_t __s1,
1148 _UIntType1 __b1,
size_t __t1,
1149 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
1150 typename _CharT,
typename _Traits>
1154 __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
1160 _UIntType _M_x[state_size];
1164#if __cpp_impl_three_way_comparison < 201907L
1177 template<
typename _UIntType,
size_t __w,
1178 size_t __n,
size_t __m,
size_t __r,
1179 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
1180 _UIntType __b,
size_t __t,
1181 _UIntType __c,
size_t __l, _UIntType __f>
1184 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __lhs,
1186 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __rhs)
1187 {
return !(__lhs == __rhs); }
1208 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
1209 class subtract_with_carry_engine
1212 "result_type must be an unsigned integral type");
1213 static_assert(0u < __s && __s < __r,
1215 static_assert(0u < __w && __w <= std::numeric_limits<_UIntType>::digits,
1216 "template argument substituting __w out of bounds");
1218 template<
typename _Sseq>
1220 = __detail::_If_seed_seq_for<_Sseq, subtract_with_carry_engine,
1228 static constexpr size_t word_size = __w;
1229 static constexpr size_t short_lag = __s;
1230 static constexpr size_t long_lag = __r;
1231 static constexpr uint_least32_t default_seed = 19780503u;
1233 subtract_with_carry_engine() : subtract_with_carry_engine(0u)
1250 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1252 subtract_with_carry_engine(_Sseq& __q)
1274 template<
typename _Sseq>
1292 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1298 discard(
unsigned long long __z)
1300 for (; __z != 0ULL; --__z)
1323 operator==(
const subtract_with_carry_engine& __lhs,
1324 const subtract_with_carry_engine& __rhs)
1325 {
return (std::equal(__lhs._M_x, __lhs._M_x + long_lag, __rhs._M_x)
1326 && __lhs._M_carry == __rhs._M_carry
1327 && __lhs._M_p == __rhs._M_p); }
1341 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
1342 typename _CharT,
typename _Traits>
1360 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
1361 typename _CharT,
typename _Traits>
1369 _UIntType _M_x[long_lag];
1374#if __cpp_impl_three_way_comparison < 201907L
1387 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
1393 {
return !(__lhs == __rhs); }
1405 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
1408 static_assert(1 <= __r && __r <= __p,
1409 "template argument substituting __r out of bounds");
1415 template<
typename _Sseq>
1421 static constexpr size_t block_size = __p;
1422 static constexpr size_t used_block = __r;
1430 : _M_b(), _M_n(0) { }
1440 : _M_b(__rng), _M_n(0) { }
1450 : _M_b(
std::
move(__rng)), _M_n(0) { }
1460 : _M_b(__s), _M_n(0) { }
1467 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1470 : _M_b(__q), _M_n(0)
1500 template<
typename _Sseq>
1512 const _RandomNumberEngine&
1513 base() const noexcept
1521 {
return _RandomNumberEngine::min(); }
1528 {
return _RandomNumberEngine::max(); }
1534 discard(
unsigned long long __z)
1536 for (; __z != 0ULL; --__z)
1560 {
return __lhs._M_b == __rhs._M_b && __lhs._M_n == __rhs._M_n; }
1573 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1574 typename _CharT,
typename _Traits>
1591 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1592 typename _CharT,
typename _Traits>
1599 _RandomNumberEngine _M_b;
1603#if __cpp_impl_three_way_comparison < 201907L
1615 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
1621 {
return !(__lhs == __rhs); }
1631 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1635 "result_type must be an unsigned integral type");
1636 static_assert(0u < __w && __w <= std::numeric_limits<_UIntType>::digits,
1637 "template argument substituting __w out of bounds");
1639 template<
typename _Sseq>
1691 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1718 template<
typename _Sseq>
1727 const _RandomNumberEngine&
1728 base() const noexcept
1743 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1749 discard(
unsigned long long __z)
1751 for (; __z != 0ULL; --__z)
1776 {
return __lhs._M_b == __rhs._M_b; }
1790 template<
typename _CharT,
typename _Traits>
1794 __w, _UIntType>& __x)
1801 _RandomNumberEngine _M_b;
1804#if __cpp_impl_three_way_comparison < 201907L
1817 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1823 {
return !(__lhs == __rhs); }
1836 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType,
1837 typename _CharT,
typename _Traits>
1838 std::basic_ostream<_CharT, _Traits>&
1839 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1840 const std::independent_bits_engine<_RandomNumberEngine,
1841 __w, _UIntType>& __x)
1858 template<
typename _RandomNumberEngine,
size_t __k>
1861 static_assert(1u <= __k,
"template argument substituting "
1862 "__k out of bound");
1868 template<
typename _Sseq>
1873 static constexpr size_t table_size = __k;
1882 { _M_initialize(); }
1893 { _M_initialize(); }
1904 { _M_initialize(); }
1915 { _M_initialize(); }
1922 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1926 { _M_initialize(); }
1955 template<
typename _Sseq>
1966 const _RandomNumberEngine&
1967 base() const noexcept
1975 {
return _RandomNumberEngine::min(); }
1982 {
return _RandomNumberEngine::max(); }
1988 discard(
unsigned long long __z)
1990 for (; __z != 0ULL; --__z)
2014 {
return (__lhs._M_b == __rhs._M_b
2015 && std::equal(__lhs._M_v, __lhs._M_v + __k, __rhs._M_v)
2016 && __lhs._M_y == __rhs._M_y); }
2029 template<
typename _RandomNumberEngine1,
size_t __k1,
2030 typename _CharT,
typename _Traits>
2047 template<
typename _RandomNumberEngine1,
size_t __k1,
2048 typename _CharT,
typename _Traits>
2054 void _M_initialize()
2056 for (
size_t __i = 0; __i < __k; ++__i)
2061 _RandomNumberEngine _M_b;
2062 result_type _M_v[__k];
2066#if __cpp_impl_three_way_comparison < 201907L
2078 template<
typename _RandomNumberEngine,
size_t __k>
2084 {
return !(__lhs == __rhs); }
2087#if __glibcxx_philox_engine
2116 template<
typename _UIntType,
size_t __w,
size_t __n,
size_t __r,
2117 _UIntType... __consts>
2120 static_assert(__n == 2 || __n == 4,
2121 "template argument N must be either 2 or 4");
2122 static_assert(
sizeof...(__consts) == __n,
2123 "length of consts array must match specified N");
2124 static_assert(0 < __r,
"a number of rounds must be specified");
2125 static_assert((0 < __w && __w <= numeric_limits<_UIntType>::digits),
2126 "specified bitlength must match input type");
2128 template<
typename _Sseq>
2129 static constexpr bool __is_seed_seq =
requires {
2130 typename __detail::_If_seed_seq_for<_Sseq, philox_engine, _UIntType>;
2133 template <
size_t __ind0,
size_t __ind1>
2135 array<_UIntType, __n / 2>
2138 if constexpr (__n == 4)
2139 return {__consts...[__ind0], __consts...[__ind1]};
2141 return {__consts...[__ind0]};
2145 using result_type = _UIntType;
2147 static constexpr size_t word_size = __w;
2148 static constexpr size_t word_count = __n;
2149 static constexpr size_t round_count = __r;
2150 static constexpr array<result_type, __n / 2> multipliers
2151 = _S_popArray<0,2>();
2152 static constexpr array<result_type, __n / 2> round_consts
2153 = _S_popArray<1,3>();
2156 static constexpr result_type
2161 static constexpr result_type
2164 return ((1ull << (__w - 1)) | ((1ull << (__w - 1)) - 1));
2167 static constexpr result_type default_seed = 20111115u;
2175 philox_engine(result_type __value)
2176 : _M_x{}, _M_k{}, _M_y{}, _M_i(__n - 1)
2177 { _M_k[0] = __value &
max(); }
2183 template<
typename _Sseq>
requires __is_seed_seq<_Sseq>
2191 seed(result_type __value = default_seed)
2196 _M_k[0] = __value &
max();
2204 template<
typename _Sseq>
2206 seed(_Sseq& __q)
requires __is_seed_seq<_Sseq>;
2215 for (
size_t __j = 0; __j < __n; ++__j)
2216 _M_x[__j] = __counter[__n - 1 - __j] &
max();
2226 operator==(
const philox_engine&,
const philox_engine&) =
default;
2257 template<
typename _CharT,
typename _Traits>
2260 const philox_engine& __x)
2263 const _CharT __fill = __os.
fill();
2265 _CharT __space = __os.
widen(
' ');
2267 for (
auto& __subkey : __x._M_k)
2268 __os << __subkey << __space;
2269 for (
auto& __ctr : __x._M_x)
2270 __os << __ctr << __space;
2272 __os.
flags(__flags);
2284 template <
typename _CharT,
typename _Traits>
2291 for (
auto& __subkey : __x._M_k)
2293 for (
auto& __ctr : __x._M_x)
2296 unsigned char __setIndex = 0;
2297 for (
size_t __j = 0; __j < __x._M_x.size(); ++__j)
2299 if (__x._M_x[__j] > 0)
2305 for (
size_t __j = 0; __j <= __setIndex; ++__j)
2307 if (__j != __setIndex)
2308 __x._M_x[__j] =
max();
2313 __x._M_x = __tmpCtr;
2315 __is.
flags(__flags);
2322 array<_UIntType, __n / 2> _M_k;
2324 unsigned long long _M_i = 0;
2328 _S_mulhi(_UIntType __a, _UIntType __b);
2332 _S_mullo(_UIntType __a, _UIntType __b);
2347 typedef linear_congruential_engine<uint_fast32_t, 16807UL, 0UL, 2147483647UL>
2378 0xb5026f5aa96619e9ULL, 29,
2379 0x5555555555555555ULL, 17,
2380 0x71d67fffeda60000ULL, 37,
2381 0xfff7eee000000000ULL, 43,
2398#if __glibcxx_philox_engine
2404 0xCD9E8D57, 0x9E3779B9,
2411 0xCA5A826395121157, 0x9E3779B97F4A7C15,
2430 random_device() { _M_init(
"default"); }
2447 entropy() const noexcept
2448 {
return this->_M_getentropy(); }
2452 {
return this->_M_getval(); }
2455 random_device(
const random_device&) =
delete;
2456 void operator=(
const random_device&) =
delete;
2466 double _M_getentropy() const noexcept;
2468 void _M_init(const
char*,
size_t);
2498#if __cpp_impl_three_way_comparison < 201907L
2503 template<
typename _IntType>
2505 operator!=(
const std::uniform_int_distribution<_IntType>& __d1,
2506 const std::uniform_int_distribution<_IntType>& __d2)
2507 {
return !(__d1 == __d2); }
2520 template<
typename _IntType,
typename _CharT,
typename _Traits>
2521 std::basic_ostream<_CharT, _Traits>&
2522 operator<<(std::basic_ostream<_CharT, _Traits>&,
2523 const std::uniform_int_distribution<_IntType>&);
2534 template<
typename _IntType,
typename _CharT,
typename _Traits>
2535 std::basic_istream<_CharT, _Traits>&
2536 operator>>(std::basic_istream<_CharT, _Traits>&,
2537 std::uniform_int_distribution<_IntType>&);
2550 template<
typename _RealType =
double>
2554 "result_type must be a floating point type");
2565 param_type() : param_type(0) { }
2568 param_type(_RealType __a, _RealType __b = _RealType(1))
2569 : _M_a(__a), _M_b(__b)
2571 __glibcxx_assert(_M_a <= _M_b);
2583 operator==(
const param_type& __p1,
const param_type& __p2)
2584 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
2586#if __cpp_impl_three_way_comparison < 201907L
2588 operator!=(
const param_type& __p1,
const param_type& __p2)
2589 {
return !(__p1 == __p2); }
2613 : _M_param(__a, __b)
2631 {
return _M_param.a(); }
2635 {
return _M_param.b(); }
2642 {
return _M_param; }
2650 { _M_param = __param; }
2657 {
return this->a(); }
2664 {
return this->b(); }
2669 template<
typename _UniformRandomNumberGenerator>
2672 {
return this->
operator()(__urng, _M_param); }
2674 template<
typename _UniformRandomNumberGenerator>
2676 operator()(_UniformRandomNumberGenerator& __urng,
2677 const param_type& __p)
2679 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
2681 return (__aurng() * (__p.b() - __p.a())) + __p.a();
2684 template<
typename _ForwardIterator,
2685 typename _UniformRandomNumberGenerator>
2687 __generate(_ForwardIterator __f, _ForwardIterator __t,
2688 _UniformRandomNumberGenerator& __urng)
2689 { this->__generate(__f, __t, __urng, _M_param); }
2691 template<
typename _ForwardIterator,
2692 typename _UniformRandomNumberGenerator>
2694 __generate(_ForwardIterator __f, _ForwardIterator __t,
2695 _UniformRandomNumberGenerator& __urng,
2697 { this->__generate_impl(__f, __t, __urng, __p); }
2699 template<
typename _UniformRandomNumberGenerator>
2702 _UniformRandomNumberGenerator& __urng,
2704 { this->__generate_impl(__f, __t, __urng, __p); }
2713 {
return __d1._M_param == __d2._M_param; }
2716 template<
typename _ForwardIterator,
2717 typename _UniformRandomNumberGenerator>
2719 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2720 _UniformRandomNumberGenerator& __urng,
2721 const param_type& __p);
2723 param_type _M_param;
2726#if __cpp_impl_three_way_comparison < 201907L
2731 template<
typename _IntType>
2735 {
return !(__d1 == __d2); }
2748 template<
typename _RealType,
typename _CharT,
typename _Traits>
2749 std::basic_ostream<_CharT, _Traits>&
2750 operator<<(std::basic_ostream<_CharT, _Traits>&,
2751 const std::uniform_real_distribution<_RealType>&);
2762 template<
typename _RealType,
typename _CharT,
typename _Traits>
2763 std::basic_istream<_CharT, _Traits>&
2764 operator>>(std::basic_istream<_CharT, _Traits>&,
2765 std::uniform_real_distribution<_RealType>&);
2787 template<
typename _RealType =
double>
2788 class normal_distribution
2791 "result_type must be a floating point type");
2800 typedef normal_distribution<_RealType> distribution_type;
2802 param_type() : param_type(0.0) { }
2805 param_type(_RealType __mean, _RealType __stddev = _RealType(1))
2806 : _M_mean(__mean), _M_stddev(__stddev)
2808 __glibcxx_assert(_M_stddev > _RealType(0));
2817 {
return _M_stddev; }
2820 operator==(
const param_type& __p1,
const param_type& __p2)
2821 {
return (__p1._M_mean == __p2._M_mean
2822 && __p1._M_stddev == __p2._M_stddev); }
2824#if __cpp_impl_three_way_comparison < 201907L
2826 operator!=(
const param_type& __p1,
const param_type& __p2)
2827 {
return !(__p1 == __p2); }
2832 _RealType _M_stddev;
2836 normal_distribution() : normal_distribution(0.0) { }
2845 : _M_param(__mean, __stddev)
2858 { _M_saved_available =
false; }
2865 {
return _M_param.mean(); }
2872 {
return _M_param.stddev(); }
2879 {
return _M_param; }
2887 { _M_param = __param; }
2906 template<
typename _UniformRandomNumberGenerator>
2909 {
return this->
operator()(__urng, _M_param); }
2911 template<
typename _UniformRandomNumberGenerator>
2914 const param_type& __p);
2916 template<
typename _ForwardIterator,
2917 typename _UniformRandomNumberGenerator>
2919 __generate(_ForwardIterator __f, _ForwardIterator __t,
2920 _UniformRandomNumberGenerator& __urng)
2921 { this->__generate(__f, __t, __urng, _M_param); }
2923 template<
typename _ForwardIterator,
2924 typename _UniformRandomNumberGenerator>
2926 __generate(_ForwardIterator __f, _ForwardIterator __t,
2927 _UniformRandomNumberGenerator& __urng,
2928 const param_type& __p)
2929 { this->__generate_impl(__f, __t, __urng, __p); }
2931 template<
typename _UniformRandomNumberGenerator>
2933 __generate(result_type* __f, result_type* __t,
2934 _UniformRandomNumberGenerator& __urng,
2935 const param_type& __p)
2936 { this->__generate_impl(__f, __t, __urng, __p); }
2943 template<
typename _RealType1>
2958 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2973 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2979 template<
typename _ForwardIterator,
2980 typename _UniformRandomNumberGenerator>
2982 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2983 _UniformRandomNumberGenerator& __urng,
2984 const param_type& __p);
2986 param_type _M_param;
2988 bool _M_saved_available =
false;
2991#if __cpp_impl_three_way_comparison < 201907L
2995 template<
typename _RealType>
2999 {
return !(__d1 == __d2); }
3014 template<
typename _RealType =
double>
3015 class lognormal_distribution
3018 "result_type must be a floating point type");
3027 typedef lognormal_distribution<_RealType> distribution_type;
3029 param_type() : param_type(0.0) { }
3032 param_type(_RealType __m, _RealType __s = _RealType(1))
3033 : _M_m(__m), _M_s(__s)
3045 operator==(
const param_type& __p1,
const param_type& __p2)
3046 {
return __p1._M_m == __p2._M_m && __p1._M_s == __p2._M_s; }
3048#if __cpp_impl_three_way_comparison < 201907L
3050 operator!=(
const param_type& __p1,
const param_type& __p2)
3051 {
return !(__p1 == __p2); }
3059 lognormal_distribution() : lognormal_distribution(0.0) { }
3063 : _M_param(__m, __s), _M_nd()
3067 lognormal_distribution(
const param_type& __p)
3068 : _M_param(__p), _M_nd()
3083 {
return _M_param.m(); }
3087 {
return _M_param.s(); }
3094 {
return _M_param; }
3102 { _M_param = __param; }
3121 template<
typename _UniformRandomNumberGenerator>
3124 {
return this->
operator()(__urng, _M_param); }
3126 template<
typename _UniformRandomNumberGenerator>
3128 operator()(_UniformRandomNumberGenerator& __urng,
3129 const param_type& __p)
3130 {
return std::exp(__p.s() * _M_nd(__urng) + __p.m()); }
3132 template<
typename _ForwardIterator,
3133 typename _UniformRandomNumberGenerator>
3135 __generate(_ForwardIterator __f, _ForwardIterator __t,
3136 _UniformRandomNumberGenerator& __urng)
3137 { this->__generate(__f, __t, __urng, _M_param); }
3139 template<
typename _ForwardIterator,
3140 typename _UniformRandomNumberGenerator>
3142 __generate(_ForwardIterator __f, _ForwardIterator __t,
3143 _UniformRandomNumberGenerator& __urng,
3145 { this->__generate_impl(__f, __t, __urng, __p); }
3147 template<
typename _UniformRandomNumberGenerator>
3150 _UniformRandomNumberGenerator& __urng,
3152 { this->__generate_impl(__f, __t, __urng, __p); }
3161 const lognormal_distribution& __d2)
3162 {
return (__d1._M_param == __d2._M_param
3163 && __d1._M_nd == __d2._M_nd); }
3175 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3190 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3196 template<
typename _ForwardIterator,
3197 typename _UniformRandomNumberGenerator>
3199 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3200 _UniformRandomNumberGenerator& __urng,
3201 const param_type& __p);
3203 param_type _M_param;
3208#if __cpp_impl_three_way_comparison < 201907L
3212 template<
typename _RealType>
3216 {
return !(__d1 == __d2); }
3239 template<
typename _RealType =
double>
3243 "result_type must be a floating point type");
3255 param_type() : param_type(1.0) { }
3258 param_type(_RealType __alpha_val, _RealType __beta_val = _RealType(1))
3259 : _M_alpha(__alpha_val), _M_beta(__beta_val)
3261 __glibcxx_assert(_M_alpha > _RealType(0));
3267 {
return _M_alpha; }
3274 operator==(
const param_type& __p1,
const param_type& __p2)
3275 {
return (__p1._M_alpha == __p2._M_alpha
3276 && __p1._M_beta == __p2._M_beta); }
3278#if __cpp_impl_three_way_comparison < 201907L
3280 operator!=(
const param_type& __p1,
const param_type& __p2)
3281 {
return !(__p1 == __p2); }
3291 _RealType _M_malpha, _M_a2;
3306 _RealType __beta_val = _RealType(1))
3307 : _M_param(__alpha_val, __beta_val), _M_nd()
3312 : _M_param(__p), _M_nd()
3327 {
return _M_param.alpha(); }
3334 {
return _M_param.beta(); }
3341 {
return _M_param; }
3349 { _M_param = __param; }
3368 template<
typename _UniformRandomNumberGenerator>
3371 {
return this->
operator()(__urng, _M_param); }
3373 template<
typename _UniformRandomNumberGenerator>
3376 const param_type& __p);
3378 template<
typename _ForwardIterator,
3379 typename _UniformRandomNumberGenerator>
3381 __generate(_ForwardIterator __f, _ForwardIterator __t,
3382 _UniformRandomNumberGenerator& __urng)
3383 { this->__generate(__f, __t, __urng, _M_param); }
3385 template<
typename _ForwardIterator,
3386 typename _UniformRandomNumberGenerator>
3388 __generate(_ForwardIterator __f, _ForwardIterator __t,
3389 _UniformRandomNumberGenerator& __urng,
3390 const param_type& __p)
3391 { this->__generate_impl(__f, __t, __urng, __p); }
3393 template<
typename _UniformRandomNumberGenerator>
3395 __generate(result_type* __f, result_type* __t,
3396 _UniformRandomNumberGenerator& __urng,
3397 const param_type& __p)
3398 { this->__generate_impl(__f, __t, __urng, __p); }
3408 {
return (__d1._M_param == __d2._M_param
3409 && __d1._M_nd == __d2._M_nd); }
3421 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3435 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3441 template<
typename _ForwardIterator,
3442 typename _UniformRandomNumberGenerator>
3444 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3445 _UniformRandomNumberGenerator& __urng,
3446 const param_type& __p);
3448 param_type _M_param;
3453#if __cpp_impl_three_way_comparison < 201907L
3457 template<
typename _RealType>
3461 {
return !(__d1 == __d2); }
3481 template<
typename _RealType =
double>
3482 class chi_squared_distribution
3485 "result_type must be a floating point type");
3494 typedef chi_squared_distribution<_RealType> distribution_type;
3496 param_type() : param_type(1) { }
3499 param_type(_RealType __n)
3508 operator==(
const param_type& __p1,
const param_type& __p2)
3509 {
return __p1._M_n == __p2._M_n; }
3511#if __cpp_impl_three_way_comparison < 201907L
3513 operator!=(
const param_type& __p1,
const param_type& __p2)
3514 {
return !(__p1 == __p2); }
3521 chi_squared_distribution() : chi_squared_distribution(1) { }
3525 : _M_param(__n), _M_gd(__n / 2)
3529 chi_squared_distribution(
const param_type& __p)
3530 : _M_param(__p), _M_gd(__p.n() / 2)
3545 {
return _M_param.n(); }
3552 {
return _M_param; }
3564 _M_gd.param(param_type{__param.n() / 2});
3584 template<
typename _UniformRandomNumberGenerator>
3587 {
return 2 * _M_gd(__urng); }
3589 template<
typename _UniformRandomNumberGenerator>
3591 operator()(_UniformRandomNumberGenerator& __urng,
3592 const param_type& __p)
3596 return 2 * _M_gd(__urng, param_type(__p.n() / 2));
3599 template<
typename _ForwardIterator,
3600 typename _UniformRandomNumberGenerator>
3602 __generate(_ForwardIterator __f, _ForwardIterator __t,
3603 _UniformRandomNumberGenerator& __urng)
3604 { this->__generate_impl(__f, __t, __urng); }
3606 template<
typename _ForwardIterator,
3607 typename _UniformRandomNumberGenerator>
3609 __generate(_ForwardIterator __f, _ForwardIterator __t,
3610 _UniformRandomNumberGenerator& __urng,
3612 {
typename std::gamma_distribution<result_type>::param_type
3614 this->__generate_impl(__f, __t, __urng, __p2); }
3616 template<
typename _UniformRandomNumberGenerator>
3619 _UniformRandomNumberGenerator& __urng)
3620 { this->__generate_impl(__f, __t, __urng); }
3622 template<
typename _UniformRandomNumberGenerator>
3625 _UniformRandomNumberGenerator& __urng,
3627 {
typename std::gamma_distribution<result_type>::param_type
3629 this->__generate_impl(__f, __t, __urng, __p2); }
3638 const chi_squared_distribution& __d2)
3639 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
3651 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3666 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3672 template<
typename _ForwardIterator,
3673 typename _UniformRandomNumberGenerator>
3675 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3676 _UniformRandomNumberGenerator& __urng);
3678 template<
typename _ForwardIterator,
3679 typename _UniformRandomNumberGenerator>
3681 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3682 _UniformRandomNumberGenerator& __urng,
3686 param_type _M_param;
3691#if __cpp_impl_three_way_comparison < 201907L
3695 template<
typename _RealType>
3699 {
return !(__d1 == __d2); }
3711 template<
typename _RealType =
double>
3712 class cauchy_distribution
3715 "result_type must be a floating point type");
3724 typedef cauchy_distribution<_RealType> distribution_type;
3726 param_type() : param_type(0) { }
3729 param_type(_RealType __a, _RealType __b = _RealType(1))
3730 : _M_a(__a), _M_b(__b)
3742 operator==(
const param_type& __p1,
const param_type& __p2)
3743 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
3745#if __cpp_impl_three_way_comparison < 201907L
3747 operator!=(
const param_type& __p1,
const param_type& __p2)
3748 {
return !(__p1 == __p2); }
3756 cauchy_distribution() : cauchy_distribution(0.0) { }
3760 : _M_param(__a, __b)
3764 cauchy_distribution(
const param_type& __p)
3780 {
return _M_param.a(); }
3784 {
return _M_param.b(); }
3791 {
return _M_param; }
3799 { _M_param = __param; }
3818 template<
typename _UniformRandomNumberGenerator>
3821 {
return this->
operator()(__urng, _M_param); }
3823 template<
typename _UniformRandomNumberGenerator>
3825 operator()(_UniformRandomNumberGenerator& __urng,
3826 const param_type& __p);
3828 template<
typename _ForwardIterator,
3829 typename _UniformRandomNumberGenerator>
3831 __generate(_ForwardIterator __f, _ForwardIterator __t,
3832 _UniformRandomNumberGenerator& __urng)
3833 { this->__generate(__f, __t, __urng, _M_param); }
3835 template<
typename _ForwardIterator,
3836 typename _UniformRandomNumberGenerator>
3838 __generate(_ForwardIterator __f, _ForwardIterator __t,
3839 _UniformRandomNumberGenerator& __urng,
3840 const param_type& __p)
3841 { this->__generate_impl(__f, __t, __urng, __p); }
3843 template<
typename _UniformRandomNumberGenerator>
3846 _UniformRandomNumberGenerator& __urng,
3848 { this->__generate_impl(__f, __t, __urng, __p); }
3856 const cauchy_distribution& __d2)
3857 {
return __d1._M_param == __d2._M_param; }
3860 template<
typename _ForwardIterator,
3861 typename _UniformRandomNumberGenerator>
3863 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3864 _UniformRandomNumberGenerator& __urng,
3865 const param_type& __p);
3867 param_type _M_param;
3870#if __cpp_impl_three_way_comparison < 201907L
3875 template<
typename _RealType>
3879 {
return !(__d1 == __d2); }
3892 template<
typename _RealType,
typename _CharT,
typename _Traits>
3893 std::basic_ostream<_CharT, _Traits>&
3894 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3895 const std::cauchy_distribution<_RealType>& __x);
3907 template<
typename _RealType,
typename _CharT,
typename _Traits>
3908 std::basic_istream<_CharT, _Traits>&
3909 operator>>(std::basic_istream<_CharT, _Traits>& __is,
3910 std::cauchy_distribution<_RealType>& __x);
3926 template<
typename _RealType =
double>
3927 class fisher_f_distribution
3930 "result_type must be a floating point type");
3939 typedef fisher_f_distribution<_RealType> distribution_type;
3941 param_type() : param_type(1) { }
3944 param_type(_RealType __m, _RealType __n = _RealType(1))
3945 : _M_m(__m), _M_n(__n)
3957 operator==(
const param_type& __p1,
const param_type& __p2)
3958 {
return __p1._M_m == __p2._M_m && __p1._M_n == __p2._M_n; }
3960#if __cpp_impl_three_way_comparison < 201907L
3962 operator!=(
const param_type& __p1,
const param_type& __p2)
3963 {
return !(__p1 == __p2); }
3971 fisher_f_distribution() : fisher_f_distribution(1.0) { }
3975 _RealType __n = _RealType(1))
3976 : _M_param(__m, __n), _M_gd_x(__m / 2), _M_gd_y(__n / 2)
3980 fisher_f_distribution(
const param_type& __p)
3981 : _M_param(__p), _M_gd_x(__p.m() / 2), _M_gd_y(__p.n() / 2)
3999 {
return _M_param.m(); }
4003 {
return _M_param.n(); }
4010 {
return _M_param; }
4018 { _M_param = __param; }
4037 template<
typename _UniformRandomNumberGenerator>
4040 {
return (_M_gd_x(__urng) * n()) / (_M_gd_y(__urng) * m()); }
4042 template<
typename _UniformRandomNumberGenerator>
4044 operator()(_UniformRandomNumberGenerator& __urng,
4045 const param_type& __p)
4049 return ((_M_gd_x(__urng, param_type(__p.m() / 2)) * n())
4050 / (_M_gd_y(__urng, param_type(__p.n() / 2)) * m()));
4053 template<
typename _ForwardIterator,
4054 typename _UniformRandomNumberGenerator>
4056 __generate(_ForwardIterator __f, _ForwardIterator __t,
4057 _UniformRandomNumberGenerator& __urng)
4058 { this->__generate_impl(__f, __t, __urng); }
4060 template<
typename _ForwardIterator,
4061 typename _UniformRandomNumberGenerator>
4063 __generate(_ForwardIterator __f, _ForwardIterator __t,
4064 _UniformRandomNumberGenerator& __urng,
4066 { this->__generate_impl(__f, __t, __urng, __p); }
4068 template<
typename _UniformRandomNumberGenerator>
4071 _UniformRandomNumberGenerator& __urng)
4072 { this->__generate_impl(__f, __t, __urng); }
4074 template<
typename _UniformRandomNumberGenerator>
4077 _UniformRandomNumberGenerator& __urng,
4079 { this->__generate_impl(__f, __t, __urng, __p); }
4088 const fisher_f_distribution& __d2)
4089 {
return (__d1._M_param == __d2._M_param
4090 && __d1._M_gd_x == __d2._M_gd_x
4091 && __d1._M_gd_y == __d2._M_gd_y); }
4103 template<
typename _RealType1,
typename _CharT,
typename _Traits>
4118 template<
typename _RealType1,
typename _CharT,
typename _Traits>
4124 template<
typename _ForwardIterator,
4125 typename _UniformRandomNumberGenerator>
4127 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4128 _UniformRandomNumberGenerator& __urng);
4130 template<
typename _ForwardIterator,
4131 typename _UniformRandomNumberGenerator>
4133 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4134 _UniformRandomNumberGenerator& __urng,
4135 const param_type& __p);
4137 param_type _M_param;
4142#if __cpp_impl_three_way_comparison < 201907L
4146 template<
typename _RealType>
4150 {
return !(__d1 == __d2); }
4165 template<
typename _RealType =
double>
4166 class student_t_distribution
4169 "result_type must be a floating point type");
4178 typedef student_t_distribution<_RealType> distribution_type;
4180 param_type() : param_type(1) { }
4183 param_type(_RealType __n)
4192 operator==(
const param_type& __p1,
const param_type& __p2)
4193 {
return __p1._M_n == __p2._M_n; }
4195#if __cpp_impl_three_way_comparison < 201907L
4197 operator!=(
const param_type& __p1,
const param_type& __p2)
4198 {
return !(__p1 == __p2); }
4205 student_t_distribution() : student_t_distribution(1.0) { }
4209 : _M_param(__n), _M_nd(), _M_gd(__n / 2, 2)
4213 student_t_distribution(
const param_type& __p)
4214 : _M_param(__p), _M_nd(), _M_gd(__p.n() / 2, 2)
4232 {
return _M_param.n(); }
4239 {
return _M_param; }
4247 { _M_param = __param; }
4266 template<
typename _UniformRandomNumberGenerator>
4269 {
return _M_nd(__urng) *
std::sqrt(n() / _M_gd(__urng)); }
4271 template<
typename _UniformRandomNumberGenerator>
4273 operator()(_UniformRandomNumberGenerator& __urng,
4274 const param_type& __p)
4279 const result_type __g = _M_gd(__urng, param_type(__p.n() / 2, 2));
4280 return _M_nd(__urng) *
std::sqrt(__p.n() / __g);
4283 template<
typename _ForwardIterator,
4284 typename _UniformRandomNumberGenerator>
4286 __generate(_ForwardIterator __f, _ForwardIterator __t,
4287 _UniformRandomNumberGenerator& __urng)
4288 { this->__generate_impl(__f, __t, __urng); }
4290 template<
typename _ForwardIterator,
4291 typename _UniformRandomNumberGenerator>
4293 __generate(_ForwardIterator __f, _ForwardIterator __t,
4294 _UniformRandomNumberGenerator& __urng,
4296 { this->__generate_impl(__f, __t, __urng, __p); }
4298 template<
typename _UniformRandomNumberGenerator>
4301 _UniformRandomNumberGenerator& __urng)
4302 { this->__generate_impl(__f, __t, __urng); }
4304 template<
typename _UniformRandomNumberGenerator>
4307 _UniformRandomNumberGenerator& __urng,
4309 { this->__generate_impl(__f, __t, __urng, __p); }
4318 const student_t_distribution& __d2)
4319 {
return (__d1._M_param == __d2._M_param
4320 && __d1._M_nd == __d2._M_nd && __d1._M_gd == __d2._M_gd); }
4332 template<
typename _RealType1,
typename _CharT,
typename _Traits>
4347 template<
typename _RealType1,
typename _CharT,
typename _Traits>
4353 template<
typename _ForwardIterator,
4354 typename _UniformRandomNumberGenerator>
4356 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4357 _UniformRandomNumberGenerator& __urng);
4358 template<
typename _ForwardIterator,
4359 typename _UniformRandomNumberGenerator>
4361 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4362 _UniformRandomNumberGenerator& __urng,
4363 const param_type& __p);
4365 param_type _M_param;
4371#if __cpp_impl_three_way_comparison < 201907L
4375 template<
typename _RealType>
4379 {
return !(__d1 == __d2); }
4410 param_type() : param_type(0.5) { }
4413 param_type(
double __p)
4416 __glibcxx_assert((_M_p >= 0.0) && (_M_p <= 1.0));
4424 operator==(
const param_type& __p1,
const param_type& __p2)
4425 {
return __p1._M_p == __p2._M_p; }
4427#if __cpp_impl_three_way_comparison < 201907L
4429 operator!=(
const param_type& __p1,
const param_type& __p2)
4430 {
return !(__p1 == __p2); }
4472 {
return _M_param.p(); }
4479 {
return _M_param; }
4487 { _M_param = __param; }
4506 template<
typename _UniformRandomNumberGenerator>
4509 {
return this->
operator()(__urng, _M_param); }
4511 template<
typename _UniformRandomNumberGenerator>
4513 operator()(_UniformRandomNumberGenerator& __urng,
4514 const param_type& __p)
4516 __detail::_Adaptor<_UniformRandomNumberGenerator, double>
4518 if ((__aurng() - __aurng.min())
4519 < __p.p() * (__aurng.max() - __aurng.min()))
4524 template<
typename _ForwardIterator,
4525 typename _UniformRandomNumberGenerator>
4527 __generate(_ForwardIterator __f, _ForwardIterator __t,
4528 _UniformRandomNumberGenerator& __urng)
4529 { this->__generate(__f, __t, __urng, _M_param); }
4531 template<
typename _ForwardIterator,
4532 typename _UniformRandomNumberGenerator>
4534 __generate(_ForwardIterator __f, _ForwardIterator __t,
4535 _UniformRandomNumberGenerator& __urng,
const param_type& __p)
4536 { this->__generate_impl(__f, __t, __urng, __p); }
4538 template<
typename _UniformRandomNumberGenerator>
4541 _UniformRandomNumberGenerator& __urng,
4543 { this->__generate_impl(__f, __t, __urng, __p); }
4552 {
return __d1._M_param == __d2._M_param; }
4555 template<
typename _ForwardIterator,
4556 typename _UniformRandomNumberGenerator>
4558 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4559 _UniformRandomNumberGenerator& __urng,
4560 const param_type& __p);
4562 param_type _M_param;
4565#if __cpp_impl_three_way_comparison < 201907L
4573 {
return !(__d1 == __d2); }
4586 template<
typename _CharT,
typename _Traits>
4587 std::basic_ostream<_CharT, _Traits>&
4588 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4589 const std::bernoulli_distribution& __x);
4600 template<
typename _CharT,
typename _Traits>
4601 inline std::basic_istream<_CharT, _Traits>&
4622 template<
typename _IntType =
int>
4623 class binomial_distribution
4626 "result_type must be an integral type");
4635 typedef binomial_distribution<_IntType> distribution_type;
4636 friend class binomial_distribution<_IntType>;
4638 param_type() : param_type(1) { }
4641 param_type(_IntType __t,
double __p = 0.5)
4642 : _M_t(__t), _M_p(__p)
4644 __glibcxx_assert((_M_t >= _IntType(0))
4659 operator==(
const param_type& __p1,
const param_type& __p2)
4660 {
return __p1._M_t == __p2._M_t && __p1._M_p == __p2._M_p; }
4662#if __cpp_impl_three_way_comparison < 201907L
4664 operator!=(
const param_type& __p1,
const param_type& __p2)
4665 {
return !(__p1 == __p2); }
4676#if _GLIBCXX_USE_C99_MATH_FUNCS
4677 double _M_d1, _M_d2, _M_s1, _M_s2, _M_c,
4678 _M_a1, _M_a123, _M_s, _M_lf, _M_lp1p;
4685 binomial_distribution() : binomial_distribution(1) { }
4689 : _M_param(__t, __p), _M_nd()
4693 binomial_distribution(
const param_type& __p)
4694 : _M_param(__p), _M_nd()
4709 {
return _M_param.t(); }
4716 {
return _M_param.p(); }
4723 {
return _M_param; }
4731 { _M_param = __param; }
4745 {
return _M_param.t(); }
4750 template<
typename _UniformRandomNumberGenerator>
4753 {
return this->
operator()(__urng, _M_param); }
4755 template<
typename _UniformRandomNumberGenerator>
4758 const param_type& __p);
4760 template<
typename _ForwardIterator,
4761 typename _UniformRandomNumberGenerator>
4763 __generate(_ForwardIterator __f, _ForwardIterator __t,
4764 _UniformRandomNumberGenerator& __urng)
4765 { this->__generate(__f, __t, __urng, _M_param); }
4767 template<
typename _ForwardIterator,
4768 typename _UniformRandomNumberGenerator>
4770 __generate(_ForwardIterator __f, _ForwardIterator __t,
4771 _UniformRandomNumberGenerator& __urng,
4772 const param_type& __p)
4773 { this->__generate_impl(__f, __t, __urng, __p); }
4775 template<
typename _UniformRandomNumberGenerator>
4777 __generate(result_type* __f, result_type* __t,
4778 _UniformRandomNumberGenerator& __urng,
4779 const param_type& __p)
4780 { this->__generate_impl(__f, __t, __urng, __p); }
4789 const binomial_distribution& __d2)
4790#ifdef _GLIBCXX_USE_C99_MATH_FUNCS
4791 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
4793 {
return __d1._M_param == __d2._M_param; }
4806 template<
typename _IntType1,
4807 typename _CharT,
typename _Traits>
4822 template<
typename _IntType1,
4823 typename _CharT,
typename _Traits>
4829 template<
typename _ForwardIterator,
4830 typename _UniformRandomNumberGenerator>
4832 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4833 _UniformRandomNumberGenerator& __urng,
4834 const param_type& __p);
4836 template<
typename _UniformRandomNumberGenerator>
4838 _M_waiting(_UniformRandomNumberGenerator& __urng,
4839 _IntType __t,
double __q);
4841 param_type _M_param;
4847#if __cpp_impl_three_way_comparison < 201907L
4851 template<
typename _IntType>
4855 {
return !(__d1 == __d2); }
4868 template<
typename _IntType =
int>
4869 class geometric_distribution
4872 "result_type must be an integral type");
4881 typedef geometric_distribution<_IntType> distribution_type;
4882 friend class geometric_distribution<_IntType>;
4884 param_type() : param_type(0.5) { }
4887 param_type(
double __p)
4890 __glibcxx_assert((_M_p > 0.0) && (_M_p < 1.0));
4899 operator==(
const param_type& __p1,
const param_type& __p2)
4900 {
return __p1._M_p == __p2._M_p; }
4902#if __cpp_impl_three_way_comparison < 201907L
4904 operator!=(
const param_type& __p1,
const param_type& __p2)
4905 {
return !(__p1 == __p2); }
4911 { _M_log_1_p =
std::log(1.0 - _M_p); }
4920 geometric_distribution() : geometric_distribution(0.5) { }
4928 geometric_distribution(
const param_type& __p)
4945 {
return _M_param.p(); }
4952 {
return _M_param; }
4960 { _M_param = __param; }
4979 template<
typename _UniformRandomNumberGenerator>
4982 {
return this->
operator()(__urng, _M_param); }
4984 template<
typename _UniformRandomNumberGenerator>
4986 operator()(_UniformRandomNumberGenerator& __urng,
4987 const param_type& __p);
4989 template<
typename _ForwardIterator,
4990 typename _UniformRandomNumberGenerator>
4992 __generate(_ForwardIterator __f, _ForwardIterator __t,
4993 _UniformRandomNumberGenerator& __urng)
4994 { this->__generate(__f, __t, __urng, _M_param); }
4996 template<
typename _ForwardIterator,
4997 typename _UniformRandomNumberGenerator>
4999 __generate(_ForwardIterator __f, _ForwardIterator __t,
5000 _UniformRandomNumberGenerator& __urng,
5001 const param_type& __p)
5002 { this->__generate_impl(__f, __t, __urng, __p); }
5004 template<
typename _UniformRandomNumberGenerator>
5007 _UniformRandomNumberGenerator& __urng,
5009 { this->__generate_impl(__f, __t, __urng, __p); }
5017 const geometric_distribution& __d2)
5018 {
return __d1._M_param == __d2._M_param; }
5021 template<
typename _ForwardIterator,
5022 typename _UniformRandomNumberGenerator>
5024 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5025 _UniformRandomNumberGenerator& __urng,
5026 const param_type& __p);
5028 param_type _M_param;
5031#if __cpp_impl_three_way_comparison < 201907L
5036 template<
typename _IntType>
5040 {
return !(__d1 == __d2); }
5053 template<
typename _IntType,
5054 typename _CharT,
typename _Traits>
5055 std::basic_ostream<_CharT, _Traits>&
5056 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5057 const std::geometric_distribution<_IntType>& __x);
5068 template<
typename _IntType,
5069 typename _CharT,
typename _Traits>
5070 std::basic_istream<_CharT, _Traits>&
5071 operator>>(std::basic_istream<_CharT, _Traits>& __is,
5072 std::geometric_distribution<_IntType>& __x);
5085 template<
typename _IntType =
int>
5086 class negative_binomial_distribution
5089 "result_type must be an integral type");
5098 typedef negative_binomial_distribution<_IntType> distribution_type;
5100 param_type() : param_type(1) { }
5103 param_type(_IntType __k,
double __p = 0.5)
5104 : _M_k(__k), _M_p(__p)
5106 __glibcxx_assert((_M_k > 0) && (_M_p > 0.0) && (_M_p <= 1.0));
5118 operator==(
const param_type& __p1,
const param_type& __p2)
5119 {
return __p1._M_k == __p2._M_k && __p1._M_p == __p2._M_p; }
5121#if __cpp_impl_three_way_comparison < 201907L
5123 operator!=(
const param_type& __p1,
const param_type& __p2)
5124 {
return !(__p1 == __p2); }
5132 negative_binomial_distribution() : negative_binomial_distribution(1) { }
5136 : _M_param(__k, __p), _M_gd(__k, (1.0 - __p) / __p)
5140 negative_binomial_distribution(
const param_type& __p)
5141 : _M_param(__p), _M_gd(__p.
k(), (1.0 - __p.
p()) / __p.
p())
5156 {
return _M_param.k(); }
5163 {
return _M_param.p(); }
5170 {
return _M_param; }
5178 { _M_param = __param; }
5197 template<
typename _UniformRandomNumberGenerator>
5201 template<
typename _UniformRandomNumberGenerator>
5203 operator()(_UniformRandomNumberGenerator& __urng,
5204 const param_type& __p);
5206 template<
typename _ForwardIterator,
5207 typename _UniformRandomNumberGenerator>
5209 __generate(_ForwardIterator __f, _ForwardIterator __t,
5210 _UniformRandomNumberGenerator& __urng)
5211 { this->__generate_impl(__f, __t, __urng); }
5213 template<
typename _ForwardIterator,
5214 typename _UniformRandomNumberGenerator>
5216 __generate(_ForwardIterator __f, _ForwardIterator __t,
5217 _UniformRandomNumberGenerator& __urng,
5218 const param_type& __p)
5219 { this->__generate_impl(__f, __t, __urng, __p); }
5221 template<
typename _UniformRandomNumberGenerator>
5223 __generate(result_type* __f, result_type* __t,
5224 _UniformRandomNumberGenerator& __urng)
5225 { this->__generate_impl(__f, __t, __urng); }
5227 template<
typename _UniformRandomNumberGenerator>
5230 _UniformRandomNumberGenerator& __urng,
5232 { this->__generate_impl(__f, __t, __urng, __p); }
5241 const negative_binomial_distribution& __d2)
5242 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
5255 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5270 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5276 template<
typename _ForwardIterator,
5277 typename _UniformRandomNumberGenerator>
5279 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5280 _UniformRandomNumberGenerator& __urng);
5281 template<
typename _ForwardIterator,
5282 typename _UniformRandomNumberGenerator>
5284 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5285 _UniformRandomNumberGenerator& __urng,
5286 const param_type& __p);
5288 param_type _M_param;
5293#if __cpp_impl_three_way_comparison < 201907L
5297 template<
typename _IntType>
5301 {
return !(__d1 == __d2); }
5322 template<
typename _IntType =
int>
5323 class poisson_distribution
5326 "result_type must be an integral type");
5335 typedef poisson_distribution<_IntType> distribution_type;
5336 friend class poisson_distribution<_IntType>;
5338 param_type() : param_type(1.0) { }
5341 param_type(
double __mean)
5344 __glibcxx_assert(_M_mean > 0.0);
5353 operator==(
const param_type& __p1,
const param_type& __p2)
5354 {
return __p1._M_mean == __p2._M_mean; }
5356#if __cpp_impl_three_way_comparison < 201907L
5358 operator!=(
const param_type& __p1,
const param_type& __p2)
5359 {
return !(__p1 == __p2); }
5370#if _GLIBCXX_USE_C99_MATH_FUNCS
5371 double _M_lfm, _M_sm, _M_d, _M_scx, _M_1cx, _M_c2b, _M_cb;
5377 poisson_distribution() : poisson_distribution(1.0) { }
5381 : _M_param(__mean), _M_nd()
5385 poisson_distribution(
const param_type& __p)
5386 : _M_param(__p), _M_nd()
5401 {
return _M_param.mean(); }
5408 {
return _M_param; }
5416 { _M_param = __param; }
5435 template<
typename _UniformRandomNumberGenerator>
5438 {
return this->
operator()(__urng, _M_param); }
5440 template<
typename _UniformRandomNumberGenerator>
5443 const param_type& __p);
5445 template<
typename _ForwardIterator,
5446 typename _UniformRandomNumberGenerator>
5448 __generate(_ForwardIterator __f, _ForwardIterator __t,
5449 _UniformRandomNumberGenerator& __urng)
5450 { this->__generate(__f, __t, __urng, _M_param); }
5452 template<
typename _ForwardIterator,
5453 typename _UniformRandomNumberGenerator>
5455 __generate(_ForwardIterator __f, _ForwardIterator __t,
5456 _UniformRandomNumberGenerator& __urng,
5457 const param_type& __p)
5458 { this->__generate_impl(__f, __t, __urng, __p); }
5460 template<
typename _UniformRandomNumberGenerator>
5462 __generate(result_type* __f, result_type* __t,
5463 _UniformRandomNumberGenerator& __urng,
5464 const param_type& __p)
5465 { this->__generate_impl(__f, __t, __urng, __p); }
5474 const poisson_distribution& __d2)
5475#ifdef _GLIBCXX_USE_C99_MATH_FUNCS
5476 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
5478 {
return __d1._M_param == __d2._M_param; }
5491 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5506 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5512 template<
typename _ForwardIterator,
5513 typename _UniformRandomNumberGenerator>
5515 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5516 _UniformRandomNumberGenerator& __urng,
5517 const param_type& __p);
5519 param_type _M_param;
5525#if __cpp_impl_three_way_comparison < 201907L
5529 template<
typename _IntType>
5533 {
return !(__d1 == __d2); }
5554 template<
typename _RealType =
double>
5558 "result_type must be a floating point type");
5569 param_type() : param_type(1.0) { }
5572 param_type(_RealType __lambda)
5573 : _M_lambda(__lambda)
5575 __glibcxx_assert(_M_lambda > _RealType(0));
5580 {
return _M_lambda; }
5583 operator==(
const param_type& __p1,
const param_type& __p2)
5584 {
return __p1._M_lambda == __p2._M_lambda; }
5586#if __cpp_impl_three_way_comparison < 201907L
5588 operator!=(
const param_type& __p1,
const param_type& __p2)
5589 {
return !(__p1 == __p2); }
5593 _RealType _M_lambda;
5609 : _M_param(__lambda)
5630 {
return _M_param.lambda(); }
5637 {
return _M_param; }
5645 { _M_param = __param; }
5664 template<
typename _UniformRandomNumberGenerator>
5667 {
return this->
operator()(__urng, _M_param); }
5669 template<
typename _UniformRandomNumberGenerator>
5671 operator()(_UniformRandomNumberGenerator& __urng,
5672 const param_type& __p)
5674 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
5679 template<
typename _ForwardIterator,
5680 typename _UniformRandomNumberGenerator>
5682 __generate(_ForwardIterator __f, _ForwardIterator __t,
5683 _UniformRandomNumberGenerator& __urng)
5684 { this->__generate(__f, __t, __urng, _M_param); }
5686 template<
typename _ForwardIterator,
5687 typename _UniformRandomNumberGenerator>
5689 __generate(_ForwardIterator __f, _ForwardIterator __t,
5690 _UniformRandomNumberGenerator& __urng,
5692 { this->__generate_impl(__f, __t, __urng, __p); }
5694 template<
typename _UniformRandomNumberGenerator>
5697 _UniformRandomNumberGenerator& __urng,
5699 { this->__generate_impl(__f, __t, __urng, __p); }
5708 {
return __d1._M_param == __d2._M_param; }
5711 template<
typename _ForwardIterator,
5712 typename _UniformRandomNumberGenerator>
5714 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5715 _UniformRandomNumberGenerator& __urng,
5716 const param_type& __p);
5718 param_type _M_param;
5721#if __cpp_impl_three_way_comparison < 201907L
5726 template<
typename _RealType>
5730 {
return !(__d1 == __d2); }
5743 template<
typename _RealType,
typename _CharT,
typename _Traits>
5744 std::basic_ostream<_CharT, _Traits>&
5745 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5746 const std::exponential_distribution<_RealType>& __x);
5758 template<
typename _RealType,
typename _CharT,
typename _Traits>
5759 std::basic_istream<_CharT, _Traits>&
5760 operator>>(std::basic_istream<_CharT, _Traits>& __is,
5761 std::exponential_distribution<_RealType>& __x);
5776 template<
typename _RealType =
double>
5777 class weibull_distribution
5780 "result_type must be a floating point type");
5789 typedef weibull_distribution<_RealType> distribution_type;
5791 param_type() : param_type(1.0) { }
5794 param_type(_RealType __a, _RealType __b = _RealType(1.0))
5795 : _M_a(__a), _M_b(__b)
5807 operator==(
const param_type& __p1,
const param_type& __p2)
5808 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
5810#if __cpp_impl_three_way_comparison < 201907L
5812 operator!=(
const param_type& __p1,
const param_type& __p2)
5813 {
return !(__p1 == __p2); }
5821 weibull_distribution() : weibull_distribution(1.0) { }
5825 : _M_param(__a, __b)
5829 weibull_distribution(
const param_type& __p)
5845 {
return _M_param.a(); }
5852 {
return _M_param.b(); }
5859 {
return _M_param; }
5867 { _M_param = __param; }
5886 template<
typename _UniformRandomNumberGenerator>
5889 {
return this->
operator()(__urng, _M_param); }
5891 template<
typename _UniformRandomNumberGenerator>
5893 operator()(_UniformRandomNumberGenerator& __urng,
5894 const param_type& __p);
5896 template<
typename _ForwardIterator,
5897 typename _UniformRandomNumberGenerator>
5899 __generate(_ForwardIterator __f, _ForwardIterator __t,
5900 _UniformRandomNumberGenerator& __urng)
5901 { this->__generate(__f, __t, __urng, _M_param); }
5903 template<
typename _ForwardIterator,
5904 typename _UniformRandomNumberGenerator>
5906 __generate(_ForwardIterator __f, _ForwardIterator __t,
5907 _UniformRandomNumberGenerator& __urng,
5908 const param_type& __p)
5909 { this->__generate_impl(__f, __t, __urng, __p); }
5911 template<
typename _UniformRandomNumberGenerator>
5914 _UniformRandomNumberGenerator& __urng,
5916 { this->__generate_impl(__f, __t, __urng, __p); }
5924 const weibull_distribution& __d2)
5925 {
return __d1._M_param == __d2._M_param; }
5928 template<
typename _ForwardIterator,
5929 typename _UniformRandomNumberGenerator>
5931 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5932 _UniformRandomNumberGenerator& __urng,
5933 const param_type& __p);
5935 param_type _M_param;
5938#if __cpp_impl_three_way_comparison < 201907L
5943 template<
typename _RealType>
5947 {
return !(__d1 == __d2); }
5960 template<
typename _RealType,
typename _CharT,
typename _Traits>
5961 std::basic_ostream<_CharT, _Traits>&
5962 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5963 const std::weibull_distribution<_RealType>& __x);
5975 template<
typename _RealType,
typename _CharT,
typename _Traits>
5976 std::basic_istream<_CharT, _Traits>&
5977 operator>>(std::basic_istream<_CharT, _Traits>& __is,
5978 std::weibull_distribution<_RealType>& __x);
5993 template<
typename _RealType =
double>
5994 class extreme_value_distribution
5997 "result_type must be a floating point type");
6006 typedef extreme_value_distribution<_RealType> distribution_type;
6008 param_type() : param_type(0.0) { }
6011 param_type(_RealType __a, _RealType __b = _RealType(1.0))
6012 : _M_a(__a), _M_b(__b)
6024 operator==(
const param_type& __p1,
const param_type& __p2)
6025 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
6027#if __cpp_impl_three_way_comparison < 201907L
6029 operator!=(
const param_type& __p1,
const param_type& __p2)
6030 {
return !(__p1 == __p2); }
6038 extreme_value_distribution() : extreme_value_distribution(0.0) { }
6042 : _M_param(__a, __b)
6046 extreme_value_distribution(
const param_type& __p)
6062 {
return _M_param.a(); }
6069 {
return _M_param.b(); }
6076 {
return _M_param; }
6084 { _M_param = __param; }
6103 template<
typename _UniformRandomNumberGenerator>
6106 {
return this->
operator()(__urng, _M_param); }
6108 template<
typename _UniformRandomNumberGenerator>
6110 operator()(_UniformRandomNumberGenerator& __urng,
6111 const param_type& __p);
6113 template<
typename _ForwardIterator,
6114 typename _UniformRandomNumberGenerator>
6116 __generate(_ForwardIterator __f, _ForwardIterator __t,
6117 _UniformRandomNumberGenerator& __urng)
6118 { this->__generate(__f, __t, __urng, _M_param); }
6120 template<
typename _ForwardIterator,
6121 typename _UniformRandomNumberGenerator>
6123 __generate(_ForwardIterator __f, _ForwardIterator __t,
6124 _UniformRandomNumberGenerator& __urng,
6125 const param_type& __p)
6126 { this->__generate_impl(__f, __t, __urng, __p); }
6128 template<
typename _UniformRandomNumberGenerator>
6131 _UniformRandomNumberGenerator& __urng,
6133 { this->__generate_impl(__f, __t, __urng, __p); }
6141 const extreme_value_distribution& __d2)
6142 {
return __d1._M_param == __d2._M_param; }
6145 template<
typename _ForwardIterator,
6146 typename _UniformRandomNumberGenerator>
6148 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6149 _UniformRandomNumberGenerator& __urng,
6150 const param_type& __p);
6152 param_type _M_param;
6155#if __cpp_impl_three_way_comparison < 201907L
6160 template<
typename _RealType>
6164 {
return !(__d1 == __d2); }
6177 template<
typename _RealType,
typename _CharT,
typename _Traits>
6178 std::basic_ostream<_CharT, _Traits>&
6179 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
6180 const std::extreme_value_distribution<_RealType>& __x);
6192 template<
typename _RealType,
typename _CharT,
typename _Traits>
6193 std::basic_istream<_CharT, _Traits>&
6194 operator>>(std::basic_istream<_CharT, _Traits>& __is,
6195 std::extreme_value_distribution<_RealType>& __x);
6215 template<
typename _IntType =
int>
6216 class discrete_distribution
6219 "result_type must be an integral type");
6228 typedef discrete_distribution<_IntType> distribution_type;
6229 friend class discrete_distribution<_IntType>;
6232 : _M_prob(), _M_cp()
6235 template<
typename _InputIterator>
6236 param_type(_InputIterator __wbegin,
6237 _InputIterator __wend)
6238 : _M_prob(__wbegin, __wend), _M_cp()
6239 { _M_initialize(); }
6242 : _M_prob(__wil.begin(), __wil.end()), _M_cp()
6243 { _M_initialize(); }
6245 template<
typename _Func>
6246 param_type(
size_t __nw,
double __xmin,
double __xmax,
6250 param_type(
const param_type&) =
default;
6251 param_type& operator=(
const param_type&) =
default;
6258 operator==(
const param_type& __p1,
const param_type& __p2)
6259 {
return __p1._M_prob == __p2._M_prob; }
6261#if __cpp_impl_three_way_comparison < 201907L
6263 operator!=(
const param_type& __p1,
const param_type& __p2)
6264 {
return !(__p1 == __p2); }
6275 discrete_distribution()
6279 template<
typename _InputIterator>
6281 _InputIterator __wend)
6282 : _M_param(__wbegin, __wend)
6285 discrete_distribution(initializer_list<double> __wl)
6289 template<
typename _Func>
6290 discrete_distribution(
size_t __nw,
double __xmin,
double __xmax,
6292 : _M_param(__nw, __xmin, __xmax, __fw)
6313 return _M_param._M_prob.
empty()
6322 {
return _M_param; }
6330 { _M_param = __param; }
6345 return _M_param._M_prob.empty()
6352 template<
typename _UniformRandomNumberGenerator>
6355 {
return this->
operator()(__urng, _M_param); }
6357 template<
typename _UniformRandomNumberGenerator>
6359 operator()(_UniformRandomNumberGenerator& __urng,
6360 const param_type& __p);
6362 template<
typename _ForwardIterator,
6363 typename _UniformRandomNumberGenerator>
6365 __generate(_ForwardIterator __f, _ForwardIterator __t,
6366 _UniformRandomNumberGenerator& __urng)
6367 { this->__generate(__f, __t, __urng, _M_param); }
6369 template<
typename _ForwardIterator,
6370 typename _UniformRandomNumberGenerator>
6372 __generate(_ForwardIterator __f, _ForwardIterator __t,
6373 _UniformRandomNumberGenerator& __urng,
6374 const param_type& __p)
6375 { this->__generate_impl(__f, __t, __urng, __p); }
6377 template<
typename _UniformRandomNumberGenerator>
6380 _UniformRandomNumberGenerator& __urng,
6382 { this->__generate_impl(__f, __t, __urng, __p); }
6390 const discrete_distribution& __d2)
6391 {
return __d1._M_param == __d2._M_param; }
6403 template<
typename _IntType1,
typename _CharT,
typename _Traits>
6419 template<
typename _IntType1,
typename _CharT,
typename _Traits>
6425 template<
typename _ForwardIterator,
6426 typename _UniformRandomNumberGenerator>
6428 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6429 _UniformRandomNumberGenerator& __urng,
6430 const param_type& __p);
6432 param_type _M_param;
6435#if __cpp_impl_three_way_comparison < 201907L
6440 template<
typename _IntType>
6444 {
return !(__d1 == __d2); }
6449#if defined(_GLIBCXX_USE_OLD_PIECEWISE_DISTRIBUTIONS)
6450 template<
typename _Tp>
6451 using __piecewise_distributions_storage_t = double;
6452#elif defined(_GLIBCXX_USE_RESULT_TYPE_FOR_PIECEWISE_DENSITIES)
6453 template<
typename _Tp>
6454 using __piecewise_distributions_storage_t = _Tp;
6456 template<
typename _Tp>
6457 struct __piecewise_distributions_storage
6458 {
using type = _Tp; };
6461 struct __piecewise_distributions_storage<float>
6462 {
using type = double; };
6464# ifdef _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT
6466 struct __piecewise_distributions_storage<__ibm128>
6467 {
using type = double; };
6470 struct __piecewise_distributions_storage<__ieee128>
6471 {
using type = double; };
6472# elif __LDBL_MANT_DIG__ != __DBL_MANT_DIG__
6474 struct __piecewise_distributions_storage<long double>
6475 {
using type = double; };
6478 template<
typename _Tp>
6479 using __piecewise_distributions_storage_t
6480 =
typename __piecewise_distributions_storage<_Tp>::type;
6500 template<
typename _RealType =
double>
6501 class piecewise_constant_distribution
6504 "result_type must be a floating point type");
6507 = __detail::__piecewise_distributions_storage_t<_RealType>;
6508#ifdef _GLIBCXX_USE_OLD_PIECEWISE_DISTRIBUTIONS
6509 using _CalcType = double;
6511 using _CalcType = _RealType;
6521 typedef piecewise_constant_distribution<_RealType> distribution_type;
6522 friend class piecewise_constant_distribution<_RealType>;
6525 : _M_int(), _M_den(), _M_cp()
6528 template<
typename _InputIteratorB,
typename _InputIteratorW>
6529 param_type(_InputIteratorB __bfirst,
6530 _InputIteratorB __bend,
6531 _InputIteratorW __wbegin);
6533 template<
typename _Func>
6536 template<
typename _Func>
6537 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
6541 param_type(
const param_type&) =
default;
6542 param_type& operator=(
const param_type&) =
default;
6550 __tmp[1] = _RealType(1);
6557#ifdef _GLIBCXX_USE_OLD_PIECEWISE_DISTRIBUTIONS
6564 [[__gnu__::__abi_tag__(
"__rt")]]
6568#pragma GCC diagnostic push
6569#pragma GCC diagnostic ignored "-Wc++17-extensions"
6576#pragma GCC diagnostic pop
6581 operator==(
const param_type& __p1,
const param_type& __p2)
6582 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
6584#if __cpp_impl_three_way_comparison < 201907L
6586 operator!=(
const param_type& __p1,
const param_type& __p2)
6587 {
return !(__p1 == __p2); }
6595 _M_initialize2(
const _RealType* __ints, _CalcType __den);
6601 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6607 piecewise_constant_distribution()
6611 template<
typename _InputIteratorB,
typename _InputIteratorW>
6613 _InputIteratorB __bend,
6614 _InputIteratorW __wbegin)
6615 : _M_param(__bfirst, __bend, __wbegin)
6618 template<
typename _Func>
6619 piecewise_constant_distribution(initializer_list<_RealType> __bl,
6621 : _M_param(__bl, __fw)
6624 template<
typename _Func>
6625 piecewise_constant_distribution(
size_t __nw,
6626 _RealType __xmin, _RealType __xmax,
6628 : _M_param(__nw, __xmin, __xmax, __fw)
6632 piecewise_constant_distribution(
const param_type& __p)
6648 {
return _M_param.intervals(); }
6653#ifdef _GLIBCXX_USE_OLD_PIECEWISE_DISTRIBUTIONS
6656 {
return _M_param.densities(); }
6658 [[__gnu__::__always_inline__]]
6661 {
return _M_param.densities(); }
6669 {
return _M_param; }
6676 param(
const param_type& __param)
6677 { _M_param = __param; }
6685 return _M_param._M_int.empty()
6695 return _M_param._M_int.empty()
6702 template<
typename _UniformRandomNumberGenerator>
6704 operator()(_UniformRandomNumberGenerator& __urng)
6705 {
return this->
operator()(__urng, _M_param); }
6707 template<
typename _UniformRandomNumberGenerator>
6709 operator()(_UniformRandomNumberGenerator& __urng,
6710 const param_type& __p);
6712 template<
typename _ForwardIterator,
6713 typename _UniformRandomNumberGenerator>
6715 __generate(_ForwardIterator __f, _ForwardIterator __t,
6716 _UniformRandomNumberGenerator& __urng)
6717 { this->__generate(__f, __t, __urng, _M_param); }
6719 template<
typename _ForwardIterator,
6720 typename _UniformRandomNumberGenerator>
6722 __generate(_ForwardIterator __f, _ForwardIterator __t,
6723 _UniformRandomNumberGenerator& __urng,
6724 const param_type& __p)
6725 { this->__generate_impl(__f, __t, __urng, __p); }
6727 template<
typename _UniformRandomNumberGenerator>
6730 _UniformRandomNumberGenerator& __urng,
6732 { this->__generate_impl(__f, __t, __urng, __p); }
6739 operator==(
const piecewise_constant_distribution& __d1,
6740 const piecewise_constant_distribution& __d2)
6741 {
return __d1._M_param == __d2._M_param; }
6754 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6770 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6776 template<
typename _AdaptedUniformRandomNumberGenerator>
6778 __generate_one(_AdaptedUniformRandomNumberGenerator& __aurng,
6779 const param_type& __param);
6781 template<
typename _ForwardIterator,
6782 typename _UniformRandomNumberGenerator>
6784 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6785 _UniformRandomNumberGenerator& __urng,
6786 const param_type& __p);
6788 param_type _M_param;
6791#if __cpp_impl_three_way_comparison < 201907L
6796 template<
typename _RealType>
6800 {
return !(__d1 == __d2); }
6815 template<
typename _RealType =
double>
6816 class piecewise_linear_distribution
6819 "result_type must be a floating point type");
6822 = __detail::__piecewise_distributions_storage_t<_RealType>;
6823#ifdef _GLIBCXX_USE_OLD_PIECEWISE_DISTRIBUTIONS
6824 using _CalcType = double;
6826 using _CalcType = _RealType;
6836 typedef piecewise_linear_distribution<_RealType> distribution_type;
6837 friend class piecewise_linear_distribution<_RealType>;
6840 : _M_int(), _M_den(), _M_cp(), _M_m()
6843 template<
typename _InputIteratorB,
typename _InputIteratorW>
6844 param_type(_InputIteratorB __bfirst,
6845 _InputIteratorB __bend,
6846 _InputIteratorW __wbegin);
6848 template<
typename _Func>
6851 template<
typename _Func>
6852 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
6856 param_type(
const param_type&) =
default;
6857 param_type& operator=(
const param_type&) =
default;
6865 __tmp[1] = _RealType(1);
6872#ifdef _GLIBCXX_USE_OLD_PIECEWISE_DISTRIBUTIONS
6879 [[__gnu__::__abi_tag__(
"__rt")]]
6883#pragma GCC diagnostic push
6884#pragma GCC diagnostic ignored "-Wc++17-extensions"
6891#pragma GCC diagnostic pop
6896 operator==(
const param_type& __p1,
const param_type& __p2)
6897 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
6899#if __cpp_impl_three_way_comparison < 201907L
6901 operator!=(
const param_type& __p1,
const param_type& __p2)
6902 {
return !(__p1 == __p2); }
6910 _M_initialize2(
const _RealType* __ints,
const _CalcType* __dens);
6917 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6923 piecewise_linear_distribution()
6927 template<
typename _InputIteratorB,
typename _InputIteratorW>
6929 _InputIteratorB __bend,
6930 _InputIteratorW __wbegin)
6931 : _M_param(__bfirst, __bend, __wbegin)
6934 template<
typename _Func>
6935 piecewise_linear_distribution(initializer_list<_RealType> __bl,
6937 : _M_param(__bl, __fw)
6940 template<
typename _Func>
6941 piecewise_linear_distribution(
size_t __nw,
6942 _RealType __xmin, _RealType __xmax,
6944 : _M_param(__nw, __xmin, __xmax, __fw)
6948 piecewise_linear_distribution(
const param_type& __p)
6964 {
return _M_param.intervals(); }
6970#ifdef _GLIBCXX_USE_OLD_PIECEWISE_DISTRIBUTIONS
6973 {
return _M_param.densities(); }
6975 [[__gnu__::__always_inline__]]
6978 {
return _M_param.densities(); }
6986 {
return _M_param; }
6993 param(
const param_type& __param)
6994 { _M_param = __param; }
7002 return _M_param._M_int.empty()
7012 return _M_param._M_int.empty()
7019 template<
typename _UniformRandomNumberGenerator>
7021 operator()(_UniformRandomNumberGenerator& __urng)
7022 {
return this->
operator()(__urng, _M_param); }
7024 template<
typename _UniformRandomNumberGenerator>
7026 operator()(_UniformRandomNumberGenerator& __urng,
7027 const param_type& __p);
7029 template<
typename _ForwardIterator,
7030 typename _UniformRandomNumberGenerator>
7032 __generate(_ForwardIterator __f, _ForwardIterator __t,
7033 _UniformRandomNumberGenerator& __urng)
7034 { this->__generate(__f, __t, __urng, _M_param); }
7036 template<
typename _ForwardIterator,
7037 typename _UniformRandomNumberGenerator>
7039 __generate(_ForwardIterator __f, _ForwardIterator __t,
7040 _UniformRandomNumberGenerator& __urng,
7041 const param_type& __p)
7042 { this->__generate_impl(__f, __t, __urng, __p); }
7044 template<
typename _UniformRandomNumberGenerator>
7047 _UniformRandomNumberGenerator& __urng,
7049 { this->__generate_impl(__f, __t, __urng, __p); }
7056 operator==(
const piecewise_linear_distribution& __d1,
7057 const piecewise_linear_distribution& __d2)
7058 {
return __d1._M_param == __d2._M_param; }
7071 template<
typename _RealType1,
typename _CharT,
typename _Traits>
7087 template<
typename _RealType1,
typename _CharT,
typename _Traits>
7093 template<
typename _AdaptedUniformRandomNumberGenerator>
7095 __generate_one(_AdaptedUniformRandomNumberGenerator& __aurng,
7096 const param_type& __param);
7098 template<
typename _ForwardIterator,
7099 typename _UniformRandomNumberGenerator>
7101 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
7102 _UniformRandomNumberGenerator& __urng,
7103 const param_type& __p);
7105 param_type _M_param;
7108#if __cpp_impl_three_way_comparison < 201907L
7113 template<
typename _RealType>
7117 {
return !(__d1 == __d2); }
7148 template<
typename _IntType,
typename = _Require<is_
integral<_IntType>>>
7151 template<
typename _InputIterator>
7152 seed_seq(_InputIterator __begin, _InputIterator __end);
7155 template<
typename _RandomAccessIterator>
7157 generate(_RandomAccessIterator __begin, _RandomAccessIterator __end);
7160 size_t size() const noexcept
7161 {
return _M_v.
size(); }
7163 template<
typename _OutputIterator>
7165 param(_OutputIterator __dest)
const
7166 { std::copy(_M_v.
begin(), _M_v.
end(), __dest); }
7173 std::vector<result_type> _M_v;
7180_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