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;
94 operator bool() const noexcept
95 {
return _M_lo || _M_hi; }
97 _GLIBCXX14_CONSTEXPR type&
98 operator=(uint64_t __x)
noexcept
99 {
return *
this = type(__x); }
101 _GLIBCXX14_CONSTEXPR type&
102 operator++() noexcept
103 {
return *
this = *
this + 1; }
105 _GLIBCXX14_CONSTEXPR type&
106 operator--() noexcept
107 {
return *
this = *
this - 1; }
109 _GLIBCXX14_CONSTEXPR type
110 operator++(
int)
noexcept
117 _GLIBCXX14_CONSTEXPR type
118 operator--(
int)
noexcept
125 _GLIBCXX14_CONSTEXPR type&
126 operator+=(
const type& __r)
noexcept
128 _M_hi += __r._M_hi + __builtin_add_overflow(_M_lo, __r._M_lo, &_M_lo);
132 friend _GLIBCXX14_CONSTEXPR type
133 operator+(type __l,
const type& __r)
noexcept
134 {
return __l += __r; }
137 friend _GLIBCXX14_CONSTEXPR type
138 operator+(type __l, uint64_t __r)
noexcept
139 {
return __l += type(__r); }
141 _GLIBCXX14_CONSTEXPR type&
142 operator-=(
const type& __r)
noexcept
144 _M_hi -= __r._M_hi + __builtin_sub_overflow(_M_lo, __r._M_lo, &_M_lo);
149 _GLIBCXX14_CONSTEXPR type&
150 operator-=(uint64_t __r)
noexcept
152 _M_hi -= __builtin_sub_overflow(_M_lo, __r, &_M_lo);
156 friend _GLIBCXX14_CONSTEXPR type
157 operator-(type __l,
const type& __r)
noexcept
158 {
return __l -= __r; }
160 friend _GLIBCXX14_CONSTEXPR type
161 operator-(type __l, uint64_t __r)
noexcept
162 {
return __l -= __r; }
164 _GLIBCXX14_CONSTEXPR type&
165 operator*=(
const type& __x)
noexcept
168 uint32_t(_M_lo), _M_lo >> 32,
169 uint32_t(_M_hi), _M_hi >> 32,
170 uint32_t(__x._M_lo), __x._M_lo >> 32,
171 uint32_t(__x._M_hi), __x._M_hi >> 32,
174 for (
int __i = 0; __i < 4; ++__i)
177 for (
int __j = __i; __j < 4; ++__j)
179 __c += __a[__i] * __a[4 + __j - __i] + __a[8 + __j];
180 __a[8 + __j] = uint32_t(__c);
184 _M_lo = __a[8] + (__a[9] << 32);
185 _M_hi = __a[10] + (__a[11] << 32);
190 _GLIBCXX14_CONSTEXPR type&
191 operator*=(uint64_t __x)
noexcept
197 constexpr uint64_t __mask = 0xffffffff;
198 uint64_t __ll[2] = { _M_lo >> 32, _M_lo & __mask };
199 uint64_t __xx[2] = { __x >> 32, __x & __mask };
200 uint64_t __l0x0 = __ll[0] * __xx[0];
201 uint64_t __l0x1 = __ll[0] * __xx[1];
202 uint64_t __l1x0 = __ll[1] * __xx[0];
203 uint64_t __l1x1 = __ll[1] * __xx[1];
206 = (__l0x1 & __mask) + (__l1x0 & __mask) + (__l1x1 >> 32);
209 _M_hi += __l0x0 + (__l0x1 >> 32) + (__l1x0 >> 32) + (__mid >> 32);
210 _M_lo = (__mid << 32) + (__l1x1 & __mask);
214 _GLIBCXX14_CONSTEXPR type&
215 operator/=(
const type& __r)
noexcept
220 _M_lo = _M_lo / __r._M_lo;
227 uint32_t(_M_lo), _M_lo >> 32,
228 uint32_t(_M_hi), _M_hi >> 32,
230 uint32_t(__r._M_lo), __r._M_lo >> 32,
231 uint32_t(__r._M_hi), __r._M_hi >> 32,
235 uint64_t __c = 0, __w = 0;
236 if (!__r._M_hi && __r._M_lo <= ~uint32_t(0))
237 for (
int __i = 3; ; --__i)
239 __w = __a[__i] + (__c << 32);
240 __a[9 + __i] = __w / __r._M_lo;
243 __c = __w % __r._M_lo;
248 int __n = 0, __d = 0;
249 uint64_t __q = 0, __s = 0;
250 for (__d = 3; __a[5 + __d] == 0; --__d)
252 __s = (uint64_t(1) << 32) / (__a[5 + __d] + 1);
255 for (
int __i = 0; __i <= 3; ++__i)
257 __w = __a[__i] * __s + __c;
258 __a[__i] = uint32_t(__w);
263 for (
int __i = 0; __i <= 3; ++__i)
265 __w = __a[5 + __i] * __s + __c;
266 __a[5 + __i] = uint32_t(__w);
273 for (
int __i = __n - __d - 1; __i >= 0; --__i)
276 __w = (__a[__n] << 32) + __a[__n - 1];
277 if (__a[__n] != __a[5 + __d])
278 __q = __w / __a[5 + __d];
281 uint64_t __t = __w - __q * __a[5 + __d];
282 if (__t <= ~uint32_t(0)
283 && __a[4 + __d] * __q > (__t << 32) + __a[__n - 2])
286 for (
int __j = 0; __j <= __d; ++__j)
288 __w = __q * __a[5 + __j] + __c;
290 __w = __a[__i + __j] - uint32_t(__w);
291 __a[__i + __j] = uint32_t(__w);
292 __c += (__w >> 32) != 0;
294 if (int64_t(__a[__n]) < int64_t(__c))
298 for (
int __j = 0; __j <= __d; ++__j)
300 __w = __a[__i + __j] + __a[5 + __j] + __c;
302 __a[__i + __j] = uint32_t(__w);
309 _M_lo = __a[9] + (__a[10] << 32);
310 _M_hi = __a[11] + (__a[12] << 32);
315 _GLIBCXX14_CONSTEXPR type&
316 operator/=(uint64_t __r)
noexcept
317 {
return *
this /= type(__r); }
320 _GLIBCXX14_CONSTEXPR type&
321 operator%=(uint64_t __m)
noexcept
329 int __shift = __builtin_clzll(__m) + 64 - __builtin_clzll(_M_hi);
333 __x._M_hi = __m << (__shift - 64);
338 __x._M_hi = __m >> (64 - __shift);
339 __x._M_lo = __m << __shift;
342 while (_M_hi != 0 || _M_lo >= __m)
347 _M_hi -= __builtin_sub_overflow(_M_lo, __x._M_lo,
350 __x._M_lo = (__x._M_lo >> 1) | (__x._M_hi << 63);
356 friend _GLIBCXX14_CONSTEXPR type
357 operator*(type __l,
const type& __r)
noexcept
358 {
return __l *= __r; }
360 friend _GLIBCXX14_CONSTEXPR type
361 operator*(type __l, uint64_t __r)
noexcept
362 {
return __l *= __r; }
364 friend _GLIBCXX14_CONSTEXPR type
365 operator/(type __l,
const type& __r)
noexcept
366 {
return __l /= __r; }
368 friend _GLIBCXX14_CONSTEXPR type
369 operator/(type __l, uint64_t __r)
noexcept
370 {
return __l /= __r; }
372 friend _GLIBCXX14_CONSTEXPR type
373 operator%(type __l, uint64_t __m)
noexcept
374 {
return __l %= __m; }
376 friend _GLIBCXX14_CONSTEXPR type
377 operator~(type __v)
noexcept
379 __v._M_hi = ~__v._M_hi;
380 __v._M_lo = ~__v._M_lo;
384 _GLIBCXX14_CONSTEXPR type&
385 operator>>=(
unsigned __c)
noexcept
389 _M_lo = _M_hi >>= (__c - 64);
394 _M_lo = (_M_lo >> __c) | (_M_hi << (64 - __c));
400 _GLIBCXX14_CONSTEXPR type&
401 operator<<=(
unsigned __c)
noexcept
405 _M_hi = _M_lo << (__c - 64);
410 _M_hi = (_M_hi << __c) | (_M_lo >> (64 - __c));
416 friend _GLIBCXX14_CONSTEXPR type
418 {
return __x >>= __c; }
420 friend _GLIBCXX14_CONSTEXPR type
422 {
return __x <<= __c; }
424 _GLIBCXX14_CONSTEXPR type&
425 operator|=(
const type& __r)
noexcept
432 _GLIBCXX14_CONSTEXPR type&
433 operator^=(
const type& __r)
noexcept
440 _GLIBCXX14_CONSTEXPR type&
441 operator&=(
const type& __r)
noexcept
448 friend _GLIBCXX14_CONSTEXPR type
449 operator|(type __l,
const type& __r)
noexcept
450 {
return __l |= __r; }
452 friend _GLIBCXX14_CONSTEXPR type
453 operator^(type __l,
const type& __r)
noexcept
454 {
return __l ^= __r; }
456 friend _GLIBCXX14_CONSTEXPR type
457 operator&(type __l,
const type& __r)
noexcept
458 {
return __l &= __r; }
460 friend _GLIBCXX14_CONSTEXPR type
461 operator&(type __l, uint64_t __r)
noexcept
468#if __cpp_impl_three_way_comparison >= 201907L
469 friend std::strong_ordering
470 operator<=>(
const type&,
const type&) =
default;
473 operator==(
const type&,
const type&) =
default;
475 friend constexpr bool
476 operator==(
const type& __l,
const type& __r)
noexcept
477 {
return __l._M_hi == __r._M_hi && __l._M_lo == __r._M_lo; }
479 friend _GLIBCXX14_CONSTEXPR
bool
480 operator<(
const type& __l,
const type& __r)
noexcept
482 if (__l._M_hi < __r._M_hi)
484 else if (__l._M_hi == __r._M_hi)
485 return __l._M_lo < __r._M_lo;
490 friend _GLIBCXX14_CONSTEXPR
bool
491 operator>(
const type& __l,
const type& __r)
noexcept
492 {
return __r < __l; }
494 friend _GLIBCXX14_CONSTEXPR
bool
495 operator<=(
const type& __l,
const type& __r)
noexcept
496 {
return !(__r < __l); }
498 friend _GLIBCXX14_CONSTEXPR
bool
499 operator>=(
const type& __l,
const type& __r)
noexcept
500 {
return !(__l < __r); }
503 friend _GLIBCXX14_CONSTEXPR
bool
504 operator==(
const type& __l, uint64_t __r)
noexcept
505 {
return __l == type(__r); }
507 template<
typename _RealT>
508 constexpr explicit operator _RealT() const noexcept
510 static_assert(std::is_floating_point<_RealT>::value,
511 "template argument must be a floating point type");
514 : _RealT(_M_hi) * _RealT(18446744073709551616.0)
519 constexpr explicit operator uint64_t() const noexcept
527 template<
typename _UIntType,
size_t __w,
528 bool = __w < static_cast<size_t>
531 {
static constexpr _UIntType __value = 0; };
533 template<
typename _UIntType,
size_t __w>
534 struct _Shift<_UIntType, __w, true>
535 {
static constexpr _UIntType __value = _UIntType(1) << __w; };
538 int __which = ((__s <= __CHAR_BIT__ *
sizeof (int))
539 + (__s <= __CHAR_BIT__ *
sizeof (long))
540 + (__s <= __CHAR_BIT__ *
sizeof (
long long))
543 struct _Select_uint_least_t
545 static_assert(__which < 0,
546 "sorry, would be too much trouble for a slow result");
550 struct _Select_uint_least_t<__s, 4>
551 {
using type =
unsigned int; };
554 struct _Select_uint_least_t<__s, 3>
555 {
using type =
unsigned long; };
558 struct _Select_uint_least_t<__s, 2>
559 {
using type =
unsigned long long; };
561#if __SIZEOF_INT128__ > __SIZEOF_LONG_LONG__
563 struct _Select_uint_least_t<__s, 1>
564 { __extension__
using type =
unsigned __int128; };
565#elif __has_builtin(__builtin_add_overflow) \
566 && __has_builtin(__builtin_sub_overflow) \
567 && defined __UINT64_TYPE__
569 struct _Select_uint_least_t<__s, 1>
570 {
using type = __rand_uint128; };
574 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
575 bool __big_enough = (!(__m & (__m - 1))
576 || (_Tp(-1) - __c) / __a >= __m - 1),
577 bool __schrage_ok = __m % __a < __m / __a>
584 =
typename _Select_uint_least_t<
std::__lg(__a)
586 return static_cast<_Tp
>((_Tp2(__a) * __x + __c) % __m);
591 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c>
592 struct _Mod<_Tp, __m, __a, __c, false, true>
601 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
bool __s>
602 struct _Mod<_Tp, __m, __a, __c, true, __s>
607 _Tp __res = __a * __x + __c;
614 template<
typename _Tp, _Tp __m, _Tp __a = 1, _Tp __c = 0>
618 if constexpr (__a == 0)
621 return _Mod<_Tp, __m, __a, __c>::__calc(__x);
628 template<
typename _Engine,
typename _DInputType>
631 static_assert(std::is_floating_point<_DInputType>::value,
632 "template argument must be a floating point type");
635 _Adaptor(_Engine& __g)
640 {
return _DInputType(0); }
644 {
return _DInputType(1); }
668 template<
typename _Sseq>
669 using __seed_seq_generate_t =
decltype(
673 template<
typename _Sseq,
typename _Engine,
typename _Res,
674 typename _GenerateCheck = __seed_seq_generate_t<_Sseq>>
675 using _If_seed_seq_for = _Require<
676 __not_<is_same<__remove_cvref_t<_Sseq>, _Engine>>,
677 is_unsigned<typename _Sseq::result_type>,
678 __not_<is_convertible<_Sseq, _Res>>
681#pragma GCC diagnostic pop
726 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
730 "result_type must be an unsigned integral type");
731 static_assert(__m == 0u || (__a < __m && __c < __m),
732 "template argument substituting __m out of bounds");
734 template<
typename _Sseq>
775 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
796 template<
typename _Sseq>
808 {
return __c == 0u ? 1u : 0u; }
821 discard(
unsigned long long __z)
823 for (; __z != 0ULL; --__z)
833 _M_x = __detail::__mod<_UIntType, __m, __a, __c>(_M_x);
851 {
return __lhs._M_x == __rhs._M_x; }
861 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
862 _UIntType1 __m1,
typename _CharT,
typename _Traits>
866 __a1, __c1, __m1>& __lcr);
881 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
882 _UIntType1 __m1,
typename _CharT,
typename _Traits>
892#if __cpp_impl_three_way_comparison < 201907L
904 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
910 {
return !(__lhs == __rhs); }
944 template<
typename _UIntType,
size_t __w,
945 size_t __n,
size_t __m,
size_t __r,
946 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
947 _UIntType __b,
size_t __t,
948 _UIntType __c,
size_t __l, _UIntType __f>
949 class mersenne_twister_engine
952 "result_type must be an unsigned integral type");
953 static_assert(1u <= __m && __m <= __n,
954 "template argument substituting __m out of bounds");
955 static_assert(__r <= __w,
"template argument substituting "
957 static_assert(__u <= __w,
"template argument substituting "
959 static_assert(__s <= __w,
"template argument substituting "
961 static_assert(__t <= __w,
"template argument substituting "
963 static_assert(__l <= __w,
"template argument substituting "
965 static_assert(__w <= std::numeric_limits<_UIntType>::digits,
966 "template argument substituting __w out of bound");
967 static_assert(__a <= (__detail::_Shift<_UIntType, __w>::__value - 1),
968 "template argument substituting __a out of bound");
969 static_assert(__b <= (__detail::_Shift<_UIntType, __w>::__value - 1),
970 "template argument substituting __b out of bound");
971 static_assert(__c <= (__detail::_Shift<_UIntType, __w>::__value - 1),
972 "template argument substituting __c out of bound");
973 static_assert(__d <= (__detail::_Shift<_UIntType, __w>::__value - 1),
974 "template argument substituting __d out of bound");
975 static_assert(__f <= (__detail::_Shift<_UIntType, __w>::__value - 1),
976 "template argument substituting __f out of bound");
978 template<
typename _Sseq>
980 = __detail::_If_seed_seq_for<_Sseq, mersenne_twister_engine,
988 static constexpr size_t word_size = __w;
989 static constexpr size_t state_size = __n;
990 static constexpr size_t shift_size = __m;
991 static constexpr size_t mask_bits = __r;
993 static constexpr size_t tempering_u = __u;
995 static constexpr size_t tempering_s = __s;
997 static constexpr size_t tempering_t = __t;
999 static constexpr size_t tempering_l = __l;
1000 static constexpr result_type initialization_multiplier = __f;
1001 static constexpr result_type default_seed = 5489u;
1005 mersenne_twister_engine() : mersenne_twister_engine(default_seed) { }
1017 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1019 mersenne_twister_engine(_Sseq& __q)
1023 seed(result_type __sd = default_seed);
1025 template<
typename _Sseq>
1041 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1047 discard(
unsigned long long __z);
1065 operator==(
const mersenne_twister_engine& __lhs,
1066 const mersenne_twister_engine& __rhs)
1067 {
return (std::equal(__lhs._M_x, __lhs._M_x + state_size, __rhs._M_x)
1068 && __lhs._M_p == __rhs._M_p); }
1082 template<
typename _UIntType1,
1083 size_t __w1,
size_t __n1,
1084 size_t __m1,
size_t __r1,
1085 _UIntType1 __a1,
size_t __u1,
1086 _UIntType1 __d1,
size_t __s1,
1087 _UIntType1 __b1,
size_t __t1,
1088 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
1089 typename _CharT,
typename _Traits>
1093 __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
1108 template<
typename _UIntType1,
1109 size_t __w1,
size_t __n1,
1110 size_t __m1,
size_t __r1,
1111 _UIntType1 __a1,
size_t __u1,
1112 _UIntType1 __d1,
size_t __s1,
1113 _UIntType1 __b1,
size_t __t1,
1114 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
1115 typename _CharT,
typename _Traits>
1119 __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
1125 _UIntType _M_x[state_size];
1129#if __cpp_impl_three_way_comparison < 201907L
1142 template<
typename _UIntType,
size_t __w,
1143 size_t __n,
size_t __m,
size_t __r,
1144 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
1145 _UIntType __b,
size_t __t,
1146 _UIntType __c,
size_t __l, _UIntType __f>
1149 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __lhs,
1151 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __rhs)
1152 {
return !(__lhs == __rhs); }
1173 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
1174 class subtract_with_carry_engine
1177 "result_type must be an unsigned integral type");
1178 static_assert(0u < __s && __s < __r,
1180 static_assert(0u < __w && __w <= std::numeric_limits<_UIntType>::digits,
1181 "template argument substituting __w out of bounds");
1183 template<
typename _Sseq>
1185 = __detail::_If_seed_seq_for<_Sseq, subtract_with_carry_engine,
1193 static constexpr size_t word_size = __w;
1194 static constexpr size_t short_lag = __s;
1195 static constexpr size_t long_lag = __r;
1196 static constexpr uint_least32_t default_seed = 19780503u;
1198 subtract_with_carry_engine() : subtract_with_carry_engine(0u)
1215 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1217 subtract_with_carry_engine(_Sseq& __q)
1239 template<
typename _Sseq>
1257 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1263 discard(
unsigned long long __z)
1265 for (; __z != 0ULL; --__z)
1288 operator==(
const subtract_with_carry_engine& __lhs,
1289 const subtract_with_carry_engine& __rhs)
1290 {
return (std::equal(__lhs._M_x, __lhs._M_x + long_lag, __rhs._M_x)
1291 && __lhs._M_carry == __rhs._M_carry
1292 && __lhs._M_p == __rhs._M_p); }
1306 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
1307 typename _CharT,
typename _Traits>
1325 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
1326 typename _CharT,
typename _Traits>
1334 _UIntType _M_x[long_lag];
1339#if __cpp_impl_three_way_comparison < 201907L
1352 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
1358 {
return !(__lhs == __rhs); }
1370 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
1373 static_assert(1 <= __r && __r <= __p,
1374 "template argument substituting __r out of bounds");
1380 template<
typename _Sseq>
1386 static constexpr size_t block_size = __p;
1387 static constexpr size_t used_block = __r;
1395 : _M_b(), _M_n(0) { }
1405 : _M_b(__rng), _M_n(0) { }
1415 : _M_b(
std::
move(__rng)), _M_n(0) { }
1425 : _M_b(__s), _M_n(0) { }
1432 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1435 : _M_b(__q), _M_n(0)
1465 template<
typename _Sseq>
1477 const _RandomNumberEngine&
1478 base() const noexcept
1486 {
return _RandomNumberEngine::min(); }
1493 {
return _RandomNumberEngine::max(); }
1499 discard(
unsigned long long __z)
1501 for (; __z != 0ULL; --__z)
1525 {
return __lhs._M_b == __rhs._M_b && __lhs._M_n == __rhs._M_n; }
1538 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1539 typename _CharT,
typename _Traits>
1556 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1557 typename _CharT,
typename _Traits>
1564 _RandomNumberEngine _M_b;
1568#if __cpp_impl_three_way_comparison < 201907L
1580 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
1586 {
return !(__lhs == __rhs); }
1596 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1600 "result_type must be an unsigned integral type");
1601 static_assert(0u < __w && __w <= std::numeric_limits<_UIntType>::digits,
1602 "template argument substituting __w out of bounds");
1604 template<
typename _Sseq>
1656 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1683 template<
typename _Sseq>
1692 const _RandomNumberEngine&
1693 base() const noexcept
1708 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1714 discard(
unsigned long long __z)
1716 for (; __z != 0ULL; --__z)
1741 {
return __lhs._M_b == __rhs._M_b; }
1755 template<
typename _CharT,
typename _Traits>
1759 __w, _UIntType>& __x)
1766 _RandomNumberEngine _M_b;
1769#if __cpp_impl_three_way_comparison < 201907L
1782 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1788 {
return !(__lhs == __rhs); }
1801 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType,
1802 typename _CharT,
typename _Traits>
1803 std::basic_ostream<_CharT, _Traits>&
1804 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1805 const std::independent_bits_engine<_RandomNumberEngine,
1806 __w, _UIntType>& __x)
1823 template<
typename _RandomNumberEngine,
size_t __k>
1826 static_assert(1u <= __k,
"template argument substituting "
1827 "__k out of bound");
1833 template<
typename _Sseq>
1838 static constexpr size_t table_size = __k;
1847 { _M_initialize(); }
1858 { _M_initialize(); }
1869 { _M_initialize(); }
1880 { _M_initialize(); }
1887 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1891 { _M_initialize(); }
1920 template<
typename _Sseq>
1931 const _RandomNumberEngine&
1932 base() const noexcept
1940 {
return _RandomNumberEngine::min(); }
1947 {
return _RandomNumberEngine::max(); }
1953 discard(
unsigned long long __z)
1955 for (; __z != 0ULL; --__z)
1979 {
return (__lhs._M_b == __rhs._M_b
1980 && std::equal(__lhs._M_v, __lhs._M_v + __k, __rhs._M_v)
1981 && __lhs._M_y == __rhs._M_y); }
1994 template<
typename _RandomNumberEngine1,
size_t __k1,
1995 typename _CharT,
typename _Traits>
2012 template<
typename _RandomNumberEngine1,
size_t __k1,
2013 typename _CharT,
typename _Traits>
2019 void _M_initialize()
2021 for (
size_t __i = 0; __i < __k; ++__i)
2026 _RandomNumberEngine _M_b;
2027 result_type _M_v[__k];
2031#if __cpp_impl_three_way_comparison < 201907L
2043 template<
typename _RandomNumberEngine,
size_t __k>
2049 {
return !(__lhs == __rhs); }
2052#if __glibcxx_philox_engine
2081 template<
typename _UIntType,
size_t __w,
size_t __n,
size_t __r,
2082 _UIntType... __consts>
2085 static_assert(__n == 2 || __n == 4,
2086 "template argument N must be either 2 or 4");
2087 static_assert(
sizeof...(__consts) == __n,
2088 "length of consts array must match specified N");
2089 static_assert(0 < __r,
"a number of rounds must be specified");
2090 static_assert((0 < __w && __w <= numeric_limits<_UIntType>::digits),
2091 "specified bitlength must match input type");
2093 template<
typename _Sseq>
2094 static constexpr bool __is_seed_seq =
requires {
2095 typename __detail::_If_seed_seq_for<_Sseq, philox_engine, _UIntType>;
2098 template <
size_t __ind0,
size_t __ind1>
2100 array<_UIntType, __n / 2>
2103 if constexpr (__n == 4)
2104 return {__consts...[__ind0], __consts...[__ind1]};
2106 return {__consts...[__ind0]};
2110 using result_type = _UIntType;
2112 static constexpr size_t word_size = __w;
2113 static constexpr size_t word_count = __n;
2114 static constexpr size_t round_count = __r;
2115 static constexpr array<result_type, __n / 2> multipliers
2116 = _S_popArray<0,2>();
2117 static constexpr array<result_type, __n / 2> round_consts
2118 = _S_popArray<1,3>();
2121 static constexpr result_type
2126 static constexpr result_type
2129 return ((1ull << (__w - 1)) | ((1ull << (__w - 1)) - 1));
2132 static constexpr result_type default_seed = 20111115u;
2140 philox_engine(result_type __value)
2141 : _M_x{}, _M_k{}, _M_y{}, _M_i(__n - 1)
2142 { _M_k[0] = __value &
max(); }
2148 template<
typename _Sseq>
requires __is_seed_seq<_Sseq>
2156 seed(result_type __value = default_seed)
2161 _M_k[0] = __value &
max();
2169 template<
typename _Sseq>
2171 seed(_Sseq& __q)
requires __is_seed_seq<_Sseq>;
2180 for (
size_t __j = 0; __j < __n; ++__j)
2181 _M_x[__j] = __counter[__n - 1 - __j] &
max();
2191 operator==(
const philox_engine&,
const philox_engine&) =
default;
2222 template<
typename _CharT,
typename _Traits>
2225 const philox_engine& __x)
2228 const _CharT __fill = __os.
fill();
2230 _CharT __space = __os.
widen(
' ');
2232 for (
auto& __subkey : __x._M_k)
2233 __os << __subkey << __space;
2234 for (
auto& __ctr : __x._M_x)
2235 __os << __ctr << __space;
2237 __os.
flags(__flags);
2249 template <
typename _CharT,
typename _Traits>
2256 for (
auto& __subkey : __x._M_k)
2258 for (
auto& __ctr : __x._M_x)
2261 unsigned char __setIndex = 0;
2262 for (
size_t __j = 0; __j < __x._M_x.size(); ++__j)
2264 if (__x._M_x[__j] > 0)
2270 for (
size_t __j = 0; __j <= __setIndex; ++__j)
2272 if (__j != __setIndex)
2273 __x._M_x[__j] =
max();
2278 __x._M_x = __tmpCtr;
2280 __is.
flags(__flags);
2287 array<_UIntType, __n / 2> _M_k;
2289 unsigned long long _M_i = 0;
2293 _S_mulhi(_UIntType __a, _UIntType __b);
2297 _S_mullo(_UIntType __a, _UIntType __b);
2312 typedef linear_congruential_engine<uint_fast32_t, 16807UL, 0UL, 2147483647UL>
2343 0xb5026f5aa96619e9ULL, 29,
2344 0x5555555555555555ULL, 17,
2345 0x71d67fffeda60000ULL, 37,
2346 0xfff7eee000000000ULL, 43,
2363#if __glibcxx_philox_engine
2369 0xCD9E8D57, 0x9E3779B9,
2376 0xCA5A826395121157, 0x9E3779B97F4A7C15,
2395 random_device() { _M_init(
"default"); }
2412 entropy() const noexcept
2413 {
return this->_M_getentropy(); }
2417 {
return this->_M_getval(); }
2420 random_device(
const random_device&) =
delete;
2421 void operator=(
const random_device&) =
delete;
2431 double _M_getentropy() const noexcept;
2433 void _M_init(const
char*,
size_t);
2463#if __cpp_impl_three_way_comparison < 201907L
2468 template<
typename _IntType>
2470 operator!=(
const std::uniform_int_distribution<_IntType>& __d1,
2471 const std::uniform_int_distribution<_IntType>& __d2)
2472 {
return !(__d1 == __d2); }
2485 template<
typename _IntType,
typename _CharT,
typename _Traits>
2486 std::basic_ostream<_CharT, _Traits>&
2487 operator<<(std::basic_ostream<_CharT, _Traits>&,
2488 const std::uniform_int_distribution<_IntType>&);
2499 template<
typename _IntType,
typename _CharT,
typename _Traits>
2500 std::basic_istream<_CharT, _Traits>&
2501 operator>>(std::basic_istream<_CharT, _Traits>&,
2502 std::uniform_int_distribution<_IntType>&);
2515 template<
typename _RealType =
double>
2519 "result_type must be a floating point type");
2530 param_type() : param_type(0) { }
2533 param_type(_RealType __a, _RealType __b = _RealType(1))
2534 : _M_a(__a), _M_b(__b)
2536 __glibcxx_assert(_M_a <= _M_b);
2548 operator==(
const param_type& __p1,
const param_type& __p2)
2549 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
2551#if __cpp_impl_three_way_comparison < 201907L
2553 operator!=(
const param_type& __p1,
const param_type& __p2)
2554 {
return !(__p1 == __p2); }
2578 : _M_param(__a, __b)
2596 {
return _M_param.a(); }
2600 {
return _M_param.b(); }
2607 {
return _M_param; }
2615 { _M_param = __param; }
2622 {
return this->a(); }
2629 {
return this->b(); }
2634 template<
typename _UniformRandomNumberGenerator>
2637 {
return this->
operator()(__urng, _M_param); }
2639 template<
typename _UniformRandomNumberGenerator>
2641 operator()(_UniformRandomNumberGenerator& __urng,
2642 const param_type& __p)
2644 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
2646 return (__aurng() * (__p.b() - __p.a())) + __p.a();
2649 template<
typename _ForwardIterator,
2650 typename _UniformRandomNumberGenerator>
2652 __generate(_ForwardIterator __f, _ForwardIterator __t,
2653 _UniformRandomNumberGenerator& __urng)
2654 { this->__generate(__f, __t, __urng, _M_param); }
2656 template<
typename _ForwardIterator,
2657 typename _UniformRandomNumberGenerator>
2659 __generate(_ForwardIterator __f, _ForwardIterator __t,
2660 _UniformRandomNumberGenerator& __urng,
2662 { this->__generate_impl(__f, __t, __urng, __p); }
2664 template<
typename _UniformRandomNumberGenerator>
2667 _UniformRandomNumberGenerator& __urng,
2669 { this->__generate_impl(__f, __t, __urng, __p); }
2678 {
return __d1._M_param == __d2._M_param; }
2681 template<
typename _ForwardIterator,
2682 typename _UniformRandomNumberGenerator>
2684 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2685 _UniformRandomNumberGenerator& __urng,
2686 const param_type& __p);
2688 param_type _M_param;
2691#if __cpp_impl_three_way_comparison < 201907L
2696 template<
typename _IntType>
2700 {
return !(__d1 == __d2); }
2713 template<
typename _RealType,
typename _CharT,
typename _Traits>
2714 std::basic_ostream<_CharT, _Traits>&
2715 operator<<(std::basic_ostream<_CharT, _Traits>&,
2716 const std::uniform_real_distribution<_RealType>&);
2727 template<
typename _RealType,
typename _CharT,
typename _Traits>
2728 std::basic_istream<_CharT, _Traits>&
2729 operator>>(std::basic_istream<_CharT, _Traits>&,
2730 std::uniform_real_distribution<_RealType>&);
2752 template<
typename _RealType =
double>
2753 class normal_distribution
2756 "result_type must be a floating point type");
2765 typedef normal_distribution<_RealType> distribution_type;
2767 param_type() : param_type(0.0) { }
2770 param_type(_RealType __mean, _RealType __stddev = _RealType(1))
2771 : _M_mean(__mean), _M_stddev(__stddev)
2773 __glibcxx_assert(_M_stddev > _RealType(0));
2782 {
return _M_stddev; }
2785 operator==(
const param_type& __p1,
const param_type& __p2)
2786 {
return (__p1._M_mean == __p2._M_mean
2787 && __p1._M_stddev == __p2._M_stddev); }
2789#if __cpp_impl_three_way_comparison < 201907L
2791 operator!=(
const param_type& __p1,
const param_type& __p2)
2792 {
return !(__p1 == __p2); }
2797 _RealType _M_stddev;
2801 normal_distribution() : normal_distribution(0.0) { }
2810 : _M_param(__mean, __stddev)
2823 { _M_saved_available =
false; }
2830 {
return _M_param.mean(); }
2837 {
return _M_param.stddev(); }
2844 {
return _M_param; }
2852 { _M_param = __param; }
2871 template<
typename _UniformRandomNumberGenerator>
2874 {
return this->
operator()(__urng, _M_param); }
2876 template<
typename _UniformRandomNumberGenerator>
2879 const param_type& __p);
2881 template<
typename _ForwardIterator,
2882 typename _UniformRandomNumberGenerator>
2884 __generate(_ForwardIterator __f, _ForwardIterator __t,
2885 _UniformRandomNumberGenerator& __urng)
2886 { this->__generate(__f, __t, __urng, _M_param); }
2888 template<
typename _ForwardIterator,
2889 typename _UniformRandomNumberGenerator>
2891 __generate(_ForwardIterator __f, _ForwardIterator __t,
2892 _UniformRandomNumberGenerator& __urng,
2893 const param_type& __p)
2894 { this->__generate_impl(__f, __t, __urng, __p); }
2896 template<
typename _UniformRandomNumberGenerator>
2898 __generate(result_type* __f, result_type* __t,
2899 _UniformRandomNumberGenerator& __urng,
2900 const param_type& __p)
2901 { this->__generate_impl(__f, __t, __urng, __p); }
2908 template<
typename _RealType1>
2923 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2938 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2944 template<
typename _ForwardIterator,
2945 typename _UniformRandomNumberGenerator>
2947 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2948 _UniformRandomNumberGenerator& __urng,
2949 const param_type& __p);
2951 param_type _M_param;
2953 bool _M_saved_available =
false;
2956#if __cpp_impl_three_way_comparison < 201907L
2960 template<
typename _RealType>
2964 {
return !(__d1 == __d2); }
2979 template<
typename _RealType =
double>
2980 class lognormal_distribution
2983 "result_type must be a floating point type");
2992 typedef lognormal_distribution<_RealType> distribution_type;
2994 param_type() : param_type(0.0) { }
2997 param_type(_RealType __m, _RealType __s = _RealType(1))
2998 : _M_m(__m), _M_s(__s)
3010 operator==(
const param_type& __p1,
const param_type& __p2)
3011 {
return __p1._M_m == __p2._M_m && __p1._M_s == __p2._M_s; }
3013#if __cpp_impl_three_way_comparison < 201907L
3015 operator!=(
const param_type& __p1,
const param_type& __p2)
3016 {
return !(__p1 == __p2); }
3024 lognormal_distribution() : lognormal_distribution(0.0) { }
3028 : _M_param(__m, __s), _M_nd()
3032 lognormal_distribution(
const param_type& __p)
3033 : _M_param(__p), _M_nd()
3048 {
return _M_param.m(); }
3052 {
return _M_param.s(); }
3059 {
return _M_param; }
3067 { _M_param = __param; }
3086 template<
typename _UniformRandomNumberGenerator>
3089 {
return this->
operator()(__urng, _M_param); }
3091 template<
typename _UniformRandomNumberGenerator>
3093 operator()(_UniformRandomNumberGenerator& __urng,
3094 const param_type& __p)
3095 {
return std::exp(__p.s() * _M_nd(__urng) + __p.m()); }
3097 template<
typename _ForwardIterator,
3098 typename _UniformRandomNumberGenerator>
3100 __generate(_ForwardIterator __f, _ForwardIterator __t,
3101 _UniformRandomNumberGenerator& __urng)
3102 { this->__generate(__f, __t, __urng, _M_param); }
3104 template<
typename _ForwardIterator,
3105 typename _UniformRandomNumberGenerator>
3107 __generate(_ForwardIterator __f, _ForwardIterator __t,
3108 _UniformRandomNumberGenerator& __urng,
3110 { this->__generate_impl(__f, __t, __urng, __p); }
3112 template<
typename _UniformRandomNumberGenerator>
3115 _UniformRandomNumberGenerator& __urng,
3117 { this->__generate_impl(__f, __t, __urng, __p); }
3126 const lognormal_distribution& __d2)
3127 {
return (__d1._M_param == __d2._M_param
3128 && __d1._M_nd == __d2._M_nd); }
3140 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3155 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3161 template<
typename _ForwardIterator,
3162 typename _UniformRandomNumberGenerator>
3164 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3165 _UniformRandomNumberGenerator& __urng,
3166 const param_type& __p);
3168 param_type _M_param;
3173#if __cpp_impl_three_way_comparison < 201907L
3177 template<
typename _RealType>
3181 {
return !(__d1 == __d2); }
3204 template<
typename _RealType =
double>
3208 "result_type must be a floating point type");
3220 param_type() : param_type(1.0) { }
3223 param_type(_RealType __alpha_val, _RealType __beta_val = _RealType(1))
3224 : _M_alpha(__alpha_val), _M_beta(__beta_val)
3226 __glibcxx_assert(_M_alpha > _RealType(0));
3232 {
return _M_alpha; }
3239 operator==(
const param_type& __p1,
const param_type& __p2)
3240 {
return (__p1._M_alpha == __p2._M_alpha
3241 && __p1._M_beta == __p2._M_beta); }
3243#if __cpp_impl_three_way_comparison < 201907L
3245 operator!=(
const param_type& __p1,
const param_type& __p2)
3246 {
return !(__p1 == __p2); }
3256 _RealType _M_malpha, _M_a2;
3271 _RealType __beta_val = _RealType(1))
3272 : _M_param(__alpha_val, __beta_val), _M_nd()
3277 : _M_param(__p), _M_nd()
3292 {
return _M_param.alpha(); }
3299 {
return _M_param.beta(); }
3306 {
return _M_param; }
3314 { _M_param = __param; }
3333 template<
typename _UniformRandomNumberGenerator>
3336 {
return this->
operator()(__urng, _M_param); }
3338 template<
typename _UniformRandomNumberGenerator>
3341 const param_type& __p);
3343 template<
typename _ForwardIterator,
3344 typename _UniformRandomNumberGenerator>
3346 __generate(_ForwardIterator __f, _ForwardIterator __t,
3347 _UniformRandomNumberGenerator& __urng)
3348 { this->__generate(__f, __t, __urng, _M_param); }
3350 template<
typename _ForwardIterator,
3351 typename _UniformRandomNumberGenerator>
3353 __generate(_ForwardIterator __f, _ForwardIterator __t,
3354 _UniformRandomNumberGenerator& __urng,
3355 const param_type& __p)
3356 { this->__generate_impl(__f, __t, __urng, __p); }
3358 template<
typename _UniformRandomNumberGenerator>
3360 __generate(result_type* __f, result_type* __t,
3361 _UniformRandomNumberGenerator& __urng,
3362 const param_type& __p)
3363 { this->__generate_impl(__f, __t, __urng, __p); }
3373 {
return (__d1._M_param == __d2._M_param
3374 && __d1._M_nd == __d2._M_nd); }
3386 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3400 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3406 template<
typename _ForwardIterator,
3407 typename _UniformRandomNumberGenerator>
3409 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3410 _UniformRandomNumberGenerator& __urng,
3411 const param_type& __p);
3413 param_type _M_param;
3418#if __cpp_impl_three_way_comparison < 201907L
3422 template<
typename _RealType>
3426 {
return !(__d1 == __d2); }
3446 template<
typename _RealType =
double>
3447 class chi_squared_distribution
3450 "result_type must be a floating point type");
3459 typedef chi_squared_distribution<_RealType> distribution_type;
3461 param_type() : param_type(1) { }
3464 param_type(_RealType __n)
3473 operator==(
const param_type& __p1,
const param_type& __p2)
3474 {
return __p1._M_n == __p2._M_n; }
3476#if __cpp_impl_three_way_comparison < 201907L
3478 operator!=(
const param_type& __p1,
const param_type& __p2)
3479 {
return !(__p1 == __p2); }
3486 chi_squared_distribution() : chi_squared_distribution(1) { }
3490 : _M_param(__n), _M_gd(__n / 2)
3494 chi_squared_distribution(
const param_type& __p)
3495 : _M_param(__p), _M_gd(__p.n() / 2)
3510 {
return _M_param.n(); }
3517 {
return _M_param; }
3529 _M_gd.param(param_type{__param.n() / 2});
3549 template<
typename _UniformRandomNumberGenerator>
3552 {
return 2 * _M_gd(__urng); }
3554 template<
typename _UniformRandomNumberGenerator>
3556 operator()(_UniformRandomNumberGenerator& __urng,
3557 const param_type& __p)
3561 return 2 * _M_gd(__urng, param_type(__p.n() / 2));
3564 template<
typename _ForwardIterator,
3565 typename _UniformRandomNumberGenerator>
3567 __generate(_ForwardIterator __f, _ForwardIterator __t,
3568 _UniformRandomNumberGenerator& __urng)
3569 { this->__generate_impl(__f, __t, __urng); }
3571 template<
typename _ForwardIterator,
3572 typename _UniformRandomNumberGenerator>
3574 __generate(_ForwardIterator __f, _ForwardIterator __t,
3575 _UniformRandomNumberGenerator& __urng,
3577 {
typename std::gamma_distribution<result_type>::param_type
3579 this->__generate_impl(__f, __t, __urng, __p2); }
3581 template<
typename _UniformRandomNumberGenerator>
3584 _UniformRandomNumberGenerator& __urng)
3585 { this->__generate_impl(__f, __t, __urng); }
3587 template<
typename _UniformRandomNumberGenerator>
3590 _UniformRandomNumberGenerator& __urng,
3592 {
typename std::gamma_distribution<result_type>::param_type
3594 this->__generate_impl(__f, __t, __urng, __p2); }
3603 const chi_squared_distribution& __d2)
3604 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
3616 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3631 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3637 template<
typename _ForwardIterator,
3638 typename _UniformRandomNumberGenerator>
3640 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3641 _UniformRandomNumberGenerator& __urng);
3643 template<
typename _ForwardIterator,
3644 typename _UniformRandomNumberGenerator>
3646 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3647 _UniformRandomNumberGenerator& __urng,
3651 param_type _M_param;
3656#if __cpp_impl_three_way_comparison < 201907L
3660 template<
typename _RealType>
3664 {
return !(__d1 == __d2); }
3676 template<
typename _RealType =
double>
3677 class cauchy_distribution
3680 "result_type must be a floating point type");
3689 typedef cauchy_distribution<_RealType> distribution_type;
3691 param_type() : param_type(0) { }
3694 param_type(_RealType __a, _RealType __b = _RealType(1))
3695 : _M_a(__a), _M_b(__b)
3707 operator==(
const param_type& __p1,
const param_type& __p2)
3708 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
3710#if __cpp_impl_three_way_comparison < 201907L
3712 operator!=(
const param_type& __p1,
const param_type& __p2)
3713 {
return !(__p1 == __p2); }
3721 cauchy_distribution() : cauchy_distribution(0.0) { }
3725 : _M_param(__a, __b)
3729 cauchy_distribution(
const param_type& __p)
3745 {
return _M_param.a(); }
3749 {
return _M_param.b(); }
3756 {
return _M_param; }
3764 { _M_param = __param; }
3783 template<
typename _UniformRandomNumberGenerator>
3786 {
return this->
operator()(__urng, _M_param); }
3788 template<
typename _UniformRandomNumberGenerator>
3790 operator()(_UniformRandomNumberGenerator& __urng,
3791 const param_type& __p);
3793 template<
typename _ForwardIterator,
3794 typename _UniformRandomNumberGenerator>
3796 __generate(_ForwardIterator __f, _ForwardIterator __t,
3797 _UniformRandomNumberGenerator& __urng)
3798 { this->__generate(__f, __t, __urng, _M_param); }
3800 template<
typename _ForwardIterator,
3801 typename _UniformRandomNumberGenerator>
3803 __generate(_ForwardIterator __f, _ForwardIterator __t,
3804 _UniformRandomNumberGenerator& __urng,
3805 const param_type& __p)
3806 { this->__generate_impl(__f, __t, __urng, __p); }
3808 template<
typename _UniformRandomNumberGenerator>
3811 _UniformRandomNumberGenerator& __urng,
3813 { this->__generate_impl(__f, __t, __urng, __p); }
3821 const cauchy_distribution& __d2)
3822 {
return __d1._M_param == __d2._M_param; }
3825 template<
typename _ForwardIterator,
3826 typename _UniformRandomNumberGenerator>
3828 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3829 _UniformRandomNumberGenerator& __urng,
3830 const param_type& __p);
3832 param_type _M_param;
3835#if __cpp_impl_three_way_comparison < 201907L
3840 template<
typename _RealType>
3844 {
return !(__d1 == __d2); }
3857 template<
typename _RealType,
typename _CharT,
typename _Traits>
3858 std::basic_ostream<_CharT, _Traits>&
3859 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3860 const std::cauchy_distribution<_RealType>& __x);
3872 template<
typename _RealType,
typename _CharT,
typename _Traits>
3873 std::basic_istream<_CharT, _Traits>&
3874 operator>>(std::basic_istream<_CharT, _Traits>& __is,
3875 std::cauchy_distribution<_RealType>& __x);
3891 template<
typename _RealType =
double>
3892 class fisher_f_distribution
3895 "result_type must be a floating point type");
3904 typedef fisher_f_distribution<_RealType> distribution_type;
3906 param_type() : param_type(1) { }
3909 param_type(_RealType __m, _RealType __n = _RealType(1))
3910 : _M_m(__m), _M_n(__n)
3922 operator==(
const param_type& __p1,
const param_type& __p2)
3923 {
return __p1._M_m == __p2._M_m && __p1._M_n == __p2._M_n; }
3925#if __cpp_impl_three_way_comparison < 201907L
3927 operator!=(
const param_type& __p1,
const param_type& __p2)
3928 {
return !(__p1 == __p2); }
3936 fisher_f_distribution() : fisher_f_distribution(1.0) { }
3940 _RealType __n = _RealType(1))
3941 : _M_param(__m, __n), _M_gd_x(__m / 2), _M_gd_y(__n / 2)
3945 fisher_f_distribution(
const param_type& __p)
3946 : _M_param(__p), _M_gd_x(__p.m() / 2), _M_gd_y(__p.n() / 2)
3964 {
return _M_param.m(); }
3968 {
return _M_param.n(); }
3975 {
return _M_param; }
3983 { _M_param = __param; }
4002 template<
typename _UniformRandomNumberGenerator>
4005 {
return (_M_gd_x(__urng) * n()) / (_M_gd_y(__urng) * m()); }
4007 template<
typename _UniformRandomNumberGenerator>
4009 operator()(_UniformRandomNumberGenerator& __urng,
4010 const param_type& __p)
4014 return ((_M_gd_x(__urng, param_type(__p.m() / 2)) * n())
4015 / (_M_gd_y(__urng, param_type(__p.n() / 2)) * m()));
4018 template<
typename _ForwardIterator,
4019 typename _UniformRandomNumberGenerator>
4021 __generate(_ForwardIterator __f, _ForwardIterator __t,
4022 _UniformRandomNumberGenerator& __urng)
4023 { this->__generate_impl(__f, __t, __urng); }
4025 template<
typename _ForwardIterator,
4026 typename _UniformRandomNumberGenerator>
4028 __generate(_ForwardIterator __f, _ForwardIterator __t,
4029 _UniformRandomNumberGenerator& __urng,
4031 { this->__generate_impl(__f, __t, __urng, __p); }
4033 template<
typename _UniformRandomNumberGenerator>
4036 _UniformRandomNumberGenerator& __urng)
4037 { this->__generate_impl(__f, __t, __urng); }
4039 template<
typename _UniformRandomNumberGenerator>
4042 _UniformRandomNumberGenerator& __urng,
4044 { this->__generate_impl(__f, __t, __urng, __p); }
4053 const fisher_f_distribution& __d2)
4054 {
return (__d1._M_param == __d2._M_param
4055 && __d1._M_gd_x == __d2._M_gd_x
4056 && __d1._M_gd_y == __d2._M_gd_y); }
4068 template<
typename _RealType1,
typename _CharT,
typename _Traits>
4083 template<
typename _RealType1,
typename _CharT,
typename _Traits>
4089 template<
typename _ForwardIterator,
4090 typename _UniformRandomNumberGenerator>
4092 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4093 _UniformRandomNumberGenerator& __urng);
4095 template<
typename _ForwardIterator,
4096 typename _UniformRandomNumberGenerator>
4098 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4099 _UniformRandomNumberGenerator& __urng,
4100 const param_type& __p);
4102 param_type _M_param;
4107#if __cpp_impl_three_way_comparison < 201907L
4111 template<
typename _RealType>
4115 {
return !(__d1 == __d2); }
4130 template<
typename _RealType =
double>
4131 class student_t_distribution
4134 "result_type must be a floating point type");
4143 typedef student_t_distribution<_RealType> distribution_type;
4145 param_type() : param_type(1) { }
4148 param_type(_RealType __n)
4157 operator==(
const param_type& __p1,
const param_type& __p2)
4158 {
return __p1._M_n == __p2._M_n; }
4160#if __cpp_impl_three_way_comparison < 201907L
4162 operator!=(
const param_type& __p1,
const param_type& __p2)
4163 {
return !(__p1 == __p2); }
4170 student_t_distribution() : student_t_distribution(1.0) { }
4174 : _M_param(__n), _M_nd(), _M_gd(__n / 2, 2)
4178 student_t_distribution(
const param_type& __p)
4179 : _M_param(__p), _M_nd(), _M_gd(__p.n() / 2, 2)
4197 {
return _M_param.n(); }
4204 {
return _M_param; }
4212 { _M_param = __param; }
4231 template<
typename _UniformRandomNumberGenerator>
4234 {
return _M_nd(__urng) *
std::sqrt(n() / _M_gd(__urng)); }
4236 template<
typename _UniformRandomNumberGenerator>
4238 operator()(_UniformRandomNumberGenerator& __urng,
4239 const param_type& __p)
4244 const result_type __g = _M_gd(__urng, param_type(__p.n() / 2, 2));
4245 return _M_nd(__urng) *
std::sqrt(__p.n() / __g);
4248 template<
typename _ForwardIterator,
4249 typename _UniformRandomNumberGenerator>
4251 __generate(_ForwardIterator __f, _ForwardIterator __t,
4252 _UniformRandomNumberGenerator& __urng)
4253 { this->__generate_impl(__f, __t, __urng); }
4255 template<
typename _ForwardIterator,
4256 typename _UniformRandomNumberGenerator>
4258 __generate(_ForwardIterator __f, _ForwardIterator __t,
4259 _UniformRandomNumberGenerator& __urng,
4261 { this->__generate_impl(__f, __t, __urng, __p); }
4263 template<
typename _UniformRandomNumberGenerator>
4266 _UniformRandomNumberGenerator& __urng)
4267 { this->__generate_impl(__f, __t, __urng); }
4269 template<
typename _UniformRandomNumberGenerator>
4272 _UniformRandomNumberGenerator& __urng,
4274 { this->__generate_impl(__f, __t, __urng, __p); }
4283 const student_t_distribution& __d2)
4284 {
return (__d1._M_param == __d2._M_param
4285 && __d1._M_nd == __d2._M_nd && __d1._M_gd == __d2._M_gd); }
4297 template<
typename _RealType1,
typename _CharT,
typename _Traits>
4312 template<
typename _RealType1,
typename _CharT,
typename _Traits>
4318 template<
typename _ForwardIterator,
4319 typename _UniformRandomNumberGenerator>
4321 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4322 _UniformRandomNumberGenerator& __urng);
4323 template<
typename _ForwardIterator,
4324 typename _UniformRandomNumberGenerator>
4326 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4327 _UniformRandomNumberGenerator& __urng,
4328 const param_type& __p);
4330 param_type _M_param;
4336#if __cpp_impl_three_way_comparison < 201907L
4340 template<
typename _RealType>
4344 {
return !(__d1 == __d2); }
4375 param_type() : param_type(0.5) { }
4378 param_type(
double __p)
4381 __glibcxx_assert((_M_p >= 0.0) && (_M_p <= 1.0));
4389 operator==(
const param_type& __p1,
const param_type& __p2)
4390 {
return __p1._M_p == __p2._M_p; }
4392#if __cpp_impl_three_way_comparison < 201907L
4394 operator!=(
const param_type& __p1,
const param_type& __p2)
4395 {
return !(__p1 == __p2); }
4437 {
return _M_param.p(); }
4444 {
return _M_param; }
4452 { _M_param = __param; }
4471 template<
typename _UniformRandomNumberGenerator>
4474 {
return this->
operator()(__urng, _M_param); }
4476 template<
typename _UniformRandomNumberGenerator>
4478 operator()(_UniformRandomNumberGenerator& __urng,
4479 const param_type& __p)
4481 __detail::_Adaptor<_UniformRandomNumberGenerator, double>
4483 if ((__aurng() - __aurng.min())
4484 < __p.p() * (__aurng.max() - __aurng.min()))
4489 template<
typename _ForwardIterator,
4490 typename _UniformRandomNumberGenerator>
4492 __generate(_ForwardIterator __f, _ForwardIterator __t,
4493 _UniformRandomNumberGenerator& __urng)
4494 { this->__generate(__f, __t, __urng, _M_param); }
4496 template<
typename _ForwardIterator,
4497 typename _UniformRandomNumberGenerator>
4499 __generate(_ForwardIterator __f, _ForwardIterator __t,
4500 _UniformRandomNumberGenerator& __urng,
const param_type& __p)
4501 { this->__generate_impl(__f, __t, __urng, __p); }
4503 template<
typename _UniformRandomNumberGenerator>
4506 _UniformRandomNumberGenerator& __urng,
4508 { this->__generate_impl(__f, __t, __urng, __p); }
4517 {
return __d1._M_param == __d2._M_param; }
4520 template<
typename _ForwardIterator,
4521 typename _UniformRandomNumberGenerator>
4523 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4524 _UniformRandomNumberGenerator& __urng,
4525 const param_type& __p);
4527 param_type _M_param;
4530#if __cpp_impl_three_way_comparison < 201907L
4538 {
return !(__d1 == __d2); }
4551 template<
typename _CharT,
typename _Traits>
4552 std::basic_ostream<_CharT, _Traits>&
4553 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4554 const std::bernoulli_distribution& __x);
4565 template<
typename _CharT,
typename _Traits>
4566 inline std::basic_istream<_CharT, _Traits>&
4587 template<
typename _IntType =
int>
4588 class binomial_distribution
4591 "result_type must be an integral type");
4600 typedef binomial_distribution<_IntType> distribution_type;
4601 friend class binomial_distribution<_IntType>;
4603 param_type() : param_type(1) { }
4606 param_type(_IntType __t,
double __p = 0.5)
4607 : _M_t(__t), _M_p(__p)
4609 __glibcxx_assert((_M_t >= _IntType(0))
4624 operator==(
const param_type& __p1,
const param_type& __p2)
4625 {
return __p1._M_t == __p2._M_t && __p1._M_p == __p2._M_p; }
4627#if __cpp_impl_three_way_comparison < 201907L
4629 operator!=(
const param_type& __p1,
const param_type& __p2)
4630 {
return !(__p1 == __p2); }
4641#if _GLIBCXX_USE_C99_MATH_FUNCS
4642 double _M_d1, _M_d2, _M_s1, _M_s2, _M_c,
4643 _M_a1, _M_a123, _M_s, _M_lf, _M_lp1p;
4650 binomial_distribution() : binomial_distribution(1) { }
4654 : _M_param(__t, __p), _M_nd()
4658 binomial_distribution(
const param_type& __p)
4659 : _M_param(__p), _M_nd()
4674 {
return _M_param.t(); }
4681 {
return _M_param.p(); }
4688 {
return _M_param; }
4696 { _M_param = __param; }
4710 {
return _M_param.t(); }
4715 template<
typename _UniformRandomNumberGenerator>
4718 {
return this->
operator()(__urng, _M_param); }
4720 template<
typename _UniformRandomNumberGenerator>
4723 const param_type& __p);
4725 template<
typename _ForwardIterator,
4726 typename _UniformRandomNumberGenerator>
4728 __generate(_ForwardIterator __f, _ForwardIterator __t,
4729 _UniformRandomNumberGenerator& __urng)
4730 { this->__generate(__f, __t, __urng, _M_param); }
4732 template<
typename _ForwardIterator,
4733 typename _UniformRandomNumberGenerator>
4735 __generate(_ForwardIterator __f, _ForwardIterator __t,
4736 _UniformRandomNumberGenerator& __urng,
4737 const param_type& __p)
4738 { this->__generate_impl(__f, __t, __urng, __p); }
4740 template<
typename _UniformRandomNumberGenerator>
4742 __generate(result_type* __f, result_type* __t,
4743 _UniformRandomNumberGenerator& __urng,
4744 const param_type& __p)
4745 { this->__generate_impl(__f, __t, __urng, __p); }
4754 const binomial_distribution& __d2)
4755#ifdef _GLIBCXX_USE_C99_MATH_FUNCS
4756 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
4758 {
return __d1._M_param == __d2._M_param; }
4771 template<
typename _IntType1,
4772 typename _CharT,
typename _Traits>
4787 template<
typename _IntType1,
4788 typename _CharT,
typename _Traits>
4794 template<
typename _ForwardIterator,
4795 typename _UniformRandomNumberGenerator>
4797 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4798 _UniformRandomNumberGenerator& __urng,
4799 const param_type& __p);
4801 template<
typename _UniformRandomNumberGenerator>
4803 _M_waiting(_UniformRandomNumberGenerator& __urng,
4804 _IntType __t,
double __q);
4806 param_type _M_param;
4812#if __cpp_impl_three_way_comparison < 201907L
4816 template<
typename _IntType>
4820 {
return !(__d1 == __d2); }
4833 template<
typename _IntType =
int>
4834 class geometric_distribution
4837 "result_type must be an integral type");
4846 typedef geometric_distribution<_IntType> distribution_type;
4847 friend class geometric_distribution<_IntType>;
4849 param_type() : param_type(0.5) { }
4852 param_type(
double __p)
4855 __glibcxx_assert((_M_p > 0.0) && (_M_p < 1.0));
4864 operator==(
const param_type& __p1,
const param_type& __p2)
4865 {
return __p1._M_p == __p2._M_p; }
4867#if __cpp_impl_three_way_comparison < 201907L
4869 operator!=(
const param_type& __p1,
const param_type& __p2)
4870 {
return !(__p1 == __p2); }
4876 { _M_log_1_p =
std::log(1.0 - _M_p); }
4885 geometric_distribution() : geometric_distribution(0.5) { }
4893 geometric_distribution(
const param_type& __p)
4910 {
return _M_param.p(); }
4917 {
return _M_param; }
4925 { _M_param = __param; }
4944 template<
typename _UniformRandomNumberGenerator>
4947 {
return this->
operator()(__urng, _M_param); }
4949 template<
typename _UniformRandomNumberGenerator>
4951 operator()(_UniformRandomNumberGenerator& __urng,
4952 const param_type& __p);
4954 template<
typename _ForwardIterator,
4955 typename _UniformRandomNumberGenerator>
4957 __generate(_ForwardIterator __f, _ForwardIterator __t,
4958 _UniformRandomNumberGenerator& __urng)
4959 { this->__generate(__f, __t, __urng, _M_param); }
4961 template<
typename _ForwardIterator,
4962 typename _UniformRandomNumberGenerator>
4964 __generate(_ForwardIterator __f, _ForwardIterator __t,
4965 _UniformRandomNumberGenerator& __urng,
4966 const param_type& __p)
4967 { this->__generate_impl(__f, __t, __urng, __p); }
4969 template<
typename _UniformRandomNumberGenerator>
4972 _UniformRandomNumberGenerator& __urng,
4974 { this->__generate_impl(__f, __t, __urng, __p); }
4982 const geometric_distribution& __d2)
4983 {
return __d1._M_param == __d2._M_param; }
4986 template<
typename _ForwardIterator,
4987 typename _UniformRandomNumberGenerator>
4989 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4990 _UniformRandomNumberGenerator& __urng,
4991 const param_type& __p);
4993 param_type _M_param;
4996#if __cpp_impl_three_way_comparison < 201907L
5001 template<
typename _IntType>
5005 {
return !(__d1 == __d2); }
5018 template<
typename _IntType,
5019 typename _CharT,
typename _Traits>
5020 std::basic_ostream<_CharT, _Traits>&
5021 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5022 const std::geometric_distribution<_IntType>& __x);
5033 template<
typename _IntType,
5034 typename _CharT,
typename _Traits>
5035 std::basic_istream<_CharT, _Traits>&
5036 operator>>(std::basic_istream<_CharT, _Traits>& __is,
5037 std::geometric_distribution<_IntType>& __x);
5050 template<
typename _IntType =
int>
5051 class negative_binomial_distribution
5054 "result_type must be an integral type");
5063 typedef negative_binomial_distribution<_IntType> distribution_type;
5065 param_type() : param_type(1) { }
5068 param_type(_IntType __k,
double __p = 0.5)
5069 : _M_k(__k), _M_p(__p)
5071 __glibcxx_assert((_M_k > 0) && (_M_p > 0.0) && (_M_p <= 1.0));
5083 operator==(
const param_type& __p1,
const param_type& __p2)
5084 {
return __p1._M_k == __p2._M_k && __p1._M_p == __p2._M_p; }
5086#if __cpp_impl_three_way_comparison < 201907L
5088 operator!=(
const param_type& __p1,
const param_type& __p2)
5089 {
return !(__p1 == __p2); }
5097 negative_binomial_distribution() : negative_binomial_distribution(1) { }
5101 : _M_param(__k, __p), _M_gd(__k, (1.0 - __p) / __p)
5105 negative_binomial_distribution(
const param_type& __p)
5106 : _M_param(__p), _M_gd(__p.
k(), (1.0 - __p.
p()) / __p.
p())
5121 {
return _M_param.k(); }
5128 {
return _M_param.p(); }
5135 {
return _M_param; }
5143 { _M_param = __param; }
5162 template<
typename _UniformRandomNumberGenerator>
5166 template<
typename _UniformRandomNumberGenerator>
5168 operator()(_UniformRandomNumberGenerator& __urng,
5169 const param_type& __p);
5171 template<
typename _ForwardIterator,
5172 typename _UniformRandomNumberGenerator>
5174 __generate(_ForwardIterator __f, _ForwardIterator __t,
5175 _UniformRandomNumberGenerator& __urng)
5176 { this->__generate_impl(__f, __t, __urng); }
5178 template<
typename _ForwardIterator,
5179 typename _UniformRandomNumberGenerator>
5181 __generate(_ForwardIterator __f, _ForwardIterator __t,
5182 _UniformRandomNumberGenerator& __urng,
5183 const param_type& __p)
5184 { this->__generate_impl(__f, __t, __urng, __p); }
5186 template<
typename _UniformRandomNumberGenerator>
5188 __generate(result_type* __f, result_type* __t,
5189 _UniformRandomNumberGenerator& __urng)
5190 { this->__generate_impl(__f, __t, __urng); }
5192 template<
typename _UniformRandomNumberGenerator>
5195 _UniformRandomNumberGenerator& __urng,
5197 { this->__generate_impl(__f, __t, __urng, __p); }
5206 const negative_binomial_distribution& __d2)
5207 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
5220 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5235 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5241 template<
typename _ForwardIterator,
5242 typename _UniformRandomNumberGenerator>
5244 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5245 _UniformRandomNumberGenerator& __urng);
5246 template<
typename _ForwardIterator,
5247 typename _UniformRandomNumberGenerator>
5249 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5250 _UniformRandomNumberGenerator& __urng,
5251 const param_type& __p);
5253 param_type _M_param;
5258#if __cpp_impl_three_way_comparison < 201907L
5262 template<
typename _IntType>
5266 {
return !(__d1 == __d2); }
5287 template<
typename _IntType =
int>
5288 class poisson_distribution
5291 "result_type must be an integral type");
5300 typedef poisson_distribution<_IntType> distribution_type;
5301 friend class poisson_distribution<_IntType>;
5303 param_type() : param_type(1.0) { }
5306 param_type(
double __mean)
5309 __glibcxx_assert(_M_mean > 0.0);
5318 operator==(
const param_type& __p1,
const param_type& __p2)
5319 {
return __p1._M_mean == __p2._M_mean; }
5321#if __cpp_impl_three_way_comparison < 201907L
5323 operator!=(
const param_type& __p1,
const param_type& __p2)
5324 {
return !(__p1 == __p2); }
5335#if _GLIBCXX_USE_C99_MATH_FUNCS
5336 double _M_lfm, _M_sm, _M_d, _M_scx, _M_1cx, _M_c2b, _M_cb;
5342 poisson_distribution() : poisson_distribution(1.0) { }
5346 : _M_param(__mean), _M_nd()
5350 poisson_distribution(
const param_type& __p)
5351 : _M_param(__p), _M_nd()
5366 {
return _M_param.mean(); }
5373 {
return _M_param; }
5381 { _M_param = __param; }
5400 template<
typename _UniformRandomNumberGenerator>
5403 {
return this->
operator()(__urng, _M_param); }
5405 template<
typename _UniformRandomNumberGenerator>
5408 const param_type& __p);
5410 template<
typename _ForwardIterator,
5411 typename _UniformRandomNumberGenerator>
5413 __generate(_ForwardIterator __f, _ForwardIterator __t,
5414 _UniformRandomNumberGenerator& __urng)
5415 { this->__generate(__f, __t, __urng, _M_param); }
5417 template<
typename _ForwardIterator,
5418 typename _UniformRandomNumberGenerator>
5420 __generate(_ForwardIterator __f, _ForwardIterator __t,
5421 _UniformRandomNumberGenerator& __urng,
5422 const param_type& __p)
5423 { this->__generate_impl(__f, __t, __urng, __p); }
5425 template<
typename _UniformRandomNumberGenerator>
5427 __generate(result_type* __f, result_type* __t,
5428 _UniformRandomNumberGenerator& __urng,
5429 const param_type& __p)
5430 { this->__generate_impl(__f, __t, __urng, __p); }
5439 const poisson_distribution& __d2)
5440#ifdef _GLIBCXX_USE_C99_MATH_FUNCS
5441 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
5443 {
return __d1._M_param == __d2._M_param; }
5456 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5471 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5477 template<
typename _ForwardIterator,
5478 typename _UniformRandomNumberGenerator>
5480 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5481 _UniformRandomNumberGenerator& __urng,
5482 const param_type& __p);
5484 param_type _M_param;
5490#if __cpp_impl_three_way_comparison < 201907L
5494 template<
typename _IntType>
5498 {
return !(__d1 == __d2); }
5519 template<
typename _RealType =
double>
5523 "result_type must be a floating point type");
5534 param_type() : param_type(1.0) { }
5537 param_type(_RealType __lambda)
5538 : _M_lambda(__lambda)
5540 __glibcxx_assert(_M_lambda > _RealType(0));
5545 {
return _M_lambda; }
5548 operator==(
const param_type& __p1,
const param_type& __p2)
5549 {
return __p1._M_lambda == __p2._M_lambda; }
5551#if __cpp_impl_three_way_comparison < 201907L
5553 operator!=(
const param_type& __p1,
const param_type& __p2)
5554 {
return !(__p1 == __p2); }
5558 _RealType _M_lambda;
5574 : _M_param(__lambda)
5595 {
return _M_param.lambda(); }
5602 {
return _M_param; }
5610 { _M_param = __param; }
5629 template<
typename _UniformRandomNumberGenerator>
5632 {
return this->
operator()(__urng, _M_param); }
5634 template<
typename _UniformRandomNumberGenerator>
5636 operator()(_UniformRandomNumberGenerator& __urng,
5637 const param_type& __p)
5639 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
5644 template<
typename _ForwardIterator,
5645 typename _UniformRandomNumberGenerator>
5647 __generate(_ForwardIterator __f, _ForwardIterator __t,
5648 _UniformRandomNumberGenerator& __urng)
5649 { this->__generate(__f, __t, __urng, _M_param); }
5651 template<
typename _ForwardIterator,
5652 typename _UniformRandomNumberGenerator>
5654 __generate(_ForwardIterator __f, _ForwardIterator __t,
5655 _UniformRandomNumberGenerator& __urng,
5657 { this->__generate_impl(__f, __t, __urng, __p); }
5659 template<
typename _UniformRandomNumberGenerator>
5662 _UniformRandomNumberGenerator& __urng,
5664 { this->__generate_impl(__f, __t, __urng, __p); }
5673 {
return __d1._M_param == __d2._M_param; }
5676 template<
typename _ForwardIterator,
5677 typename _UniformRandomNumberGenerator>
5679 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5680 _UniformRandomNumberGenerator& __urng,
5681 const param_type& __p);
5683 param_type _M_param;
5686#if __cpp_impl_three_way_comparison < 201907L
5691 template<
typename _RealType>
5695 {
return !(__d1 == __d2); }
5708 template<
typename _RealType,
typename _CharT,
typename _Traits>
5709 std::basic_ostream<_CharT, _Traits>&
5710 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5711 const std::exponential_distribution<_RealType>& __x);
5723 template<
typename _RealType,
typename _CharT,
typename _Traits>
5724 std::basic_istream<_CharT, _Traits>&
5725 operator>>(std::basic_istream<_CharT, _Traits>& __is,
5726 std::exponential_distribution<_RealType>& __x);
5741 template<
typename _RealType =
double>
5742 class weibull_distribution
5745 "result_type must be a floating point type");
5754 typedef weibull_distribution<_RealType> distribution_type;
5756 param_type() : param_type(1.0) { }
5759 param_type(_RealType __a, _RealType __b = _RealType(1.0))
5760 : _M_a(__a), _M_b(__b)
5772 operator==(
const param_type& __p1,
const param_type& __p2)
5773 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
5775#if __cpp_impl_three_way_comparison < 201907L
5777 operator!=(
const param_type& __p1,
const param_type& __p2)
5778 {
return !(__p1 == __p2); }
5786 weibull_distribution() : weibull_distribution(1.0) { }
5790 : _M_param(__a, __b)
5794 weibull_distribution(
const param_type& __p)
5810 {
return _M_param.a(); }
5817 {
return _M_param.b(); }
5824 {
return _M_param; }
5832 { _M_param = __param; }
5851 template<
typename _UniformRandomNumberGenerator>
5854 {
return this->
operator()(__urng, _M_param); }
5856 template<
typename _UniformRandomNumberGenerator>
5858 operator()(_UniformRandomNumberGenerator& __urng,
5859 const param_type& __p);
5861 template<
typename _ForwardIterator,
5862 typename _UniformRandomNumberGenerator>
5864 __generate(_ForwardIterator __f, _ForwardIterator __t,
5865 _UniformRandomNumberGenerator& __urng)
5866 { this->__generate(__f, __t, __urng, _M_param); }
5868 template<
typename _ForwardIterator,
5869 typename _UniformRandomNumberGenerator>
5871 __generate(_ForwardIterator __f, _ForwardIterator __t,
5872 _UniformRandomNumberGenerator& __urng,
5873 const param_type& __p)
5874 { this->__generate_impl(__f, __t, __urng, __p); }
5876 template<
typename _UniformRandomNumberGenerator>
5879 _UniformRandomNumberGenerator& __urng,
5881 { this->__generate_impl(__f, __t, __urng, __p); }
5889 const weibull_distribution& __d2)
5890 {
return __d1._M_param == __d2._M_param; }
5893 template<
typename _ForwardIterator,
5894 typename _UniformRandomNumberGenerator>
5896 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5897 _UniformRandomNumberGenerator& __urng,
5898 const param_type& __p);
5900 param_type _M_param;
5903#if __cpp_impl_three_way_comparison < 201907L
5908 template<
typename _RealType>
5912 {
return !(__d1 == __d2); }
5925 template<
typename _RealType,
typename _CharT,
typename _Traits>
5926 std::basic_ostream<_CharT, _Traits>&
5927 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5928 const std::weibull_distribution<_RealType>& __x);
5940 template<
typename _RealType,
typename _CharT,
typename _Traits>
5941 std::basic_istream<_CharT, _Traits>&
5942 operator>>(std::basic_istream<_CharT, _Traits>& __is,
5943 std::weibull_distribution<_RealType>& __x);
5958 template<
typename _RealType =
double>
5959 class extreme_value_distribution
5962 "result_type must be a floating point type");
5971 typedef extreme_value_distribution<_RealType> distribution_type;
5973 param_type() : param_type(0.0) { }
5976 param_type(_RealType __a, _RealType __b = _RealType(1.0))
5977 : _M_a(__a), _M_b(__b)
5989 operator==(
const param_type& __p1,
const param_type& __p2)
5990 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
5992#if __cpp_impl_three_way_comparison < 201907L
5994 operator!=(
const param_type& __p1,
const param_type& __p2)
5995 {
return !(__p1 == __p2); }
6003 extreme_value_distribution() : extreme_value_distribution(0.0) { }
6007 : _M_param(__a, __b)
6011 extreme_value_distribution(
const param_type& __p)
6027 {
return _M_param.a(); }
6034 {
return _M_param.b(); }
6041 {
return _M_param; }
6049 { _M_param = __param; }
6068 template<
typename _UniformRandomNumberGenerator>
6071 {
return this->
operator()(__urng, _M_param); }
6073 template<
typename _UniformRandomNumberGenerator>
6075 operator()(_UniformRandomNumberGenerator& __urng,
6076 const param_type& __p);
6078 template<
typename _ForwardIterator,
6079 typename _UniformRandomNumberGenerator>
6081 __generate(_ForwardIterator __f, _ForwardIterator __t,
6082 _UniformRandomNumberGenerator& __urng)
6083 { this->__generate(__f, __t, __urng, _M_param); }
6085 template<
typename _ForwardIterator,
6086 typename _UniformRandomNumberGenerator>
6088 __generate(_ForwardIterator __f, _ForwardIterator __t,
6089 _UniformRandomNumberGenerator& __urng,
6090 const param_type& __p)
6091 { this->__generate_impl(__f, __t, __urng, __p); }
6093 template<
typename _UniformRandomNumberGenerator>
6096 _UniformRandomNumberGenerator& __urng,
6098 { this->__generate_impl(__f, __t, __urng, __p); }
6106 const extreme_value_distribution& __d2)
6107 {
return __d1._M_param == __d2._M_param; }
6110 template<
typename _ForwardIterator,
6111 typename _UniformRandomNumberGenerator>
6113 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6114 _UniformRandomNumberGenerator& __urng,
6115 const param_type& __p);
6117 param_type _M_param;
6120#if __cpp_impl_three_way_comparison < 201907L
6125 template<
typename _RealType>
6129 {
return !(__d1 == __d2); }
6142 template<
typename _RealType,
typename _CharT,
typename _Traits>
6143 std::basic_ostream<_CharT, _Traits>&
6144 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
6145 const std::extreme_value_distribution<_RealType>& __x);
6157 template<
typename _RealType,
typename _CharT,
typename _Traits>
6158 std::basic_istream<_CharT, _Traits>&
6159 operator>>(std::basic_istream<_CharT, _Traits>& __is,
6160 std::extreme_value_distribution<_RealType>& __x);
6180 template<
typename _IntType =
int>
6181 class discrete_distribution
6184 "result_type must be an integral type");
6193 typedef discrete_distribution<_IntType> distribution_type;
6194 friend class discrete_distribution<_IntType>;
6197 : _M_prob(), _M_cp()
6200 template<
typename _InputIterator>
6201 param_type(_InputIterator __wbegin,
6202 _InputIterator __wend)
6203 : _M_prob(__wbegin, __wend), _M_cp()
6204 { _M_initialize(); }
6207 : _M_prob(__wil.begin(), __wil.end()), _M_cp()
6208 { _M_initialize(); }
6210 template<
typename _Func>
6211 param_type(
size_t __nw,
double __xmin,
double __xmax,
6215 param_type(
const param_type&) =
default;
6216 param_type& operator=(
const param_type&) =
default;
6223 operator==(
const param_type& __p1,
const param_type& __p2)
6224 {
return __p1._M_prob == __p2._M_prob; }
6226#if __cpp_impl_three_way_comparison < 201907L
6228 operator!=(
const param_type& __p1,
const param_type& __p2)
6229 {
return !(__p1 == __p2); }
6240 discrete_distribution()
6244 template<
typename _InputIterator>
6246 _InputIterator __wend)
6247 : _M_param(__wbegin, __wend)
6250 discrete_distribution(initializer_list<double> __wl)
6254 template<
typename _Func>
6255 discrete_distribution(
size_t __nw,
double __xmin,
double __xmax,
6257 : _M_param(__nw, __xmin, __xmax, __fw)
6278 return _M_param._M_prob.
empty()
6287 {
return _M_param; }
6295 { _M_param = __param; }
6310 return _M_param._M_prob.empty()
6317 template<
typename _UniformRandomNumberGenerator>
6320 {
return this->
operator()(__urng, _M_param); }
6322 template<
typename _UniformRandomNumberGenerator>
6324 operator()(_UniformRandomNumberGenerator& __urng,
6325 const param_type& __p);
6327 template<
typename _ForwardIterator,
6328 typename _UniformRandomNumberGenerator>
6330 __generate(_ForwardIterator __f, _ForwardIterator __t,
6331 _UniformRandomNumberGenerator& __urng)
6332 { this->__generate(__f, __t, __urng, _M_param); }
6334 template<
typename _ForwardIterator,
6335 typename _UniformRandomNumberGenerator>
6337 __generate(_ForwardIterator __f, _ForwardIterator __t,
6338 _UniformRandomNumberGenerator& __urng,
6339 const param_type& __p)
6340 { this->__generate_impl(__f, __t, __urng, __p); }
6342 template<
typename _UniformRandomNumberGenerator>
6345 _UniformRandomNumberGenerator& __urng,
6347 { this->__generate_impl(__f, __t, __urng, __p); }
6355 const discrete_distribution& __d2)
6356 {
return __d1._M_param == __d2._M_param; }
6368 template<
typename _IntType1,
typename _CharT,
typename _Traits>
6384 template<
typename _IntType1,
typename _CharT,
typename _Traits>
6390 template<
typename _ForwardIterator,
6391 typename _UniformRandomNumberGenerator>
6393 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6394 _UniformRandomNumberGenerator& __urng,
6395 const param_type& __p);
6397 param_type _M_param;
6400#if __cpp_impl_three_way_comparison < 201907L
6405 template<
typename _IntType>
6409 {
return !(__d1 == __d2); }
6428 template<
typename _RealType =
double>
6429 class piecewise_constant_distribution
6432 "result_type must be a floating point type");
6441 typedef piecewise_constant_distribution<_RealType> distribution_type;
6442 friend class piecewise_constant_distribution<_RealType>;
6445 : _M_int(), _M_den(), _M_cp()
6448 template<
typename _InputIteratorB,
typename _InputIteratorW>
6449 param_type(_InputIteratorB __bfirst,
6450 _InputIteratorB __bend,
6451 _InputIteratorW __wbegin);
6453 template<
typename _Func>
6456 template<
typename _Func>
6457 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
6461 param_type(
const param_type&) =
default;
6462 param_type& operator=(
const param_type&) =
default;
6470 __tmp[1] = _RealType(1);
6482 operator==(
const param_type& __p1,
const param_type& __p2)
6483 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
6485#if __cpp_impl_three_way_comparison < 201907L
6487 operator!=(
const param_type& __p1,
const param_type& __p2)
6488 {
return !(__p1 == __p2); }
6496 _M_initialize2(
const _RealType* __ints, _RealType __den);
6502 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6508 piecewise_constant_distribution()
6512 template<
typename _InputIteratorB,
typename _InputIteratorW>
6514 _InputIteratorB __bend,
6515 _InputIteratorW __wbegin)
6516 : _M_param(__bfirst, __bend, __wbegin)
6519 template<
typename _Func>
6520 piecewise_constant_distribution(initializer_list<_RealType> __bl,
6522 : _M_param(__bl, __fw)
6525 template<
typename _Func>
6526 piecewise_constant_distribution(
size_t __nw,
6527 _RealType __xmin, _RealType __xmax,
6529 : _M_param(__nw, __xmin, __xmax, __fw)
6533 piecewise_constant_distribution(
const param_type& __p)
6550 if (_M_param._M_int.empty())
6553 __tmp[1] = _RealType(1);
6557 return _M_param._M_int;
6566 return _M_param._M_den.
empty()
6575 {
return _M_param; }
6583 { _M_param = __param; }
6591 return _M_param._M_int.empty()
6601 return _M_param._M_int.empty()
6608 template<
typename _UniformRandomNumberGenerator>
6611 {
return this->
operator()(__urng, _M_param); }
6613 template<
typename _UniformRandomNumberGenerator>
6615 operator()(_UniformRandomNumberGenerator& __urng,
6616 const param_type& __p);
6618 template<
typename _ForwardIterator,
6619 typename _UniformRandomNumberGenerator>
6621 __generate(_ForwardIterator __f, _ForwardIterator __t,
6622 _UniformRandomNumberGenerator& __urng)
6623 { this->__generate(__f, __t, __urng, _M_param); }
6625 template<
typename _ForwardIterator,
6626 typename _UniformRandomNumberGenerator>
6628 __generate(_ForwardIterator __f, _ForwardIterator __t,
6629 _UniformRandomNumberGenerator& __urng,
6630 const param_type& __p)
6631 { this->__generate_impl(__f, __t, __urng, __p); }
6633 template<
typename _UniformRandomNumberGenerator>
6636 _UniformRandomNumberGenerator& __urng,
6638 { this->__generate_impl(__f, __t, __urng, __p); }
6646 const piecewise_constant_distribution& __d2)
6647 {
return __d1._M_param == __d2._M_param; }
6660 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6676 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6682 template<
typename _ForwardIterator,
6683 typename _UniformRandomNumberGenerator>
6685 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6686 _UniformRandomNumberGenerator& __urng,
6687 const param_type& __p);
6689 param_type _M_param;
6692#if __cpp_impl_three_way_comparison < 201907L
6697 template<
typename _RealType>
6701 {
return !(__d1 == __d2); }
6716 template<
typename _RealType =
double>
6717 class piecewise_linear_distribution
6720 "result_type must be a floating point type");
6729 typedef piecewise_linear_distribution<_RealType> distribution_type;
6730 friend class piecewise_linear_distribution<_RealType>;
6733 : _M_int(), _M_den(), _M_cp(), _M_m()
6736 template<
typename _InputIteratorB,
typename _InputIteratorW>
6737 param_type(_InputIteratorB __bfirst,
6738 _InputIteratorB __bend,
6739 _InputIteratorW __wbegin);
6741 template<
typename _Func>
6744 template<
typename _Func>
6745 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
6749 param_type(
const param_type&) =
default;
6750 param_type& operator=(
const param_type&) =
default;
6758 __tmp[1] = _RealType(1);
6770 operator==(
const param_type& __p1,
const param_type& __p2)
6771 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
6773#if __cpp_impl_three_way_comparison < 201907L
6775 operator!=(
const param_type& __p1,
const param_type& __p2)
6776 {
return !(__p1 == __p2); }
6784 _M_initialize2(
const _RealType* __ints,
const _RealType* __dens);
6791 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6797 piecewise_linear_distribution()
6801 template<
typename _InputIteratorB,
typename _InputIteratorW>
6803 _InputIteratorB __bend,
6804 _InputIteratorW __wbegin)
6805 : _M_param(__bfirst, __bend, __wbegin)
6808 template<
typename _Func>
6809 piecewise_linear_distribution(initializer_list<_RealType> __bl,
6811 : _M_param(__bl, __fw)
6814 template<
typename _Func>
6815 piecewise_linear_distribution(
size_t __nw,
6816 _RealType __xmin, _RealType __xmax,
6818 : _M_param(__nw, __xmin, __xmax, __fw)
6822 piecewise_linear_distribution(
const param_type& __p)
6839 if (_M_param._M_int.empty())
6842 __tmp[1] = _RealType(1);
6846 return _M_param._M_int;
6856 return _M_param._M_den.
empty()
6865 {
return _M_param; }
6873 { _M_param = __param; }
6881 return _M_param._M_int.empty()
6891 return _M_param._M_int.empty()
6898 template<
typename _UniformRandomNumberGenerator>
6901 {
return this->
operator()(__urng, _M_param); }
6903 template<
typename _UniformRandomNumberGenerator>
6905 operator()(_UniformRandomNumberGenerator& __urng,
6906 const param_type& __p);
6908 template<
typename _ForwardIterator,
6909 typename _UniformRandomNumberGenerator>
6911 __generate(_ForwardIterator __f, _ForwardIterator __t,
6912 _UniformRandomNumberGenerator& __urng)
6913 { this->__generate(__f, __t, __urng, _M_param); }
6915 template<
typename _ForwardIterator,
6916 typename _UniformRandomNumberGenerator>
6918 __generate(_ForwardIterator __f, _ForwardIterator __t,
6919 _UniformRandomNumberGenerator& __urng,
6920 const param_type& __p)
6921 { this->__generate_impl(__f, __t, __urng, __p); }
6923 template<
typename _UniformRandomNumberGenerator>
6926 _UniformRandomNumberGenerator& __urng,
6928 { this->__generate_impl(__f, __t, __urng, __p); }
6936 const piecewise_linear_distribution& __d2)
6937 {
return __d1._M_param == __d2._M_param; }
6950 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6966 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6972 template<
typename _ForwardIterator,
6973 typename _UniformRandomNumberGenerator>
6975 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6976 _UniformRandomNumberGenerator& __urng,
6977 const param_type& __p);
6979 param_type _M_param;
6982#if __cpp_impl_three_way_comparison < 201907L
6987 template<
typename _RealType>
6991 {
return !(__d1 == __d2); }
7022 template<
typename _IntType,
typename = _Require<is_
integral<_IntType>>>
7025 template<
typename _InputIterator>
7026 seed_seq(_InputIterator __begin, _InputIterator __end);
7029 template<
typename _RandomAccessIterator>
7031 generate(_RandomAccessIterator __begin, _RandomAccessIterator __end);
7034 size_t size() const noexcept
7035 {
return _M_v.
size(); }
7037 template<
typename _OutputIterator>
7039 param(_OutputIterator __dest)
const
7040 { std::copy(_M_v.
begin(), _M_v.
end(), __dest); }
7047 std::vector<result_type> _M_v;
7054_GLIBCXX_END_NAMESPACE_VERSION
constexpr bool operator<=(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr bool operator>=(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr duration< __common_rep_t< _Rep1, __disable_if_is_duration< _Rep2 > >, _Period > operator%(const duration< _Rep1, _Period > &__d, const _Rep2 &__s)
constexpr bool operator<(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr bool operator>(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr complex< _Tp > operator*(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x times y.
constexpr complex< _Tp > operator-(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x minus y.
complex< _Tp > log(const complex< _Tp > &)
Return complex natural logarithm of z.
constexpr complex< _Tp > operator+(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x plus y.
complex< _Tp > exp(const complex< _Tp > &)
Return complex base e exponential of z.
constexpr complex< _Tp > operator/(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x divided by y.
complex< _Tp > sqrt(const complex< _Tp > &)
Return complex square root of z.
auto declval() noexcept -> decltype(__declval< _Tp >(0))
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
_RealType generate_canonical(_UniformRandomNumberGenerator &__g)
A function template for converting the output of a (integral) uniform random number generator to a fl...
basic_string< char > string
A string of char.
linear_congruential_engine< uint_fast32_t, 48271UL, 0UL, 2147483647UL > minstd_rand
philox_engine< uint_fast32_t, 32, 4, 10, 0xCD9E8D57, 0x9E3779B9, 0xD2511F53, 0xBB67AE85 > philox4x32
32-bit four-word Philox engine.
linear_congruential_engine< uint_fast32_t, 16807UL, 0UL, 2147483647UL > minstd_rand0
mersenne_twister_engine< uint_fast32_t, 32, 624, 397, 31, 0x9908b0dfUL, 11, 0xffffffffUL, 7, 0x9d2c5680UL, 15, 0xefc60000UL, 18, 1812433253UL > mt19937
mersenne_twister_engine< uint_fast64_t, 64, 312, 156, 31, 0xb5026f5aa96619e9ULL, 29, 0x5555555555555555ULL, 17, 0x71d67fffeda60000ULL, 37, 0xfff7eee000000000ULL, 43, 6364136223846793005ULL > mt19937_64
philox_engine< uint_fast64_t, 64, 4, 10, 0xCA5A826395121157, 0x9E3779B97F4A7C15, 0xD2E7470EE14C6C93, 0xBB67AE8584CAA73B > philox4x64
64-bit four-word Philox engine.
ISO C++ entities toplevel namespace is std.
constexpr _Tp __lg(_Tp __n)
This is a helper function for the sort routines and for random.tcc.
constexpr auto size(const _Container &__cont) noexcept(noexcept(__cont.size())) -> decltype(__cont.size())
Return the size of a container.
constexpr bitset< _Nb > operator^(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, bitset< _Nb > &__x)
Global I/O operators for bitsets.
std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const bitset< _Nb > &__x)
Global I/O operators for bitsets.
constexpr bitset< _Nb > operator|(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
constexpr bitset< _Nb > operator&(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
Implementation details not part of the namespace std interface.
A standard container for storing a fixed size sequence of elements.
Template class basic_istream.
static constexpr int digits
static constexpr _Tp max() noexcept
static constexpr _Tp lowest() noexcept
static constexpr _Tp min() noexcept
char_type widen(char __c) const
Widens characters.
char_type fill() const
Retrieves the empty character.
static const fmtflags skipws
Skips leading white space before certain input operations.
_Ios_Fmtflags fmtflags
This is a bitmask type.
static const fmtflags dec
Converts integer input or generates integer output in decimal base.
fmtflags flags() const
Access to format flags.
static const fmtflags left
Adds fill characters on the right (final positions) of certain generated output. (I....
Template class basic_ostream.
A model of a linear congruential random number generator.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::linear_congruential_engine< _UIntType1, __a1, __c1, __m1 > &__lcr)
Sets the state of the engine by reading its textual representation from __is.
static constexpr result_type min()
Gets the smallest possible value in the output range.
static constexpr result_type multiplier
void discard(unsigned long long __z)
Discard a sequence of random numbers.
static constexpr result_type modulus
linear_congruential_engine()
Constructs a linear_congruential_engine random number generator engine with seed 1.
void seed(result_type __s=default_seed)
Reseeds the linear_congruential_engine random number generator engine sequence to the seed __s.
static constexpr result_type increment
friend bool operator==(const linear_congruential_engine &__lhs, const linear_congruential_engine &__rhs)
Compares two linear congruential random number generator objects of the same type for equality.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::linear_congruential_engine< _UIntType1, __a1, __c1, __m1 > &__lcr)
Writes the textual representation of the state x(i) of x to __os.
result_type operator()()
Gets the next random number in the sequence.
static constexpr result_type max()
Gets the largest possible value in the output range.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::mersenne_twister_engine< _UIntType1, __w1, __n1, __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1, __l1, __f1 > &__x)
Extracts the current state of a % mersenne_twister_engine random number generator engine __x from the...
static constexpr result_type max()
Gets the largest possible value in the output range.
friend bool operator==(const mersenne_twister_engine &__lhs, const mersenne_twister_engine &__rhs)
Compares two % mersenne_twister_engine random number generator objects of the same type for equality.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::mersenne_twister_engine< _UIntType1, __w1, __n1, __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1, __l1, __f1 > &__x)
Inserts the current state of a % mersenne_twister_engine random number generator engine __x into the ...
static constexpr result_type min()
Gets the smallest possible value in the output range.
The Marsaglia-Zaman generator.
void seed(result_type __sd=0u)
Seeds the initial state of the random number generator.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::subtract_with_carry_engine< _UIntType1, __w1, __s1, __r1 > &__x)
Inserts the current state of a % subtract_with_carry_engine random number generator engine __x into t...
void discard(unsigned long long __z)
Discard a sequence of random numbers.
result_type operator()()
Gets the next random number in the sequence.
static constexpr result_type min()
Gets the inclusive minimum value of the range of random integers returned by this generator.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::subtract_with_carry_engine< _UIntType1, __w1, __s1, __r1 > &__x)
Extracts the current state of a % subtract_with_carry_engine random number generator engine __x from ...
friend bool operator==(const subtract_with_carry_engine &__lhs, const subtract_with_carry_engine &__rhs)
Compares two % subtract_with_carry_engine random number generator objects of the same type for equali...
static constexpr result_type max()
Gets the inclusive maximum value of the range of random integers returned by this generator.
static constexpr result_type min()
Gets the minimum value in the generated random number range.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::discard_block_engine< _RandomNumberEngine1, __p1, __r1 > &__x)
Inserts the current state of a discard_block_engine random number generator engine __x into the outpu...
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine object.
void seed()
Reseeds the discard_block_engine object with the default seed for the underlying base class generator...
void discard(unsigned long long __z)
Discard a sequence of random numbers.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::discard_block_engine< _RandomNumberEngine1, __p1, __r1 > &__x)
Extracts the current state of a % subtract_with_carry_engine random number generator engine __x from ...
static constexpr result_type max()
Gets the maximum value in the generated random number range.
discard_block_engine()
Constructs a default discard_block_engine engine.
friend bool operator==(const discard_block_engine &__lhs, const discard_block_engine &__rhs)
Compares two discard_block_engine random number generator objects of the same type for equality.
result_type operator()()
Gets the next value in the generated random number sequence.
_RandomNumberEngine::result_type result_type
static constexpr result_type min()
Gets the minimum value in the generated random number range.
result_type operator()()
Gets the next value in the generated random number sequence.
void seed()
Reseeds the independent_bits_engine object with the default seed for the underlying base class genera...
void discard(unsigned long long __z)
Discard a sequence of random numbers.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType > &__x)
Extracts the current state of a % subtract_with_carry_engine random number generator engine __x from ...
friend bool operator==(const independent_bits_engine &__lhs, const independent_bits_engine &__rhs)
Compares two independent_bits_engine random number generator objects of the same type for equality.
static constexpr result_type max()
Gets the maximum value in the generated random number range.
independent_bits_engine()
Constructs a default independent_bits_engine engine.
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine object.
Produces random numbers by reordering random numbers from some base engine.
static constexpr result_type min()
shuffle_order_engine()
Constructs a default shuffle_order_engine engine.
static constexpr result_type max()
const _RandomNumberEngine & base() const noexcept
void seed()
Reseeds the shuffle_order_engine object with the default seed for the underlying base class generator...
_RandomNumberEngine::result_type result_type
friend bool operator==(const shuffle_order_engine &__lhs, const shuffle_order_engine &__rhs)
void discard(unsigned long long __z)
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::shuffle_order_engine< _RandomNumberEngine1, __k1 > &__x)
Inserts the current state of a shuffle_order_engine random number generator engine __x into the outpu...
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::shuffle_order_engine< _RandomNumberEngine1, __k1 > &__x)
Extracts the current state of a % subtract_with_carry_engine random number generator engine __x from ...
A discrete pseudorandom number generator with weak cryptographic properties.
void set_counter(const array< result_type, __n > &__counter)
sets the internal counter "cleartext"
friend basic_istream< _CharT, _Traits > & operator>>(basic_istream< _CharT, _Traits > &__is, philox_engine &__x)
takes input to set the state of the philox_engine object
void discard(unsigned long long __z)
discards __z numbers
void seed(_Sseq &__q)
seeds philox_engine by seed sequence
static constexpr result_type max()
The maximum value that this engine can return.
result_type operator()()
outputs a single w-bit number and handles state advancement
friend bool operator==(const philox_engine &, const philox_engine &)=default
compares two philox_engine objects
static constexpr result_type min()
The minimum value that this engine can return.
philox_engine(_Sseq &__q)
seed sequence constructor for philox_engine
friend basic_ostream< _CharT, _Traits > & operator<<(basic_ostream< _CharT, _Traits > &__os, const philox_engine &__x)
outputs the state of the generator
Uniform continuous distribution for random numbers.
param_type param() const
Returns the parameter set of the distribution.
void reset()
Resets the distribution state.
uniform_real_distribution(_RealType __a, _RealType __b=_RealType(1))
Constructs a uniform_real_distribution object.
result_type min() const
Returns the inclusive lower bound of the distribution range.
friend bool operator==(const uniform_real_distribution &__d1, const uniform_real_distribution &__d2)
Return true if two uniform real distributions have the same parameters.
result_type max() const
Returns the inclusive upper bound of the distribution range.
uniform_real_distribution()
Constructs a uniform_real_distribution object.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void param(const param_type &__param)
Sets the parameter set of the distribution.
A normal continuous distribution for random numbers.
result_type operator()(_UniformRandomNumberGenerator &__urng, const param_type &__p)
_RealType stddev() const
Returns the standard deviation of the distribution.
param_type param() const
Returns the parameter set of the distribution.
void reset()
Resets the distribution state.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::normal_distribution< _RealType1 > &__x)
Extracts a normal_distribution random number distribution __x from the input stream __is.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
_RealType mean() const
Returns the mean of the distribution.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::normal_distribution< _RealType1 > &__x)
Inserts a normal_distribution random number distribution __x into the output stream __os.
normal_distribution(result_type __mean, result_type __stddev=result_type(1))
result_type max() const
Returns the least upper bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend bool operator==(const std::normal_distribution< _RealType1 > &__d1, const std::normal_distribution< _RealType1 > &__d2)
Return true if two normal distributions have the same parameters and the sequences that would be gene...
A lognormal_distribution random number distribution.
friend bool operator==(const lognormal_distribution &__d1, const lognormal_distribution &__d2)
Return true if two lognormal distributions have the same parameters and the sequences that would be g...
param_type param() const
Returns the parameter set of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::lognormal_distribution< _RealType1 > &__x)
Extracts a lognormal_distribution random number distribution __x from the input stream __is.
result_type min() const
Returns the greatest lower bound value of the distribution.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::lognormal_distribution< _RealType1 > &__x)
Inserts a lognormal_distribution random number distribution __x into the output stream __os.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
A gamma continuous distribution for random numbers.
result_type operator()(_UniformRandomNumberGenerator &__urng, const param_type &__p)
gamma_distribution(_RealType __alpha_val, _RealType __beta_val=_RealType(1))
Constructs a gamma distribution with parameters and .
void reset()
Resets the distribution state.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::gamma_distribution< _RealType1 > &__x)
Inserts a gamma_distribution random number distribution __x into the output stream __os.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type min() const
Returns the greatest lower bound value of the distribution.
_RealType alpha() const
Returns the of the distribution.
gamma_distribution()
Constructs a gamma distribution with parameters 1 and 1.
friend bool operator==(const gamma_distribution &__d1, const gamma_distribution &__d2)
Return true if two gamma distributions have the same parameters and the sequences that would be gener...
void param(const param_type &__param)
Sets the parameter set of the distribution.
_RealType beta() const
Returns the of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::gamma_distribution< _RealType1 > &__x)
Extracts a gamma_distribution random number distribution __x from the input stream __is.
param_type param() const
Returns the parameter set of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
A chi_squared_distribution random number distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
param_type param() const
Returns the parameter set of the distribution.
friend bool operator==(const chi_squared_distribution &__d1, const chi_squared_distribution &__d2)
Return true if two Chi-squared distributions have the same parameters and the sequences that would be...
result_type min() const
Returns the greatest lower bound value of the distribution.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::chi_squared_distribution< _RealType1 > &__x)
Inserts a chi_squared_distribution random number distribution __x into the output stream __os.
void reset()
Resets the distribution state.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::chi_squared_distribution< _RealType1 > &__x)
Extracts a chi_squared_distribution random number distribution __x from the input stream __is.
A cauchy_distribution random number distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
friend bool operator==(const cauchy_distribution &__d1, const cauchy_distribution &__d2)
Return true if two Cauchy distributions have the same parameters.
void reset()
Resets the distribution state.
param_type param() const
Returns the parameter set of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type max() const
Returns the least upper bound value of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
A fisher_f_distribution random number distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
void reset()
Resets the distribution state.
param_type param() const
Returns the parameter set of the distribution.
friend bool operator==(const fisher_f_distribution &__d1, const fisher_f_distribution &__d2)
Return true if two Fisher f distributions have the same parameters and the sequences that would be ge...
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::fisher_f_distribution< _RealType1 > &__x)
Inserts a fisher_f_distribution random number distribution __x into the output stream __os.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::fisher_f_distribution< _RealType1 > &__x)
Extracts a fisher_f_distribution random number distribution __x from the input stream __is.
A student_t_distribution random number distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
void reset()
Resets the distribution state.
friend bool operator==(const student_t_distribution &__d1, const student_t_distribution &__d2)
Return true if two Student t distributions have the same parameters and the sequences that would be g...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::student_t_distribution< _RealType1 > &__x)
Inserts a student_t_distribution random number distribution __x into the output stream __os.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::student_t_distribution< _RealType1 > &__x)
Extracts a student_t_distribution random number distribution __x from the input stream __is.
param_type param() const
Returns the parameter set of the distribution.
A Bernoulli random number distribution.
void reset()
Resets the distribution state.
result_type max() const
Returns the least upper bound value of the distribution.
friend bool operator==(const bernoulli_distribution &__d1, const bernoulli_distribution &__d2)
Return true if two Bernoulli distributions have the same parameters.
param_type param() const
Returns the parameter set of the distribution.
bernoulli_distribution()
Constructs a Bernoulli distribution with likelihood 0.5.
bernoulli_distribution(double __p)
Constructs a Bernoulli distribution with likelihood p.
result_type min() const
Returns the greatest lower bound value of the distribution.
double p() const
Returns the p parameter of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
A discrete binomial random number distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend bool operator==(const binomial_distribution &__d1, const binomial_distribution &__d2)
Return true if two binomial distributions have the same parameters and the sequences that would be ge...
param_type param() const
Returns the parameter set of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::binomial_distribution< _IntType1 > &__x)
Extracts a binomial_distribution random number distribution __x from the input stream __is.
_IntType t() const
Returns the distribution t parameter.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::binomial_distribution< _IntType1 > &__x)
Inserts a binomial_distribution random number distribution __x into the output stream __os.
void reset()
Resets the distribution state.
double p() const
Returns the distribution p parameter.
result_type operator()(_UniformRandomNumberGenerator &__urng, const param_type &__p)
A discrete geometric random number distribution.
double p() const
Returns the distribution parameter p.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type max() const
Returns the least upper bound value of the distribution.
friend bool operator==(const geometric_distribution &__d1, const geometric_distribution &__d2)
Return true if two geometric distributions have the same parameters.
param_type param() const
Returns the parameter set of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
void reset()
Resets the distribution state.
result_type min() const
Returns the greatest lower bound value of the distribution.
A negative_binomial_distribution random number distribution.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::negative_binomial_distribution< _IntType1 > &__x)
Inserts a negative_binomial_distribution random number distribution __x into the output stream __os.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::negative_binomial_distribution< _IntType1 > &__x)
Extracts a negative_binomial_distribution random number distribution __x from the input stream __is.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
double p() const
Return the parameter of the distribution.
friend bool operator==(const negative_binomial_distribution &__d1, const negative_binomial_distribution &__d2)
Return true if two negative binomial distributions have the same parameters and the sequences that wo...
param_type param() const
Returns the parameter set of the distribution.
_IntType k() const
Return the parameter of the distribution.
void reset()
Resets the distribution state.
A discrete Poisson random number distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng, const param_type &__p)
void reset()
Resets the distribution state.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
double mean() const
Returns the distribution parameter mean.
friend bool operator==(const poisson_distribution &__d1, const poisson_distribution &__d2)
Return true if two Poisson distributions have the same parameters and the sequences that would be gen...
result_type max() const
Returns the least upper bound value of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::poisson_distribution< _IntType1 > &__x)
Inserts a poisson_distribution random number distribution __x into the output stream __os.
param_type param() const
Returns the parameter set of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::poisson_distribution< _IntType1 > &__x)
Extracts a poisson_distribution random number distribution __x from the input stream __is.
result_type min() const
Returns the greatest lower bound value of the distribution.
An exponential continuous distribution for random numbers.
_RealType lambda() const
Returns the inverse scale parameter of the distribution.
exponential_distribution()
Constructs an exponential distribution with inverse scale parameter 1.0.
exponential_distribution(_RealType __lambda)
Constructs an exponential distribution with inverse scale parameter .
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void reset()
Resets the distribution state.
result_type min() const
Returns the greatest lower bound value of the distribution.
param_type param() const
Returns the parameter set of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
friend bool operator==(const exponential_distribution &__d1, const exponential_distribution &__d2)
Return true if two exponential distributions have the same parameters.
A weibull_distribution random number distribution.
param_type param() const
Returns the parameter set of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
void reset()
Resets the distribution state.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend bool operator==(const weibull_distribution &__d1, const weibull_distribution &__d2)
Return true if two Weibull distributions have the same parameters.
void param(const param_type &__param)
Sets the parameter set of the distribution.
_RealType b() const
Return the parameter of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
_RealType a() const
Return the parameter of the distribution.
A extreme_value_distribution random number distribution.
void reset()
Resets the distribution state.
_RealType b() const
Return the parameter of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
_RealType a() const
Return the parameter of the distribution.
friend bool operator==(const extreme_value_distribution &__d1, const extreme_value_distribution &__d2)
Return true if two extreme value distributions have the same parameters.
param_type param() const
Returns the parameter set of the distribution.
A discrete_distribution random number distribution.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::discrete_distribution< _IntType1 > &__x)
Inserts a discrete_distribution random number distribution __x into the output stream __os.
result_type min() const
Returns the greatest lower bound value of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::discrete_distribution< _IntType1 > &__x)
Extracts a discrete_distribution random number distribution __x from the input stream __is.
result_type max() const
Returns the least upper bound value of the distribution.
void reset()
Resets the distribution state.
param_type param() const
Returns the parameter set of the distribution.
friend bool operator==(const discrete_distribution &__d1, const discrete_distribution &__d2)
Return true if two discrete distributions have the same parameters.
std::vector< double > probabilities() const
Returns the probabilities of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void param(const param_type &__param)
Sets the parameter set of the distribution.
A piecewise_constant_distribution random number distribution.
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