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; }
3505 _M_gd.param(param_type{__param.n() / 2});
3525 template<
typename _UniformRandomNumberGenerator>
3528 {
return 2 * _M_gd(__urng); }
3530 template<
typename _UniformRandomNumberGenerator>
3532 operator()(_UniformRandomNumberGenerator& __urng,
3533 const param_type& __p)
3537 return 2 * _M_gd(__urng, param_type(__p.n() / 2));
3540 template<
typename _ForwardIterator,
3541 typename _UniformRandomNumberGenerator>
3543 __generate(_ForwardIterator __f, _ForwardIterator __t,
3544 _UniformRandomNumberGenerator& __urng)
3545 { this->__generate_impl(__f, __t, __urng); }
3547 template<
typename _ForwardIterator,
3548 typename _UniformRandomNumberGenerator>
3550 __generate(_ForwardIterator __f, _ForwardIterator __t,
3551 _UniformRandomNumberGenerator& __urng,
3553 {
typename std::gamma_distribution<result_type>::param_type
3555 this->__generate_impl(__f, __t, __urng, __p2); }
3557 template<
typename _UniformRandomNumberGenerator>
3560 _UniformRandomNumberGenerator& __urng)
3561 { this->__generate_impl(__f, __t, __urng); }
3563 template<
typename _UniformRandomNumberGenerator>
3566 _UniformRandomNumberGenerator& __urng,
3568 {
typename std::gamma_distribution<result_type>::param_type
3570 this->__generate_impl(__f, __t, __urng, __p2); }
3579 const chi_squared_distribution& __d2)
3580 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
3592 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3607 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3613 template<
typename _ForwardIterator,
3614 typename _UniformRandomNumberGenerator>
3616 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3617 _UniformRandomNumberGenerator& __urng);
3619 template<
typename _ForwardIterator,
3620 typename _UniformRandomNumberGenerator>
3622 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3623 _UniformRandomNumberGenerator& __urng,
3627 param_type _M_param;
3632#if __cpp_impl_three_way_comparison < 201907L
3636 template<
typename _RealType>
3640 {
return !(__d1 == __d2); }
3652 template<
typename _RealType =
double>
3653 class cauchy_distribution
3656 "result_type must be a floating point type");
3665 typedef cauchy_distribution<_RealType> distribution_type;
3667 param_type() : param_type(0) { }
3670 param_type(_RealType __a, _RealType __b = _RealType(1))
3671 : _M_a(__a), _M_b(__b)
3683 operator==(
const param_type& __p1,
const param_type& __p2)
3684 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
3686#if __cpp_impl_three_way_comparison < 201907L
3688 operator!=(
const param_type& __p1,
const param_type& __p2)
3689 {
return !(__p1 == __p2); }
3697 cauchy_distribution() : cauchy_distribution(0.0) { }
3701 : _M_param(__a, __b)
3705 cauchy_distribution(
const param_type& __p)
3721 {
return _M_param.a(); }
3725 {
return _M_param.b(); }
3732 {
return _M_param; }
3740 { _M_param = __param; }
3759 template<
typename _UniformRandomNumberGenerator>
3762 {
return this->
operator()(__urng, _M_param); }
3764 template<
typename _UniformRandomNumberGenerator>
3766 operator()(_UniformRandomNumberGenerator& __urng,
3767 const param_type& __p);
3769 template<
typename _ForwardIterator,
3770 typename _UniformRandomNumberGenerator>
3772 __generate(_ForwardIterator __f, _ForwardIterator __t,
3773 _UniformRandomNumberGenerator& __urng)
3774 { this->__generate(__f, __t, __urng, _M_param); }
3776 template<
typename _ForwardIterator,
3777 typename _UniformRandomNumberGenerator>
3779 __generate(_ForwardIterator __f, _ForwardIterator __t,
3780 _UniformRandomNumberGenerator& __urng,
3781 const param_type& __p)
3782 { this->__generate_impl(__f, __t, __urng, __p); }
3784 template<
typename _UniformRandomNumberGenerator>
3787 _UniformRandomNumberGenerator& __urng,
3789 { this->__generate_impl(__f, __t, __urng, __p); }
3797 const cauchy_distribution& __d2)
3798 {
return __d1._M_param == __d2._M_param; }
3801 template<
typename _ForwardIterator,
3802 typename _UniformRandomNumberGenerator>
3804 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3805 _UniformRandomNumberGenerator& __urng,
3806 const param_type& __p);
3808 param_type _M_param;
3811#if __cpp_impl_three_way_comparison < 201907L
3816 template<
typename _RealType>
3820 {
return !(__d1 == __d2); }
3833 template<
typename _RealType,
typename _CharT,
typename _Traits>
3834 std::basic_ostream<_CharT, _Traits>&
3835 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3836 const std::cauchy_distribution<_RealType>& __x);
3848 template<
typename _RealType,
typename _CharT,
typename _Traits>
3849 std::basic_istream<_CharT, _Traits>&
3850 operator>>(std::basic_istream<_CharT, _Traits>& __is,
3851 std::cauchy_distribution<_RealType>& __x);
3867 template<
typename _RealType =
double>
3868 class fisher_f_distribution
3871 "result_type must be a floating point type");
3880 typedef fisher_f_distribution<_RealType> distribution_type;
3882 param_type() : param_type(1) { }
3885 param_type(_RealType __m, _RealType __n = _RealType(1))
3886 : _M_m(__m), _M_n(__n)
3898 operator==(
const param_type& __p1,
const param_type& __p2)
3899 {
return __p1._M_m == __p2._M_m && __p1._M_n == __p2._M_n; }
3901#if __cpp_impl_three_way_comparison < 201907L
3903 operator!=(
const param_type& __p1,
const param_type& __p2)
3904 {
return !(__p1 == __p2); }
3912 fisher_f_distribution() : fisher_f_distribution(1.0) { }
3916 _RealType __n = _RealType(1))
3917 : _M_param(__m, __n), _M_gd_x(__m / 2), _M_gd_y(__n / 2)
3921 fisher_f_distribution(
const param_type& __p)
3922 : _M_param(__p), _M_gd_x(__p.m() / 2), _M_gd_y(__p.n() / 2)
3940 {
return _M_param.m(); }
3944 {
return _M_param.n(); }
3951 {
return _M_param; }
3959 { _M_param = __param; }
3978 template<
typename _UniformRandomNumberGenerator>
3981 {
return (_M_gd_x(__urng) * n()) / (_M_gd_y(__urng) * m()); }
3983 template<
typename _UniformRandomNumberGenerator>
3985 operator()(_UniformRandomNumberGenerator& __urng,
3986 const param_type& __p)
3990 return ((_M_gd_x(__urng, param_type(__p.m() / 2)) * n())
3991 / (_M_gd_y(__urng, param_type(__p.n() / 2)) * m()));
3994 template<
typename _ForwardIterator,
3995 typename _UniformRandomNumberGenerator>
3997 __generate(_ForwardIterator __f, _ForwardIterator __t,
3998 _UniformRandomNumberGenerator& __urng)
3999 { this->__generate_impl(__f, __t, __urng); }
4001 template<
typename _ForwardIterator,
4002 typename _UniformRandomNumberGenerator>
4004 __generate(_ForwardIterator __f, _ForwardIterator __t,
4005 _UniformRandomNumberGenerator& __urng,
4007 { this->__generate_impl(__f, __t, __urng, __p); }
4009 template<
typename _UniformRandomNumberGenerator>
4012 _UniformRandomNumberGenerator& __urng)
4013 { this->__generate_impl(__f, __t, __urng); }
4015 template<
typename _UniformRandomNumberGenerator>
4018 _UniformRandomNumberGenerator& __urng,
4020 { this->__generate_impl(__f, __t, __urng, __p); }
4029 const fisher_f_distribution& __d2)
4030 {
return (__d1._M_param == __d2._M_param
4031 && __d1._M_gd_x == __d2._M_gd_x
4032 && __d1._M_gd_y == __d2._M_gd_y); }
4044 template<
typename _RealType1,
typename _CharT,
typename _Traits>
4059 template<
typename _RealType1,
typename _CharT,
typename _Traits>
4065 template<
typename _ForwardIterator,
4066 typename _UniformRandomNumberGenerator>
4068 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4069 _UniformRandomNumberGenerator& __urng);
4071 template<
typename _ForwardIterator,
4072 typename _UniformRandomNumberGenerator>
4074 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4075 _UniformRandomNumberGenerator& __urng,
4076 const param_type& __p);
4078 param_type _M_param;
4083#if __cpp_impl_three_way_comparison < 201907L
4087 template<
typename _RealType>
4091 {
return !(__d1 == __d2); }
4106 template<
typename _RealType =
double>
4107 class student_t_distribution
4110 "result_type must be a floating point type");
4119 typedef student_t_distribution<_RealType> distribution_type;
4121 param_type() : param_type(1) { }
4124 param_type(_RealType __n)
4133 operator==(
const param_type& __p1,
const param_type& __p2)
4134 {
return __p1._M_n == __p2._M_n; }
4136#if __cpp_impl_three_way_comparison < 201907L
4138 operator!=(
const param_type& __p1,
const param_type& __p2)
4139 {
return !(__p1 == __p2); }
4146 student_t_distribution() : student_t_distribution(1.0) { }
4150 : _M_param(__n), _M_nd(), _M_gd(__n / 2, 2)
4154 student_t_distribution(
const param_type& __p)
4155 : _M_param(__p), _M_nd(), _M_gd(__p.n() / 2, 2)
4173 {
return _M_param.n(); }
4180 {
return _M_param; }
4188 { _M_param = __param; }
4207 template<
typename _UniformRandomNumberGenerator>
4210 {
return _M_nd(__urng) *
std::sqrt(n() / _M_gd(__urng)); }
4212 template<
typename _UniformRandomNumberGenerator>
4214 operator()(_UniformRandomNumberGenerator& __urng,
4215 const param_type& __p)
4220 const result_type __g = _M_gd(__urng, param_type(__p.n() / 2, 2));
4221 return _M_nd(__urng) *
std::sqrt(__p.n() / __g);
4224 template<
typename _ForwardIterator,
4225 typename _UniformRandomNumberGenerator>
4227 __generate(_ForwardIterator __f, _ForwardIterator __t,
4228 _UniformRandomNumberGenerator& __urng)
4229 { this->__generate_impl(__f, __t, __urng); }
4231 template<
typename _ForwardIterator,
4232 typename _UniformRandomNumberGenerator>
4234 __generate(_ForwardIterator __f, _ForwardIterator __t,
4235 _UniformRandomNumberGenerator& __urng,
4237 { this->__generate_impl(__f, __t, __urng, __p); }
4239 template<
typename _UniformRandomNumberGenerator>
4242 _UniformRandomNumberGenerator& __urng)
4243 { this->__generate_impl(__f, __t, __urng); }
4245 template<
typename _UniformRandomNumberGenerator>
4248 _UniformRandomNumberGenerator& __urng,
4250 { this->__generate_impl(__f, __t, __urng, __p); }
4259 const student_t_distribution& __d2)
4260 {
return (__d1._M_param == __d2._M_param
4261 && __d1._M_nd == __d2._M_nd && __d1._M_gd == __d2._M_gd); }
4273 template<
typename _RealType1,
typename _CharT,
typename _Traits>
4288 template<
typename _RealType1,
typename _CharT,
typename _Traits>
4294 template<
typename _ForwardIterator,
4295 typename _UniformRandomNumberGenerator>
4297 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4298 _UniformRandomNumberGenerator& __urng);
4299 template<
typename _ForwardIterator,
4300 typename _UniformRandomNumberGenerator>
4302 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4303 _UniformRandomNumberGenerator& __urng,
4304 const param_type& __p);
4306 param_type _M_param;
4312#if __cpp_impl_three_way_comparison < 201907L
4316 template<
typename _RealType>
4320 {
return !(__d1 == __d2); }
4351 param_type() : param_type(0.5) { }
4354 param_type(
double __p)
4357 __glibcxx_assert((_M_p >= 0.0) && (_M_p <= 1.0));
4365 operator==(
const param_type& __p1,
const param_type& __p2)
4366 {
return __p1._M_p == __p2._M_p; }
4368#if __cpp_impl_three_way_comparison < 201907L
4370 operator!=(
const param_type& __p1,
const param_type& __p2)
4371 {
return !(__p1 == __p2); }
4413 {
return _M_param.p(); }
4420 {
return _M_param; }
4428 { _M_param = __param; }
4447 template<
typename _UniformRandomNumberGenerator>
4450 {
return this->
operator()(__urng, _M_param); }
4452 template<
typename _UniformRandomNumberGenerator>
4454 operator()(_UniformRandomNumberGenerator& __urng,
4455 const param_type& __p)
4457 __detail::_Adaptor<_UniformRandomNumberGenerator, double>
4459 if ((__aurng() - __aurng.min())
4460 < __p.p() * (__aurng.max() - __aurng.min()))
4465 template<
typename _ForwardIterator,
4466 typename _UniformRandomNumberGenerator>
4468 __generate(_ForwardIterator __f, _ForwardIterator __t,
4469 _UniformRandomNumberGenerator& __urng)
4470 { this->__generate(__f, __t, __urng, _M_param); }
4472 template<
typename _ForwardIterator,
4473 typename _UniformRandomNumberGenerator>
4475 __generate(_ForwardIterator __f, _ForwardIterator __t,
4476 _UniformRandomNumberGenerator& __urng,
const param_type& __p)
4477 { this->__generate_impl(__f, __t, __urng, __p); }
4479 template<
typename _UniformRandomNumberGenerator>
4482 _UniformRandomNumberGenerator& __urng,
4484 { this->__generate_impl(__f, __t, __urng, __p); }
4493 {
return __d1._M_param == __d2._M_param; }
4496 template<
typename _ForwardIterator,
4497 typename _UniformRandomNumberGenerator>
4499 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4500 _UniformRandomNumberGenerator& __urng,
4501 const param_type& __p);
4503 param_type _M_param;
4506#if __cpp_impl_three_way_comparison < 201907L
4514 {
return !(__d1 == __d2); }
4527 template<
typename _CharT,
typename _Traits>
4528 std::basic_ostream<_CharT, _Traits>&
4529 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4530 const std::bernoulli_distribution& __x);
4541 template<
typename _CharT,
typename _Traits>
4542 inline std::basic_istream<_CharT, _Traits>&
4563 template<
typename _IntType =
int>
4564 class binomial_distribution
4567 "result_type must be an integral type");
4576 typedef binomial_distribution<_IntType> distribution_type;
4577 friend class binomial_distribution<_IntType>;
4579 param_type() : param_type(1) { }
4582 param_type(_IntType __t,
double __p = 0.5)
4583 : _M_t(__t), _M_p(__p)
4585 __glibcxx_assert((_M_t >= _IntType(0))
4600 operator==(
const param_type& __p1,
const param_type& __p2)
4601 {
return __p1._M_t == __p2._M_t && __p1._M_p == __p2._M_p; }
4603#if __cpp_impl_three_way_comparison < 201907L
4605 operator!=(
const param_type& __p1,
const param_type& __p2)
4606 {
return !(__p1 == __p2); }
4617#if _GLIBCXX_USE_C99_MATH_FUNCS
4618 double _M_d1, _M_d2, _M_s1, _M_s2, _M_c,
4619 _M_a1, _M_a123, _M_s, _M_lf, _M_lp1p;
4626 binomial_distribution() : binomial_distribution(1) { }
4630 : _M_param(__t, __p), _M_nd()
4634 binomial_distribution(
const param_type& __p)
4635 : _M_param(__p), _M_nd()
4650 {
return _M_param.t(); }
4657 {
return _M_param.p(); }
4664 {
return _M_param; }
4672 { _M_param = __param; }
4686 {
return _M_param.t(); }
4691 template<
typename _UniformRandomNumberGenerator>
4694 {
return this->
operator()(__urng, _M_param); }
4696 template<
typename _UniformRandomNumberGenerator>
4699 const param_type& __p);
4701 template<
typename _ForwardIterator,
4702 typename _UniformRandomNumberGenerator>
4704 __generate(_ForwardIterator __f, _ForwardIterator __t,
4705 _UniformRandomNumberGenerator& __urng)
4706 { this->__generate(__f, __t, __urng, _M_param); }
4708 template<
typename _ForwardIterator,
4709 typename _UniformRandomNumberGenerator>
4711 __generate(_ForwardIterator __f, _ForwardIterator __t,
4712 _UniformRandomNumberGenerator& __urng,
4713 const param_type& __p)
4714 { this->__generate_impl(__f, __t, __urng, __p); }
4716 template<
typename _UniformRandomNumberGenerator>
4718 __generate(result_type* __f, result_type* __t,
4719 _UniformRandomNumberGenerator& __urng,
4720 const param_type& __p)
4721 { this->__generate_impl(__f, __t, __urng, __p); }
4730 const binomial_distribution& __d2)
4731#ifdef _GLIBCXX_USE_C99_MATH_FUNCS
4732 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
4734 {
return __d1._M_param == __d2._M_param; }
4747 template<
typename _IntType1,
4748 typename _CharT,
typename _Traits>
4763 template<
typename _IntType1,
4764 typename _CharT,
typename _Traits>
4770 template<
typename _ForwardIterator,
4771 typename _UniformRandomNumberGenerator>
4773 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4774 _UniformRandomNumberGenerator& __urng,
4775 const param_type& __p);
4777 template<
typename _UniformRandomNumberGenerator>
4779 _M_waiting(_UniformRandomNumberGenerator& __urng,
4780 _IntType __t,
double __q);
4782 param_type _M_param;
4788#if __cpp_impl_three_way_comparison < 201907L
4792 template<
typename _IntType>
4796 {
return !(__d1 == __d2); }
4809 template<
typename _IntType =
int>
4810 class geometric_distribution
4813 "result_type must be an integral type");
4822 typedef geometric_distribution<_IntType> distribution_type;
4823 friend class geometric_distribution<_IntType>;
4825 param_type() : param_type(0.5) { }
4828 param_type(
double __p)
4831 __glibcxx_assert((_M_p > 0.0) && (_M_p < 1.0));
4840 operator==(
const param_type& __p1,
const param_type& __p2)
4841 {
return __p1._M_p == __p2._M_p; }
4843#if __cpp_impl_three_way_comparison < 201907L
4845 operator!=(
const param_type& __p1,
const param_type& __p2)
4846 {
return !(__p1 == __p2); }
4852 { _M_log_1_p =
std::log(1.0 - _M_p); }
4861 geometric_distribution() : geometric_distribution(0.5) { }
4869 geometric_distribution(
const param_type& __p)
4886 {
return _M_param.p(); }
4893 {
return _M_param; }
4901 { _M_param = __param; }
4920 template<
typename _UniformRandomNumberGenerator>
4923 {
return this->
operator()(__urng, _M_param); }
4925 template<
typename _UniformRandomNumberGenerator>
4927 operator()(_UniformRandomNumberGenerator& __urng,
4928 const param_type& __p);
4930 template<
typename _ForwardIterator,
4931 typename _UniformRandomNumberGenerator>
4933 __generate(_ForwardIterator __f, _ForwardIterator __t,
4934 _UniformRandomNumberGenerator& __urng)
4935 { this->__generate(__f, __t, __urng, _M_param); }
4937 template<
typename _ForwardIterator,
4938 typename _UniformRandomNumberGenerator>
4940 __generate(_ForwardIterator __f, _ForwardIterator __t,
4941 _UniformRandomNumberGenerator& __urng,
4942 const param_type& __p)
4943 { this->__generate_impl(__f, __t, __urng, __p); }
4945 template<
typename _UniformRandomNumberGenerator>
4948 _UniformRandomNumberGenerator& __urng,
4950 { this->__generate_impl(__f, __t, __urng, __p); }
4958 const geometric_distribution& __d2)
4959 {
return __d1._M_param == __d2._M_param; }
4962 template<
typename _ForwardIterator,
4963 typename _UniformRandomNumberGenerator>
4965 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4966 _UniformRandomNumberGenerator& __urng,
4967 const param_type& __p);
4969 param_type _M_param;
4972#if __cpp_impl_three_way_comparison < 201907L
4977 template<
typename _IntType>
4981 {
return !(__d1 == __d2); }
4994 template<
typename _IntType,
4995 typename _CharT,
typename _Traits>
4996 std::basic_ostream<_CharT, _Traits>&
4997 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4998 const std::geometric_distribution<_IntType>& __x);
5009 template<
typename _IntType,
5010 typename _CharT,
typename _Traits>
5011 std::basic_istream<_CharT, _Traits>&
5012 operator>>(std::basic_istream<_CharT, _Traits>& __is,
5013 std::geometric_distribution<_IntType>& __x);
5026 template<
typename _IntType =
int>
5027 class negative_binomial_distribution
5030 "result_type must be an integral type");
5039 typedef negative_binomial_distribution<_IntType> distribution_type;
5041 param_type() : param_type(1) { }
5044 param_type(_IntType __k,
double __p = 0.5)
5045 : _M_k(__k), _M_p(__p)
5047 __glibcxx_assert((_M_k > 0) && (_M_p > 0.0) && (_M_p <= 1.0));
5059 operator==(
const param_type& __p1,
const param_type& __p2)
5060 {
return __p1._M_k == __p2._M_k && __p1._M_p == __p2._M_p; }
5062#if __cpp_impl_three_way_comparison < 201907L
5064 operator!=(
const param_type& __p1,
const param_type& __p2)
5065 {
return !(__p1 == __p2); }
5073 negative_binomial_distribution() : negative_binomial_distribution(1) { }
5077 : _M_param(__k, __p), _M_gd(__k, (1.0 - __p) / __p)
5081 negative_binomial_distribution(
const param_type& __p)
5082 : _M_param(__p), _M_gd(__p.
k(), (1.0 - __p.
p()) / __p.
p())
5097 {
return _M_param.k(); }
5104 {
return _M_param.p(); }
5111 {
return _M_param; }
5119 { _M_param = __param; }
5138 template<
typename _UniformRandomNumberGenerator>
5142 template<
typename _UniformRandomNumberGenerator>
5144 operator()(_UniformRandomNumberGenerator& __urng,
5145 const param_type& __p);
5147 template<
typename _ForwardIterator,
5148 typename _UniformRandomNumberGenerator>
5150 __generate(_ForwardIterator __f, _ForwardIterator __t,
5151 _UniformRandomNumberGenerator& __urng)
5152 { this->__generate_impl(__f, __t, __urng); }
5154 template<
typename _ForwardIterator,
5155 typename _UniformRandomNumberGenerator>
5157 __generate(_ForwardIterator __f, _ForwardIterator __t,
5158 _UniformRandomNumberGenerator& __urng,
5159 const param_type& __p)
5160 { this->__generate_impl(__f, __t, __urng, __p); }
5162 template<
typename _UniformRandomNumberGenerator>
5164 __generate(result_type* __f, result_type* __t,
5165 _UniformRandomNumberGenerator& __urng)
5166 { this->__generate_impl(__f, __t, __urng); }
5168 template<
typename _UniformRandomNumberGenerator>
5171 _UniformRandomNumberGenerator& __urng,
5173 { this->__generate_impl(__f, __t, __urng, __p); }
5182 const negative_binomial_distribution& __d2)
5183 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
5196 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5211 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5217 template<
typename _ForwardIterator,
5218 typename _UniformRandomNumberGenerator>
5220 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5221 _UniformRandomNumberGenerator& __urng);
5222 template<
typename _ForwardIterator,
5223 typename _UniformRandomNumberGenerator>
5225 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5226 _UniformRandomNumberGenerator& __urng,
5227 const param_type& __p);
5229 param_type _M_param;
5234#if __cpp_impl_three_way_comparison < 201907L
5238 template<
typename _IntType>
5242 {
return !(__d1 == __d2); }
5263 template<
typename _IntType =
int>
5264 class poisson_distribution
5267 "result_type must be an integral type");
5276 typedef poisson_distribution<_IntType> distribution_type;
5277 friend class poisson_distribution<_IntType>;
5279 param_type() : param_type(1.0) { }
5282 param_type(
double __mean)
5285 __glibcxx_assert(_M_mean > 0.0);
5294 operator==(
const param_type& __p1,
const param_type& __p2)
5295 {
return __p1._M_mean == __p2._M_mean; }
5297#if __cpp_impl_three_way_comparison < 201907L
5299 operator!=(
const param_type& __p1,
const param_type& __p2)
5300 {
return !(__p1 == __p2); }
5311#if _GLIBCXX_USE_C99_MATH_FUNCS
5312 double _M_lfm, _M_sm, _M_d, _M_scx, _M_1cx, _M_c2b, _M_cb;
5318 poisson_distribution() : poisson_distribution(1.0) { }
5322 : _M_param(__mean), _M_nd()
5326 poisson_distribution(
const param_type& __p)
5327 : _M_param(__p), _M_nd()
5342 {
return _M_param.mean(); }
5349 {
return _M_param; }
5357 { _M_param = __param; }
5376 template<
typename _UniformRandomNumberGenerator>
5379 {
return this->
operator()(__urng, _M_param); }
5381 template<
typename _UniformRandomNumberGenerator>
5384 const param_type& __p);
5386 template<
typename _ForwardIterator,
5387 typename _UniformRandomNumberGenerator>
5389 __generate(_ForwardIterator __f, _ForwardIterator __t,
5390 _UniformRandomNumberGenerator& __urng)
5391 { this->__generate(__f, __t, __urng, _M_param); }
5393 template<
typename _ForwardIterator,
5394 typename _UniformRandomNumberGenerator>
5396 __generate(_ForwardIterator __f, _ForwardIterator __t,
5397 _UniformRandomNumberGenerator& __urng,
5398 const param_type& __p)
5399 { this->__generate_impl(__f, __t, __urng, __p); }
5401 template<
typename _UniformRandomNumberGenerator>
5403 __generate(result_type* __f, result_type* __t,
5404 _UniformRandomNumberGenerator& __urng,
5405 const param_type& __p)
5406 { this->__generate_impl(__f, __t, __urng, __p); }
5415 const poisson_distribution& __d2)
5416#ifdef _GLIBCXX_USE_C99_MATH_FUNCS
5417 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
5419 {
return __d1._M_param == __d2._M_param; }
5432 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5447 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5453 template<
typename _ForwardIterator,
5454 typename _UniformRandomNumberGenerator>
5456 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5457 _UniformRandomNumberGenerator& __urng,
5458 const param_type& __p);
5460 param_type _M_param;
5466#if __cpp_impl_three_way_comparison < 201907L
5470 template<
typename _IntType>
5474 {
return !(__d1 == __d2); }
5495 template<
typename _RealType =
double>
5499 "result_type must be a floating point type");
5510 param_type() : param_type(1.0) { }
5513 param_type(_RealType __lambda)
5514 : _M_lambda(__lambda)
5516 __glibcxx_assert(_M_lambda > _RealType(0));
5521 {
return _M_lambda; }
5524 operator==(
const param_type& __p1,
const param_type& __p2)
5525 {
return __p1._M_lambda == __p2._M_lambda; }
5527#if __cpp_impl_three_way_comparison < 201907L
5529 operator!=(
const param_type& __p1,
const param_type& __p2)
5530 {
return !(__p1 == __p2); }
5534 _RealType _M_lambda;
5550 : _M_param(__lambda)
5571 {
return _M_param.lambda(); }
5578 {
return _M_param; }
5586 { _M_param = __param; }
5605 template<
typename _UniformRandomNumberGenerator>
5608 {
return this->
operator()(__urng, _M_param); }
5610 template<
typename _UniformRandomNumberGenerator>
5612 operator()(_UniformRandomNumberGenerator& __urng,
5613 const param_type& __p)
5615 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
5620 template<
typename _ForwardIterator,
5621 typename _UniformRandomNumberGenerator>
5623 __generate(_ForwardIterator __f, _ForwardIterator __t,
5624 _UniformRandomNumberGenerator& __urng)
5625 { this->__generate(__f, __t, __urng, _M_param); }
5627 template<
typename _ForwardIterator,
5628 typename _UniformRandomNumberGenerator>
5630 __generate(_ForwardIterator __f, _ForwardIterator __t,
5631 _UniformRandomNumberGenerator& __urng,
5633 { this->__generate_impl(__f, __t, __urng, __p); }
5635 template<
typename _UniformRandomNumberGenerator>
5638 _UniformRandomNumberGenerator& __urng,
5640 { this->__generate_impl(__f, __t, __urng, __p); }
5649 {
return __d1._M_param == __d2._M_param; }
5652 template<
typename _ForwardIterator,
5653 typename _UniformRandomNumberGenerator>
5655 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5656 _UniformRandomNumberGenerator& __urng,
5657 const param_type& __p);
5659 param_type _M_param;
5662#if __cpp_impl_three_way_comparison < 201907L
5667 template<
typename _RealType>
5671 {
return !(__d1 == __d2); }
5684 template<
typename _RealType,
typename _CharT,
typename _Traits>
5685 std::basic_ostream<_CharT, _Traits>&
5686 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5687 const std::exponential_distribution<_RealType>& __x);
5699 template<
typename _RealType,
typename _CharT,
typename _Traits>
5700 std::basic_istream<_CharT, _Traits>&
5701 operator>>(std::basic_istream<_CharT, _Traits>& __is,
5702 std::exponential_distribution<_RealType>& __x);
5717 template<
typename _RealType =
double>
5718 class weibull_distribution
5721 "result_type must be a floating point type");
5730 typedef weibull_distribution<_RealType> distribution_type;
5732 param_type() : param_type(1.0) { }
5735 param_type(_RealType __a, _RealType __b = _RealType(1.0))
5736 : _M_a(__a), _M_b(__b)
5748 operator==(
const param_type& __p1,
const param_type& __p2)
5749 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
5751#if __cpp_impl_three_way_comparison < 201907L
5753 operator!=(
const param_type& __p1,
const param_type& __p2)
5754 {
return !(__p1 == __p2); }
5762 weibull_distribution() : weibull_distribution(1.0) { }
5766 : _M_param(__a, __b)
5770 weibull_distribution(
const param_type& __p)
5786 {
return _M_param.a(); }
5793 {
return _M_param.b(); }
5800 {
return _M_param; }
5808 { _M_param = __param; }
5827 template<
typename _UniformRandomNumberGenerator>
5830 {
return this->
operator()(__urng, _M_param); }
5832 template<
typename _UniformRandomNumberGenerator>
5834 operator()(_UniformRandomNumberGenerator& __urng,
5835 const param_type& __p);
5837 template<
typename _ForwardIterator,
5838 typename _UniformRandomNumberGenerator>
5840 __generate(_ForwardIterator __f, _ForwardIterator __t,
5841 _UniformRandomNumberGenerator& __urng)
5842 { this->__generate(__f, __t, __urng, _M_param); }
5844 template<
typename _ForwardIterator,
5845 typename _UniformRandomNumberGenerator>
5847 __generate(_ForwardIterator __f, _ForwardIterator __t,
5848 _UniformRandomNumberGenerator& __urng,
5849 const param_type& __p)
5850 { this->__generate_impl(__f, __t, __urng, __p); }
5852 template<
typename _UniformRandomNumberGenerator>
5855 _UniformRandomNumberGenerator& __urng,
5857 { this->__generate_impl(__f, __t, __urng, __p); }
5865 const weibull_distribution& __d2)
5866 {
return __d1._M_param == __d2._M_param; }
5869 template<
typename _ForwardIterator,
5870 typename _UniformRandomNumberGenerator>
5872 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5873 _UniformRandomNumberGenerator& __urng,
5874 const param_type& __p);
5876 param_type _M_param;
5879#if __cpp_impl_three_way_comparison < 201907L
5884 template<
typename _RealType>
5888 {
return !(__d1 == __d2); }
5901 template<
typename _RealType,
typename _CharT,
typename _Traits>
5902 std::basic_ostream<_CharT, _Traits>&
5903 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5904 const std::weibull_distribution<_RealType>& __x);
5916 template<
typename _RealType,
typename _CharT,
typename _Traits>
5917 std::basic_istream<_CharT, _Traits>&
5918 operator>>(std::basic_istream<_CharT, _Traits>& __is,
5919 std::weibull_distribution<_RealType>& __x);
5934 template<
typename _RealType =
double>
5935 class extreme_value_distribution
5938 "result_type must be a floating point type");
5947 typedef extreme_value_distribution<_RealType> distribution_type;
5949 param_type() : param_type(0.0) { }
5952 param_type(_RealType __a, _RealType __b = _RealType(1.0))
5953 : _M_a(__a), _M_b(__b)
5965 operator==(
const param_type& __p1,
const param_type& __p2)
5966 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
5968#if __cpp_impl_three_way_comparison < 201907L
5970 operator!=(
const param_type& __p1,
const param_type& __p2)
5971 {
return !(__p1 == __p2); }
5979 extreme_value_distribution() : extreme_value_distribution(0.0) { }
5983 : _M_param(__a, __b)
5987 extreme_value_distribution(
const param_type& __p)
6003 {
return _M_param.a(); }
6010 {
return _M_param.b(); }
6017 {
return _M_param; }
6025 { _M_param = __param; }
6044 template<
typename _UniformRandomNumberGenerator>
6047 {
return this->
operator()(__urng, _M_param); }
6049 template<
typename _UniformRandomNumberGenerator>
6051 operator()(_UniformRandomNumberGenerator& __urng,
6052 const param_type& __p);
6054 template<
typename _ForwardIterator,
6055 typename _UniformRandomNumberGenerator>
6057 __generate(_ForwardIterator __f, _ForwardIterator __t,
6058 _UniformRandomNumberGenerator& __urng)
6059 { this->__generate(__f, __t, __urng, _M_param); }
6061 template<
typename _ForwardIterator,
6062 typename _UniformRandomNumberGenerator>
6064 __generate(_ForwardIterator __f, _ForwardIterator __t,
6065 _UniformRandomNumberGenerator& __urng,
6066 const param_type& __p)
6067 { this->__generate_impl(__f, __t, __urng, __p); }
6069 template<
typename _UniformRandomNumberGenerator>
6072 _UniformRandomNumberGenerator& __urng,
6074 { this->__generate_impl(__f, __t, __urng, __p); }
6082 const extreme_value_distribution& __d2)
6083 {
return __d1._M_param == __d2._M_param; }
6086 template<
typename _ForwardIterator,
6087 typename _UniformRandomNumberGenerator>
6089 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6090 _UniformRandomNumberGenerator& __urng,
6091 const param_type& __p);
6093 param_type _M_param;
6096#if __cpp_impl_three_way_comparison < 201907L
6101 template<
typename _RealType>
6105 {
return !(__d1 == __d2); }
6118 template<
typename _RealType,
typename _CharT,
typename _Traits>
6119 std::basic_ostream<_CharT, _Traits>&
6120 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
6121 const std::extreme_value_distribution<_RealType>& __x);
6133 template<
typename _RealType,
typename _CharT,
typename _Traits>
6134 std::basic_istream<_CharT, _Traits>&
6135 operator>>(std::basic_istream<_CharT, _Traits>& __is,
6136 std::extreme_value_distribution<_RealType>& __x);
6156 template<
typename _IntType =
int>
6157 class discrete_distribution
6160 "result_type must be an integral type");
6169 typedef discrete_distribution<_IntType> distribution_type;
6170 friend class discrete_distribution<_IntType>;
6173 : _M_prob(), _M_cp()
6176 template<
typename _InputIterator>
6177 param_type(_InputIterator __wbegin,
6178 _InputIterator __wend)
6179 : _M_prob(__wbegin, __wend), _M_cp()
6180 { _M_initialize(); }
6183 : _M_prob(__wil.begin(), __wil.end()), _M_cp()
6184 { _M_initialize(); }
6186 template<
typename _Func>
6187 param_type(
size_t __nw,
double __xmin,
double __xmax,
6191 param_type(
const param_type&) =
default;
6192 param_type& operator=(
const param_type&) =
default;
6199 operator==(
const param_type& __p1,
const param_type& __p2)
6200 {
return __p1._M_prob == __p2._M_prob; }
6202#if __cpp_impl_three_way_comparison < 201907L
6204 operator!=(
const param_type& __p1,
const param_type& __p2)
6205 {
return !(__p1 == __p2); }
6216 discrete_distribution()
6220 template<
typename _InputIterator>
6222 _InputIterator __wend)
6223 : _M_param(__wbegin, __wend)
6226 discrete_distribution(initializer_list<double> __wl)
6230 template<
typename _Func>
6231 discrete_distribution(
size_t __nw,
double __xmin,
double __xmax,
6233 : _M_param(__nw, __xmin, __xmax, __fw)
6254 return _M_param._M_prob.
empty()
6263 {
return _M_param; }
6271 { _M_param = __param; }
6286 return _M_param._M_prob.empty()
6293 template<
typename _UniformRandomNumberGenerator>
6296 {
return this->
operator()(__urng, _M_param); }
6298 template<
typename _UniformRandomNumberGenerator>
6300 operator()(_UniformRandomNumberGenerator& __urng,
6301 const param_type& __p);
6303 template<
typename _ForwardIterator,
6304 typename _UniformRandomNumberGenerator>
6306 __generate(_ForwardIterator __f, _ForwardIterator __t,
6307 _UniformRandomNumberGenerator& __urng)
6308 { this->__generate(__f, __t, __urng, _M_param); }
6310 template<
typename _ForwardIterator,
6311 typename _UniformRandomNumberGenerator>
6313 __generate(_ForwardIterator __f, _ForwardIterator __t,
6314 _UniformRandomNumberGenerator& __urng,
6315 const param_type& __p)
6316 { this->__generate_impl(__f, __t, __urng, __p); }
6318 template<
typename _UniformRandomNumberGenerator>
6321 _UniformRandomNumberGenerator& __urng,
6323 { this->__generate_impl(__f, __t, __urng, __p); }
6331 const discrete_distribution& __d2)
6332 {
return __d1._M_param == __d2._M_param; }
6344 template<
typename _IntType1,
typename _CharT,
typename _Traits>
6360 template<
typename _IntType1,
typename _CharT,
typename _Traits>
6366 template<
typename _ForwardIterator,
6367 typename _UniformRandomNumberGenerator>
6369 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6370 _UniformRandomNumberGenerator& __urng,
6371 const param_type& __p);
6373 param_type _M_param;
6376#if __cpp_impl_three_way_comparison < 201907L
6381 template<
typename _IntType>
6385 {
return !(__d1 == __d2); }
6404 template<
typename _RealType =
double>
6405 class piecewise_constant_distribution
6408 "result_type must be a floating point type");
6417 typedef piecewise_constant_distribution<_RealType> distribution_type;
6418 friend class piecewise_constant_distribution<_RealType>;
6421 : _M_int(), _M_den(), _M_cp()
6424 template<
typename _InputIteratorB,
typename _InputIteratorW>
6425 param_type(_InputIteratorB __bfirst,
6426 _InputIteratorB __bend,
6427 _InputIteratorW __wbegin);
6429 template<
typename _Func>
6432 template<
typename _Func>
6433 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
6437 param_type(
const param_type&) =
default;
6438 param_type& operator=(
const param_type&) =
default;
6446 __tmp[1] = _RealType(1);
6458 operator==(
const param_type& __p1,
const param_type& __p2)
6459 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
6461#if __cpp_impl_three_way_comparison < 201907L
6463 operator!=(
const param_type& __p1,
const param_type& __p2)
6464 {
return !(__p1 == __p2); }
6476 piecewise_constant_distribution()
6480 template<
typename _InputIteratorB,
typename _InputIteratorW>
6482 _InputIteratorB __bend,
6483 _InputIteratorW __wbegin)
6484 : _M_param(__bfirst, __bend, __wbegin)
6487 template<
typename _Func>
6488 piecewise_constant_distribution(initializer_list<_RealType> __bl,
6490 : _M_param(__bl, __fw)
6493 template<
typename _Func>
6494 piecewise_constant_distribution(
size_t __nw,
6495 _RealType __xmin, _RealType __xmax,
6497 : _M_param(__nw, __xmin, __xmax, __fw)
6501 piecewise_constant_distribution(
const param_type& __p)
6518 if (_M_param._M_int.empty())
6521 __tmp[1] = _RealType(1);
6525 return _M_param._M_int;
6534 return _M_param._M_den.
empty()
6543 {
return _M_param; }
6551 { _M_param = __param; }
6559 return _M_param._M_int.empty()
6569 return _M_param._M_int.empty()
6576 template<
typename _UniformRandomNumberGenerator>
6579 {
return this->
operator()(__urng, _M_param); }
6581 template<
typename _UniformRandomNumberGenerator>
6583 operator()(_UniformRandomNumberGenerator& __urng,
6584 const param_type& __p);
6586 template<
typename _ForwardIterator,
6587 typename _UniformRandomNumberGenerator>
6589 __generate(_ForwardIterator __f, _ForwardIterator __t,
6590 _UniformRandomNumberGenerator& __urng)
6591 { this->__generate(__f, __t, __urng, _M_param); }
6593 template<
typename _ForwardIterator,
6594 typename _UniformRandomNumberGenerator>
6596 __generate(_ForwardIterator __f, _ForwardIterator __t,
6597 _UniformRandomNumberGenerator& __urng,
6598 const param_type& __p)
6599 { this->__generate_impl(__f, __t, __urng, __p); }
6601 template<
typename _UniformRandomNumberGenerator>
6604 _UniformRandomNumberGenerator& __urng,
6606 { this->__generate_impl(__f, __t, __urng, __p); }
6614 const piecewise_constant_distribution& __d2)
6615 {
return __d1._M_param == __d2._M_param; }
6628 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6644 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6650 template<
typename _ForwardIterator,
6651 typename _UniformRandomNumberGenerator>
6653 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6654 _UniformRandomNumberGenerator& __urng,
6655 const param_type& __p);
6657 param_type _M_param;
6660#if __cpp_impl_three_way_comparison < 201907L
6665 template<
typename _RealType>
6669 {
return !(__d1 == __d2); }
6684 template<
typename _RealType =
double>
6685 class piecewise_linear_distribution
6688 "result_type must be a floating point type");
6697 typedef piecewise_linear_distribution<_RealType> distribution_type;
6698 friend class piecewise_linear_distribution<_RealType>;
6701 : _M_int(), _M_den(), _M_cp(), _M_m()
6704 template<
typename _InputIteratorB,
typename _InputIteratorW>
6705 param_type(_InputIteratorB __bfirst,
6706 _InputIteratorB __bend,
6707 _InputIteratorW __wbegin);
6709 template<
typename _Func>
6712 template<
typename _Func>
6713 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
6717 param_type(
const param_type&) =
default;
6718 param_type& operator=(
const param_type&) =
default;
6726 __tmp[1] = _RealType(1);
6738 operator==(
const param_type& __p1,
const param_type& __p2)
6739 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
6741#if __cpp_impl_three_way_comparison < 201907L
6743 operator!=(
const param_type& __p1,
const param_type& __p2)
6744 {
return !(__p1 == __p2); }
6757 piecewise_linear_distribution()
6761 template<
typename _InputIteratorB,
typename _InputIteratorW>
6763 _InputIteratorB __bend,
6764 _InputIteratorW __wbegin)
6765 : _M_param(__bfirst, __bend, __wbegin)
6768 template<
typename _Func>
6769 piecewise_linear_distribution(initializer_list<_RealType> __bl,
6771 : _M_param(__bl, __fw)
6774 template<
typename _Func>
6775 piecewise_linear_distribution(
size_t __nw,
6776 _RealType __xmin, _RealType __xmax,
6778 : _M_param(__nw, __xmin, __xmax, __fw)
6782 piecewise_linear_distribution(
const param_type& __p)
6799 if (_M_param._M_int.empty())
6802 __tmp[1] = _RealType(1);
6806 return _M_param._M_int;
6816 return _M_param._M_den.
empty()
6825 {
return _M_param; }
6833 { _M_param = __param; }
6841 return _M_param._M_int.empty()
6851 return _M_param._M_int.empty()
6858 template<
typename _UniformRandomNumberGenerator>
6861 {
return this->
operator()(__urng, _M_param); }
6863 template<
typename _UniformRandomNumberGenerator>
6865 operator()(_UniformRandomNumberGenerator& __urng,
6866 const param_type& __p);
6868 template<
typename _ForwardIterator,
6869 typename _UniformRandomNumberGenerator>
6871 __generate(_ForwardIterator __f, _ForwardIterator __t,
6872 _UniformRandomNumberGenerator& __urng)
6873 { this->__generate(__f, __t, __urng, _M_param); }
6875 template<
typename _ForwardIterator,
6876 typename _UniformRandomNumberGenerator>
6878 __generate(_ForwardIterator __f, _ForwardIterator __t,
6879 _UniformRandomNumberGenerator& __urng,
6880 const param_type& __p)
6881 { this->__generate_impl(__f, __t, __urng, __p); }
6883 template<
typename _UniformRandomNumberGenerator>
6886 _UniformRandomNumberGenerator& __urng,
6888 { this->__generate_impl(__f, __t, __urng, __p); }
6896 const piecewise_linear_distribution& __d2)
6897 {
return __d1._M_param == __d2._M_param; }
6910 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6926 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6932 template<
typename _ForwardIterator,
6933 typename _UniformRandomNumberGenerator>
6935 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6936 _UniformRandomNumberGenerator& __urng,
6937 const param_type& __p);
6939 param_type _M_param;
6942#if __cpp_impl_three_way_comparison < 201907L
6947 template<
typename _RealType>
6951 {
return !(__d1 == __d2); }
6982 template<
typename _IntType,
typename = _Require<is_
integral<_IntType>>>
6985 template<
typename _InputIterator>
6986 seed_seq(_InputIterator __begin, _InputIterator __end);
6989 template<
typename _RandomAccessIterator>
6991 generate(_RandomAccessIterator __begin, _RandomAccessIterator __end);
6994 size_t size() const noexcept
6995 {
return _M_v.
size(); }
6997 template<
typename _OutputIterator>
6999 param(_OutputIterator __dest)
const
7000 { std::copy(_M_v.
begin(), _M_v.
end(), __dest); }
7007 std::vector<result_type> _M_v;
7014_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