37namespace std _GLIBCXX_VISIBILITY(default)
39_GLIBCXX_BEGIN_NAMESPACE_VERSION
58 template<
typename _RealType,
size_t __bits,
59 typename _UniformRandomNumberGenerator>
67 template<
typename _UIntType,
size_t __w,
68 bool = __w < static_cast<size_t>
71 {
static constexpr _UIntType __value = 0; };
73 template<
typename _UIntType,
size_t __w>
74 struct _Shift<_UIntType, __w, true>
75 {
static constexpr _UIntType __value = _UIntType(1) << __w; };
78 int __which = ((__s <= __CHAR_BIT__ *
sizeof (int))
79 + (__s <= __CHAR_BIT__ *
sizeof (long))
80 + (__s <= __CHAR_BIT__ *
sizeof (
long long))
83 struct _Select_uint_least_t
85 static_assert(__which < 0,
86 "sorry, would be too much trouble for a slow result");
90 struct _Select_uint_least_t<__s, 4>
91 {
using type =
unsigned int; };
94 struct _Select_uint_least_t<__s, 3>
95 {
using type =
unsigned long; };
98 struct _Select_uint_least_t<__s, 2>
99 {
using type =
unsigned long long; };
101#if __SIZEOF_INT128__ > __SIZEOF_LONG_LONG__
103 struct _Select_uint_least_t<__s, 1>
104 { __extension__
using type =
unsigned __int128; };
108 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
109 bool __big_enough = (!(__m & (__m - 1))
110 || (_Tp(-1) - __c) / __a >= __m - 1),
111 bool __schrage_ok = __m % __a < __m / __a>
118 =
typename _Select_uint_least_t<
std::__lg(__a)
120 return static_cast<_Tp
>((_Tp2(__a) * __x + __c) % __m);
125 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c>
126 struct _Mod<_Tp, __m, __a, __c, false, true>
135 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
bool __s>
136 struct _Mod<_Tp, __m, __a, __c, true, __s>
141 _Tp __res = __a * __x + __c;
148 template<
typename _Tp, _Tp __m, _Tp __a = 1, _Tp __c = 0>
152 if _GLIBCXX17_CONSTEXPR (__a == 0)
157 constexpr _Tp __a1 = __a ? __a : 1;
158 return _Mod<_Tp, __m, __a1, __c>::__calc(__x);
166 template<
typename _Engine,
typename _DInputType>
170 "template argument must be a floating point type");
173 _Adaptor(_Engine& __g)
178 {
return _DInputType(0); }
182 {
return _DInputType(1); }
206 template<
typename _Sseq>
207 using __seed_seq_generate_t =
decltype(
208 std::declval<_Sseq&>().generate(std::declval<uint_least32_t*>(),
209 std::declval<uint_least32_t*>()));
211 template<
typename _Sseq,
typename _Engine,
typename _Res,
212 typename _GenerateCheck = __seed_seq_generate_t<_Sseq>>
213 using _If_seed_seq_for = _Require<
214 __not_<is_same<__remove_cvref_t<_Sseq>, _Engine>>,
215 is_unsigned<typename _Sseq::result_type>,
216 __not_<is_convertible<_Sseq, _Res>>
263 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
267 "result_type must be an unsigned integral type");
268 static_assert(__m == 0u || (__a < __m && __c < __m),
269 "template argument substituting __m out of bounds");
271 template<
typename _Sseq>
312 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
333 template<
typename _Sseq>
345 {
return __c == 0u ? 1u : 0u; }
360 for (; __z != 0ULL; --__z)
370 _M_x = __detail::__mod<_UIntType, __m, __a, __c>(_M_x);
388 {
return __lhs._M_x == __rhs._M_x; }
398 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
399 _UIntType1 __m1,
typename _CharT,
typename _Traits>
403 __a1, __c1, __m1>& __lcr);
418 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
419 _UIntType1 __m1,
typename _CharT,
typename _Traits>
429#if __cpp_impl_three_way_comparison < 201907L
441 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
447 {
return !(__lhs == __rhs); }
481 template<
typename _UIntType,
size_t __w,
482 size_t __n,
size_t __m,
size_t __r,
483 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
484 _UIntType __b,
size_t __t,
485 _UIntType __c,
size_t __l, _UIntType __f>
489 "result_type must be an unsigned integral type");
490 static_assert(1u <= __m && __m <= __n,
491 "template argument substituting __m out of bounds");
492 static_assert(__r <= __w,
"template argument substituting "
494 static_assert(__u <= __w,
"template argument substituting "
496 static_assert(__s <= __w,
"template argument substituting "
498 static_assert(__t <= __w,
"template argument substituting "
500 static_assert(__l <= __w,
"template argument substituting "
502 static_assert(__w <= std::numeric_limits<_UIntType>::digits,
503 "template argument substituting __w out of bound");
504 static_assert(__a <= (__detail::_Shift<_UIntType, __w>::__value - 1),
505 "template argument substituting __a out of bound");
506 static_assert(__b <= (__detail::_Shift<_UIntType, __w>::__value - 1),
507 "template argument substituting __b out of bound");
508 static_assert(__c <= (__detail::_Shift<_UIntType, __w>::__value - 1),
509 "template argument substituting __c out of bound");
510 static_assert(__d <= (__detail::_Shift<_UIntType, __w>::__value - 1),
511 "template argument substituting __d out of bound");
512 static_assert(__f <= (__detail::_Shift<_UIntType, __w>::__value - 1),
513 "template argument substituting __f out of bound");
515 template<
typename _Sseq>
525 static constexpr size_t word_size = __w;
526 static constexpr size_t state_size = __n;
527 static constexpr size_t shift_size = __m;
528 static constexpr size_t mask_bits = __r;
530 static constexpr size_t tempering_u = __u;
532 static constexpr size_t tempering_s = __s;
534 static constexpr size_t tempering_t = __t;
536 static constexpr size_t tempering_l = __l;
537 static constexpr result_type initialization_multiplier = __f;
554 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
562 template<
typename _Sseq>
578 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
584 discard(
unsigned long long __z);
604 {
return (std::equal(__lhs._M_x, __lhs._M_x + state_size, __rhs._M_x)
605 && __lhs._M_p == __rhs._M_p); }
619 template<
typename _UIntType1,
620 size_t __w1,
size_t __n1,
621 size_t __m1,
size_t __r1,
622 _UIntType1 __a1,
size_t __u1,
623 _UIntType1 __d1,
size_t __s1,
624 _UIntType1 __b1,
size_t __t1,
625 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
626 typename _CharT,
typename _Traits>
630 __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
645 template<
typename _UIntType1,
646 size_t __w1,
size_t __n1,
647 size_t __m1,
size_t __r1,
648 _UIntType1 __a1,
size_t __u1,
649 _UIntType1 __d1,
size_t __s1,
650 _UIntType1 __b1,
size_t __t1,
651 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
652 typename _CharT,
typename _Traits>
656 __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
662 _UIntType _M_x[state_size];
666#if __cpp_impl_three_way_comparison < 201907L
679 template<
typename _UIntType,
size_t __w,
680 size_t __n,
size_t __m,
size_t __r,
681 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
682 _UIntType __b,
size_t __t,
683 _UIntType __c,
size_t __l, _UIntType __f>
686 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __lhs,
688 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __rhs)
689 {
return !(__lhs == __rhs); }
710 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
714 "result_type must be an unsigned integral type");
715 static_assert(0u < __s && __s < __r,
717 static_assert(0u < __w && __w <= std::numeric_limits<_UIntType>::digits,
718 "template argument substituting __w out of bounds");
720 template<
typename _Sseq>
730 static constexpr size_t word_size = __w;
731 static constexpr size_t short_lag = __s;
732 static constexpr size_t long_lag = __r;
733 static constexpr uint_least32_t default_seed = 19780503u;
752 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
776 template<
typename _Sseq>
794 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
802 for (; __z != 0ULL; --__z)
827 {
return (std::equal(__lhs._M_x, __lhs._M_x + long_lag, __rhs._M_x)
828 && __lhs._M_carry == __rhs._M_carry
829 && __lhs._M_p == __rhs._M_p); }
843 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
844 typename _CharT,
typename _Traits>
862 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
863 typename _CharT,
typename _Traits>
871 _UIntType _M_x[long_lag];
876#if __cpp_impl_three_way_comparison < 201907L
889 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
895 {
return !(__lhs == __rhs); }
907 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
910 static_assert(1 <= __r && __r <= __p,
911 "template argument substituting __r out of bounds");
917 template<
typename _Sseq>
923 static constexpr size_t block_size = __p;
924 static constexpr size_t used_block = __r;
932 : _M_b(), _M_n(0) { }
942 : _M_b(__rng), _M_n(0) { }
952 : _M_b(
std::
move(__rng)), _M_n(0) { }
962 : _M_b(__s), _M_n(0) { }
969 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1002 template<
typename _Sseq>
1014 const _RandomNumberEngine&
1023 {
return _RandomNumberEngine::min(); }
1030 {
return _RandomNumberEngine::max(); }
1038 for (; __z != 0ULL; --__z)
1062 {
return __lhs._M_b == __rhs._M_b && __lhs._M_n == __rhs._M_n; }
1075 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1076 typename _CharT,
typename _Traits>
1093 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1094 typename _CharT,
typename _Traits>
1101 _RandomNumberEngine _M_b;
1105#if __cpp_impl_three_way_comparison < 201907L
1117 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
1123 {
return !(__lhs == __rhs); }
1133 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1137 "result_type must be an unsigned integral type");
1138 static_assert(0u < __w && __w <= std::numeric_limits<_UIntType>::digits,
1139 "template argument substituting __w out of bounds");
1141 template<
typename _Sseq>
1193 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1220 template<
typename _Sseq>
1229 const _RandomNumberEngine&
1245 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1253 for (; __z != 0ULL; --__z)
1278 {
return __lhs._M_b == __rhs._M_b; }
1292 template<
typename _CharT,
typename _Traits>
1296 __w, _UIntType>& __x)
1303 _RandomNumberEngine _M_b;
1306#if __cpp_impl_three_way_comparison < 201907L
1319 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1325 {
return !(__lhs == __rhs); }
1338 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType,
1339 typename _CharT,
typename _Traits>
1343 __w, _UIntType>& __x)
1360 template<
typename _RandomNumberEngine,
size_t __k>
1363 static_assert(1u <= __k,
"template argument substituting "
1364 "__k out of bound");
1370 template<
typename _Sseq>
1375 static constexpr size_t table_size = __k;
1384 { _M_initialize(); }
1395 { _M_initialize(); }
1406 { _M_initialize(); }
1417 { _M_initialize(); }
1424 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1428 { _M_initialize(); }
1457 template<
typename _Sseq>
1468 const _RandomNumberEngine&
1477 {
return _RandomNumberEngine::min(); }
1484 {
return _RandomNumberEngine::max(); }
1492 for (; __z != 0ULL; --__z)
1516 {
return (__lhs._M_b == __rhs._M_b
1517 && std::equal(__lhs._M_v, __lhs._M_v + __k, __rhs._M_v)
1518 && __lhs._M_y == __rhs._M_y); }
1531 template<
typename _RandomNumberEngine1,
size_t __k1,
1532 typename _CharT,
typename _Traits>
1549 template<
typename _RandomNumberEngine1,
size_t __k1,
1550 typename _CharT,
typename _Traits>
1556 void _M_initialize()
1558 for (
size_t __i = 0; __i < __k; ++__i)
1563 _RandomNumberEngine _M_b;
1568#if __cpp_impl_three_way_comparison < 201907L
1580 template<
typename _RandomNumberEngine,
size_t __k>
1586 {
return !(__lhs == __rhs); }
1592 typedef linear_congruential_engine<uint_fast32_t, 16807UL, 0UL, 2147483647UL>
1623 0xb5026f5aa96619e9ULL, 29,
1624 0x5555555555555555ULL, 17,
1625 0x71d67fffeda60000ULL, 37,
1626 0xfff7eee000000000ULL, 43,
1675 entropy() const noexcept
1676 {
return this->_M_getentropy(); }
1680 {
return this->_M_getval(); }
1683 random_device(
const random_device&) =
delete;
1684 void operator=(
const random_device&) =
delete;
1694 double _M_getentropy() const noexcept;
1696 void _M_init(const
char*,
size_t);
1726#if __cpp_impl_three_way_comparison < 201907L
1731 template<
typename _IntType>
1735 {
return !(__d1 == __d2); }
1748 template<
typename _IntType,
typename _CharT,
typename _Traits>
1762 template<
typename _IntType,
typename _CharT,
typename _Traits>
1778 template<
typename _RealType =
double>
1782 "result_type must be a floating point type");
1796 param_type(_RealType __a, _RealType __b = _RealType(1))
1797 : _M_a(__a), _M_b(__b)
1799 __glibcxx_assert(_M_a <= _M_b);
1812 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
1814#if __cpp_impl_three_way_comparison < 201907L
1817 {
return !(__p1 == __p2); }
1841 : _M_param(__a, __b)
1859 {
return _M_param.a(); }
1863 {
return _M_param.b(); }
1870 {
return _M_param; }
1878 { _M_param = __param; }
1885 {
return this->a(); }
1892 {
return this->b(); }
1897 template<
typename _UniformRandomNumberGenerator>
1900 {
return this->
operator()(__urng, _M_param); }
1902 template<
typename _UniformRandomNumberGenerator>
1904 operator()(_UniformRandomNumberGenerator& __urng,
1905 const param_type& __p)
1907 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
1909 return (__aurng() * (__p.b() - __p.a())) + __p.a();
1912 template<
typename _ForwardIterator,
1913 typename _UniformRandomNumberGenerator>
1915 __generate(_ForwardIterator __f, _ForwardIterator __t,
1916 _UniformRandomNumberGenerator& __urng)
1917 { this->__generate(__f, __t, __urng, _M_param); }
1919 template<
typename _ForwardIterator,
1920 typename _UniformRandomNumberGenerator>
1922 __generate(_ForwardIterator __f, _ForwardIterator __t,
1923 _UniformRandomNumberGenerator& __urng,
1924 const param_type& __p)
1925 { this->__generate_impl(__f, __t, __urng, __p); }
1927 template<
typename _UniformRandomNumberGenerator>
1930 _UniformRandomNumberGenerator& __urng,
1931 const param_type& __p)
1932 { this->__generate_impl(__f, __t, __urng, __p); }
1941 {
return __d1._M_param == __d2._M_param; }
1944 template<
typename _ForwardIterator,
1945 typename _UniformRandomNumberGenerator>
1947 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
1948 _UniformRandomNumberGenerator& __urng,
1949 const param_type& __p);
1951 param_type _M_param;
1954#if __cpp_impl_three_way_comparison < 201907L
1959 template<
typename _IntType>
1963 {
return !(__d1 == __d2); }
1976 template<
typename _RealType,
typename _CharT,
typename _Traits>
1990 template<
typename _RealType,
typename _CharT,
typename _Traits>
2015 template<
typename _RealType =
double>
2019 "result_type must be a floating point type");
2033 param_type(_RealType __mean, _RealType __stddev = _RealType(1))
2034 : _M_mean(__mean), _M_stddev(__stddev)
2036 __glibcxx_assert(_M_stddev > _RealType(0));
2045 {
return _M_stddev; }
2049 {
return (__p1._M_mean == __p2._M_mean
2050 && __p1._M_stddev == __p2._M_stddev); }
2052#if __cpp_impl_three_way_comparison < 201907L
2055 {
return !(__p1 == __p2); }
2060 _RealType _M_stddev;
2073 : _M_param(__mean, __stddev)
2086 { _M_saved_available =
false; }
2093 {
return _M_param.mean(); }
2100 {
return _M_param.stddev(); }
2107 {
return _M_param; }
2115 { _M_param = __param; }
2134 template<
typename _UniformRandomNumberGenerator>
2137 {
return this->
operator()(__urng, _M_param); }
2139 template<
typename _UniformRandomNumberGenerator>
2141 operator()(_UniformRandomNumberGenerator& __urng,
2142 const param_type& __p);
2144 template<
typename _ForwardIterator,
2145 typename _UniformRandomNumberGenerator>
2147 __generate(_ForwardIterator __f, _ForwardIterator __t,
2148 _UniformRandomNumberGenerator& __urng)
2149 { this->__generate(__f, __t, __urng, _M_param); }
2151 template<
typename _ForwardIterator,
2152 typename _UniformRandomNumberGenerator>
2154 __generate(_ForwardIterator __f, _ForwardIterator __t,
2155 _UniformRandomNumberGenerator& __urng,
2156 const param_type& __p)
2157 { this->__generate_impl(__f, __t, __urng, __p); }
2159 template<
typename _UniformRandomNumberGenerator>
2162 _UniformRandomNumberGenerator& __urng,
2163 const param_type& __p)
2164 { this->__generate_impl(__f, __t, __urng, __p); }
2171 template<
typename _RealType1>
2186 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2201 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2207 template<
typename _ForwardIterator,
2208 typename _UniformRandomNumberGenerator>
2210 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2211 _UniformRandomNumberGenerator& __urng,
2216 bool _M_saved_available =
false;
2219#if __cpp_impl_three_way_comparison < 201907L
2223 template<
typename _RealType>
2227 {
return !(__d1 == __d2); }
2242 template<
typename _RealType =
double>
2246 "result_type must be a floating point type");
2260 param_type(_RealType __m, _RealType __s = _RealType(1))
2261 : _M_m(__m), _M_s(__s)
2274 {
return __p1._M_m == __p2._M_m && __p1._M_s == __p2._M_s; }
2276#if __cpp_impl_three_way_comparison < 201907L
2279 {
return !(__p1 == __p2); }
2291 : _M_param(__m, __s), _M_nd()
2295 lognormal_distribution(
const param_type& __p)
2296 : _M_param(__p), _M_nd()
2311 {
return _M_param.m(); }
2315 {
return _M_param.s(); }
2322 {
return _M_param; }
2330 { _M_param = __param; }
2349 template<
typename _UniformRandomNumberGenerator>
2352 {
return this->
operator()(__urng, _M_param); }
2354 template<
typename _UniformRandomNumberGenerator>
2356 operator()(_UniformRandomNumberGenerator& __urng,
2357 const param_type& __p)
2358 {
return std::exp(__p.s() * _M_nd(__urng) + __p.m()); }
2360 template<
typename _ForwardIterator,
2361 typename _UniformRandomNumberGenerator>
2363 __generate(_ForwardIterator __f, _ForwardIterator __t,
2364 _UniformRandomNumberGenerator& __urng)
2365 { this->__generate(__f, __t, __urng, _M_param); }
2367 template<
typename _ForwardIterator,
2368 typename _UniformRandomNumberGenerator>
2370 __generate(_ForwardIterator __f, _ForwardIterator __t,
2371 _UniformRandomNumberGenerator& __urng,
2372 const param_type& __p)
2373 { this->__generate_impl(__f, __t, __urng, __p); }
2375 template<
typename _UniformRandomNumberGenerator>
2378 _UniformRandomNumberGenerator& __urng,
2379 const param_type& __p)
2380 { this->__generate_impl(__f, __t, __urng, __p); }
2390 {
return (__d1._M_param == __d2._M_param
2391 && __d1._M_nd == __d2._M_nd); }
2403 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2418 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2424 template<
typename _ForwardIterator,
2425 typename _UniformRandomNumberGenerator>
2427 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2428 _UniformRandomNumberGenerator& __urng,
2436#if __cpp_impl_three_way_comparison < 201907L
2440 template<
typename _RealType>
2444 {
return !(__d1 == __d2); }
2467 template<
typename _RealType =
double>
2471 "result_type must be a floating point type");
2486 param_type(_RealType __alpha_val, _RealType __beta_val = _RealType(1))
2487 : _M_alpha(__alpha_val), _M_beta(__beta_val)
2489 __glibcxx_assert(_M_alpha > _RealType(0));
2495 {
return _M_alpha; }
2503 {
return (__p1._M_alpha == __p2._M_alpha
2504 && __p1._M_beta == __p2._M_beta); }
2506#if __cpp_impl_three_way_comparison < 201907L
2509 {
return !(__p1 == __p2); }
2519 _RealType _M_malpha, _M_a2;
2534 _RealType __beta_val = _RealType(1))
2535 : _M_param(__alpha_val, __beta_val), _M_nd()
2540 : _M_param(__p), _M_nd()
2555 {
return _M_param.alpha(); }
2562 {
return _M_param.beta(); }
2569 {
return _M_param; }
2577 { _M_param = __param; }
2596 template<
typename _UniformRandomNumberGenerator>
2599 {
return this->
operator()(__urng, _M_param); }
2601 template<
typename _UniformRandomNumberGenerator>
2603 operator()(_UniformRandomNumberGenerator& __urng,
2604 const param_type& __p);
2606 template<
typename _ForwardIterator,
2607 typename _UniformRandomNumberGenerator>
2609 __generate(_ForwardIterator __f, _ForwardIterator __t,
2610 _UniformRandomNumberGenerator& __urng)
2611 { this->__generate(__f, __t, __urng, _M_param); }
2613 template<
typename _ForwardIterator,
2614 typename _UniformRandomNumberGenerator>
2616 __generate(_ForwardIterator __f, _ForwardIterator __t,
2617 _UniformRandomNumberGenerator& __urng,
2618 const param_type& __p)
2619 { this->__generate_impl(__f, __t, __urng, __p); }
2621 template<
typename _UniformRandomNumberGenerator>
2624 _UniformRandomNumberGenerator& __urng,
2625 const param_type& __p)
2626 { this->__generate_impl(__f, __t, __urng, __p); }
2636 {
return (__d1._M_param == __d2._M_param
2637 && __d1._M_nd == __d2._M_nd); }
2649 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2663 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2669 template<
typename _ForwardIterator,
2670 typename _UniformRandomNumberGenerator>
2672 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2673 _UniformRandomNumberGenerator& __urng,
2681#if __cpp_impl_three_way_comparison < 201907L
2685 template<
typename _RealType>
2689 {
return !(__d1 == __d2); }
2709 template<
typename _RealType =
double>
2713 "result_type must be a floating point type");
2737 {
return __p1._M_n == __p2._M_n; }
2739#if __cpp_impl_three_way_comparison < 201907L
2742 {
return !(__p1 == __p2); }
2753 : _M_param(__n), _M_gd(__n / 2)
2757 chi_squared_distribution(
const param_type& __p)
2758 : _M_param(__p), _M_gd(__p.n() / 2)
2773 {
return _M_param.n(); }
2780 {
return _M_param; }
2812 template<
typename _UniformRandomNumberGenerator>
2815 {
return 2 * _M_gd(__urng); }
2817 template<
typename _UniformRandomNumberGenerator>
2819 operator()(_UniformRandomNumberGenerator& __urng,
2820 const param_type& __p)
2824 return 2 * _M_gd(__urng, param_type(__p.n() / 2));
2827 template<
typename _ForwardIterator,
2828 typename _UniformRandomNumberGenerator>
2830 __generate(_ForwardIterator __f, _ForwardIterator __t,
2831 _UniformRandomNumberGenerator& __urng)
2832 { this->__generate_impl(__f, __t, __urng); }
2834 template<
typename _ForwardIterator,
2835 typename _UniformRandomNumberGenerator>
2837 __generate(_ForwardIterator __f, _ForwardIterator __t,
2838 _UniformRandomNumberGenerator& __urng,
2839 const param_type& __p)
2842 this->__generate_impl(__f, __t, __urng, __p2); }
2844 template<
typename _UniformRandomNumberGenerator>
2847 _UniformRandomNumberGenerator& __urng)
2848 { this->__generate_impl(__f, __t, __urng); }
2850 template<
typename _UniformRandomNumberGenerator>
2853 _UniformRandomNumberGenerator& __urng,
2854 const param_type& __p)
2857 this->__generate_impl(__f, __t, __urng, __p2); }
2867 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
2879 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2894 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2900 template<
typename _ForwardIterator,
2901 typename _UniformRandomNumberGenerator>
2903 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2904 _UniformRandomNumberGenerator& __urng);
2906 template<
typename _ForwardIterator,
2907 typename _UniformRandomNumberGenerator>
2909 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2910 _UniformRandomNumberGenerator& __urng,
2919#if __cpp_impl_three_way_comparison < 201907L
2923 template<
typename _RealType>
2927 {
return !(__d1 == __d2); }
2939 template<
typename _RealType =
double>
2943 "result_type must be a floating point type");
2957 param_type(_RealType __a, _RealType __b = _RealType(1))
2958 : _M_a(__a), _M_b(__b)
2971 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
2973#if __cpp_impl_three_way_comparison < 201907L
2976 {
return !(__p1 == __p2); }
2988 : _M_param(__a, __b)
2992 cauchy_distribution(
const param_type& __p)
3008 {
return _M_param.a(); }
3012 {
return _M_param.b(); }
3019 {
return _M_param; }
3027 { _M_param = __param; }
3046 template<
typename _UniformRandomNumberGenerator>
3049 {
return this->
operator()(__urng, _M_param); }
3051 template<
typename _UniformRandomNumberGenerator>
3053 operator()(_UniformRandomNumberGenerator& __urng,
3054 const param_type& __p);
3056 template<
typename _ForwardIterator,
3057 typename _UniformRandomNumberGenerator>
3059 __generate(_ForwardIterator __f, _ForwardIterator __t,
3060 _UniformRandomNumberGenerator& __urng)
3061 { this->__generate(__f, __t, __urng, _M_param); }
3063 template<
typename _ForwardIterator,
3064 typename _UniformRandomNumberGenerator>
3066 __generate(_ForwardIterator __f, _ForwardIterator __t,
3067 _UniformRandomNumberGenerator& __urng,
3068 const param_type& __p)
3069 { this->__generate_impl(__f, __t, __urng, __p); }
3071 template<
typename _UniformRandomNumberGenerator>
3074 _UniformRandomNumberGenerator& __urng,
3075 const param_type& __p)
3076 { this->__generate_impl(__f, __t, __urng, __p); }
3085 {
return __d1._M_param == __d2._M_param; }
3088 template<
typename _ForwardIterator,
3089 typename _UniformRandomNumberGenerator>
3091 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3092 _UniformRandomNumberGenerator& __urng,
3093 const param_type& __p);
3095 param_type _M_param;
3098#if __cpp_impl_three_way_comparison < 201907L
3103 template<
typename _RealType>
3107 {
return !(__d1 == __d2); }
3120 template<
typename _RealType,
typename _CharT,
typename _Traits>
3135 template<
typename _RealType,
typename _CharT,
typename _Traits>
3154 template<
typename _RealType =
double>
3158 "result_type must be a floating point type");
3172 param_type(_RealType __m, _RealType __n = _RealType(1))
3173 : _M_m(__m), _M_n(__n)
3186 {
return __p1._M_m == __p2._M_m && __p1._M_n == __p2._M_n; }
3188#if __cpp_impl_three_way_comparison < 201907L
3191 {
return !(__p1 == __p2); }
3203 _RealType __n = _RealType(1))
3204 : _M_param(__m, __n), _M_gd_x(__m / 2), _M_gd_y(__n / 2)
3208 fisher_f_distribution(
const param_type& __p)
3209 : _M_param(__p), _M_gd_x(__p.m() / 2), _M_gd_y(__p.n() / 2)
3227 {
return _M_param.m(); }
3231 {
return _M_param.n(); }
3238 {
return _M_param; }
3246 { _M_param = __param; }
3265 template<
typename _UniformRandomNumberGenerator>
3268 {
return (_M_gd_x(__urng) * n()) / (_M_gd_y(__urng) * m()); }
3270 template<
typename _UniformRandomNumberGenerator>
3272 operator()(_UniformRandomNumberGenerator& __urng,
3273 const param_type& __p)
3277 return ((_M_gd_x(__urng, param_type(__p.m() / 2)) * n())
3278 / (_M_gd_y(__urng, param_type(__p.n() / 2)) * m()));
3281 template<
typename _ForwardIterator,
3282 typename _UniformRandomNumberGenerator>
3284 __generate(_ForwardIterator __f, _ForwardIterator __t,
3285 _UniformRandomNumberGenerator& __urng)
3286 { this->__generate_impl(__f, __t, __urng); }
3288 template<
typename _ForwardIterator,
3289 typename _UniformRandomNumberGenerator>
3291 __generate(_ForwardIterator __f, _ForwardIterator __t,
3292 _UniformRandomNumberGenerator& __urng,
3293 const param_type& __p)
3294 { this->__generate_impl(__f, __t, __urng, __p); }
3296 template<
typename _UniformRandomNumberGenerator>
3299 _UniformRandomNumberGenerator& __urng)
3300 { this->__generate_impl(__f, __t, __urng); }
3302 template<
typename _UniformRandomNumberGenerator>
3305 _UniformRandomNumberGenerator& __urng,
3306 const param_type& __p)
3307 { this->__generate_impl(__f, __t, __urng, __p); }
3317 {
return (__d1._M_param == __d2._M_param
3318 && __d1._M_gd_x == __d2._M_gd_x
3319 && __d1._M_gd_y == __d2._M_gd_y); }
3331 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3346 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3352 template<
typename _ForwardIterator,
3353 typename _UniformRandomNumberGenerator>
3355 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3356 _UniformRandomNumberGenerator& __urng);
3358 template<
typename _ForwardIterator,
3359 typename _UniformRandomNumberGenerator>
3361 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3362 _UniformRandomNumberGenerator& __urng,
3370#if __cpp_impl_three_way_comparison < 201907L
3374 template<
typename _RealType>
3378 {
return !(__d1 == __d2); }
3393 template<
typename _RealType =
double>
3397 "result_type must be a floating point type");
3421 {
return __p1._M_n == __p2._M_n; }
3423#if __cpp_impl_three_way_comparison < 201907L
3426 {
return !(__p1 == __p2); }
3437 : _M_param(__n), _M_nd(), _M_gd(__n / 2, 2)
3441 student_t_distribution(
const param_type& __p)
3442 : _M_param(__p), _M_nd(), _M_gd(__p.n() / 2, 2)
3460 {
return _M_param.n(); }
3467 {
return _M_param; }
3475 { _M_param = __param; }
3494 template<
typename _UniformRandomNumberGenerator>
3497 {
return _M_nd(__urng) *
std::sqrt(n() / _M_gd(__urng)); }
3499 template<
typename _UniformRandomNumberGenerator>
3501 operator()(_UniformRandomNumberGenerator& __urng,
3502 const param_type& __p)
3507 const result_type __g = _M_gd(__urng, param_type(__p.n() / 2, 2));
3508 return _M_nd(__urng) *
std::sqrt(__p.n() / __g);
3511 template<
typename _ForwardIterator,
3512 typename _UniformRandomNumberGenerator>
3514 __generate(_ForwardIterator __f, _ForwardIterator __t,
3515 _UniformRandomNumberGenerator& __urng)
3516 { this->__generate_impl(__f, __t, __urng); }
3518 template<
typename _ForwardIterator,
3519 typename _UniformRandomNumberGenerator>
3521 __generate(_ForwardIterator __f, _ForwardIterator __t,
3522 _UniformRandomNumberGenerator& __urng,
3523 const param_type& __p)
3524 { this->__generate_impl(__f, __t, __urng, __p); }
3526 template<
typename _UniformRandomNumberGenerator>
3529 _UniformRandomNumberGenerator& __urng)
3530 { this->__generate_impl(__f, __t, __urng); }
3532 template<
typename _UniformRandomNumberGenerator>
3535 _UniformRandomNumberGenerator& __urng,
3536 const param_type& __p)
3537 { this->__generate_impl(__f, __t, __urng, __p); }
3547 {
return (__d1._M_param == __d2._M_param
3548 && __d1._M_nd == __d2._M_nd && __d1._M_gd == __d2._M_gd); }
3560 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3575 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3581 template<
typename _ForwardIterator,
3582 typename _UniformRandomNumberGenerator>
3584 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3585 _UniformRandomNumberGenerator& __urng);
3586 template<
typename _ForwardIterator,
3587 typename _UniformRandomNumberGenerator>
3589 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3590 _UniformRandomNumberGenerator& __urng,
3599#if __cpp_impl_three_way_comparison < 201907L
3603 template<
typename _RealType>
3607 {
return !(__d1 == __d2); }
3644 __glibcxx_assert((_M_p >= 0.0) && (_M_p <= 1.0));
3653 {
return __p1._M_p == __p2._M_p; }
3655#if __cpp_impl_three_way_comparison < 201907L
3658 {
return !(__p1 == __p2); }
3700 {
return _M_param.p(); }
3707 {
return _M_param; }
3715 { _M_param = __param; }
3734 template<
typename _UniformRandomNumberGenerator>
3737 {
return this->
operator()(__urng, _M_param); }
3739 template<
typename _UniformRandomNumberGenerator>
3741 operator()(_UniformRandomNumberGenerator& __urng,
3742 const param_type& __p)
3744 __detail::_Adaptor<_UniformRandomNumberGenerator, double>
3746 if ((__aurng() - __aurng.min())
3747 < __p.p() * (__aurng.max() - __aurng.min()))
3752 template<
typename _ForwardIterator,
3753 typename _UniformRandomNumberGenerator>
3755 __generate(_ForwardIterator __f, _ForwardIterator __t,
3756 _UniformRandomNumberGenerator& __urng)
3757 { this->__generate(__f, __t, __urng, _M_param); }
3759 template<
typename _ForwardIterator,
3760 typename _UniformRandomNumberGenerator>
3762 __generate(_ForwardIterator __f, _ForwardIterator __t,
3763 _UniformRandomNumberGenerator& __urng,
const param_type& __p)
3764 { this->__generate_impl(__f, __t, __urng, __p); }
3766 template<
typename _UniformRandomNumberGenerator>
3769 _UniformRandomNumberGenerator& __urng,
3770 const param_type& __p)
3771 { this->__generate_impl(__f, __t, __urng, __p); }
3780 {
return __d1._M_param == __d2._M_param; }
3783 template<
typename _ForwardIterator,
3784 typename _UniformRandomNumberGenerator>
3786 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3787 _UniformRandomNumberGenerator& __urng,
3788 const param_type& __p);
3790 param_type _M_param;
3793#if __cpp_impl_three_way_comparison < 201907L
3801 {
return !(__d1 == __d2); }
3814 template<
typename _CharT,
typename _Traits>
3828 template<
typename _CharT,
typename _Traits>
3850 template<
typename _IntType =
int>
3854 "result_type must be an integral type");
3870 : _M_t(__t), _M_p(__p)
3872 __glibcxx_assert((_M_t >= _IntType(0))
3888 {
return __p1._M_t == __p2._M_t && __p1._M_p == __p2._M_p; }
3890#if __cpp_impl_three_way_comparison < 201907L
3893 {
return !(__p1 == __p2); }
3904#if _GLIBCXX_USE_C99_MATH_TR1
3905 double _M_d1, _M_d2, _M_s1, _M_s2, _M_c,
3906 _M_a1, _M_a123, _M_s, _M_lf, _M_lp1p;
3917 : _M_param(__t, __p), _M_nd()
3921 binomial_distribution(
const param_type& __p)
3922 : _M_param(__p), _M_nd()
3937 {
return _M_param.t(); }
3944 {
return _M_param.p(); }
3951 {
return _M_param; }
3959 { _M_param = __param; }
3973 {
return _M_param.t(); }
3978 template<
typename _UniformRandomNumberGenerator>
3981 {
return this->
operator()(__urng, _M_param); }
3983 template<
typename _UniformRandomNumberGenerator>
3985 operator()(_UniformRandomNumberGenerator& __urng,
3986 const param_type& __p);
3988 template<
typename _ForwardIterator,
3989 typename _UniformRandomNumberGenerator>
3991 __generate(_ForwardIterator __f, _ForwardIterator __t,
3992 _UniformRandomNumberGenerator& __urng)
3993 { this->__generate(__f, __t, __urng, _M_param); }
3995 template<
typename _ForwardIterator,
3996 typename _UniformRandomNumberGenerator>
3998 __generate(_ForwardIterator __f, _ForwardIterator __t,
3999 _UniformRandomNumberGenerator& __urng,
4000 const param_type& __p)
4001 { this->__generate_impl(__f, __t, __urng, __p); }
4003 template<
typename _UniformRandomNumberGenerator>
4006 _UniformRandomNumberGenerator& __urng,
4007 const param_type& __p)
4008 { this->__generate_impl(__f, __t, __urng, __p); }
4018#ifdef _GLIBCXX_USE_C99_MATH_TR1
4019 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
4021 {
return __d1._M_param == __d2._M_param; }
4034 template<
typename _IntType1,
4035 typename _CharT,
typename _Traits>
4050 template<
typename _IntType1,
4051 typename _CharT,
typename _Traits>
4057 template<
typename _ForwardIterator,
4058 typename _UniformRandomNumberGenerator>
4060 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4061 _UniformRandomNumberGenerator& __urng,
4064 template<
typename _UniformRandomNumberGenerator>
4066 _M_waiting(_UniformRandomNumberGenerator& __urng,
4067 _IntType __t,
double __q);
4075#if __cpp_impl_three_way_comparison < 201907L
4079 template<
typename _IntType>
4083 {
return !(__d1 == __d2); }
4096 template<
typename _IntType =
int>
4100 "result_type must be an integral type");
4118 __glibcxx_assert((_M_p > 0.0) && (_M_p < 1.0));
4128 {
return __p1._M_p == __p2._M_p; }
4130#if __cpp_impl_three_way_comparison < 201907L
4133 {
return !(__p1 == __p2); }
4139 { _M_log_1_p =
std::log(1.0 - _M_p); }
4156 geometric_distribution(
const param_type& __p)
4173 {
return _M_param.p(); }
4180 {
return _M_param; }
4188 { _M_param = __param; }
4207 template<
typename _UniformRandomNumberGenerator>
4210 {
return this->
operator()(__urng, _M_param); }
4212 template<
typename _UniformRandomNumberGenerator>
4214 operator()(_UniformRandomNumberGenerator& __urng,
4215 const param_type& __p);
4217 template<
typename _ForwardIterator,
4218 typename _UniformRandomNumberGenerator>
4220 __generate(_ForwardIterator __f, _ForwardIterator __t,
4221 _UniformRandomNumberGenerator& __urng)
4222 { this->__generate(__f, __t, __urng, _M_param); }
4224 template<
typename _ForwardIterator,
4225 typename _UniformRandomNumberGenerator>
4227 __generate(_ForwardIterator __f, _ForwardIterator __t,
4228 _UniformRandomNumberGenerator& __urng,
4229 const param_type& __p)
4230 { this->__generate_impl(__f, __t, __urng, __p); }
4232 template<
typename _UniformRandomNumberGenerator>
4235 _UniformRandomNumberGenerator& __urng,
4236 const param_type& __p)
4237 { this->__generate_impl(__f, __t, __urng, __p); }
4246 {
return __d1._M_param == __d2._M_param; }
4249 template<
typename _ForwardIterator,
4250 typename _UniformRandomNumberGenerator>
4252 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4253 _UniformRandomNumberGenerator& __urng,
4254 const param_type& __p);
4256 param_type _M_param;
4259#if __cpp_impl_three_way_comparison < 201907L
4264 template<
typename _IntType>
4268 {
return !(__d1 == __d2); }
4281 template<
typename _IntType,
4282 typename _CharT,
typename _Traits>
4296 template<
typename _IntType,
4297 typename _CharT,
typename _Traits>
4313 template<
typename _IntType =
int>
4317 "result_type must be an integral type");
4332 : _M_k(__k), _M_p(__p)
4334 __glibcxx_assert((_M_k > 0) && (_M_p > 0.0) && (_M_p <= 1.0));
4347 {
return __p1._M_k == __p2._M_k && __p1._M_p == __p2._M_p; }
4349#if __cpp_impl_three_way_comparison < 201907L
4352 {
return !(__p1 == __p2); }
4364 : _M_param(__k, __p), _M_gd(__k, (1.0 - __p) / __p)
4368 negative_binomial_distribution(
const param_type& __p)
4369 : _M_param(__p), _M_gd(__p.
k(), (1.0 - __p.
p()) / __p.
p())
4384 {
return _M_param.k(); }
4391 {
return _M_param.p(); }
4398 {
return _M_param; }
4406 { _M_param = __param; }
4425 template<
typename _UniformRandomNumberGenerator>
4427 operator()(_UniformRandomNumberGenerator& __urng);
4429 template<
typename _UniformRandomNumberGenerator>
4431 operator()(_UniformRandomNumberGenerator& __urng,
4432 const param_type& __p);
4434 template<
typename _ForwardIterator,
4435 typename _UniformRandomNumberGenerator>
4437 __generate(_ForwardIterator __f, _ForwardIterator __t,
4438 _UniformRandomNumberGenerator& __urng)
4439 { this->__generate_impl(__f, __t, __urng); }
4441 template<
typename _ForwardIterator,
4442 typename _UniformRandomNumberGenerator>
4444 __generate(_ForwardIterator __f, _ForwardIterator __t,
4445 _UniformRandomNumberGenerator& __urng,
4446 const param_type& __p)
4447 { this->__generate_impl(__f, __t, __urng, __p); }
4449 template<
typename _UniformRandomNumberGenerator>
4452 _UniformRandomNumberGenerator& __urng)
4453 { this->__generate_impl(__f, __t, __urng); }
4455 template<
typename _UniformRandomNumberGenerator>
4458 _UniformRandomNumberGenerator& __urng,
4459 const param_type& __p)
4460 { this->__generate_impl(__f, __t, __urng, __p); }
4470 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
4483 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4498 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4504 template<
typename _ForwardIterator,
4505 typename _UniformRandomNumberGenerator>
4507 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4508 _UniformRandomNumberGenerator& __urng);
4509 template<
typename _ForwardIterator,
4510 typename _UniformRandomNumberGenerator>
4512 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4513 _UniformRandomNumberGenerator& __urng,
4521#if __cpp_impl_three_way_comparison < 201907L
4525 template<
typename _IntType>
4529 {
return !(__d1 == __d2); }
4550 template<
typename _IntType =
int>
4554 "result_type must be an integral type");
4572 __glibcxx_assert(_M_mean > 0.0);
4582 {
return __p1._M_mean == __p2._M_mean; }
4584#if __cpp_impl_three_way_comparison < 201907L
4587 {
return !(__p1 == __p2); }
4598#if _GLIBCXX_USE_C99_MATH_TR1
4599 double _M_lfm, _M_sm, _M_d, _M_scx, _M_1cx, _M_c2b, _M_cb;
4609 : _M_param(__mean), _M_nd()
4613 poisson_distribution(
const param_type& __p)
4614 : _M_param(__p), _M_nd()
4629 {
return _M_param.mean(); }
4636 {
return _M_param; }
4644 { _M_param = __param; }
4663 template<
typename _UniformRandomNumberGenerator>
4666 {
return this->
operator()(__urng, _M_param); }
4668 template<
typename _UniformRandomNumberGenerator>
4670 operator()(_UniformRandomNumberGenerator& __urng,
4671 const param_type& __p);
4673 template<
typename _ForwardIterator,
4674 typename _UniformRandomNumberGenerator>
4676 __generate(_ForwardIterator __f, _ForwardIterator __t,
4677 _UniformRandomNumberGenerator& __urng)
4678 { this->__generate(__f, __t, __urng, _M_param); }
4680 template<
typename _ForwardIterator,
4681 typename _UniformRandomNumberGenerator>
4683 __generate(_ForwardIterator __f, _ForwardIterator __t,
4684 _UniformRandomNumberGenerator& __urng,
4685 const param_type& __p)
4686 { this->__generate_impl(__f, __t, __urng, __p); }
4688 template<
typename _UniformRandomNumberGenerator>
4691 _UniformRandomNumberGenerator& __urng,
4692 const param_type& __p)
4693 { this->__generate_impl(__f, __t, __urng, __p); }
4703#ifdef _GLIBCXX_USE_C99_MATH_TR1
4704 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
4706 {
return __d1._M_param == __d2._M_param; }
4719 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4734 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4740 template<
typename _ForwardIterator,
4741 typename _UniformRandomNumberGenerator>
4743 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4744 _UniformRandomNumberGenerator& __urng,
4753#if __cpp_impl_three_way_comparison < 201907L
4757 template<
typename _IntType>
4761 {
return !(__d1 == __d2); }
4782 template<
typename _RealType =
double>
4786 "result_type must be a floating point type");
4801 : _M_lambda(__lambda)
4803 __glibcxx_assert(_M_lambda > _RealType(0));
4808 {
return _M_lambda; }
4812 {
return __p1._M_lambda == __p2._M_lambda; }
4814#if __cpp_impl_three_way_comparison < 201907L
4817 {
return !(__p1 == __p2); }
4821 _RealType _M_lambda;
4837 : _M_param(__lambda)
4858 {
return _M_param.lambda(); }
4865 {
return _M_param; }
4873 { _M_param = __param; }
4892 template<
typename _UniformRandomNumberGenerator>
4895 {
return this->
operator()(__urng, _M_param); }
4897 template<
typename _UniformRandomNumberGenerator>
4899 operator()(_UniformRandomNumberGenerator& __urng,
4900 const param_type& __p)
4902 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
4907 template<
typename _ForwardIterator,
4908 typename _UniformRandomNumberGenerator>
4910 __generate(_ForwardIterator __f, _ForwardIterator __t,
4911 _UniformRandomNumberGenerator& __urng)
4912 { this->__generate(__f, __t, __urng, _M_param); }
4914 template<
typename _ForwardIterator,
4915 typename _UniformRandomNumberGenerator>
4917 __generate(_ForwardIterator __f, _ForwardIterator __t,
4918 _UniformRandomNumberGenerator& __urng,
4919 const param_type& __p)
4920 { this->__generate_impl(__f, __t, __urng, __p); }
4922 template<
typename _UniformRandomNumberGenerator>
4925 _UniformRandomNumberGenerator& __urng,
4926 const param_type& __p)
4927 { this->__generate_impl(__f, __t, __urng, __p); }
4936 {
return __d1._M_param == __d2._M_param; }
4939 template<
typename _ForwardIterator,
4940 typename _UniformRandomNumberGenerator>
4942 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4943 _UniformRandomNumberGenerator& __urng,
4944 const param_type& __p);
4946 param_type _M_param;
4949#if __cpp_impl_three_way_comparison < 201907L
4954 template<
typename _RealType>
4958 {
return !(__d1 == __d2); }
4971 template<
typename _RealType,
typename _CharT,
typename _Traits>
4986 template<
typename _RealType,
typename _CharT,
typename _Traits>
5004 template<
typename _RealType =
double>
5008 "result_type must be a floating point type");
5022 param_type(_RealType __a, _RealType __b = _RealType(1.0))
5023 : _M_a(__a), _M_b(__b)
5036 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
5038#if __cpp_impl_three_way_comparison < 201907L
5041 {
return !(__p1 == __p2); }
5053 : _M_param(__a, __b)
5057 weibull_distribution(
const param_type& __p)
5073 {
return _M_param.a(); }
5080 {
return _M_param.b(); }
5087 {
return _M_param; }
5095 { _M_param = __param; }
5114 template<
typename _UniformRandomNumberGenerator>
5117 {
return this->
operator()(__urng, _M_param); }
5119 template<
typename _UniformRandomNumberGenerator>
5121 operator()(_UniformRandomNumberGenerator& __urng,
5122 const param_type& __p);
5124 template<
typename _ForwardIterator,
5125 typename _UniformRandomNumberGenerator>
5127 __generate(_ForwardIterator __f, _ForwardIterator __t,
5128 _UniformRandomNumberGenerator& __urng)
5129 { this->__generate(__f, __t, __urng, _M_param); }
5131 template<
typename _ForwardIterator,
5132 typename _UniformRandomNumberGenerator>
5134 __generate(_ForwardIterator __f, _ForwardIterator __t,
5135 _UniformRandomNumberGenerator& __urng,
5136 const param_type& __p)
5137 { this->__generate_impl(__f, __t, __urng, __p); }
5139 template<
typename _UniformRandomNumberGenerator>
5142 _UniformRandomNumberGenerator& __urng,
5143 const param_type& __p)
5144 { this->__generate_impl(__f, __t, __urng, __p); }
5153 {
return __d1._M_param == __d2._M_param; }
5156 template<
typename _ForwardIterator,
5157 typename _UniformRandomNumberGenerator>
5159 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5160 _UniformRandomNumberGenerator& __urng,
5161 const param_type& __p);
5163 param_type _M_param;
5166#if __cpp_impl_three_way_comparison < 201907L
5171 template<
typename _RealType>
5175 {
return !(__d1 == __d2); }
5188 template<
typename _RealType,
typename _CharT,
typename _Traits>
5203 template<
typename _RealType,
typename _CharT,
typename _Traits>
5221 template<
typename _RealType =
double>
5225 "result_type must be a floating point type");
5239 param_type(_RealType __a, _RealType __b = _RealType(1.0))
5240 : _M_a(__a), _M_b(__b)
5253 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
5255#if __cpp_impl_three_way_comparison < 201907L
5258 {
return !(__p1 == __p2); }
5270 : _M_param(__a, __b)
5274 extreme_value_distribution(
const param_type& __p)
5290 {
return _M_param.a(); }
5297 {
return _M_param.b(); }
5304 {
return _M_param; }
5312 { _M_param = __param; }
5331 template<
typename _UniformRandomNumberGenerator>
5334 {
return this->
operator()(__urng, _M_param); }
5336 template<
typename _UniformRandomNumberGenerator>
5338 operator()(_UniformRandomNumberGenerator& __urng,
5339 const param_type& __p);
5341 template<
typename _ForwardIterator,
5342 typename _UniformRandomNumberGenerator>
5344 __generate(_ForwardIterator __f, _ForwardIterator __t,
5345 _UniformRandomNumberGenerator& __urng)
5346 { this->__generate(__f, __t, __urng, _M_param); }
5348 template<
typename _ForwardIterator,
5349 typename _UniformRandomNumberGenerator>
5351 __generate(_ForwardIterator __f, _ForwardIterator __t,
5352 _UniformRandomNumberGenerator& __urng,
5353 const param_type& __p)
5354 { this->__generate_impl(__f, __t, __urng, __p); }
5356 template<
typename _UniformRandomNumberGenerator>
5359 _UniformRandomNumberGenerator& __urng,
5360 const param_type& __p)
5361 { this->__generate_impl(__f, __t, __urng, __p); }
5370 {
return __d1._M_param == __d2._M_param; }
5373 template<
typename _ForwardIterator,
5374 typename _UniformRandomNumberGenerator>
5376 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5377 _UniformRandomNumberGenerator& __urng,
5378 const param_type& __p);
5380 param_type _M_param;
5383#if __cpp_impl_three_way_comparison < 201907L
5388 template<
typename _RealType>
5392 {
return !(__d1 == __d2); }
5405 template<
typename _RealType,
typename _CharT,
typename _Traits>
5420 template<
typename _RealType,
typename _CharT,
typename _Traits>
5443 template<
typename _IntType =
int>
5447 "result_type must be an integral type");
5460 : _M_prob(), _M_cp()
5463 template<
typename _InputIterator>
5465 _InputIterator __wend)
5466 : _M_prob(__wbegin, __wend), _M_cp()
5467 { _M_initialize(); }
5470 : _M_prob(__wil.begin(), __wil.end()), _M_cp()
5471 { _M_initialize(); }
5473 template<
typename _Func>
5474 param_type(
size_t __nw,
double __xmin,
double __xmax,
5482 probabilities()
const
5487 {
return __p1._M_prob == __p2._M_prob; }
5489#if __cpp_impl_three_way_comparison < 201907L
5492 {
return !(__p1 == __p2); }
5507 template<
typename _InputIterator>
5509 _InputIterator __wend)
5510 : _M_param(__wbegin, __wend)
5513 discrete_distribution(initializer_list<double> __wl)
5517 template<
typename _Func>
5518 discrete_distribution(
size_t __nw,
double __xmin,
double __xmax,
5520 : _M_param(__nw, __xmin, __xmax, __fw)
5524 discrete_distribution(
const param_type& __p)
5541 return _M_param._M_prob.
empty()
5550 {
return _M_param; }
5558 { _M_param = __param; }
5573 return _M_param._M_prob.
empty()
5580 template<
typename _UniformRandomNumberGenerator>
5583 {
return this->
operator()(__urng, _M_param); }
5585 template<
typename _UniformRandomNumberGenerator>
5587 operator()(_UniformRandomNumberGenerator& __urng,
5588 const param_type& __p);
5590 template<
typename _ForwardIterator,
5591 typename _UniformRandomNumberGenerator>
5593 __generate(_ForwardIterator __f, _ForwardIterator __t,
5594 _UniformRandomNumberGenerator& __urng)
5595 { this->__generate(__f, __t, __urng, _M_param); }
5597 template<
typename _ForwardIterator,
5598 typename _UniformRandomNumberGenerator>
5600 __generate(_ForwardIterator __f, _ForwardIterator __t,
5601 _UniformRandomNumberGenerator& __urng,
5602 const param_type& __p)
5603 { this->__generate_impl(__f, __t, __urng, __p); }
5605 template<
typename _UniformRandomNumberGenerator>
5608 _UniformRandomNumberGenerator& __urng,
5609 const param_type& __p)
5610 { this->__generate_impl(__f, __t, __urng, __p); }
5619 {
return __d1._M_param == __d2._M_param; }
5631 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5647 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5653 template<
typename _ForwardIterator,
5654 typename _UniformRandomNumberGenerator>
5656 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5657 _UniformRandomNumberGenerator& __urng,
5663#if __cpp_impl_three_way_comparison < 201907L
5668 template<
typename _IntType>
5672 {
return !(__d1 == __d2); }
5691 template<
typename _RealType =
double>
5695 "result_type must be a floating point type");
5708 : _M_int(), _M_den(), _M_cp()
5711 template<
typename _InputIteratorB,
typename _InputIteratorW>
5713 _InputIteratorB __bend,
5714 _InputIteratorW __wbegin);
5716 template<
typename _Func>
5719 template<
typename _Func>
5720 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5733 __tmp[1] = _RealType(1);
5746 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
5748#if __cpp_impl_three_way_comparison < 201907L
5751 {
return !(__p1 == __p2); }
5767 template<
typename _InputIteratorB,
typename _InputIteratorW>
5769 _InputIteratorB __bend,
5770 _InputIteratorW __wbegin)
5771 : _M_param(__bfirst, __bend, __wbegin)
5774 template<
typename _Func>
5775 piecewise_constant_distribution(initializer_list<_RealType> __bl,
5777 : _M_param(__bl, __fw)
5780 template<
typename _Func>
5781 piecewise_constant_distribution(
size_t __nw,
5782 _RealType __xmin, _RealType __xmax,
5784 : _M_param(__nw, __xmin, __xmax, __fw)
5788 piecewise_constant_distribution(
const param_type& __p)
5805 if (_M_param._M_int.
empty())
5808 __tmp[1] = _RealType(1);
5812 return _M_param._M_int;
5821 return _M_param._M_den.
empty()
5830 {
return _M_param; }
5838 { _M_param = __param; }
5846 return _M_param._M_int.
empty()
5856 return _M_param._M_int.
empty()
5863 template<
typename _UniformRandomNumberGenerator>
5866 {
return this->
operator()(__urng, _M_param); }
5868 template<
typename _UniformRandomNumberGenerator>
5870 operator()(_UniformRandomNumberGenerator& __urng,
5871 const param_type& __p);
5873 template<
typename _ForwardIterator,
5874 typename _UniformRandomNumberGenerator>
5876 __generate(_ForwardIterator __f, _ForwardIterator __t,
5877 _UniformRandomNumberGenerator& __urng)
5878 { this->__generate(__f, __t, __urng, _M_param); }
5880 template<
typename _ForwardIterator,
5881 typename _UniformRandomNumberGenerator>
5883 __generate(_ForwardIterator __f, _ForwardIterator __t,
5884 _UniformRandomNumberGenerator& __urng,
5885 const param_type& __p)
5886 { this->__generate_impl(__f, __t, __urng, __p); }
5888 template<
typename _UniformRandomNumberGenerator>
5891 _UniformRandomNumberGenerator& __urng,
5892 const param_type& __p)
5893 { this->__generate_impl(__f, __t, __urng, __p); }
5902 {
return __d1._M_param == __d2._M_param; }
5915 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5931 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5937 template<
typename _ForwardIterator,
5938 typename _UniformRandomNumberGenerator>
5940 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5941 _UniformRandomNumberGenerator& __urng,
5947#if __cpp_impl_three_way_comparison < 201907L
5952 template<
typename _RealType>
5956 {
return !(__d1 == __d2); }
5971 template<
typename _RealType =
double>
5975 "result_type must be a floating point type");
5988 : _M_int(), _M_den(), _M_cp(), _M_m()
5991 template<
typename _InputIteratorB,
typename _InputIteratorW>
5993 _InputIteratorB __bend,
5994 _InputIteratorW __wbegin);
5996 template<
typename _Func>
5999 template<
typename _Func>
6000 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
6013 __tmp[1] = _RealType(1);
6026 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
6028#if __cpp_impl_three_way_comparison < 201907L
6031 {
return !(__p1 == __p2); }
6048 template<
typename _InputIteratorB,
typename _InputIteratorW>
6050 _InputIteratorB __bend,
6051 _InputIteratorW __wbegin)
6052 : _M_param(__bfirst, __bend, __wbegin)
6055 template<
typename _Func>
6056 piecewise_linear_distribution(initializer_list<_RealType> __bl,
6058 : _M_param(__bl, __fw)
6061 template<
typename _Func>
6062 piecewise_linear_distribution(
size_t __nw,
6063 _RealType __xmin, _RealType __xmax,
6065 : _M_param(__nw, __xmin, __xmax, __fw)
6069 piecewise_linear_distribution(
const param_type& __p)
6086 if (_M_param._M_int.
empty())
6089 __tmp[1] = _RealType(1);
6093 return _M_param._M_int;
6103 return _M_param._M_den.
empty()
6112 {
return _M_param; }
6120 { _M_param = __param; }
6128 return _M_param._M_int.
empty()
6138 return _M_param._M_int.
empty()
6145 template<
typename _UniformRandomNumberGenerator>
6148 {
return this->
operator()(__urng, _M_param); }
6150 template<
typename _UniformRandomNumberGenerator>
6152 operator()(_UniformRandomNumberGenerator& __urng,
6153 const param_type& __p);
6155 template<
typename _ForwardIterator,
6156 typename _UniformRandomNumberGenerator>
6158 __generate(_ForwardIterator __f, _ForwardIterator __t,
6159 _UniformRandomNumberGenerator& __urng)
6160 { this->__generate(__f, __t, __urng, _M_param); }
6162 template<
typename _ForwardIterator,
6163 typename _UniformRandomNumberGenerator>
6165 __generate(_ForwardIterator __f, _ForwardIterator __t,
6166 _UniformRandomNumberGenerator& __urng,
6167 const param_type& __p)
6168 { this->__generate_impl(__f, __t, __urng, __p); }
6170 template<
typename _UniformRandomNumberGenerator>
6173 _UniformRandomNumberGenerator& __urng,
6174 const param_type& __p)
6175 { this->__generate_impl(__f, __t, __urng, __p); }
6184 {
return __d1._M_param == __d2._M_param; }
6197 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6213 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6219 template<
typename _ForwardIterator,
6220 typename _UniformRandomNumberGenerator>
6222 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6223 _UniformRandomNumberGenerator& __urng,
6229#if __cpp_impl_three_way_comparison < 201907L
6234 template<
typename _RealType>
6238 {
return !(__d1 == __d2); }
6269 template<
typename _IntType,
typename = _Require<is_
integral<_IntType>>>
6272 template<
typename _InputIterator>
6273 seed_seq(_InputIterator __begin, _InputIterator __end);
6276 template<
typename _RandomAccessIterator>
6278 generate(_RandomAccessIterator __begin, _RandomAccessIterator __end);
6281 size_t size() const noexcept
6282 {
return _M_v.
size(); }
6284 template<
typename _OutputIterator>
6286 param(_OutputIterator __dest)
const
6287 { std::copy(_M_v.
begin(), _M_v.
end(), __dest); }
6301_GLIBCXX_END_NAMESPACE_VERSION
complex< _Tp > log(const complex< _Tp > &)
Return complex natural logarithm of z.
complex< _Tp > exp(const complex< _Tp > &)
Return complex base e exponential of z.
complex< _Tp > sqrt(const complex< _Tp > &)
Return complex square root of z.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
constexpr const _Tp & max(const _Tp &, const _Tp &)
This does what you think it does.
constexpr const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
_RealType generate_canonical(_UniformRandomNumberGenerator &__g)
A function template for converting the output of a (integral) uniform random number generator to a fl...
__gnu_cxx::__promote_2< _Tpa, _Tpb >::__type beta(_Tpa __a, _Tpb __b)
linear_congruential_engine< uint_fast32_t, 48271UL, 0UL, 2147483647UL > minstd_rand
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
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.
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.
Template class basic_istream.
Template class basic_ostream.
Properties of fundamental types.
static constexpr _Tp max() noexcept
static constexpr _Tp lowest() noexcept
static constexpr _Tp min() noexcept
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.
linear_congruential_engine(result_type __s)
Constructs a linear_congruential_engine random number generator engine with seed __s....
linear_congruential_engine(_Sseq &__q)
Constructs a linear_congruential_engine random number generator engine seeded from the seed sequence ...
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.
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
_If_seed_seq< _Sseq > seed(_Sseq &__q)
Reseeds the linear_congruential_engine random number generator engine sequence using values from the ...
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.
mersenne_twister_engine(_Sseq &__q)
Constructs a mersenne_twister_engine random number generator engine seeded from the seed sequence __q...
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...
subtract_with_carry_engine(result_type __sd)
Constructs an explicitly seeded subtract_with_carry_engine random number generator.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
result_type operator()()
Gets the next random number in the sequence.
_If_seed_seq< _Sseq > seed(_Sseq &__q)
Seeds the initial state of the % subtract_with_carry_engine random number generator.
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...
subtract_with_carry_engine(_Sseq &__q)
Constructs a subtract_with_carry_engine random number engine seeded from the seed sequence __q.
static constexpr result_type max()
Gets the inclusive maximum value of the range of random integers returned by this generator.
void seed(result_type __s)
Reseeds the discard_block_engine object with the default seed for the underlying base class 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...
_If_seed_seq< _Sseq > seed(_Sseq &__q)
Reseeds the discard_block_engine object with the given seed sequence.
discard_block_engine(const _RandomNumberEngine &__rng)
Copy constructs a discard_block_engine engine.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
discard_block_engine(_RandomNumberEngine &&__rng)
Move constructs a discard_block_engine engine.
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.
discard_block_engine(_Sseq &__q)
Generator construct a discard_block_engine engine.
result_type operator()()
Gets the next value in the generated random number sequence.
discard_block_engine(result_type __s)
Seed constructs a discard_block_engine engine.
_RandomNumberEngine::result_type result_type
_If_seed_seq< _Sseq > seed(_Sseq &__q)
Reseeds the independent_bits_engine object with the given seed sequence.
independent_bits_engine(_Sseq &__q)
Generator construct a independent_bits_engine engine.
independent_bits_engine(const _RandomNumberEngine &__rng)
Copy constructs a independent_bits_engine engine.
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.
void seed(result_type __s)
Reseeds the independent_bits_engine object with the default seed for the underlying base class genera...
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.
independent_bits_engine(result_type __s)
Seed constructs a independent_bits_engine engine.
independent_bits_engine(_RandomNumberEngine &&__rng)
Move constructs a independent_bits_engine engine.
Produces random numbers by reordering random numbers from some base engine.
_If_seed_seq< _Sseq > seed(_Sseq &__q)
Reseeds the shuffle_order_engine object with the given seed sequence.
static constexpr result_type min()
shuffle_order_engine()
Constructs a default shuffle_order_engine engine.
static constexpr result_type max()
shuffle_order_engine(const _RandomNumberEngine &__rng)
Copy constructs a shuffle_order_engine engine.
shuffle_order_engine(_Sseq &__q)
Generator construct a shuffle_order_engine engine.
const _RandomNumberEngine & base() const noexcept
shuffle_order_engine(_RandomNumberEngine &&__rng)
Move constructs a shuffle_order_engine engine.
void seed()
Reseeds the shuffle_order_engine object with the default seed for the underlying base class generator...
shuffle_order_engine(result_type __s)
Seed constructs a shuffle_order_engine engine.
_RandomNumberEngine::result_type result_type
friend bool operator==(const shuffle_order_engine &__lhs, const shuffle_order_engine &__rhs)
void discard(unsigned long long __z)
void seed(result_type __s)
Reseeds the shuffle_order_engine object with the default seed for the underlying base class generator...
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 ...
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.
_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.
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.
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.
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.
The seed_seq class generates sequences of seeds for random number generators.
uint_least32_t result_type
One of the math functors.
constexpr iterator end() noexcept
constexpr iterator begin() noexcept
constexpr reference front() noexcept
constexpr bool empty() const noexcept
constexpr size_type size() const noexcept
constexpr reference back() noexcept
Uniform discrete distribution for random numbers. A discrete random distribution on the range with e...