38namespace std _GLIBCXX_VISIBILITY(default)
40_GLIBCXX_BEGIN_NAMESPACE_VERSION
54#ifndef _GLIBCXX_USE_OLD_GENERATE_CANONICAL
55_GLIBCXX_BEGIN_INLINE_ABI_NAMESPACE(_V2)
62 template<
typename _RealType,
size_t __bits,
63 typename _UniformRandomNumberGenerator>
66#ifndef _GLIBCXX_USE_OLD_GENERATE_CANONICAL
67_GLIBCXX_END_INLINE_ABI_NAMESPACE(_V2)
74#pragma GCC diagnostic push
75#pragma GCC diagnostic ignored "-Wc++17-extensions"
77#ifndef __SIZEOF_INT128__
83 using type = __rand_uint128;
85 __rand_uint128() =
default;
88 __rand_uint128(uint64_t __lo) noexcept : _M_lo(__lo) { }
90 __rand_uint128(
const __rand_uint128&) =
default;
91 __rand_uint128& operator=(
const __rand_uint128&) =
default;
93 _GLIBCXX14_CONSTEXPR type&
94 operator=(uint64_t __x)
noexcept
95 {
return *
this = type(__x); }
97 _GLIBCXX14_CONSTEXPR type&
99 {
return *
this = *
this + 1; }
101 _GLIBCXX14_CONSTEXPR type&
102 operator--() noexcept
103 {
return *
this = *
this - 1; }
105 _GLIBCXX14_CONSTEXPR type
106 operator++(
int)
noexcept
113 _GLIBCXX14_CONSTEXPR type
114 operator--(
int)
noexcept
121 _GLIBCXX14_CONSTEXPR type&
122 operator+=(
const type& __r)
noexcept
124 _M_hi += __r._M_hi + __builtin_add_overflow(_M_lo, __r._M_lo, &_M_lo);
128 friend _GLIBCXX14_CONSTEXPR type
129 operator+(type __l,
const type& __r)
noexcept
130 {
return __l += __r; }
133 friend _GLIBCXX14_CONSTEXPR type
134 operator+(type __l, uint64_t __r)
noexcept
135 {
return __l += type(__r); }
138 _GLIBCXX14_CONSTEXPR type&
139 operator-=(uint64_t __r)
noexcept
141 _M_hi -= __builtin_sub_overflow(_M_lo, __r, &_M_lo);
145 friend _GLIBCXX14_CONSTEXPR type
146 operator-(type __l, uint64_t __r)
noexcept
147 {
return __l -= __r; }
149 _GLIBCXX14_CONSTEXPR type&
150 operator*=(
const type& __x)
noexcept
153 uint32_t(_M_lo), _M_lo >> 32,
154 uint32_t(_M_hi), _M_hi >> 32,
155 uint32_t(__x._M_lo), __x._M_lo >> 32,
156 uint32_t(__x._M_hi), __x._M_hi >> 32,
159 for (
int __i = 0; __i < 4; ++__i)
162 for (
int __j = __i; __j < 4; ++__j)
164 __c += __a[__i] * __a[4 + __j - __i] + __a[8 + __j];
165 __a[8 + __j] = uint32_t(__c);
169 _M_lo = __a[8] + (__a[9] << 32);
170 _M_hi = __a[10] + (__a[11] << 32);
176 _GLIBCXX14_CONSTEXPR type&
177 operator*=(uint64_t __x)
noexcept
183 constexpr uint64_t __mask = 0xffffffff;
184 uint64_t __ll[2] = { _M_lo >> 32, _M_lo & __mask };
185 uint64_t __xx[2] = { __x >> 32, __x & __mask };
186 uint64_t __l0x0 = __ll[0] * __xx[0];
187 uint64_t __l0x1 = __ll[0] * __xx[1];
188 uint64_t __l1x0 = __ll[1] * __xx[0];
189 uint64_t __l1x1 = __ll[1] * __xx[1];
192 = (__l0x1 & __mask) + (__l1x0 & __mask) + (__l1x1 >> 32);
193 _M_hi = __l0x0 + (__l0x1 >> 32) + (__l1x0 >> 32) + (__mid >> 32);
194 _M_lo = (__mid << 32) + (__l1x1 & __mask);
198 _GLIBCXX14_CONSTEXPR type&
199 operator/=(
const type& __r)
noexcept
204 _M_lo = _M_lo / __r._M_lo;
211 uint32_t(_M_lo), _M_lo >> 32,
212 uint32_t(_M_hi), _M_hi >> 32,
214 uint32_t(__r._M_lo), __r._M_lo >> 32,
215 uint32_t(__r._M_hi), __r._M_hi >> 32,
219 uint64_t __c = 0, __w = 0;
220 if (!__r._M_hi && __r._M_lo <= ~uint32_t(0))
221 for (
int __i = 3; ; --__i)
223 __w = __a[__i] + (__c << 32);
224 __a[9 + __i] = __w / __r._M_lo;
227 __c = __w % __r._M_lo;
232 int __n = 0, __d = 0;
233 uint64_t __q = 0, __s = 0;
234 for (__d = 3; __a[5 + __d] == 0; --__d)
236 __s = (uint64_t(1) << 32) / (__a[5 + __d] + 1);
239 for (
int __i = 0; __i <= 3; ++__i)
241 __w = __a[__i] * __s + __c;
242 __a[__i] = uint32_t(__w);
247 for (
int __i = 0; __i <= 3; ++__i)
249 __w = __a[5 + __i] * __s + __c;
250 __a[5 + __i] = uint32_t(__w);
257 for (
int __i = __n - __d - 1; __i >= 0; --__i)
260 __w = (__a[__n] << 32) + __a[__n - 1];
261 if (__a[__n] != __a[5 + __d])
262 __q = __w / __a[5 + __d];
265 uint64_t __t = __w - __q * __a[5 + __d];
266 if (__t <= ~uint32_t(0)
267 && __a[4 + __d] * __q > (__t << 32) + __a[__n - 2])
270 for (
int __j = 0; __j <= __d; ++__j)
272 __w = __q * __a[5 + __j] + __c;
274 __w = __a[__i + __j] - uint32_t(__w);
275 __a[__i + __j] = uint32_t(__w);
276 __c += (__w >> 32) != 0;
278 if (int64_t(__a[__n]) < int64_t(__c))
282 for (
int __j = 0; __j <= __d; ++__j)
284 __w = __a[__i + __j] + __a[5 + __j] + __c;
286 __a[__i + __j] = uint32_t(__w);
293 _M_lo = __a[9] + (__a[10] << 32);
294 _M_hi = __a[11] + (__a[12] << 32);
300 _GLIBCXX14_CONSTEXPR type&
301 operator%=(uint64_t __m)
noexcept
309 int __shift = __builtin_clzll(__m) + 64 - __builtin_clzll(_M_hi);
313 __x._M_hi = __m << (__shift - 64);
318 __x._M_hi = __m >> (64 - __shift);
319 __x._M_lo = __m << __shift;
322 while (_M_hi != 0 || _M_lo >= __m)
327 _M_hi -= __builtin_sub_overflow(_M_lo, __x._M_lo,
330 __x._M_lo = (__x._M_lo >> 1) | (__x._M_hi << 63);
336 friend _GLIBCXX14_CONSTEXPR type
337 operator*(type __l,
const type& __r)
noexcept
338 {
return __l *= __r; }
340 friend _GLIBCXX14_CONSTEXPR type
341 operator*(type __l, uint64_t __r)
noexcept
342 {
return __l *= __r; }
344 friend _GLIBCXX14_CONSTEXPR type
345 operator/(type __l,
const type& __r)
noexcept
346 {
return __l /= __r; }
348 friend _GLIBCXX14_CONSTEXPR type
349 operator%(type __l, uint64_t __m)
noexcept
350 {
return __l %= __m; }
352 friend _GLIBCXX14_CONSTEXPR type
353 operator~(type __v)
noexcept
355 __v._M_hi = ~__v._M_hi;
356 __v._M_lo = ~__v._M_lo;
360 _GLIBCXX14_CONSTEXPR type&
361 operator>>=(
unsigned __c)
noexcept
365 _M_lo = _M_hi >>= (__c - 64);
370 _M_lo = (_M_lo >> __c) | (_M_hi << (64 - __c));
376 _GLIBCXX14_CONSTEXPR type&
377 operator<<=(
unsigned __c)
noexcept
381 _M_hi = _M_lo << (__c - 64);
386 _M_hi = (_M_hi << __c) | (_M_lo >> (64 - __c));
392 friend _GLIBCXX14_CONSTEXPR type
394 {
return __x >>= __c; }
396 friend _GLIBCXX14_CONSTEXPR type
398 {
return __x <<= __c; }
400 _GLIBCXX14_CONSTEXPR type&
401 operator|=(
const type& __r)
noexcept
408 _GLIBCXX14_CONSTEXPR type&
409 operator^=(
const type& __r)
noexcept
416 _GLIBCXX14_CONSTEXPR type&
417 operator&=(
const type& __r)
noexcept
424 friend _GLIBCXX14_CONSTEXPR type
425 operator|(type __l,
const type& __r)
noexcept
426 {
return __l |= __r; }
428 friend _GLIBCXX14_CONSTEXPR type
429 operator^(type __l,
const type& __r)
noexcept
430 {
return __l ^= __r; }
432 friend _GLIBCXX14_CONSTEXPR type
433 operator&(type __l,
const type& __r)
noexcept
434 {
return __l &= __r; }
436 friend _GLIBCXX14_CONSTEXPR type
437 operator&(type __l, uint64_t __r)
noexcept
444#if __cpp_impl_three_way_comparison >= 201907L
445 friend std::strong_ordering
446 operator<=>(
const type&,
const type&) =
default;
449 operator==(
const type&,
const type&) =
default;
451 friend constexpr bool
452 operator==(
const type& __l,
const type& __r)
noexcept
453 {
return __l._M_hi == __r._M_hi && __l._M_lo == __r._M_lo; }
455 friend _GLIBCXX14_CONSTEXPR
bool
456 operator<(
const type& __l,
const type& __r)
noexcept
458 if (__l._M_hi < __r._M_hi)
460 else if (__l._M_hi == __r._M_hi)
461 return __l._M_lo < __r._M_lo;
466 friend _GLIBCXX14_CONSTEXPR
bool
467 operator>(
const type& __l,
const type& __r)
noexcept
468 {
return __r < __l; }
470 friend _GLIBCXX14_CONSTEXPR
bool
471 operator<=(
const type& __l,
const type& __r)
noexcept
472 {
return !(__r < __l); }
474 friend _GLIBCXX14_CONSTEXPR
bool
475 operator>=(
const type& __l,
const type& __r)
noexcept
476 {
return !(__l < __r); }
479 friend _GLIBCXX14_CONSTEXPR
bool
480 operator==(
const type& __l, uint64_t __r)
noexcept
481 {
return __l == type(__r); }
483 template<
typename _RealT>
484 constexpr explicit operator _RealT() const noexcept
486 static_assert(std::is_floating_point<_RealT>::value,
487 "template argument must be a floating point type");
490 : _RealT(_M_hi) * _RealT(18446744073709551616.0)
495 constexpr explicit operator uint64_t() const noexcept
503 template<
typename _UIntType,
size_t __w,
504 bool = __w < static_cast<size_t>
507 {
static constexpr _UIntType __value = 0; };
509 template<
typename _UIntType,
size_t __w>
510 struct _Shift<_UIntType, __w, true>
511 {
static constexpr _UIntType __value = _UIntType(1) << __w; };
514 int __which = ((__s <= __CHAR_BIT__ *
sizeof (int))
515 + (__s <= __CHAR_BIT__ *
sizeof (long))
516 + (__s <= __CHAR_BIT__ *
sizeof (
long long))
519 struct _Select_uint_least_t
521 static_assert(__which < 0,
522 "sorry, would be too much trouble for a slow result");
526 struct _Select_uint_least_t<__s, 4>
527 {
using type =
unsigned int; };
530 struct _Select_uint_least_t<__s, 3>
531 {
using type =
unsigned long; };
534 struct _Select_uint_least_t<__s, 2>
535 {
using type =
unsigned long long; };
537#if __SIZEOF_INT128__ > __SIZEOF_LONG_LONG__
539 struct _Select_uint_least_t<__s, 1>
540 { __extension__
using type =
unsigned __int128; };
541#elif __has_builtin(__builtin_add_overflow) \
542 && __has_builtin(__builtin_sub_overflow) \
543 && defined __UINT64_TYPE__
545 struct _Select_uint_least_t<__s, 1>
546 {
using type = __rand_uint128; };
550 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
551 bool __big_enough = (!(__m & (__m - 1))
552 || (_Tp(-1) - __c) / __a >= __m - 1),
553 bool __schrage_ok = __m % __a < __m / __a>
560 =
typename _Select_uint_least_t<
std::__lg(__a)
562 return static_cast<_Tp
>((_Tp2(__a) * __x + __c) % __m);
567 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c>
568 struct _Mod<_Tp, __m, __a, __c, false, true>
577 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
bool __s>
578 struct _Mod<_Tp, __m, __a, __c, true, __s>
583 _Tp __res = __a * __x + __c;
590 template<
typename _Tp, _Tp __m, _Tp __a = 1, _Tp __c = 0>
594 if constexpr (__a == 0)
597 return _Mod<_Tp, __m, __a, __c>::__calc(__x);
604 template<
typename _Engine,
typename _DInputType>
607 static_assert(std::is_floating_point<_DInputType>::value,
608 "template argument must be a floating point type");
611 _Adaptor(_Engine& __g)
616 {
return _DInputType(0); }
620 {
return _DInputType(1); }
644 template<
typename _Sseq>
645 using __seed_seq_generate_t =
decltype(
649 template<
typename _Sseq,
typename _Engine,
typename _Res,
650 typename _GenerateCheck = __seed_seq_generate_t<_Sseq>>
651 using _If_seed_seq_for = _Require<
652 __not_<is_same<__remove_cvref_t<_Sseq>, _Engine>>,
653 is_unsigned<typename _Sseq::result_type>,
654 __not_<is_convertible<_Sseq, _Res>>
657#pragma GCC diagnostic pop
702 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
706 "result_type must be an unsigned integral type");
707 static_assert(__m == 0u || (__a < __m && __c < __m),
708 "template argument substituting __m out of bounds");
710 template<
typename _Sseq>
751 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
772 template<
typename _Sseq>
784 {
return __c == 0u ? 1u : 0u; }
797 discard(
unsigned long long __z)
799 for (; __z != 0ULL; --__z)
809 _M_x = __detail::__mod<_UIntType, __m, __a, __c>(_M_x);
827 {
return __lhs._M_x == __rhs._M_x; }
837 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
838 _UIntType1 __m1,
typename _CharT,
typename _Traits>
842 __a1, __c1, __m1>& __lcr);
857 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
858 _UIntType1 __m1,
typename _CharT,
typename _Traits>
868#if __cpp_impl_three_way_comparison < 201907L
880 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
886 {
return !(__lhs == __rhs); }
920 template<
typename _UIntType,
size_t __w,
921 size_t __n,
size_t __m,
size_t __r,
922 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
923 _UIntType __b,
size_t __t,
924 _UIntType __c,
size_t __l, _UIntType __f>
925 class mersenne_twister_engine
928 "result_type must be an unsigned integral type");
929 static_assert(1u <= __m && __m <= __n,
930 "template argument substituting __m out of bounds");
931 static_assert(__r <= __w,
"template argument substituting "
933 static_assert(__u <= __w,
"template argument substituting "
935 static_assert(__s <= __w,
"template argument substituting "
937 static_assert(__t <= __w,
"template argument substituting "
939 static_assert(__l <= __w,
"template argument substituting "
941 static_assert(__w <= std::numeric_limits<_UIntType>::digits,
942 "template argument substituting __w out of bound");
943 static_assert(__a <= (__detail::_Shift<_UIntType, __w>::__value - 1),
944 "template argument substituting __a out of bound");
945 static_assert(__b <= (__detail::_Shift<_UIntType, __w>::__value - 1),
946 "template argument substituting __b out of bound");
947 static_assert(__c <= (__detail::_Shift<_UIntType, __w>::__value - 1),
948 "template argument substituting __c out of bound");
949 static_assert(__d <= (__detail::_Shift<_UIntType, __w>::__value - 1),
950 "template argument substituting __d out of bound");
951 static_assert(__f <= (__detail::_Shift<_UIntType, __w>::__value - 1),
952 "template argument substituting __f out of bound");
954 template<
typename _Sseq>
956 = __detail::_If_seed_seq_for<_Sseq, mersenne_twister_engine,
964 static constexpr size_t word_size = __w;
965 static constexpr size_t state_size = __n;
966 static constexpr size_t shift_size = __m;
967 static constexpr size_t mask_bits = __r;
969 static constexpr size_t tempering_u = __u;
971 static constexpr size_t tempering_s = __s;
973 static constexpr size_t tempering_t = __t;
975 static constexpr size_t tempering_l = __l;
976 static constexpr result_type initialization_multiplier = __f;
981 mersenne_twister_engine() : mersenne_twister_engine(default_seed) { }
993 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
995 mersenne_twister_engine(_Sseq& __q)
999 seed(result_type __sd = default_seed);
1001 template<
typename _Sseq>
1017 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1023 discard(
unsigned long long __z);
1041 operator==(
const mersenne_twister_engine& __lhs,
1042 const mersenne_twister_engine& __rhs)
1043 {
return (std::equal(__lhs._M_x, __lhs._M_x + state_size, __rhs._M_x)
1044 && __lhs._M_p == __rhs._M_p); }
1058 template<
typename _UIntType1,
1059 size_t __w1,
size_t __n1,
1060 size_t __m1,
size_t __r1,
1061 _UIntType1 __a1,
size_t __u1,
1062 _UIntType1 __d1,
size_t __s1,
1063 _UIntType1 __b1,
size_t __t1,
1064 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
1065 typename _CharT,
typename _Traits>
1069 __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
1084 template<
typename _UIntType1,
1085 size_t __w1,
size_t __n1,
1086 size_t __m1,
size_t __r1,
1087 _UIntType1 __a1,
size_t __u1,
1088 _UIntType1 __d1,
size_t __s1,
1089 _UIntType1 __b1,
size_t __t1,
1090 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
1091 typename _CharT,
typename _Traits>
1095 __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
1101 _UIntType _M_x[state_size];
1105#if __cpp_impl_three_way_comparison < 201907L
1118 template<
typename _UIntType,
size_t __w,
1119 size_t __n,
size_t __m,
size_t __r,
1120 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
1121 _UIntType __b,
size_t __t,
1122 _UIntType __c,
size_t __l, _UIntType __f>
1125 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __lhs,
1127 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __rhs)
1128 {
return !(__lhs == __rhs); }
1149 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
1150 class subtract_with_carry_engine
1153 "result_type must be an unsigned integral type");
1154 static_assert(0u < __s && __s < __r,
1156 static_assert(0u < __w && __w <= std::numeric_limits<_UIntType>::digits,
1157 "template argument substituting __w out of bounds");
1159 template<
typename _Sseq>
1161 = __detail::_If_seed_seq_for<_Sseq, subtract_with_carry_engine,
1169 static constexpr size_t word_size = __w;
1170 static constexpr size_t short_lag = __s;
1171 static constexpr size_t long_lag = __r;
1172 static constexpr uint_least32_t default_seed = 19780503u;
1174 subtract_with_carry_engine() : subtract_with_carry_engine(0u)
1191 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1193 subtract_with_carry_engine(_Sseq& __q)
1215 template<
typename _Sseq>
1233 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1239 discard(
unsigned long long __z)
1241 for (; __z != 0ULL; --__z)
1264 operator==(
const subtract_with_carry_engine& __lhs,
1265 const subtract_with_carry_engine& __rhs)
1266 {
return (std::equal(__lhs._M_x, __lhs._M_x + long_lag, __rhs._M_x)
1267 && __lhs._M_carry == __rhs._M_carry
1268 && __lhs._M_p == __rhs._M_p); }
1282 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
1283 typename _CharT,
typename _Traits>
1301 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
1302 typename _CharT,
typename _Traits>
1310 _UIntType _M_x[long_lag];
1315#if __cpp_impl_three_way_comparison < 201907L
1328 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
1334 {
return !(__lhs == __rhs); }
1346 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
1349 static_assert(1 <= __r && __r <= __p,
1350 "template argument substituting __r out of bounds");
1356 template<
typename _Sseq>
1362 static constexpr size_t block_size = __p;
1363 static constexpr size_t used_block = __r;
1371 : _M_b(), _M_n(0) { }
1381 : _M_b(__rng), _M_n(0) { }
1391 : _M_b(
std::
move(__rng)), _M_n(0) { }
1401 : _M_b(__s), _M_n(0) { }
1408 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1411 : _M_b(__q), _M_n(0)
1441 template<
typename _Sseq>
1453 const _RandomNumberEngine&
1454 base() const noexcept
1462 {
return _RandomNumberEngine::min(); }
1469 {
return _RandomNumberEngine::max(); }
1475 discard(
unsigned long long __z)
1477 for (; __z != 0ULL; --__z)
1501 {
return __lhs._M_b == __rhs._M_b && __lhs._M_n == __rhs._M_n; }
1514 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1515 typename _CharT,
typename _Traits>
1532 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1533 typename _CharT,
typename _Traits>
1540 _RandomNumberEngine _M_b;
1544#if __cpp_impl_three_way_comparison < 201907L
1556 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
1562 {
return !(__lhs == __rhs); }
1572 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1576 "result_type must be an unsigned integral type");
1577 static_assert(0u < __w && __w <= std::numeric_limits<_UIntType>::digits,
1578 "template argument substituting __w out of bounds");
1580 template<
typename _Sseq>
1632 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1659 template<
typename _Sseq>
1668 const _RandomNumberEngine&
1669 base() const noexcept
1684 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1690 discard(
unsigned long long __z)
1692 for (; __z != 0ULL; --__z)
1717 {
return __lhs._M_b == __rhs._M_b; }
1731 template<
typename _CharT,
typename _Traits>
1735 __w, _UIntType>& __x)
1742 _RandomNumberEngine _M_b;
1745#if __cpp_impl_three_way_comparison < 201907L
1758 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1764 {
return !(__lhs == __rhs); }
1777 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType,
1778 typename _CharT,
typename _Traits>
1779 std::basic_ostream<_CharT, _Traits>&
1780 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1781 const std::independent_bits_engine<_RandomNumberEngine,
1782 __w, _UIntType>& __x)
1799 template<
typename _RandomNumberEngine,
size_t __k>
1802 static_assert(1u <= __k,
"template argument substituting "
1803 "__k out of bound");
1809 template<
typename _Sseq>
1814 static constexpr size_t table_size = __k;
1823 { _M_initialize(); }
1834 { _M_initialize(); }
1845 { _M_initialize(); }
1856 { _M_initialize(); }
1863 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1867 { _M_initialize(); }
1896 template<
typename _Sseq>
1907 const _RandomNumberEngine&
1908 base() const noexcept
1916 {
return _RandomNumberEngine::min(); }
1923 {
return _RandomNumberEngine::max(); }
1929 discard(
unsigned long long __z)
1931 for (; __z != 0ULL; --__z)
1955 {
return (__lhs._M_b == __rhs._M_b
1956 && std::equal(__lhs._M_v, __lhs._M_v + __k, __rhs._M_v)
1957 && __lhs._M_y == __rhs._M_y); }
1970 template<
typename _RandomNumberEngine1,
size_t __k1,
1971 typename _CharT,
typename _Traits>
1988 template<
typename _RandomNumberEngine1,
size_t __k1,
1989 typename _CharT,
typename _Traits>
1995 void _M_initialize()
1997 for (
size_t __i = 0; __i < __k; ++__i)
2002 _RandomNumberEngine _M_b;
2003 result_type _M_v[__k];
2007#if __cpp_impl_three_way_comparison < 201907L
2019 template<
typename _RandomNumberEngine,
size_t __k>
2025 {
return !(__lhs == __rhs); }
2028#if __glibcxx_philox_engine
2057 template<
typename _UIntType,
size_t __w,
size_t __n,
size_t __r,
2058 _UIntType... __consts>
2061 static_assert(__n == 2 || __n == 4,
2062 "template argument N must be either 2 or 4");
2063 static_assert(
sizeof...(__consts) == __n,
2064 "length of consts array must match specified N");
2065 static_assert(0 < __r,
"a number of rounds must be specified");
2066 static_assert((0 < __w && __w <= numeric_limits<_UIntType>::digits),
2067 "specified bitlength must match input type");
2069 template<
typename _Sseq>
2070 static constexpr bool __is_seed_seq =
requires {
2071 typename __detail::_If_seed_seq_for<_Sseq, philox_engine, _UIntType>;
2074 template <
size_t __ind0,
size_t __ind1>
2076 array<_UIntType, __n / 2>
2079 if constexpr (__n == 4)
2080 return {__consts...[__ind0], __consts...[__ind1]};
2082 return {__consts...[__ind0]};
2086 using result_type = _UIntType;
2088 static constexpr size_t word_size = __w;
2089 static constexpr size_t word_count = __n;
2090 static constexpr size_t round_count = __r;
2091 static constexpr array<result_type, __n / 2> multipliers
2092 = _S_popArray<0,2>();
2093 static constexpr array<result_type, __n / 2> round_consts
2094 = _S_popArray<1,3>();
2097 static constexpr result_type
2102 static constexpr result_type
2105 return ((1ull << (__w - 1)) | ((1ull << (__w - 1)) - 1));
2108 static constexpr result_type default_seed = 20111115u;
2116 philox_engine(result_type __value)
2117 : _M_x{}, _M_k{}, _M_y{}, _M_i(__n - 1)
2118 { _M_k[0] = __value &
max(); }
2124 template<
typename _Sseq>
requires __is_seed_seq<_Sseq>
2132 seed(result_type __value = default_seed)
2137 _M_k[0] = __value &
max();
2145 template<
typename _Sseq>
2147 seed(_Sseq& __q)
requires __is_seed_seq<_Sseq>;
2156 for (
size_t __j = 0; __j < __n; ++__j)
2157 _M_x[__j] = __counter[__n - 1 - __j] &
max();
2167 operator==(
const philox_engine&,
const philox_engine&) =
default;
2198 template<
typename _CharT,
typename _Traits>
2201 const philox_engine& __x)
2204 const _CharT __fill = __os.
fill();
2206 _CharT __space = __os.
widen(
' ');
2208 for (
auto& __subkey : __x._M_k)
2209 __os << __subkey << __space;
2210 for (
auto& __ctr : __x._M_x)
2211 __os << __ctr << __space;
2213 __os.
flags(__flags);
2225 template <
typename _CharT,
typename _Traits>
2232 for (
auto& __subkey : __x._M_k)
2234 for (
auto& __ctr : __x._M_x)
2237 unsigned char __setIndex = 0;
2238 for (
size_t __j = 0; __j < __x._M_x.size(); ++__j)
2240 if (__x._M_x[__j] > 0)
2246 for (
size_t __j = 0; __j <= __setIndex; ++__j)
2248 if (__j != __setIndex)
2249 __x._M_x[__j] =
max();
2254 __x._M_x = __tmpCtr;
2256 __is.
flags(__flags);
2263 array<_UIntType, __n / 2> _M_k;
2265 unsigned long long _M_i = 0;
2269 _S_mulhi(_UIntType __a, _UIntType __b);
2273 _S_mullo(_UIntType __a, _UIntType __b);
2288 typedef linear_congruential_engine<uint_fast32_t, 16807UL, 0UL, 2147483647UL>
2319 0xb5026f5aa96619e9ULL, 29,
2320 0x5555555555555555ULL, 17,
2321 0x71d67fffeda60000ULL, 37,
2322 0xfff7eee000000000ULL, 43,
2339#if __glibcxx_philox_engine
2345 0xCD9E8D57, 0x9E3779B9,
2352 0xCA5A826395121157, 0x9E3779B97F4A7C15,
2371 random_device() { _M_init(
"default"); }
2388 entropy() const noexcept
2389 {
return this->_M_getentropy(); }
2393 {
return this->_M_getval(); }
2396 random_device(
const random_device&) =
delete;
2397 void operator=(
const random_device&) =
delete;
2407 double _M_getentropy() const noexcept;
2409 void _M_init(const
char*,
size_t);
2439#if __cpp_impl_three_way_comparison < 201907L
2444 template<
typename _IntType>
2446 operator!=(
const std::uniform_int_distribution<_IntType>& __d1,
2447 const std::uniform_int_distribution<_IntType>& __d2)
2448 {
return !(__d1 == __d2); }
2461 template<
typename _IntType,
typename _CharT,
typename _Traits>
2462 std::basic_ostream<_CharT, _Traits>&
2463 operator<<(std::basic_ostream<_CharT, _Traits>&,
2464 const std::uniform_int_distribution<_IntType>&);
2475 template<
typename _IntType,
typename _CharT,
typename _Traits>
2476 std::basic_istream<_CharT, _Traits>&
2477 operator>>(std::basic_istream<_CharT, _Traits>&,
2478 std::uniform_int_distribution<_IntType>&);
2491 template<
typename _RealType =
double>
2495 "result_type must be a floating point type");
2506 param_type() : param_type(0) { }
2509 param_type(_RealType __a, _RealType __b = _RealType(1))
2510 : _M_a(__a), _M_b(__b)
2512 __glibcxx_assert(_M_a <= _M_b);
2524 operator==(
const param_type& __p1,
const param_type& __p2)
2525 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
2527#if __cpp_impl_three_way_comparison < 201907L
2529 operator!=(
const param_type& __p1,
const param_type& __p2)
2530 {
return !(__p1 == __p2); }
2554 : _M_param(__a, __b)
2572 {
return _M_param.a(); }
2576 {
return _M_param.b(); }
2583 {
return _M_param; }
2591 { _M_param = __param; }
2598 {
return this->a(); }
2605 {
return this->b(); }
2610 template<
typename _UniformRandomNumberGenerator>
2613 {
return this->
operator()(__urng, _M_param); }
2615 template<
typename _UniformRandomNumberGenerator>
2617 operator()(_UniformRandomNumberGenerator& __urng,
2618 const param_type& __p)
2620 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
2622 return (__aurng() * (__p.b() - __p.a())) + __p.a();
2625 template<
typename _ForwardIterator,
2626 typename _UniformRandomNumberGenerator>
2628 __generate(_ForwardIterator __f, _ForwardIterator __t,
2629 _UniformRandomNumberGenerator& __urng)
2630 { this->__generate(__f, __t, __urng, _M_param); }
2632 template<
typename _ForwardIterator,
2633 typename _UniformRandomNumberGenerator>
2635 __generate(_ForwardIterator __f, _ForwardIterator __t,
2636 _UniformRandomNumberGenerator& __urng,
2638 { this->__generate_impl(__f, __t, __urng, __p); }
2640 template<
typename _UniformRandomNumberGenerator>
2643 _UniformRandomNumberGenerator& __urng,
2645 { this->__generate_impl(__f, __t, __urng, __p); }
2654 {
return __d1._M_param == __d2._M_param; }
2657 template<
typename _ForwardIterator,
2658 typename _UniformRandomNumberGenerator>
2660 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2661 _UniformRandomNumberGenerator& __urng,
2662 const param_type& __p);
2664 param_type _M_param;
2667#if __cpp_impl_three_way_comparison < 201907L
2672 template<
typename _IntType>
2676 {
return !(__d1 == __d2); }
2689 template<
typename _RealType,
typename _CharT,
typename _Traits>
2690 std::basic_ostream<_CharT, _Traits>&
2691 operator<<(std::basic_ostream<_CharT, _Traits>&,
2692 const std::uniform_real_distribution<_RealType>&);
2703 template<
typename _RealType,
typename _CharT,
typename _Traits>
2704 std::basic_istream<_CharT, _Traits>&
2705 operator>>(std::basic_istream<_CharT, _Traits>&,
2706 std::uniform_real_distribution<_RealType>&);
2728 template<
typename _RealType =
double>
2729 class normal_distribution
2732 "result_type must be a floating point type");
2741 typedef normal_distribution<_RealType> distribution_type;
2743 param_type() : param_type(0.0) { }
2746 param_type(_RealType __mean, _RealType __stddev = _RealType(1))
2747 : _M_mean(__mean), _M_stddev(__stddev)
2749 __glibcxx_assert(_M_stddev > _RealType(0));
2758 {
return _M_stddev; }
2761 operator==(
const param_type& __p1,
const param_type& __p2)
2762 {
return (__p1._M_mean == __p2._M_mean
2763 && __p1._M_stddev == __p2._M_stddev); }
2765#if __cpp_impl_three_way_comparison < 201907L
2767 operator!=(
const param_type& __p1,
const param_type& __p2)
2768 {
return !(__p1 == __p2); }
2773 _RealType _M_stddev;
2777 normal_distribution() : normal_distribution(0.0) { }
2786 : _M_param(__mean, __stddev)
2799 { _M_saved_available =
false; }
2806 {
return _M_param.mean(); }
2813 {
return _M_param.stddev(); }
2820 {
return _M_param; }
2828 { _M_param = __param; }
2847 template<
typename _UniformRandomNumberGenerator>
2850 {
return this->
operator()(__urng, _M_param); }
2852 template<
typename _UniformRandomNumberGenerator>
2855 const param_type& __p);
2857 template<
typename _ForwardIterator,
2858 typename _UniformRandomNumberGenerator>
2860 __generate(_ForwardIterator __f, _ForwardIterator __t,
2861 _UniformRandomNumberGenerator& __urng)
2862 { this->__generate(__f, __t, __urng, _M_param); }
2864 template<
typename _ForwardIterator,
2865 typename _UniformRandomNumberGenerator>
2867 __generate(_ForwardIterator __f, _ForwardIterator __t,
2868 _UniformRandomNumberGenerator& __urng,
2869 const param_type& __p)
2870 { this->__generate_impl(__f, __t, __urng, __p); }
2872 template<
typename _UniformRandomNumberGenerator>
2874 __generate(result_type* __f, result_type* __t,
2875 _UniformRandomNumberGenerator& __urng,
2876 const param_type& __p)
2877 { this->__generate_impl(__f, __t, __urng, __p); }
2884 template<
typename _RealType1>
2899 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2914 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2920 template<
typename _ForwardIterator,
2921 typename _UniformRandomNumberGenerator>
2923 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2924 _UniformRandomNumberGenerator& __urng,
2925 const param_type& __p);
2927 param_type _M_param;
2929 bool _M_saved_available =
false;
2932#if __cpp_impl_three_way_comparison < 201907L
2936 template<
typename _RealType>
2940 {
return !(__d1 == __d2); }
2955 template<
typename _RealType =
double>
2956 class lognormal_distribution
2959 "result_type must be a floating point type");
2968 typedef lognormal_distribution<_RealType> distribution_type;
2970 param_type() : param_type(0.0) { }
2973 param_type(_RealType __m, _RealType __s = _RealType(1))
2974 : _M_m(__m), _M_s(__s)
2986 operator==(
const param_type& __p1,
const param_type& __p2)
2987 {
return __p1._M_m == __p2._M_m && __p1._M_s == __p2._M_s; }
2989#if __cpp_impl_three_way_comparison < 201907L
2991 operator!=(
const param_type& __p1,
const param_type& __p2)
2992 {
return !(__p1 == __p2); }
3000 lognormal_distribution() : lognormal_distribution(0.0) { }
3004 : _M_param(__m, __s), _M_nd()
3008 lognormal_distribution(
const param_type& __p)
3009 : _M_param(__p), _M_nd()
3024 {
return _M_param.m(); }
3028 {
return _M_param.s(); }
3035 {
return _M_param; }
3043 { _M_param = __param; }
3062 template<
typename _UniformRandomNumberGenerator>
3065 {
return this->
operator()(__urng, _M_param); }
3067 template<
typename _UniformRandomNumberGenerator>
3069 operator()(_UniformRandomNumberGenerator& __urng,
3070 const param_type& __p)
3071 {
return std::exp(__p.s() * _M_nd(__urng) + __p.m()); }
3073 template<
typename _ForwardIterator,
3074 typename _UniformRandomNumberGenerator>
3076 __generate(_ForwardIterator __f, _ForwardIterator __t,
3077 _UniformRandomNumberGenerator& __urng)
3078 { this->__generate(__f, __t, __urng, _M_param); }
3080 template<
typename _ForwardIterator,
3081 typename _UniformRandomNumberGenerator>
3083 __generate(_ForwardIterator __f, _ForwardIterator __t,
3084 _UniformRandomNumberGenerator& __urng,
3086 { this->__generate_impl(__f, __t, __urng, __p); }
3088 template<
typename _UniformRandomNumberGenerator>
3091 _UniformRandomNumberGenerator& __urng,
3093 { this->__generate_impl(__f, __t, __urng, __p); }
3102 const lognormal_distribution& __d2)
3103 {
return (__d1._M_param == __d2._M_param
3104 && __d1._M_nd == __d2._M_nd); }
3116 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3131 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3137 template<
typename _ForwardIterator,
3138 typename _UniformRandomNumberGenerator>
3140 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3141 _UniformRandomNumberGenerator& __urng,
3142 const param_type& __p);
3144 param_type _M_param;
3149#if __cpp_impl_three_way_comparison < 201907L
3153 template<
typename _RealType>
3157 {
return !(__d1 == __d2); }
3180 template<
typename _RealType =
double>
3184 "result_type must be a floating point type");
3196 param_type() : param_type(1.0) { }
3199 param_type(_RealType __alpha_val, _RealType __beta_val = _RealType(1))
3200 : _M_alpha(__alpha_val), _M_beta(__beta_val)
3202 __glibcxx_assert(_M_alpha > _RealType(0));
3208 {
return _M_alpha; }
3215 operator==(
const param_type& __p1,
const param_type& __p2)
3216 {
return (__p1._M_alpha == __p2._M_alpha
3217 && __p1._M_beta == __p2._M_beta); }
3219#if __cpp_impl_three_way_comparison < 201907L
3221 operator!=(
const param_type& __p1,
const param_type& __p2)
3222 {
return !(__p1 == __p2); }
3232 _RealType _M_malpha, _M_a2;
3247 _RealType __beta_val = _RealType(1))
3248 : _M_param(__alpha_val, __beta_val), _M_nd()
3253 : _M_param(__p), _M_nd()
3268 {
return _M_param.alpha(); }
3275 {
return _M_param.beta(); }
3282 {
return _M_param; }
3290 { _M_param = __param; }
3309 template<
typename _UniformRandomNumberGenerator>
3312 {
return this->
operator()(__urng, _M_param); }
3314 template<
typename _UniformRandomNumberGenerator>
3317 const param_type& __p);
3319 template<
typename _ForwardIterator,
3320 typename _UniformRandomNumberGenerator>
3322 __generate(_ForwardIterator __f, _ForwardIterator __t,
3323 _UniformRandomNumberGenerator& __urng)
3324 { this->__generate(__f, __t, __urng, _M_param); }
3326 template<
typename _ForwardIterator,
3327 typename _UniformRandomNumberGenerator>
3329 __generate(_ForwardIterator __f, _ForwardIterator __t,
3330 _UniformRandomNumberGenerator& __urng,
3331 const param_type& __p)
3332 { this->__generate_impl(__f, __t, __urng, __p); }
3334 template<
typename _UniformRandomNumberGenerator>
3336 __generate(result_type* __f, result_type* __t,
3337 _UniformRandomNumberGenerator& __urng,
3338 const param_type& __p)
3339 { this->__generate_impl(__f, __t, __urng, __p); }
3349 {
return (__d1._M_param == __d2._M_param
3350 && __d1._M_nd == __d2._M_nd); }
3362 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3376 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3382 template<
typename _ForwardIterator,
3383 typename _UniformRandomNumberGenerator>
3385 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3386 _UniformRandomNumberGenerator& __urng,
3387 const param_type& __p);
3389 param_type _M_param;
3394#if __cpp_impl_three_way_comparison < 201907L
3398 template<
typename _RealType>
3402 {
return !(__d1 == __d2); }
3422 template<
typename _RealType =
double>
3423 class chi_squared_distribution
3426 "result_type must be a floating point type");
3435 typedef chi_squared_distribution<_RealType> distribution_type;
3437 param_type() : param_type(1) { }
3440 param_type(_RealType __n)
3449 operator==(
const param_type& __p1,
const param_type& __p2)
3450 {
return __p1._M_n == __p2._M_n; }
3452#if __cpp_impl_three_way_comparison < 201907L
3454 operator!=(
const param_type& __p1,
const param_type& __p2)
3455 {
return !(__p1 == __p2); }
3462 chi_squared_distribution() : chi_squared_distribution(1) { }
3466 : _M_param(__n), _M_gd(__n / 2)
3470 chi_squared_distribution(
const param_type& __p)
3471 : _M_param(__p), _M_gd(__p.n() / 2)
3486 {
return _M_param.n(); }
3493 {
return _M_param; }
3506 _M_gd.param(param_type(__param.n() / 2));
3526 template<
typename _UniformRandomNumberGenerator>
3529 {
return 2 * _M_gd(__urng); }
3531 template<
typename _UniformRandomNumberGenerator>
3533 operator()(_UniformRandomNumberGenerator& __urng,
3534 const param_type& __p)
3538 return 2 * _M_gd(__urng, param_type(__p.n() / 2));
3541 template<
typename _ForwardIterator,
3542 typename _UniformRandomNumberGenerator>
3544 __generate(_ForwardIterator __f, _ForwardIterator __t,
3545 _UniformRandomNumberGenerator& __urng)
3546 { this->__generate_impl(__f, __t, __urng); }
3548 template<
typename _ForwardIterator,
3549 typename _UniformRandomNumberGenerator>
3551 __generate(_ForwardIterator __f, _ForwardIterator __t,
3552 _UniformRandomNumberGenerator& __urng,
3554 {
typename std::gamma_distribution<result_type>::param_type
3556 this->__generate_impl(__f, __t, __urng, __p2); }
3558 template<
typename _UniformRandomNumberGenerator>
3561 _UniformRandomNumberGenerator& __urng)
3562 { this->__generate_impl(__f, __t, __urng); }
3564 template<
typename _UniformRandomNumberGenerator>
3567 _UniformRandomNumberGenerator& __urng,
3569 {
typename std::gamma_distribution<result_type>::param_type
3571 this->__generate_impl(__f, __t, __urng, __p2); }
3580 const chi_squared_distribution& __d2)
3581 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
3593 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3608 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3614 template<
typename _ForwardIterator,
3615 typename _UniformRandomNumberGenerator>
3617 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3618 _UniformRandomNumberGenerator& __urng);
3620 template<
typename _ForwardIterator,
3621 typename _UniformRandomNumberGenerator>
3623 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3624 _UniformRandomNumberGenerator& __urng,
3628 param_type _M_param;
3633#if __cpp_impl_three_way_comparison < 201907L
3637 template<
typename _RealType>
3641 {
return !(__d1 == __d2); }
3653 template<
typename _RealType =
double>
3654 class cauchy_distribution
3657 "result_type must be a floating point type");
3666 typedef cauchy_distribution<_RealType> distribution_type;
3668 param_type() : param_type(0) { }
3671 param_type(_RealType __a, _RealType __b = _RealType(1))
3672 : _M_a(__a), _M_b(__b)
3684 operator==(
const param_type& __p1,
const param_type& __p2)
3685 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
3687#if __cpp_impl_three_way_comparison < 201907L
3689 operator!=(
const param_type& __p1,
const param_type& __p2)
3690 {
return !(__p1 == __p2); }
3698 cauchy_distribution() : cauchy_distribution(0.0) { }
3702 : _M_param(__a, __b)
3706 cauchy_distribution(
const param_type& __p)
3722 {
return _M_param.a(); }
3726 {
return _M_param.b(); }
3733 {
return _M_param; }
3741 { _M_param = __param; }
3760 template<
typename _UniformRandomNumberGenerator>
3763 {
return this->
operator()(__urng, _M_param); }
3765 template<
typename _UniformRandomNumberGenerator>
3767 operator()(_UniformRandomNumberGenerator& __urng,
3768 const param_type& __p);
3770 template<
typename _ForwardIterator,
3771 typename _UniformRandomNumberGenerator>
3773 __generate(_ForwardIterator __f, _ForwardIterator __t,
3774 _UniformRandomNumberGenerator& __urng)
3775 { this->__generate(__f, __t, __urng, _M_param); }
3777 template<
typename _ForwardIterator,
3778 typename _UniformRandomNumberGenerator>
3780 __generate(_ForwardIterator __f, _ForwardIterator __t,
3781 _UniformRandomNumberGenerator& __urng,
3782 const param_type& __p)
3783 { this->__generate_impl(__f, __t, __urng, __p); }
3785 template<
typename _UniformRandomNumberGenerator>
3788 _UniformRandomNumberGenerator& __urng,
3790 { this->__generate_impl(__f, __t, __urng, __p); }
3798 const cauchy_distribution& __d2)
3799 {
return __d1._M_param == __d2._M_param; }
3802 template<
typename _ForwardIterator,
3803 typename _UniformRandomNumberGenerator>
3805 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3806 _UniformRandomNumberGenerator& __urng,
3807 const param_type& __p);
3809 param_type _M_param;
3812#if __cpp_impl_three_way_comparison < 201907L
3817 template<
typename _RealType>
3821 {
return !(__d1 == __d2); }
3834 template<
typename _RealType,
typename _CharT,
typename _Traits>
3835 std::basic_ostream<_CharT, _Traits>&
3836 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3837 const std::cauchy_distribution<_RealType>& __x);
3849 template<
typename _RealType,
typename _CharT,
typename _Traits>
3850 std::basic_istream<_CharT, _Traits>&
3851 operator>>(std::basic_istream<_CharT, _Traits>& __is,
3852 std::cauchy_distribution<_RealType>& __x);
3868 template<
typename _RealType =
double>
3869 class fisher_f_distribution
3872 "result_type must be a floating point type");
3881 typedef fisher_f_distribution<_RealType> distribution_type;
3883 param_type() : param_type(1) { }
3886 param_type(_RealType __m, _RealType __n = _RealType(1))
3887 : _M_m(__m), _M_n(__n)
3899 operator==(
const param_type& __p1,
const param_type& __p2)
3900 {
return __p1._M_m == __p2._M_m && __p1._M_n == __p2._M_n; }
3902#if __cpp_impl_three_way_comparison < 201907L
3904 operator!=(
const param_type& __p1,
const param_type& __p2)
3905 {
return !(__p1 == __p2); }
3913 fisher_f_distribution() : fisher_f_distribution(1.0) { }
3917 _RealType __n = _RealType(1))
3918 : _M_param(__m, __n), _M_gd_x(__m / 2), _M_gd_y(__n / 2)
3922 fisher_f_distribution(
const param_type& __p)
3923 : _M_param(__p), _M_gd_x(__p.m() / 2), _M_gd_y(__p.n() / 2)
3941 {
return _M_param.m(); }
3945 {
return _M_param.n(); }
3952 {
return _M_param; }
3965 _M_gd_x.param(param_type(__param.m() / 2));
3966 _M_gd_y.param(param_type(__param.n() / 2));
3986 template<
typename _UniformRandomNumberGenerator>
3989 {
return (_M_gd_x(__urng) * n()) / (_M_gd_y(__urng) * m()); }
3991 template<
typename _UniformRandomNumberGenerator>
3993 operator()(_UniformRandomNumberGenerator& __urng,
3994 const param_type& __p)
3998 return ((_M_gd_x(__urng, param_type(__p.m() / 2)) * n())
3999 / (_M_gd_y(__urng, param_type(__p.n() / 2)) * m()));
4002 template<
typename _ForwardIterator,
4003 typename _UniformRandomNumberGenerator>
4005 __generate(_ForwardIterator __f, _ForwardIterator __t,
4006 _UniformRandomNumberGenerator& __urng)
4007 { this->__generate_impl(__f, __t, __urng); }
4009 template<
typename _ForwardIterator,
4010 typename _UniformRandomNumberGenerator>
4012 __generate(_ForwardIterator __f, _ForwardIterator __t,
4013 _UniformRandomNumberGenerator& __urng,
4015 { this->__generate_impl(__f, __t, __urng, __p); }
4017 template<
typename _UniformRandomNumberGenerator>
4020 _UniformRandomNumberGenerator& __urng)
4021 { this->__generate_impl(__f, __t, __urng); }
4023 template<
typename _UniformRandomNumberGenerator>
4026 _UniformRandomNumberGenerator& __urng,
4028 { this->__generate_impl(__f, __t, __urng, __p); }
4037 const fisher_f_distribution& __d2)
4038 {
return (__d1._M_param == __d2._M_param
4039 && __d1._M_gd_x == __d2._M_gd_x
4040 && __d1._M_gd_y == __d2._M_gd_y); }
4052 template<
typename _RealType1,
typename _CharT,
typename _Traits>
4067 template<
typename _RealType1,
typename _CharT,
typename _Traits>
4073 template<
typename _ForwardIterator,
4074 typename _UniformRandomNumberGenerator>
4076 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4077 _UniformRandomNumberGenerator& __urng);
4079 template<
typename _ForwardIterator,
4080 typename _UniformRandomNumberGenerator>
4082 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4083 _UniformRandomNumberGenerator& __urng,
4084 const param_type& __p);
4086 param_type _M_param;
4091#if __cpp_impl_three_way_comparison < 201907L
4095 template<
typename _RealType>
4099 {
return !(__d1 == __d2); }
4114 template<
typename _RealType =
double>
4115 class student_t_distribution
4118 "result_type must be a floating point type");
4127 typedef student_t_distribution<_RealType> distribution_type;
4129 param_type() : param_type(1) { }
4132 param_type(_RealType __n)
4141 operator==(
const param_type& __p1,
const param_type& __p2)
4142 {
return __p1._M_n == __p2._M_n; }
4144#if __cpp_impl_three_way_comparison < 201907L
4146 operator!=(
const param_type& __p1,
const param_type& __p2)
4147 {
return !(__p1 == __p2); }
4154 student_t_distribution() : student_t_distribution(1.0) { }
4158 : _M_param(__n), _M_nd(), _M_gd(__n / 2, 2)
4162 student_t_distribution(
const param_type& __p)
4163 : _M_param(__p), _M_nd(), _M_gd(__p.n() / 2, 2)
4181 {
return _M_param.n(); }
4188 {
return _M_param; }
4201 _M_gd.param(param_type(__param.n() / 2, 2));
4221 template<
typename _UniformRandomNumberGenerator>
4224 {
return _M_nd(__urng) *
std::sqrt(n() / _M_gd(__urng)); }
4226 template<
typename _UniformRandomNumberGenerator>
4228 operator()(_UniformRandomNumberGenerator& __urng,
4229 const param_type& __p)
4234 const result_type __g = _M_gd(__urng, param_type(__p.n() / 2, 2));
4235 return _M_nd(__urng) *
std::sqrt(__p.n() / __g);
4238 template<
typename _ForwardIterator,
4239 typename _UniformRandomNumberGenerator>
4241 __generate(_ForwardIterator __f, _ForwardIterator __t,
4242 _UniformRandomNumberGenerator& __urng)
4243 { this->__generate_impl(__f, __t, __urng); }
4245 template<
typename _ForwardIterator,
4246 typename _UniformRandomNumberGenerator>
4248 __generate(_ForwardIterator __f, _ForwardIterator __t,
4249 _UniformRandomNumberGenerator& __urng,
4251 { this->__generate_impl(__f, __t, __urng, __p); }
4253 template<
typename _UniformRandomNumberGenerator>
4256 _UniformRandomNumberGenerator& __urng)
4257 { this->__generate_impl(__f, __t, __urng); }
4259 template<
typename _UniformRandomNumberGenerator>
4262 _UniformRandomNumberGenerator& __urng,
4264 { this->__generate_impl(__f, __t, __urng, __p); }
4273 const student_t_distribution& __d2)
4274 {
return (__d1._M_param == __d2._M_param
4275 && __d1._M_nd == __d2._M_nd && __d1._M_gd == __d2._M_gd); }
4287 template<
typename _RealType1,
typename _CharT,
typename _Traits>
4302 template<
typename _RealType1,
typename _CharT,
typename _Traits>
4308 template<
typename _ForwardIterator,
4309 typename _UniformRandomNumberGenerator>
4311 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4312 _UniformRandomNumberGenerator& __urng);
4313 template<
typename _ForwardIterator,
4314 typename _UniformRandomNumberGenerator>
4316 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4317 _UniformRandomNumberGenerator& __urng,
4318 const param_type& __p);
4320 param_type _M_param;
4326#if __cpp_impl_three_way_comparison < 201907L
4330 template<
typename _RealType>
4334 {
return !(__d1 == __d2); }
4365 param_type() : param_type(0.5) { }
4368 param_type(
double __p)
4371 __glibcxx_assert((_M_p >= 0.0) && (_M_p <= 1.0));
4379 operator==(
const param_type& __p1,
const param_type& __p2)
4380 {
return __p1._M_p == __p2._M_p; }
4382#if __cpp_impl_three_way_comparison < 201907L
4384 operator!=(
const param_type& __p1,
const param_type& __p2)
4385 {
return !(__p1 == __p2); }
4427 {
return _M_param.p(); }
4434 {
return _M_param; }
4442 { _M_param = __param; }
4461 template<
typename _UniformRandomNumberGenerator>
4464 {
return this->
operator()(__urng, _M_param); }
4466 template<
typename _UniformRandomNumberGenerator>
4468 operator()(_UniformRandomNumberGenerator& __urng,
4469 const param_type& __p)
4471 __detail::_Adaptor<_UniformRandomNumberGenerator, double>
4473 if ((__aurng() - __aurng.min())
4474 < __p.p() * (__aurng.max() - __aurng.min()))
4479 template<
typename _ForwardIterator,
4480 typename _UniformRandomNumberGenerator>
4482 __generate(_ForwardIterator __f, _ForwardIterator __t,
4483 _UniformRandomNumberGenerator& __urng)
4484 { this->__generate(__f, __t, __urng, _M_param); }
4486 template<
typename _ForwardIterator,
4487 typename _UniformRandomNumberGenerator>
4489 __generate(_ForwardIterator __f, _ForwardIterator __t,
4490 _UniformRandomNumberGenerator& __urng,
const param_type& __p)
4491 { this->__generate_impl(__f, __t, __urng, __p); }
4493 template<
typename _UniformRandomNumberGenerator>
4496 _UniformRandomNumberGenerator& __urng,
4498 { this->__generate_impl(__f, __t, __urng, __p); }
4507 {
return __d1._M_param == __d2._M_param; }
4510 template<
typename _ForwardIterator,
4511 typename _UniformRandomNumberGenerator>
4513 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4514 _UniformRandomNumberGenerator& __urng,
4515 const param_type& __p);
4517 param_type _M_param;
4520#if __cpp_impl_three_way_comparison < 201907L
4528 {
return !(__d1 == __d2); }
4541 template<
typename _CharT,
typename _Traits>
4542 std::basic_ostream<_CharT, _Traits>&
4543 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4544 const std::bernoulli_distribution& __x);
4555 template<
typename _CharT,
typename _Traits>
4556 inline std::basic_istream<_CharT, _Traits>&
4577 template<
typename _IntType =
int>
4578 class binomial_distribution
4581 "result_type must be an integral type");
4590 typedef binomial_distribution<_IntType> distribution_type;
4591 friend class binomial_distribution<_IntType>;
4593 param_type() : param_type(1) { }
4596 param_type(_IntType __t,
double __p = 0.5)
4597 : _M_t(__t), _M_p(__p)
4599 __glibcxx_assert((_M_t >= _IntType(0))
4614 operator==(
const param_type& __p1,
const param_type& __p2)
4615 {
return __p1._M_t == __p2._M_t && __p1._M_p == __p2._M_p; }
4617#if __cpp_impl_three_way_comparison < 201907L
4619 operator!=(
const param_type& __p1,
const param_type& __p2)
4620 {
return !(__p1 == __p2); }
4631#if _GLIBCXX_USE_C99_MATH_FUNCS
4632 double _M_d1, _M_d2, _M_s1, _M_s2, _M_c,
4633 _M_a1, _M_a123, _M_s, _M_lf, _M_lp1p;
4640 binomial_distribution() : binomial_distribution(1) { }
4644 : _M_param(__t, __p), _M_nd()
4648 binomial_distribution(
const param_type& __p)
4649 : _M_param(__p), _M_nd()
4664 {
return _M_param.t(); }
4671 {
return _M_param.p(); }
4678 {
return _M_param; }
4686 { _M_param = __param; }
4700 {
return _M_param.t(); }
4705 template<
typename _UniformRandomNumberGenerator>
4708 {
return this->
operator()(__urng, _M_param); }
4710 template<
typename _UniformRandomNumberGenerator>
4713 const param_type& __p);
4715 template<
typename _ForwardIterator,
4716 typename _UniformRandomNumberGenerator>
4718 __generate(_ForwardIterator __f, _ForwardIterator __t,
4719 _UniformRandomNumberGenerator& __urng)
4720 { this->__generate(__f, __t, __urng, _M_param); }
4722 template<
typename _ForwardIterator,
4723 typename _UniformRandomNumberGenerator>
4725 __generate(_ForwardIterator __f, _ForwardIterator __t,
4726 _UniformRandomNumberGenerator& __urng,
4727 const param_type& __p)
4728 { this->__generate_impl(__f, __t, __urng, __p); }
4730 template<
typename _UniformRandomNumberGenerator>
4732 __generate(result_type* __f, result_type* __t,
4733 _UniformRandomNumberGenerator& __urng,
4734 const param_type& __p)
4735 { this->__generate_impl(__f, __t, __urng, __p); }
4744 const binomial_distribution& __d2)
4745#ifdef _GLIBCXX_USE_C99_MATH_FUNCS
4746 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
4748 {
return __d1._M_param == __d2._M_param; }
4761 template<
typename _IntType1,
4762 typename _CharT,
typename _Traits>
4777 template<
typename _IntType1,
4778 typename _CharT,
typename _Traits>
4784 template<
typename _ForwardIterator,
4785 typename _UniformRandomNumberGenerator>
4787 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4788 _UniformRandomNumberGenerator& __urng,
4789 const param_type& __p);
4791 template<
typename _UniformRandomNumberGenerator>
4793 _M_waiting(_UniformRandomNumberGenerator& __urng,
4794 _IntType __t,
double __q);
4796 param_type _M_param;
4802#if __cpp_impl_three_way_comparison < 201907L
4806 template<
typename _IntType>
4810 {
return !(__d1 == __d2); }
4823 template<
typename _IntType =
int>
4824 class geometric_distribution
4827 "result_type must be an integral type");
4836 typedef geometric_distribution<_IntType> distribution_type;
4837 friend class geometric_distribution<_IntType>;
4839 param_type() : param_type(0.5) { }
4842 param_type(
double __p)
4845 __glibcxx_assert((_M_p > 0.0) && (_M_p < 1.0));
4854 operator==(
const param_type& __p1,
const param_type& __p2)
4855 {
return __p1._M_p == __p2._M_p; }
4857#if __cpp_impl_three_way_comparison < 201907L
4859 operator!=(
const param_type& __p1,
const param_type& __p2)
4860 {
return !(__p1 == __p2); }
4866 { _M_log_1_p =
std::log(1.0 - _M_p); }
4875 geometric_distribution() : geometric_distribution(0.5) { }
4883 geometric_distribution(
const param_type& __p)
4900 {
return _M_param.p(); }
4907 {
return _M_param; }
4915 { _M_param = __param; }
4934 template<
typename _UniformRandomNumberGenerator>
4937 {
return this->
operator()(__urng, _M_param); }
4939 template<
typename _UniformRandomNumberGenerator>
4941 operator()(_UniformRandomNumberGenerator& __urng,
4942 const param_type& __p);
4944 template<
typename _ForwardIterator,
4945 typename _UniformRandomNumberGenerator>
4947 __generate(_ForwardIterator __f, _ForwardIterator __t,
4948 _UniformRandomNumberGenerator& __urng)
4949 { this->__generate(__f, __t, __urng, _M_param); }
4951 template<
typename _ForwardIterator,
4952 typename _UniformRandomNumberGenerator>
4954 __generate(_ForwardIterator __f, _ForwardIterator __t,
4955 _UniformRandomNumberGenerator& __urng,
4956 const param_type& __p)
4957 { this->__generate_impl(__f, __t, __urng, __p); }
4959 template<
typename _UniformRandomNumberGenerator>
4962 _UniformRandomNumberGenerator& __urng,
4964 { this->__generate_impl(__f, __t, __urng, __p); }
4972 const geometric_distribution& __d2)
4973 {
return __d1._M_param == __d2._M_param; }
4976 template<
typename _ForwardIterator,
4977 typename _UniformRandomNumberGenerator>
4979 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4980 _UniformRandomNumberGenerator& __urng,
4981 const param_type& __p);
4983 param_type _M_param;
4986#if __cpp_impl_three_way_comparison < 201907L
4991 template<
typename _IntType>
4995 {
return !(__d1 == __d2); }
5008 template<
typename _IntType,
5009 typename _CharT,
typename _Traits>
5010 std::basic_ostream<_CharT, _Traits>&
5011 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5012 const std::geometric_distribution<_IntType>& __x);
5023 template<
typename _IntType,
5024 typename _CharT,
typename _Traits>
5025 std::basic_istream<_CharT, _Traits>&
5026 operator>>(std::basic_istream<_CharT, _Traits>& __is,
5027 std::geometric_distribution<_IntType>& __x);
5040 template<
typename _IntType =
int>
5041 class negative_binomial_distribution
5044 "result_type must be an integral type");
5053 typedef negative_binomial_distribution<_IntType> distribution_type;
5055 param_type() : param_type(1) { }
5058 param_type(_IntType __k,
double __p = 0.5)
5059 : _M_k(__k), _M_p(__p)
5061 __glibcxx_assert((_M_k > 0) && (_M_p > 0.0) && (_M_p <= 1.0));
5073 operator==(
const param_type& __p1,
const param_type& __p2)
5074 {
return __p1._M_k == __p2._M_k && __p1._M_p == __p2._M_p; }
5076#if __cpp_impl_three_way_comparison < 201907L
5078 operator!=(
const param_type& __p1,
const param_type& __p2)
5079 {
return !(__p1 == __p2); }
5087 negative_binomial_distribution() : negative_binomial_distribution(1) { }
5091 : _M_param(__k, __p), _M_gd(__k, (1.0 - __p) / __p)
5095 negative_binomial_distribution(
const param_type& __p)
5096 : _M_param(__p), _M_gd(__p.
k(), (1.0 - __p.
p()) / __p.
p())
5111 {
return _M_param.k(); }
5118 {
return _M_param.p(); }
5125 {
return _M_param; }
5138 _M_gd.param(param_type(__param.k(), (1.0 - __param.p()) / __param.p()));
5158 template<
typename _UniformRandomNumberGenerator>
5162 template<
typename _UniformRandomNumberGenerator>
5164 operator()(_UniformRandomNumberGenerator& __urng,
5165 const param_type& __p);
5167 template<
typename _ForwardIterator,
5168 typename _UniformRandomNumberGenerator>
5170 __generate(_ForwardIterator __f, _ForwardIterator __t,
5171 _UniformRandomNumberGenerator& __urng)
5172 { this->__generate_impl(__f, __t, __urng); }
5174 template<
typename _ForwardIterator,
5175 typename _UniformRandomNumberGenerator>
5177 __generate(_ForwardIterator __f, _ForwardIterator __t,
5178 _UniformRandomNumberGenerator& __urng,
5179 const param_type& __p)
5180 { this->__generate_impl(__f, __t, __urng, __p); }
5182 template<
typename _UniformRandomNumberGenerator>
5184 __generate(result_type* __f, result_type* __t,
5185 _UniformRandomNumberGenerator& __urng)
5186 { this->__generate_impl(__f, __t, __urng); }
5188 template<
typename _UniformRandomNumberGenerator>
5191 _UniformRandomNumberGenerator& __urng,
5193 { this->__generate_impl(__f, __t, __urng, __p); }
5202 const negative_binomial_distribution& __d2)
5203 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
5216 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5231 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5237 template<
typename _ForwardIterator,
5238 typename _UniformRandomNumberGenerator>
5240 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5241 _UniformRandomNumberGenerator& __urng);
5242 template<
typename _ForwardIterator,
5243 typename _UniformRandomNumberGenerator>
5245 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5246 _UniformRandomNumberGenerator& __urng,
5247 const param_type& __p);
5249 param_type _M_param;
5254#if __cpp_impl_three_way_comparison < 201907L
5258 template<
typename _IntType>
5262 {
return !(__d1 == __d2); }
5283 template<
typename _IntType =
int>
5284 class poisson_distribution
5287 "result_type must be an integral type");
5296 typedef poisson_distribution<_IntType> distribution_type;
5297 friend class poisson_distribution<_IntType>;
5299 param_type() : param_type(1.0) { }
5302 param_type(
double __mean)
5305 __glibcxx_assert(_M_mean > 0.0);
5314 operator==(
const param_type& __p1,
const param_type& __p2)
5315 {
return __p1._M_mean == __p2._M_mean; }
5317#if __cpp_impl_three_way_comparison < 201907L
5319 operator!=(
const param_type& __p1,
const param_type& __p2)
5320 {
return !(__p1 == __p2); }
5331#if _GLIBCXX_USE_C99_MATH_FUNCS
5332 double _M_lfm, _M_sm, _M_d, _M_scx, _M_1cx, _M_c2b, _M_cb;
5338 poisson_distribution() : poisson_distribution(1.0) { }
5342 : _M_param(__mean), _M_nd()
5346 poisson_distribution(
const param_type& __p)
5347 : _M_param(__p), _M_nd()
5362 {
return _M_param.mean(); }
5369 {
return _M_param; }
5377 { _M_param = __param; }
5396 template<
typename _UniformRandomNumberGenerator>
5399 {
return this->
operator()(__urng, _M_param); }
5401 template<
typename _UniformRandomNumberGenerator>
5404 const param_type& __p);
5406 template<
typename _ForwardIterator,
5407 typename _UniformRandomNumberGenerator>
5409 __generate(_ForwardIterator __f, _ForwardIterator __t,
5410 _UniformRandomNumberGenerator& __urng)
5411 { this->__generate(__f, __t, __urng, _M_param); }
5413 template<
typename _ForwardIterator,
5414 typename _UniformRandomNumberGenerator>
5416 __generate(_ForwardIterator __f, _ForwardIterator __t,
5417 _UniformRandomNumberGenerator& __urng,
5418 const param_type& __p)
5419 { this->__generate_impl(__f, __t, __urng, __p); }
5421 template<
typename _UniformRandomNumberGenerator>
5423 __generate(result_type* __f, result_type* __t,
5424 _UniformRandomNumberGenerator& __urng,
5425 const param_type& __p)
5426 { this->__generate_impl(__f, __t, __urng, __p); }
5435 const poisson_distribution& __d2)
5436#ifdef _GLIBCXX_USE_C99_MATH_FUNCS
5437 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
5439 {
return __d1._M_param == __d2._M_param; }
5452 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5467 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5473 template<
typename _ForwardIterator,
5474 typename _UniformRandomNumberGenerator>
5476 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5477 _UniformRandomNumberGenerator& __urng,
5478 const param_type& __p);
5480 param_type _M_param;
5486#if __cpp_impl_three_way_comparison < 201907L
5490 template<
typename _IntType>
5494 {
return !(__d1 == __d2); }
5515 template<
typename _RealType =
double>
5519 "result_type must be a floating point type");
5530 param_type() : param_type(1.0) { }
5533 param_type(_RealType __lambda)
5534 : _M_lambda(__lambda)
5536 __glibcxx_assert(_M_lambda > _RealType(0));
5541 {
return _M_lambda; }
5544 operator==(
const param_type& __p1,
const param_type& __p2)
5545 {
return __p1._M_lambda == __p2._M_lambda; }
5547#if __cpp_impl_three_way_comparison < 201907L
5549 operator!=(
const param_type& __p1,
const param_type& __p2)
5550 {
return !(__p1 == __p2); }
5554 _RealType _M_lambda;
5570 : _M_param(__lambda)
5591 {
return _M_param.lambda(); }
5598 {
return _M_param; }
5606 { _M_param = __param; }
5625 template<
typename _UniformRandomNumberGenerator>
5628 {
return this->
operator()(__urng, _M_param); }
5630 template<
typename _UniformRandomNumberGenerator>
5632 operator()(_UniformRandomNumberGenerator& __urng,
5633 const param_type& __p)
5635 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
5640 template<
typename _ForwardIterator,
5641 typename _UniformRandomNumberGenerator>
5643 __generate(_ForwardIterator __f, _ForwardIterator __t,
5644 _UniformRandomNumberGenerator& __urng)
5645 { this->__generate(__f, __t, __urng, _M_param); }
5647 template<
typename _ForwardIterator,
5648 typename _UniformRandomNumberGenerator>
5650 __generate(_ForwardIterator __f, _ForwardIterator __t,
5651 _UniformRandomNumberGenerator& __urng,
5653 { this->__generate_impl(__f, __t, __urng, __p); }
5655 template<
typename _UniformRandomNumberGenerator>
5658 _UniformRandomNumberGenerator& __urng,
5660 { this->__generate_impl(__f, __t, __urng, __p); }
5669 {
return __d1._M_param == __d2._M_param; }
5672 template<
typename _ForwardIterator,
5673 typename _UniformRandomNumberGenerator>
5675 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5676 _UniformRandomNumberGenerator& __urng,
5677 const param_type& __p);
5679 param_type _M_param;
5682#if __cpp_impl_three_way_comparison < 201907L
5687 template<
typename _RealType>
5691 {
return !(__d1 == __d2); }
5704 template<
typename _RealType,
typename _CharT,
typename _Traits>
5705 std::basic_ostream<_CharT, _Traits>&
5706 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5707 const std::exponential_distribution<_RealType>& __x);
5719 template<
typename _RealType,
typename _CharT,
typename _Traits>
5720 std::basic_istream<_CharT, _Traits>&
5721 operator>>(std::basic_istream<_CharT, _Traits>& __is,
5722 std::exponential_distribution<_RealType>& __x);
5737 template<
typename _RealType =
double>
5738 class weibull_distribution
5741 "result_type must be a floating point type");
5750 typedef weibull_distribution<_RealType> distribution_type;
5752 param_type() : param_type(1.0) { }
5755 param_type(_RealType __a, _RealType __b = _RealType(1.0))
5756 : _M_a(__a), _M_b(__b)
5768 operator==(
const param_type& __p1,
const param_type& __p2)
5769 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
5771#if __cpp_impl_three_way_comparison < 201907L
5773 operator!=(
const param_type& __p1,
const param_type& __p2)
5774 {
return !(__p1 == __p2); }
5782 weibull_distribution() : weibull_distribution(1.0) { }
5786 : _M_param(__a, __b)
5790 weibull_distribution(
const param_type& __p)
5806 {
return _M_param.a(); }
5813 {
return _M_param.b(); }
5820 {
return _M_param; }
5828 { _M_param = __param; }
5847 template<
typename _UniformRandomNumberGenerator>
5850 {
return this->
operator()(__urng, _M_param); }
5852 template<
typename _UniformRandomNumberGenerator>
5854 operator()(_UniformRandomNumberGenerator& __urng,
5855 const param_type& __p);
5857 template<
typename _ForwardIterator,
5858 typename _UniformRandomNumberGenerator>
5860 __generate(_ForwardIterator __f, _ForwardIterator __t,
5861 _UniformRandomNumberGenerator& __urng)
5862 { this->__generate(__f, __t, __urng, _M_param); }
5864 template<
typename _ForwardIterator,
5865 typename _UniformRandomNumberGenerator>
5867 __generate(_ForwardIterator __f, _ForwardIterator __t,
5868 _UniformRandomNumberGenerator& __urng,
5869 const param_type& __p)
5870 { this->__generate_impl(__f, __t, __urng, __p); }
5872 template<
typename _UniformRandomNumberGenerator>
5875 _UniformRandomNumberGenerator& __urng,
5877 { this->__generate_impl(__f, __t, __urng, __p); }
5885 const weibull_distribution& __d2)
5886 {
return __d1._M_param == __d2._M_param; }
5889 template<
typename _ForwardIterator,
5890 typename _UniformRandomNumberGenerator>
5892 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5893 _UniformRandomNumberGenerator& __urng,
5894 const param_type& __p);
5896 param_type _M_param;
5899#if __cpp_impl_three_way_comparison < 201907L
5904 template<
typename _RealType>
5908 {
return !(__d1 == __d2); }
5921 template<
typename _RealType,
typename _CharT,
typename _Traits>
5922 std::basic_ostream<_CharT, _Traits>&
5923 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5924 const std::weibull_distribution<_RealType>& __x);
5936 template<
typename _RealType,
typename _CharT,
typename _Traits>
5937 std::basic_istream<_CharT, _Traits>&
5938 operator>>(std::basic_istream<_CharT, _Traits>& __is,
5939 std::weibull_distribution<_RealType>& __x);
5954 template<
typename _RealType =
double>
5955 class extreme_value_distribution
5958 "result_type must be a floating point type");
5967 typedef extreme_value_distribution<_RealType> distribution_type;
5969 param_type() : param_type(0.0) { }
5972 param_type(_RealType __a, _RealType __b = _RealType(1.0))
5973 : _M_a(__a), _M_b(__b)
5985 operator==(
const param_type& __p1,
const param_type& __p2)
5986 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
5988#if __cpp_impl_three_way_comparison < 201907L
5990 operator!=(
const param_type& __p1,
const param_type& __p2)
5991 {
return !(__p1 == __p2); }
5999 extreme_value_distribution() : extreme_value_distribution(0.0) { }
6003 : _M_param(__a, __b)
6007 extreme_value_distribution(
const param_type& __p)
6023 {
return _M_param.a(); }
6030 {
return _M_param.b(); }
6037 {
return _M_param; }
6045 { _M_param = __param; }
6064 template<
typename _UniformRandomNumberGenerator>
6067 {
return this->
operator()(__urng, _M_param); }
6069 template<
typename _UniformRandomNumberGenerator>
6071 operator()(_UniformRandomNumberGenerator& __urng,
6072 const param_type& __p);
6074 template<
typename _ForwardIterator,
6075 typename _UniformRandomNumberGenerator>
6077 __generate(_ForwardIterator __f, _ForwardIterator __t,
6078 _UniformRandomNumberGenerator& __urng)
6079 { this->__generate(__f, __t, __urng, _M_param); }
6081 template<
typename _ForwardIterator,
6082 typename _UniformRandomNumberGenerator>
6084 __generate(_ForwardIterator __f, _ForwardIterator __t,
6085 _UniformRandomNumberGenerator& __urng,
6086 const param_type& __p)
6087 { this->__generate_impl(__f, __t, __urng, __p); }
6089 template<
typename _UniformRandomNumberGenerator>
6092 _UniformRandomNumberGenerator& __urng,
6094 { this->__generate_impl(__f, __t, __urng, __p); }
6102 const extreme_value_distribution& __d2)
6103 {
return __d1._M_param == __d2._M_param; }
6106 template<
typename _ForwardIterator,
6107 typename _UniformRandomNumberGenerator>
6109 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6110 _UniformRandomNumberGenerator& __urng,
6111 const param_type& __p);
6113 param_type _M_param;
6116#if __cpp_impl_three_way_comparison < 201907L
6121 template<
typename _RealType>
6125 {
return !(__d1 == __d2); }
6138 template<
typename _RealType,
typename _CharT,
typename _Traits>
6139 std::basic_ostream<_CharT, _Traits>&
6140 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
6141 const std::extreme_value_distribution<_RealType>& __x);
6153 template<
typename _RealType,
typename _CharT,
typename _Traits>
6154 std::basic_istream<_CharT, _Traits>&
6155 operator>>(std::basic_istream<_CharT, _Traits>& __is,
6156 std::extreme_value_distribution<_RealType>& __x);
6176 template<
typename _IntType =
int>
6177 class discrete_distribution
6180 "result_type must be an integral type");
6189 typedef discrete_distribution<_IntType> distribution_type;
6190 friend class discrete_distribution<_IntType>;
6193 : _M_prob(), _M_cp()
6196 template<
typename _InputIterator>
6197 param_type(_InputIterator __wbegin,
6198 _InputIterator __wend)
6199 : _M_prob(__wbegin, __wend), _M_cp()
6200 { _M_initialize(); }
6203 : _M_prob(__wil.begin(), __wil.end()), _M_cp()
6204 { _M_initialize(); }
6206 template<
typename _Func>
6207 param_type(
size_t __nw,
double __xmin,
double __xmax,
6211 param_type(
const param_type&) =
default;
6212 param_type& operator=(
const param_type&) =
default;
6219 operator==(
const param_type& __p1,
const param_type& __p2)
6220 {
return __p1._M_prob == __p2._M_prob; }
6222#if __cpp_impl_three_way_comparison < 201907L
6224 operator!=(
const param_type& __p1,
const param_type& __p2)
6225 {
return !(__p1 == __p2); }
6236 discrete_distribution()
6240 template<
typename _InputIterator>
6242 _InputIterator __wend)
6243 : _M_param(__wbegin, __wend)
6246 discrete_distribution(initializer_list<double> __wl)
6250 template<
typename _Func>
6251 discrete_distribution(
size_t __nw,
double __xmin,
double __xmax,
6253 : _M_param(__nw, __xmin, __xmax, __fw)
6274 return _M_param._M_prob.
empty()
6283 {
return _M_param; }
6291 { _M_param = __param; }
6306 return _M_param._M_prob.empty()
6313 template<
typename _UniformRandomNumberGenerator>
6316 {
return this->
operator()(__urng, _M_param); }
6318 template<
typename _UniformRandomNumberGenerator>
6320 operator()(_UniformRandomNumberGenerator& __urng,
6321 const param_type& __p);
6323 template<
typename _ForwardIterator,
6324 typename _UniformRandomNumberGenerator>
6326 __generate(_ForwardIterator __f, _ForwardIterator __t,
6327 _UniformRandomNumberGenerator& __urng)
6328 { this->__generate(__f, __t, __urng, _M_param); }
6330 template<
typename _ForwardIterator,
6331 typename _UniformRandomNumberGenerator>
6333 __generate(_ForwardIterator __f, _ForwardIterator __t,
6334 _UniformRandomNumberGenerator& __urng,
6335 const param_type& __p)
6336 { this->__generate_impl(__f, __t, __urng, __p); }
6338 template<
typename _UniformRandomNumberGenerator>
6341 _UniformRandomNumberGenerator& __urng,
6343 { this->__generate_impl(__f, __t, __urng, __p); }
6351 const discrete_distribution& __d2)
6352 {
return __d1._M_param == __d2._M_param; }
6364 template<
typename _IntType1,
typename _CharT,
typename _Traits>
6380 template<
typename _IntType1,
typename _CharT,
typename _Traits>
6386 template<
typename _ForwardIterator,
6387 typename _UniformRandomNumberGenerator>
6389 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6390 _UniformRandomNumberGenerator& __urng,
6391 const param_type& __p);
6393 param_type _M_param;
6396#if __cpp_impl_three_way_comparison < 201907L
6401 template<
typename _IntType>
6405 {
return !(__d1 == __d2); }
6424 template<
typename _RealType =
double>
6425 class piecewise_constant_distribution
6428 "result_type must be a floating point type");
6437 typedef piecewise_constant_distribution<_RealType> distribution_type;
6438 friend class piecewise_constant_distribution<_RealType>;
6441 : _M_int(), _M_den(), _M_cp()
6444 template<
typename _InputIteratorB,
typename _InputIteratorW>
6445 param_type(_InputIteratorB __bfirst,
6446 _InputIteratorB __bend,
6447 _InputIteratorW __wbegin);
6449 template<
typename _Func>
6452 template<
typename _Func>
6453 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
6457 param_type(
const param_type&) =
default;
6458 param_type& operator=(
const param_type&) =
default;
6466 __tmp[1] = _RealType(1);
6478 operator==(
const param_type& __p1,
const param_type& __p2)
6479 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
6481#if __cpp_impl_three_way_comparison < 201907L
6483 operator!=(
const param_type& __p1,
const param_type& __p2)
6484 {
return !(__p1 == __p2); }
6496 piecewise_constant_distribution()
6500 template<
typename _InputIteratorB,
typename _InputIteratorW>
6502 _InputIteratorB __bend,
6503 _InputIteratorW __wbegin)
6504 : _M_param(__bfirst, __bend, __wbegin)
6507 template<
typename _Func>
6508 piecewise_constant_distribution(initializer_list<_RealType> __bl,
6510 : _M_param(__bl, __fw)
6513 template<
typename _Func>
6514 piecewise_constant_distribution(
size_t __nw,
6515 _RealType __xmin, _RealType __xmax,
6517 : _M_param(__nw, __xmin, __xmax, __fw)
6521 piecewise_constant_distribution(
const param_type& __p)
6538 if (_M_param._M_int.empty())
6541 __tmp[1] = _RealType(1);
6545 return _M_param._M_int;
6554 return _M_param._M_den.
empty()
6563 {
return _M_param; }
6571 { _M_param = __param; }
6579 return _M_param._M_int.empty()
6589 return _M_param._M_int.empty()
6596 template<
typename _UniformRandomNumberGenerator>
6599 {
return this->
operator()(__urng, _M_param); }
6601 template<
typename _UniformRandomNumberGenerator>
6603 operator()(_UniformRandomNumberGenerator& __urng,
6604 const param_type& __p);
6606 template<
typename _ForwardIterator,
6607 typename _UniformRandomNumberGenerator>
6609 __generate(_ForwardIterator __f, _ForwardIterator __t,
6610 _UniformRandomNumberGenerator& __urng)
6611 { this->__generate(__f, __t, __urng, _M_param); }
6613 template<
typename _ForwardIterator,
6614 typename _UniformRandomNumberGenerator>
6616 __generate(_ForwardIterator __f, _ForwardIterator __t,
6617 _UniformRandomNumberGenerator& __urng,
6618 const param_type& __p)
6619 { this->__generate_impl(__f, __t, __urng, __p); }
6621 template<
typename _UniformRandomNumberGenerator>
6624 _UniformRandomNumberGenerator& __urng,
6626 { this->__generate_impl(__f, __t, __urng, __p); }
6634 const piecewise_constant_distribution& __d2)
6635 {
return __d1._M_param == __d2._M_param; }
6648 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6664 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6670 template<
typename _ForwardIterator,
6671 typename _UniformRandomNumberGenerator>
6673 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6674 _UniformRandomNumberGenerator& __urng,
6675 const param_type& __p);
6677 param_type _M_param;
6680#if __cpp_impl_three_way_comparison < 201907L
6685 template<
typename _RealType>
6689 {
return !(__d1 == __d2); }
6704 template<
typename _RealType =
double>
6705 class piecewise_linear_distribution
6708 "result_type must be a floating point type");
6717 typedef piecewise_linear_distribution<_RealType> distribution_type;
6718 friend class piecewise_linear_distribution<_RealType>;
6721 : _M_int(), _M_den(), _M_cp(), _M_m()
6724 template<
typename _InputIteratorB,
typename _InputIteratorW>
6725 param_type(_InputIteratorB __bfirst,
6726 _InputIteratorB __bend,
6727 _InputIteratorW __wbegin);
6729 template<
typename _Func>
6732 template<
typename _Func>
6733 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
6737 param_type(
const param_type&) =
default;
6738 param_type& operator=(
const param_type&) =
default;
6746 __tmp[1] = _RealType(1);
6758 operator==(
const param_type& __p1,
const param_type& __p2)
6759 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
6761#if __cpp_impl_three_way_comparison < 201907L
6763 operator!=(
const param_type& __p1,
const param_type& __p2)
6764 {
return !(__p1 == __p2); }
6777 piecewise_linear_distribution()
6781 template<
typename _InputIteratorB,
typename _InputIteratorW>
6783 _InputIteratorB __bend,
6784 _InputIteratorW __wbegin)
6785 : _M_param(__bfirst, __bend, __wbegin)
6788 template<
typename _Func>
6789 piecewise_linear_distribution(initializer_list<_RealType> __bl,
6791 : _M_param(__bl, __fw)
6794 template<
typename _Func>
6795 piecewise_linear_distribution(
size_t __nw,
6796 _RealType __xmin, _RealType __xmax,
6798 : _M_param(__nw, __xmin, __xmax, __fw)
6802 piecewise_linear_distribution(
const param_type& __p)
6819 if (_M_param._M_int.empty())
6822 __tmp[1] = _RealType(1);
6826 return _M_param._M_int;
6836 return _M_param._M_den.
empty()
6845 {
return _M_param; }
6853 { _M_param = __param; }
6861 return _M_param._M_int.empty()
6871 return _M_param._M_int.empty()
6878 template<
typename _UniformRandomNumberGenerator>
6881 {
return this->
operator()(__urng, _M_param); }
6883 template<
typename _UniformRandomNumberGenerator>
6885 operator()(_UniformRandomNumberGenerator& __urng,
6886 const param_type& __p);
6888 template<
typename _ForwardIterator,
6889 typename _UniformRandomNumberGenerator>
6891 __generate(_ForwardIterator __f, _ForwardIterator __t,
6892 _UniformRandomNumberGenerator& __urng)
6893 { this->__generate(__f, __t, __urng, _M_param); }
6895 template<
typename _ForwardIterator,
6896 typename _UniformRandomNumberGenerator>
6898 __generate(_ForwardIterator __f, _ForwardIterator __t,
6899 _UniformRandomNumberGenerator& __urng,
6900 const param_type& __p)
6901 { this->__generate_impl(__f, __t, __urng, __p); }
6903 template<
typename _UniformRandomNumberGenerator>
6906 _UniformRandomNumberGenerator& __urng,
6908 { this->__generate_impl(__f, __t, __urng, __p); }
6916 const piecewise_linear_distribution& __d2)
6917 {
return __d1._M_param == __d2._M_param; }
6930 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6946 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6952 template<
typename _ForwardIterator,
6953 typename _UniformRandomNumberGenerator>
6955 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6956 _UniformRandomNumberGenerator& __urng,
6957 const param_type& __p);
6959 param_type _M_param;
6962#if __cpp_impl_three_way_comparison < 201907L
6967 template<
typename _RealType>
6971 {
return !(__d1 == __d2); }
7002 template<
typename _IntType,
typename = _Require<is_
integral<_IntType>>>
7005 template<
typename _InputIterator>
7006 seed_seq(_InputIterator __begin, _InputIterator __end);
7009 template<
typename _RandomAccessIterator>
7011 generate(_RandomAccessIterator __begin, _RandomAccessIterator __end);
7014 size_t size() const noexcept
7015 {
return _M_v.
size(); }
7017 template<
typename _OutputIterator>
7019 param(_OutputIterator __dest)
const
7020 { std::copy(_M_v.
begin(), _M_v.
end(), __dest); }
7027 std::vector<result_type> _M_v;
7034_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.
char_type widen(char __c) const
Widens characters.
char_type fill() const
Retrieves the empty character.
Template class basic_istream.
Template class basic_ostream.
static constexpr int digits
static constexpr _Tp max() noexcept
static constexpr _Tp lowest() noexcept
static constexpr _Tp min() noexcept
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....
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.
philox_engine(_Sseq &__q)
seed sequence constructor for philox_engine
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.
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.
std::vector< double > densities() const
Returns a vector of the probability densities.
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.
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.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
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.
std::vector< _RealType > intervals() const
Returns a vector of the intervals.
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< _RealType > intervals() const
Return the intervals 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.
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.
std::vector< double > densities() const
Return a vector of the probability densities 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