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>>
260 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
264 "result_type must be an unsigned integral type");
265 static_assert(__m == 0u || (__a < __m && __c < __m),
266 "template argument substituting __m out of bounds");
268 template<
typename _Sseq>
309 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
330 template<
typename _Sseq>
342 {
return __c == 0u ? 1u : 0u; }
357 for (; __z != 0ULL; --__z)
367 _M_x = __detail::__mod<_UIntType, __m, __a, __c>(_M_x);
385 {
return __lhs._M_x == __rhs._M_x; }
395 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
396 _UIntType1 __m1,
typename _CharT,
typename _Traits>
400 __a1, __c1, __m1>& __lcr);
415 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
416 _UIntType1 __m1,
typename _CharT,
typename _Traits>
426#if __cpp_impl_three_way_comparison < 201907L
438 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
444 {
return !(__lhs == __rhs); }
475 template<
typename _UIntType,
size_t __w,
476 size_t __n,
size_t __m,
size_t __r,
477 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
478 _UIntType __b,
size_t __t,
479 _UIntType __c,
size_t __l, _UIntType __f>
483 "result_type must be an unsigned integral type");
484 static_assert(1u <= __m && __m <= __n,
485 "template argument substituting __m out of bounds");
486 static_assert(__r <= __w,
"template argument substituting "
488 static_assert(__u <= __w,
"template argument substituting "
490 static_assert(__s <= __w,
"template argument substituting "
492 static_assert(__t <= __w,
"template argument substituting "
494 static_assert(__l <= __w,
"template argument substituting "
496 static_assert(__w <= std::numeric_limits<_UIntType>::digits,
497 "template argument substituting __w out of bound");
498 static_assert(__a <= (__detail::_Shift<_UIntType, __w>::__value - 1),
499 "template argument substituting __a out of bound");
500 static_assert(__b <= (__detail::_Shift<_UIntType, __w>::__value - 1),
501 "template argument substituting __b out of bound");
502 static_assert(__c <= (__detail::_Shift<_UIntType, __w>::__value - 1),
503 "template argument substituting __c out of bound");
504 static_assert(__d <= (__detail::_Shift<_UIntType, __w>::__value - 1),
505 "template argument substituting __d out of bound");
506 static_assert(__f <= (__detail::_Shift<_UIntType, __w>::__value - 1),
507 "template argument substituting __f out of bound");
509 template<
typename _Sseq>
519 static constexpr size_t word_size = __w;
520 static constexpr size_t state_size = __n;
521 static constexpr size_t shift_size = __m;
522 static constexpr size_t mask_bits = __r;
524 static constexpr size_t tempering_u = __u;
526 static constexpr size_t tempering_s = __s;
528 static constexpr size_t tempering_t = __t;
530 static constexpr size_t tempering_l = __l;
531 static constexpr result_type initialization_multiplier = __f;
548 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
556 template<
typename _Sseq>
572 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
578 discard(
unsigned long long __z);
598 {
return (std::equal(__lhs._M_x, __lhs._M_x + state_size, __rhs._M_x)
599 && __lhs._M_p == __rhs._M_p); }
613 template<
typename _UIntType1,
614 size_t __w1,
size_t __n1,
615 size_t __m1,
size_t __r1,
616 _UIntType1 __a1,
size_t __u1,
617 _UIntType1 __d1,
size_t __s1,
618 _UIntType1 __b1,
size_t __t1,
619 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
620 typename _CharT,
typename _Traits>
624 __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
639 template<
typename _UIntType1,
640 size_t __w1,
size_t __n1,
641 size_t __m1,
size_t __r1,
642 _UIntType1 __a1,
size_t __u1,
643 _UIntType1 __d1,
size_t __s1,
644 _UIntType1 __b1,
size_t __t1,
645 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
646 typename _CharT,
typename _Traits>
650 __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
656 _UIntType _M_x[state_size];
660#if __cpp_impl_three_way_comparison < 201907L
673 template<
typename _UIntType,
size_t __w,
674 size_t __n,
size_t __m,
size_t __r,
675 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
676 _UIntType __b,
size_t __t,
677 _UIntType __c,
size_t __l, _UIntType __f>
680 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __lhs,
682 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __rhs)
683 {
return !(__lhs == __rhs); }
701 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
705 "result_type must be an unsigned integral type");
706 static_assert(0u < __s && __s < __r,
708 static_assert(0u < __w && __w <= std::numeric_limits<_UIntType>::digits,
709 "template argument substituting __w out of bounds");
711 template<
typename _Sseq>
721 static constexpr size_t word_size = __w;
722 static constexpr size_t short_lag = __s;
723 static constexpr size_t long_lag = __r;
724 static constexpr uint_least32_t default_seed = 19780503u;
743 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
767 template<
typename _Sseq>
785 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
793 for (; __z != 0ULL; --__z)
818 {
return (std::equal(__lhs._M_x, __lhs._M_x + long_lag, __rhs._M_x)
819 && __lhs._M_carry == __rhs._M_carry
820 && __lhs._M_p == __rhs._M_p); }
834 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
835 typename _CharT,
typename _Traits>
853 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
854 typename _CharT,
typename _Traits>
862 _UIntType _M_x[long_lag];
867#if __cpp_impl_three_way_comparison < 201907L
880 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
886 {
return !(__lhs == __rhs); }
895 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
898 static_assert(1 <= __r && __r <= __p,
899 "template argument substituting __r out of bounds");
905 template<
typename _Sseq>
911 static constexpr size_t block_size = __p;
912 static constexpr size_t used_block = __r;
920 : _M_b(), _M_n(0) { }
930 : _M_b(__rng), _M_n(0) { }
940 : _M_b(
std::
move(__rng)), _M_n(0) { }
950 : _M_b(__s), _M_n(0) { }
957 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
990 template<
typename _Sseq>
1002 const _RandomNumberEngine&
1011 {
return _RandomNumberEngine::min(); }
1018 {
return _RandomNumberEngine::max(); }
1026 for (; __z != 0ULL; --__z)
1050 {
return __lhs._M_b == __rhs._M_b && __lhs._M_n == __rhs._M_n; }
1063 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1064 typename _CharT,
typename _Traits>
1081 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1082 typename _CharT,
typename _Traits>
1089 _RandomNumberEngine _M_b;
1093#if __cpp_impl_three_way_comparison < 201907L
1105 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
1111 {
return !(__lhs == __rhs); }
1118 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1122 "result_type must be an unsigned integral type");
1123 static_assert(0u < __w && __w <= std::numeric_limits<_UIntType>::digits,
1124 "template argument substituting __w out of bounds");
1126 template<
typename _Sseq>
1178 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1205 template<
typename _Sseq>
1214 const _RandomNumberEngine&
1230 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1238 for (; __z != 0ULL; --__z)
1263 {
return __lhs._M_b == __rhs._M_b; }
1277 template<
typename _CharT,
typename _Traits>
1281 __w, _UIntType>& __x)
1288 _RandomNumberEngine _M_b;
1291#if __cpp_impl_three_way_comparison < 201907L
1304 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1310 {
return !(__lhs == __rhs); }
1323 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType,
1324 typename _CharT,
typename _Traits>
1328 __w, _UIntType>& __x)
1342 template<
typename _RandomNumberEngine,
size_t __k>
1345 static_assert(1u <= __k,
"template argument substituting "
1346 "__k out of bound");
1352 template<
typename _Sseq>
1357 static constexpr size_t table_size = __k;
1366 { _M_initialize(); }
1377 { _M_initialize(); }
1388 { _M_initialize(); }
1399 { _M_initialize(); }
1406 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1410 { _M_initialize(); }
1439 template<
typename _Sseq>
1450 const _RandomNumberEngine&
1459 {
return _RandomNumberEngine::min(); }
1466 {
return _RandomNumberEngine::max(); }
1474 for (; __z != 0ULL; --__z)
1498 {
return (__lhs._M_b == __rhs._M_b
1499 && std::equal(__lhs._M_v, __lhs._M_v + __k, __rhs._M_v)
1500 && __lhs._M_y == __rhs._M_y); }
1513 template<
typename _RandomNumberEngine1,
size_t __k1,
1514 typename _CharT,
typename _Traits>
1531 template<
typename _RandomNumberEngine1,
size_t __k1,
1532 typename _CharT,
typename _Traits>
1538 void _M_initialize()
1540 for (
size_t __i = 0; __i < __k; ++__i)
1545 _RandomNumberEngine _M_b;
1550#if __cpp_impl_three_way_comparison < 201907L
1562 template<
typename _RandomNumberEngine,
size_t __k>
1568 {
return !(__lhs == __rhs); }
1574 typedef linear_congruential_engine<uint_fast32_t, 16807UL, 0UL, 2147483647UL>
1605 0xb5026f5aa96619e9ULL, 29,
1606 0x5555555555555555ULL, 17,
1607 0x71d67fffeda60000ULL, 37,
1608 0xfff7eee000000000ULL, 43,
1654 entropy() const noexcept
1655 {
return this->_M_getentropy(); }
1659 {
return this->_M_getval(); }
1662 random_device(
const random_device&) =
delete;
1663 void operator=(
const random_device&) =
delete;
1673 double _M_getentropy() const noexcept;
1675 void _M_init(const
char*,
size_t);
1705#if __cpp_impl_three_way_comparison < 201907L
1710 template<
typename _IntType>
1714 {
return !(__d1 == __d2); }
1727 template<
typename _IntType,
typename _CharT,
typename _Traits>
1741 template<
typename _IntType,
typename _CharT,
typename _Traits>
1754 template<
typename _RealType =
double>
1758 "result_type must be a floating point type");
1772 param_type(_RealType __a, _RealType __b = _RealType(1))
1773 : _M_a(__a), _M_b(__b)
1775 __glibcxx_assert(_M_a <= _M_b);
1788 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
1790#if __cpp_impl_three_way_comparison < 201907L
1793 {
return !(__p1 == __p2); }
1817 : _M_param(__a, __b)
1835 {
return _M_param.a(); }
1839 {
return _M_param.b(); }
1846 {
return _M_param; }
1854 { _M_param = __param; }
1861 {
return this->a(); }
1868 {
return this->b(); }
1873 template<
typename _UniformRandomNumberGenerator>
1876 {
return this->
operator()(__urng, _M_param); }
1878 template<
typename _UniformRandomNumberGenerator>
1880 operator()(_UniformRandomNumberGenerator& __urng,
1881 const param_type& __p)
1883 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
1885 return (__aurng() * (__p.b() - __p.a())) + __p.a();
1888 template<
typename _ForwardIterator,
1889 typename _UniformRandomNumberGenerator>
1891 __generate(_ForwardIterator __f, _ForwardIterator __t,
1892 _UniformRandomNumberGenerator& __urng)
1893 { this->__generate(__f, __t, __urng, _M_param); }
1895 template<
typename _ForwardIterator,
1896 typename _UniformRandomNumberGenerator>
1898 __generate(_ForwardIterator __f, _ForwardIterator __t,
1899 _UniformRandomNumberGenerator& __urng,
1900 const param_type& __p)
1901 { this->__generate_impl(__f, __t, __urng, __p); }
1903 template<
typename _UniformRandomNumberGenerator>
1906 _UniformRandomNumberGenerator& __urng,
1907 const param_type& __p)
1908 { this->__generate_impl(__f, __t, __urng, __p); }
1917 {
return __d1._M_param == __d2._M_param; }
1920 template<
typename _ForwardIterator,
1921 typename _UniformRandomNumberGenerator>
1923 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
1924 _UniformRandomNumberGenerator& __urng,
1925 const param_type& __p);
1927 param_type _M_param;
1930#if __cpp_impl_three_way_comparison < 201907L
1935 template<
typename _IntType>
1939 {
return !(__d1 == __d2); }
1952 template<
typename _RealType,
typename _CharT,
typename _Traits>
1966 template<
typename _RealType,
typename _CharT,
typename _Traits>
1988 template<
typename _RealType =
double>
1992 "result_type must be a floating point type");
2006 param_type(_RealType __mean, _RealType __stddev = _RealType(1))
2007 : _M_mean(__mean), _M_stddev(__stddev)
2009 __glibcxx_assert(_M_stddev > _RealType(0));
2018 {
return _M_stddev; }
2022 {
return (__p1._M_mean == __p2._M_mean
2023 && __p1._M_stddev == __p2._M_stddev); }
2025#if __cpp_impl_three_way_comparison < 201907L
2028 {
return !(__p1 == __p2); }
2033 _RealType _M_stddev;
2046 : _M_param(__mean, __stddev)
2059 { _M_saved_available =
false; }
2066 {
return _M_param.mean(); }
2073 {
return _M_param.stddev(); }
2080 {
return _M_param; }
2088 { _M_param = __param; }
2107 template<
typename _UniformRandomNumberGenerator>
2110 {
return this->
operator()(__urng, _M_param); }
2112 template<
typename _UniformRandomNumberGenerator>
2114 operator()(_UniformRandomNumberGenerator& __urng,
2115 const param_type& __p);
2117 template<
typename _ForwardIterator,
2118 typename _UniformRandomNumberGenerator>
2120 __generate(_ForwardIterator __f, _ForwardIterator __t,
2121 _UniformRandomNumberGenerator& __urng)
2122 { this->__generate(__f, __t, __urng, _M_param); }
2124 template<
typename _ForwardIterator,
2125 typename _UniformRandomNumberGenerator>
2127 __generate(_ForwardIterator __f, _ForwardIterator __t,
2128 _UniformRandomNumberGenerator& __urng,
2129 const param_type& __p)
2130 { this->__generate_impl(__f, __t, __urng, __p); }
2132 template<
typename _UniformRandomNumberGenerator>
2135 _UniformRandomNumberGenerator& __urng,
2136 const param_type& __p)
2137 { this->__generate_impl(__f, __t, __urng, __p); }
2144 template<
typename _RealType1>
2159 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2174 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2180 template<
typename _ForwardIterator,
2181 typename _UniformRandomNumberGenerator>
2183 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2184 _UniformRandomNumberGenerator& __urng,
2189 bool _M_saved_available =
false;
2192#if __cpp_impl_three_way_comparison < 201907L
2196 template<
typename _RealType>
2200 {
return !(__d1 == __d2); }
2212 template<
typename _RealType =
double>
2216 "result_type must be a floating point type");
2230 param_type(_RealType __m, _RealType __s = _RealType(1))
2231 : _M_m(__m), _M_s(__s)
2244 {
return __p1._M_m == __p2._M_m && __p1._M_s == __p2._M_s; }
2246#if __cpp_impl_three_way_comparison < 201907L
2249 {
return !(__p1 == __p2); }
2261 : _M_param(__m, __s), _M_nd()
2265 lognormal_distribution(
const param_type& __p)
2266 : _M_param(__p), _M_nd()
2281 {
return _M_param.m(); }
2285 {
return _M_param.s(); }
2292 {
return _M_param; }
2300 { _M_param = __param; }
2319 template<
typename _UniformRandomNumberGenerator>
2322 {
return this->
operator()(__urng, _M_param); }
2324 template<
typename _UniformRandomNumberGenerator>
2326 operator()(_UniformRandomNumberGenerator& __urng,
2327 const param_type& __p)
2328 {
return std::exp(__p.s() * _M_nd(__urng) + __p.m()); }
2330 template<
typename _ForwardIterator,
2331 typename _UniformRandomNumberGenerator>
2333 __generate(_ForwardIterator __f, _ForwardIterator __t,
2334 _UniformRandomNumberGenerator& __urng)
2335 { this->__generate(__f, __t, __urng, _M_param); }
2337 template<
typename _ForwardIterator,
2338 typename _UniformRandomNumberGenerator>
2340 __generate(_ForwardIterator __f, _ForwardIterator __t,
2341 _UniformRandomNumberGenerator& __urng,
2342 const param_type& __p)
2343 { this->__generate_impl(__f, __t, __urng, __p); }
2345 template<
typename _UniformRandomNumberGenerator>
2348 _UniformRandomNumberGenerator& __urng,
2349 const param_type& __p)
2350 { this->__generate_impl(__f, __t, __urng, __p); }
2360 {
return (__d1._M_param == __d2._M_param
2361 && __d1._M_nd == __d2._M_nd); }
2373 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2388 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2394 template<
typename _ForwardIterator,
2395 typename _UniformRandomNumberGenerator>
2397 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2398 _UniformRandomNumberGenerator& __urng,
2406#if __cpp_impl_three_way_comparison < 201907L
2410 template<
typename _RealType>
2414 {
return !(__d1 == __d2); }
2426 template<
typename _RealType =
double>
2430 "result_type must be a floating point type");
2445 param_type(_RealType __alpha_val, _RealType __beta_val = _RealType(1))
2446 : _M_alpha(__alpha_val), _M_beta(__beta_val)
2448 __glibcxx_assert(_M_alpha > _RealType(0));
2454 {
return _M_alpha; }
2462 {
return (__p1._M_alpha == __p2._M_alpha
2463 && __p1._M_beta == __p2._M_beta); }
2465#if __cpp_impl_three_way_comparison < 201907L
2468 {
return !(__p1 == __p2); }
2478 _RealType _M_malpha, _M_a2;
2493 _RealType __beta_val = _RealType(1))
2494 : _M_param(__alpha_val, __beta_val), _M_nd()
2499 : _M_param(__p), _M_nd()
2514 {
return _M_param.alpha(); }
2521 {
return _M_param.beta(); }
2528 {
return _M_param; }
2536 { _M_param = __param; }
2555 template<
typename _UniformRandomNumberGenerator>
2558 {
return this->
operator()(__urng, _M_param); }
2560 template<
typename _UniformRandomNumberGenerator>
2562 operator()(_UniformRandomNumberGenerator& __urng,
2563 const param_type& __p);
2565 template<
typename _ForwardIterator,
2566 typename _UniformRandomNumberGenerator>
2568 __generate(_ForwardIterator __f, _ForwardIterator __t,
2569 _UniformRandomNumberGenerator& __urng)
2570 { this->__generate(__f, __t, __urng, _M_param); }
2572 template<
typename _ForwardIterator,
2573 typename _UniformRandomNumberGenerator>
2575 __generate(_ForwardIterator __f, _ForwardIterator __t,
2576 _UniformRandomNumberGenerator& __urng,
2577 const param_type& __p)
2578 { this->__generate_impl(__f, __t, __urng, __p); }
2580 template<
typename _UniformRandomNumberGenerator>
2583 _UniformRandomNumberGenerator& __urng,
2584 const param_type& __p)
2585 { this->__generate_impl(__f, __t, __urng, __p); }
2595 {
return (__d1._M_param == __d2._M_param
2596 && __d1._M_nd == __d2._M_nd); }
2608 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2622 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2628 template<
typename _ForwardIterator,
2629 typename _UniformRandomNumberGenerator>
2631 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2632 _UniformRandomNumberGenerator& __urng,
2640#if __cpp_impl_three_way_comparison < 201907L
2644 template<
typename _RealType>
2648 {
return !(__d1 == __d2); }
2657 template<
typename _RealType =
double>
2661 "result_type must be a floating point type");
2685 {
return __p1._M_n == __p2._M_n; }
2687#if __cpp_impl_three_way_comparison < 201907L
2690 {
return !(__p1 == __p2); }
2701 : _M_param(__n), _M_gd(__n / 2)
2705 chi_squared_distribution(
const param_type& __p)
2706 : _M_param(__p), _M_gd(__p.n() / 2)
2721 {
return _M_param.n(); }
2728 {
return _M_param; }
2760 template<
typename _UniformRandomNumberGenerator>
2763 {
return 2 * _M_gd(__urng); }
2765 template<
typename _UniformRandomNumberGenerator>
2767 operator()(_UniformRandomNumberGenerator& __urng,
2768 const param_type& __p)
2772 return 2 * _M_gd(__urng, param_type(__p.n() / 2));
2775 template<
typename _ForwardIterator,
2776 typename _UniformRandomNumberGenerator>
2778 __generate(_ForwardIterator __f, _ForwardIterator __t,
2779 _UniformRandomNumberGenerator& __urng)
2780 { this->__generate_impl(__f, __t, __urng); }
2782 template<
typename _ForwardIterator,
2783 typename _UniformRandomNumberGenerator>
2785 __generate(_ForwardIterator __f, _ForwardIterator __t,
2786 _UniformRandomNumberGenerator& __urng,
2787 const param_type& __p)
2790 this->__generate_impl(__f, __t, __urng, __p2); }
2792 template<
typename _UniformRandomNumberGenerator>
2795 _UniformRandomNumberGenerator& __urng)
2796 { this->__generate_impl(__f, __t, __urng); }
2798 template<
typename _UniformRandomNumberGenerator>
2801 _UniformRandomNumberGenerator& __urng,
2802 const param_type& __p)
2805 this->__generate_impl(__f, __t, __urng, __p2); }
2815 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
2827 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2842 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2848 template<
typename _ForwardIterator,
2849 typename _UniformRandomNumberGenerator>
2851 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2852 _UniformRandomNumberGenerator& __urng);
2854 template<
typename _ForwardIterator,
2855 typename _UniformRandomNumberGenerator>
2857 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2858 _UniformRandomNumberGenerator& __urng,
2867#if __cpp_impl_three_way_comparison < 201907L
2871 template<
typename _RealType>
2875 {
return !(__d1 == __d2); }
2884 template<
typename _RealType =
double>
2888 "result_type must be a floating point type");
2902 param_type(_RealType __a, _RealType __b = _RealType(1))
2903 : _M_a(__a), _M_b(__b)
2916 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
2918#if __cpp_impl_three_way_comparison < 201907L
2921 {
return !(__p1 == __p2); }
2933 : _M_param(__a, __b)
2937 cauchy_distribution(
const param_type& __p)
2953 {
return _M_param.a(); }
2957 {
return _M_param.b(); }
2964 {
return _M_param; }
2972 { _M_param = __param; }
2991 template<
typename _UniformRandomNumberGenerator>
2994 {
return this->
operator()(__urng, _M_param); }
2996 template<
typename _UniformRandomNumberGenerator>
2998 operator()(_UniformRandomNumberGenerator& __urng,
2999 const param_type& __p);
3001 template<
typename _ForwardIterator,
3002 typename _UniformRandomNumberGenerator>
3004 __generate(_ForwardIterator __f, _ForwardIterator __t,
3005 _UniformRandomNumberGenerator& __urng)
3006 { this->__generate(__f, __t, __urng, _M_param); }
3008 template<
typename _ForwardIterator,
3009 typename _UniformRandomNumberGenerator>
3011 __generate(_ForwardIterator __f, _ForwardIterator __t,
3012 _UniformRandomNumberGenerator& __urng,
3013 const param_type& __p)
3014 { this->__generate_impl(__f, __t, __urng, __p); }
3016 template<
typename _UniformRandomNumberGenerator>
3019 _UniformRandomNumberGenerator& __urng,
3020 const param_type& __p)
3021 { this->__generate_impl(__f, __t, __urng, __p); }
3030 {
return __d1._M_param == __d2._M_param; }
3033 template<
typename _ForwardIterator,
3034 typename _UniformRandomNumberGenerator>
3036 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3037 _UniformRandomNumberGenerator& __urng,
3038 const param_type& __p);
3040 param_type _M_param;
3043#if __cpp_impl_three_way_comparison < 201907L
3048 template<
typename _RealType>
3052 {
return !(__d1 == __d2); }
3065 template<
typename _RealType,
typename _CharT,
typename _Traits>
3080 template<
typename _RealType,
typename _CharT,
typename _Traits>
3096 template<
typename _RealType =
double>
3100 "result_type must be a floating point type");
3114 param_type(_RealType __m, _RealType __n = _RealType(1))
3115 : _M_m(__m), _M_n(__n)
3128 {
return __p1._M_m == __p2._M_m && __p1._M_n == __p2._M_n; }
3130#if __cpp_impl_three_way_comparison < 201907L
3133 {
return !(__p1 == __p2); }
3145 _RealType __n = _RealType(1))
3146 : _M_param(__m, __n), _M_gd_x(__m / 2), _M_gd_y(__n / 2)
3150 fisher_f_distribution(
const param_type& __p)
3151 : _M_param(__p), _M_gd_x(__p.m() / 2), _M_gd_y(__p.n() / 2)
3169 {
return _M_param.m(); }
3173 {
return _M_param.n(); }
3180 {
return _M_param; }
3188 { _M_param = __param; }
3207 template<
typename _UniformRandomNumberGenerator>
3210 {
return (_M_gd_x(__urng) * n()) / (_M_gd_y(__urng) * m()); }
3212 template<
typename _UniformRandomNumberGenerator>
3214 operator()(_UniformRandomNumberGenerator& __urng,
3215 const param_type& __p)
3219 return ((_M_gd_x(__urng, param_type(__p.m() / 2)) * n())
3220 / (_M_gd_y(__urng, param_type(__p.n() / 2)) * m()));
3223 template<
typename _ForwardIterator,
3224 typename _UniformRandomNumberGenerator>
3226 __generate(_ForwardIterator __f, _ForwardIterator __t,
3227 _UniformRandomNumberGenerator& __urng)
3228 { this->__generate_impl(__f, __t, __urng); }
3230 template<
typename _ForwardIterator,
3231 typename _UniformRandomNumberGenerator>
3233 __generate(_ForwardIterator __f, _ForwardIterator __t,
3234 _UniformRandomNumberGenerator& __urng,
3235 const param_type& __p)
3236 { this->__generate_impl(__f, __t, __urng, __p); }
3238 template<
typename _UniformRandomNumberGenerator>
3241 _UniformRandomNumberGenerator& __urng)
3242 { this->__generate_impl(__f, __t, __urng); }
3244 template<
typename _UniformRandomNumberGenerator>
3247 _UniformRandomNumberGenerator& __urng,
3248 const param_type& __p)
3249 { this->__generate_impl(__f, __t, __urng, __p); }
3259 {
return (__d1._M_param == __d2._M_param
3260 && __d1._M_gd_x == __d2._M_gd_x
3261 && __d1._M_gd_y == __d2._M_gd_y); }
3273 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3288 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3294 template<
typename _ForwardIterator,
3295 typename _UniformRandomNumberGenerator>
3297 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3298 _UniformRandomNumberGenerator& __urng);
3300 template<
typename _ForwardIterator,
3301 typename _UniformRandomNumberGenerator>
3303 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3304 _UniformRandomNumberGenerator& __urng,
3312#if __cpp_impl_three_way_comparison < 201907L
3316 template<
typename _RealType>
3320 {
return !(__d1 == __d2); }
3332 template<
typename _RealType =
double>
3336 "result_type must be a floating point type");
3360 {
return __p1._M_n == __p2._M_n; }
3362#if __cpp_impl_three_way_comparison < 201907L
3365 {
return !(__p1 == __p2); }
3376 : _M_param(__n), _M_nd(), _M_gd(__n / 2, 2)
3380 student_t_distribution(
const param_type& __p)
3381 : _M_param(__p), _M_nd(), _M_gd(__p.n() / 2, 2)
3399 {
return _M_param.n(); }
3406 {
return _M_param; }
3414 { _M_param = __param; }
3433 template<
typename _UniformRandomNumberGenerator>
3436 {
return _M_nd(__urng) *
std::sqrt(n() / _M_gd(__urng)); }
3438 template<
typename _UniformRandomNumberGenerator>
3440 operator()(_UniformRandomNumberGenerator& __urng,
3441 const param_type& __p)
3446 const result_type __g = _M_gd(__urng, param_type(__p.n() / 2, 2));
3447 return _M_nd(__urng) *
std::sqrt(__p.n() / __g);
3450 template<
typename _ForwardIterator,
3451 typename _UniformRandomNumberGenerator>
3453 __generate(_ForwardIterator __f, _ForwardIterator __t,
3454 _UniformRandomNumberGenerator& __urng)
3455 { this->__generate_impl(__f, __t, __urng); }
3457 template<
typename _ForwardIterator,
3458 typename _UniformRandomNumberGenerator>
3460 __generate(_ForwardIterator __f, _ForwardIterator __t,
3461 _UniformRandomNumberGenerator& __urng,
3462 const param_type& __p)
3463 { this->__generate_impl(__f, __t, __urng, __p); }
3465 template<
typename _UniformRandomNumberGenerator>
3468 _UniformRandomNumberGenerator& __urng)
3469 { this->__generate_impl(__f, __t, __urng); }
3471 template<
typename _UniformRandomNumberGenerator>
3474 _UniformRandomNumberGenerator& __urng,
3475 const param_type& __p)
3476 { this->__generate_impl(__f, __t, __urng, __p); }
3486 {
return (__d1._M_param == __d2._M_param
3487 && __d1._M_nd == __d2._M_nd && __d1._M_gd == __d2._M_gd); }
3499 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3514 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3520 template<
typename _ForwardIterator,
3521 typename _UniformRandomNumberGenerator>
3523 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3524 _UniformRandomNumberGenerator& __urng);
3525 template<
typename _ForwardIterator,
3526 typename _UniformRandomNumberGenerator>
3528 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3529 _UniformRandomNumberGenerator& __urng,
3538#if __cpp_impl_three_way_comparison < 201907L
3542 template<
typename _RealType>
3546 {
return !(__d1 == __d2); }
3580 __glibcxx_assert((_M_p >= 0.0) && (_M_p <= 1.0));
3589 {
return __p1._M_p == __p2._M_p; }
3591#if __cpp_impl_three_way_comparison < 201907L
3594 {
return !(__p1 == __p2); }
3636 {
return _M_param.p(); }
3643 {
return _M_param; }
3651 { _M_param = __param; }
3670 template<
typename _UniformRandomNumberGenerator>
3673 {
return this->
operator()(__urng, _M_param); }
3675 template<
typename _UniformRandomNumberGenerator>
3677 operator()(_UniformRandomNumberGenerator& __urng,
3678 const param_type& __p)
3680 __detail::_Adaptor<_UniformRandomNumberGenerator, double>
3682 if ((__aurng() - __aurng.min())
3683 < __p.p() * (__aurng.max() - __aurng.min()))
3688 template<
typename _ForwardIterator,
3689 typename _UniformRandomNumberGenerator>
3691 __generate(_ForwardIterator __f, _ForwardIterator __t,
3692 _UniformRandomNumberGenerator& __urng)
3693 { this->__generate(__f, __t, __urng, _M_param); }
3695 template<
typename _ForwardIterator,
3696 typename _UniformRandomNumberGenerator>
3698 __generate(_ForwardIterator __f, _ForwardIterator __t,
3699 _UniformRandomNumberGenerator& __urng,
const param_type& __p)
3700 { this->__generate_impl(__f, __t, __urng, __p); }
3702 template<
typename _UniformRandomNumberGenerator>
3705 _UniformRandomNumberGenerator& __urng,
3706 const param_type& __p)
3707 { this->__generate_impl(__f, __t, __urng, __p); }
3716 {
return __d1._M_param == __d2._M_param; }
3719 template<
typename _ForwardIterator,
3720 typename _UniformRandomNumberGenerator>
3722 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3723 _UniformRandomNumberGenerator& __urng,
3724 const param_type& __p);
3726 param_type _M_param;
3729#if __cpp_impl_three_way_comparison < 201907L
3737 {
return !(__d1 == __d2); }
3750 template<
typename _CharT,
typename _Traits>
3764 template<
typename _CharT,
typename _Traits>
3783 template<
typename _IntType =
int>
3787 "result_type must be an integral type");
3803 : _M_t(__t), _M_p(__p)
3805 __glibcxx_assert((_M_t >= _IntType(0))
3821 {
return __p1._M_t == __p2._M_t && __p1._M_p == __p2._M_p; }
3823#if __cpp_impl_three_way_comparison < 201907L
3826 {
return !(__p1 == __p2); }
3837#if _GLIBCXX_USE_C99_MATH_TR1
3838 double _M_d1, _M_d2, _M_s1, _M_s2, _M_c,
3839 _M_a1, _M_a123, _M_s, _M_lf, _M_lp1p;
3850 : _M_param(__t, __p), _M_nd()
3854 binomial_distribution(
const param_type& __p)
3855 : _M_param(__p), _M_nd()
3870 {
return _M_param.t(); }
3877 {
return _M_param.p(); }
3884 {
return _M_param; }
3892 { _M_param = __param; }
3906 {
return _M_param.t(); }
3911 template<
typename _UniformRandomNumberGenerator>
3914 {
return this->
operator()(__urng, _M_param); }
3916 template<
typename _UniformRandomNumberGenerator>
3918 operator()(_UniformRandomNumberGenerator& __urng,
3919 const param_type& __p);
3921 template<
typename _ForwardIterator,
3922 typename _UniformRandomNumberGenerator>
3924 __generate(_ForwardIterator __f, _ForwardIterator __t,
3925 _UniformRandomNumberGenerator& __urng)
3926 { this->__generate(__f, __t, __urng, _M_param); }
3928 template<
typename _ForwardIterator,
3929 typename _UniformRandomNumberGenerator>
3931 __generate(_ForwardIterator __f, _ForwardIterator __t,
3932 _UniformRandomNumberGenerator& __urng,
3933 const param_type& __p)
3934 { this->__generate_impl(__f, __t, __urng, __p); }
3936 template<
typename _UniformRandomNumberGenerator>
3939 _UniformRandomNumberGenerator& __urng,
3940 const param_type& __p)
3941 { this->__generate_impl(__f, __t, __urng, __p); }
3951#ifdef _GLIBCXX_USE_C99_MATH_TR1
3952 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
3954 {
return __d1._M_param == __d2._M_param; }
3967 template<
typename _IntType1,
3968 typename _CharT,
typename _Traits>
3983 template<
typename _IntType1,
3984 typename _CharT,
typename _Traits>
3990 template<
typename _ForwardIterator,
3991 typename _UniformRandomNumberGenerator>
3993 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3994 _UniformRandomNumberGenerator& __urng,
3997 template<
typename _UniformRandomNumberGenerator>
3999 _M_waiting(_UniformRandomNumberGenerator& __urng,
4000 _IntType __t,
double __q);
4008#if __cpp_impl_three_way_comparison < 201907L
4012 template<
typename _IntType>
4016 {
return !(__d1 == __d2); }
4026 template<
typename _IntType =
int>
4030 "result_type must be an integral type");
4048 __glibcxx_assert((_M_p > 0.0) && (_M_p < 1.0));
4058 {
return __p1._M_p == __p2._M_p; }
4060#if __cpp_impl_three_way_comparison < 201907L
4063 {
return !(__p1 == __p2); }
4069 { _M_log_1_p =
std::log(1.0 - _M_p); }
4086 geometric_distribution(
const param_type& __p)
4103 {
return _M_param.p(); }
4110 {
return _M_param; }
4118 { _M_param = __param; }
4137 template<
typename _UniformRandomNumberGenerator>
4140 {
return this->
operator()(__urng, _M_param); }
4142 template<
typename _UniformRandomNumberGenerator>
4144 operator()(_UniformRandomNumberGenerator& __urng,
4145 const param_type& __p);
4147 template<
typename _ForwardIterator,
4148 typename _UniformRandomNumberGenerator>
4150 __generate(_ForwardIterator __f, _ForwardIterator __t,
4151 _UniformRandomNumberGenerator& __urng)
4152 { this->__generate(__f, __t, __urng, _M_param); }
4154 template<
typename _ForwardIterator,
4155 typename _UniformRandomNumberGenerator>
4157 __generate(_ForwardIterator __f, _ForwardIterator __t,
4158 _UniformRandomNumberGenerator& __urng,
4159 const param_type& __p)
4160 { this->__generate_impl(__f, __t, __urng, __p); }
4162 template<
typename _UniformRandomNumberGenerator>
4165 _UniformRandomNumberGenerator& __urng,
4166 const param_type& __p)
4167 { this->__generate_impl(__f, __t, __urng, __p); }
4176 {
return __d1._M_param == __d2._M_param; }
4179 template<
typename _ForwardIterator,
4180 typename _UniformRandomNumberGenerator>
4182 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4183 _UniformRandomNumberGenerator& __urng,
4184 const param_type& __p);
4186 param_type _M_param;
4189#if __cpp_impl_three_way_comparison < 201907L
4194 template<
typename _IntType>
4198 {
return !(__d1 == __d2); }
4211 template<
typename _IntType,
4212 typename _CharT,
typename _Traits>
4226 template<
typename _IntType,
4227 typename _CharT,
typename _Traits>
4240 template<
typename _IntType =
int>
4244 "result_type must be an integral type");
4259 : _M_k(__k), _M_p(__p)
4261 __glibcxx_assert((_M_k > 0) && (_M_p > 0.0) && (_M_p <= 1.0));
4274 {
return __p1._M_k == __p2._M_k && __p1._M_p == __p2._M_p; }
4276#if __cpp_impl_three_way_comparison < 201907L
4279 {
return !(__p1 == __p2); }
4291 : _M_param(__k, __p), _M_gd(__k, (1.0 - __p) / __p)
4295 negative_binomial_distribution(
const param_type& __p)
4296 : _M_param(__p), _M_gd(__p.
k(), (1.0 - __p.
p()) / __p.
p())
4311 {
return _M_param.k(); }
4318 {
return _M_param.p(); }
4325 {
return _M_param; }
4333 { _M_param = __param; }
4352 template<
typename _UniformRandomNumberGenerator>
4354 operator()(_UniformRandomNumberGenerator& __urng);
4356 template<
typename _UniformRandomNumberGenerator>
4358 operator()(_UniformRandomNumberGenerator& __urng,
4359 const param_type& __p);
4361 template<
typename _ForwardIterator,
4362 typename _UniformRandomNumberGenerator>
4364 __generate(_ForwardIterator __f, _ForwardIterator __t,
4365 _UniformRandomNumberGenerator& __urng)
4366 { this->__generate_impl(__f, __t, __urng); }
4368 template<
typename _ForwardIterator,
4369 typename _UniformRandomNumberGenerator>
4371 __generate(_ForwardIterator __f, _ForwardIterator __t,
4372 _UniformRandomNumberGenerator& __urng,
4373 const param_type& __p)
4374 { this->__generate_impl(__f, __t, __urng, __p); }
4376 template<
typename _UniformRandomNumberGenerator>
4379 _UniformRandomNumberGenerator& __urng)
4380 { this->__generate_impl(__f, __t, __urng); }
4382 template<
typename _UniformRandomNumberGenerator>
4385 _UniformRandomNumberGenerator& __urng,
4386 const param_type& __p)
4387 { this->__generate_impl(__f, __t, __urng, __p); }
4397 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
4410 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4425 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4431 template<
typename _ForwardIterator,
4432 typename _UniformRandomNumberGenerator>
4434 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4435 _UniformRandomNumberGenerator& __urng);
4436 template<
typename _ForwardIterator,
4437 typename _UniformRandomNumberGenerator>
4439 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4440 _UniformRandomNumberGenerator& __urng,
4448#if __cpp_impl_three_way_comparison < 201907L
4452 template<
typename _IntType>
4456 {
return !(__d1 == __d2); }
4474 template<
typename _IntType =
int>
4478 "result_type must be an integral type");
4496 __glibcxx_assert(_M_mean > 0.0);
4506 {
return __p1._M_mean == __p2._M_mean; }
4508#if __cpp_impl_three_way_comparison < 201907L
4511 {
return !(__p1 == __p2); }
4522#if _GLIBCXX_USE_C99_MATH_TR1
4523 double _M_lfm, _M_sm, _M_d, _M_scx, _M_1cx, _M_c2b, _M_cb;
4533 : _M_param(__mean), _M_nd()
4537 poisson_distribution(
const param_type& __p)
4538 : _M_param(__p), _M_nd()
4553 {
return _M_param.mean(); }
4560 {
return _M_param; }
4568 { _M_param = __param; }
4587 template<
typename _UniformRandomNumberGenerator>
4590 {
return this->
operator()(__urng, _M_param); }
4592 template<
typename _UniformRandomNumberGenerator>
4594 operator()(_UniformRandomNumberGenerator& __urng,
4595 const param_type& __p);
4597 template<
typename _ForwardIterator,
4598 typename _UniformRandomNumberGenerator>
4600 __generate(_ForwardIterator __f, _ForwardIterator __t,
4601 _UniformRandomNumberGenerator& __urng)
4602 { this->__generate(__f, __t, __urng, _M_param); }
4604 template<
typename _ForwardIterator,
4605 typename _UniformRandomNumberGenerator>
4607 __generate(_ForwardIterator __f, _ForwardIterator __t,
4608 _UniformRandomNumberGenerator& __urng,
4609 const param_type& __p)
4610 { this->__generate_impl(__f, __t, __urng, __p); }
4612 template<
typename _UniformRandomNumberGenerator>
4615 _UniformRandomNumberGenerator& __urng,
4616 const param_type& __p)
4617 { this->__generate_impl(__f, __t, __urng, __p); }
4627#ifdef _GLIBCXX_USE_C99_MATH_TR1
4628 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
4630 {
return __d1._M_param == __d2._M_param; }
4643 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4658 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4664 template<
typename _ForwardIterator,
4665 typename _UniformRandomNumberGenerator>
4667 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4668 _UniformRandomNumberGenerator& __urng,
4677#if __cpp_impl_three_way_comparison < 201907L
4681 template<
typename _IntType>
4685 {
return !(__d1 == __d2); }
4703 template<
typename _RealType =
double>
4707 "result_type must be a floating point type");
4722 : _M_lambda(__lambda)
4724 __glibcxx_assert(_M_lambda > _RealType(0));
4729 {
return _M_lambda; }
4733 {
return __p1._M_lambda == __p2._M_lambda; }
4735#if __cpp_impl_three_way_comparison < 201907L
4738 {
return !(__p1 == __p2); }
4742 _RealType _M_lambda;
4758 : _M_param(__lambda)
4779 {
return _M_param.lambda(); }
4786 {
return _M_param; }
4794 { _M_param = __param; }
4813 template<
typename _UniformRandomNumberGenerator>
4816 {
return this->
operator()(__urng, _M_param); }
4818 template<
typename _UniformRandomNumberGenerator>
4820 operator()(_UniformRandomNumberGenerator& __urng,
4821 const param_type& __p)
4823 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
4828 template<
typename _ForwardIterator,
4829 typename _UniformRandomNumberGenerator>
4831 __generate(_ForwardIterator __f, _ForwardIterator __t,
4832 _UniformRandomNumberGenerator& __urng)
4833 { this->__generate(__f, __t, __urng, _M_param); }
4835 template<
typename _ForwardIterator,
4836 typename _UniformRandomNumberGenerator>
4838 __generate(_ForwardIterator __f, _ForwardIterator __t,
4839 _UniformRandomNumberGenerator& __urng,
4840 const param_type& __p)
4841 { this->__generate_impl(__f, __t, __urng, __p); }
4843 template<
typename _UniformRandomNumberGenerator>
4846 _UniformRandomNumberGenerator& __urng,
4847 const param_type& __p)
4848 { this->__generate_impl(__f, __t, __urng, __p); }
4857 {
return __d1._M_param == __d2._M_param; }
4860 template<
typename _ForwardIterator,
4861 typename _UniformRandomNumberGenerator>
4863 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4864 _UniformRandomNumberGenerator& __urng,
4865 const param_type& __p);
4867 param_type _M_param;
4870#if __cpp_impl_three_way_comparison < 201907L
4875 template<
typename _RealType>
4879 {
return !(__d1 == __d2); }
4892 template<
typename _RealType,
typename _CharT,
typename _Traits>
4907 template<
typename _RealType,
typename _CharT,
typename _Traits>
4922 template<
typename _RealType =
double>
4926 "result_type must be a floating point type");
4940 param_type(_RealType __a, _RealType __b = _RealType(1.0))
4941 : _M_a(__a), _M_b(__b)
4954 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
4956#if __cpp_impl_three_way_comparison < 201907L
4959 {
return !(__p1 == __p2); }
4971 : _M_param(__a, __b)
4975 weibull_distribution(
const param_type& __p)
4991 {
return _M_param.a(); }
4998 {
return _M_param.b(); }
5005 {
return _M_param; }
5013 { _M_param = __param; }
5032 template<
typename _UniformRandomNumberGenerator>
5035 {
return this->
operator()(__urng, _M_param); }
5037 template<
typename _UniformRandomNumberGenerator>
5039 operator()(_UniformRandomNumberGenerator& __urng,
5040 const param_type& __p);
5042 template<
typename _ForwardIterator,
5043 typename _UniformRandomNumberGenerator>
5045 __generate(_ForwardIterator __f, _ForwardIterator __t,
5046 _UniformRandomNumberGenerator& __urng)
5047 { this->__generate(__f, __t, __urng, _M_param); }
5049 template<
typename _ForwardIterator,
5050 typename _UniformRandomNumberGenerator>
5052 __generate(_ForwardIterator __f, _ForwardIterator __t,
5053 _UniformRandomNumberGenerator& __urng,
5054 const param_type& __p)
5055 { this->__generate_impl(__f, __t, __urng, __p); }
5057 template<
typename _UniformRandomNumberGenerator>
5060 _UniformRandomNumberGenerator& __urng,
5061 const param_type& __p)
5062 { this->__generate_impl(__f, __t, __urng, __p); }
5071 {
return __d1._M_param == __d2._M_param; }
5074 template<
typename _ForwardIterator,
5075 typename _UniformRandomNumberGenerator>
5077 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5078 _UniformRandomNumberGenerator& __urng,
5079 const param_type& __p);
5081 param_type _M_param;
5084#if __cpp_impl_three_way_comparison < 201907L
5089 template<
typename _RealType>
5093 {
return !(__d1 == __d2); }
5106 template<
typename _RealType,
typename _CharT,
typename _Traits>
5121 template<
typename _RealType,
typename _CharT,
typename _Traits>
5136 template<
typename _RealType =
double>
5140 "result_type must be a floating point type");
5154 param_type(_RealType __a, _RealType __b = _RealType(1.0))
5155 : _M_a(__a), _M_b(__b)
5168 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
5170#if __cpp_impl_three_way_comparison < 201907L
5173 {
return !(__p1 == __p2); }
5185 : _M_param(__a, __b)
5189 extreme_value_distribution(
const param_type& __p)
5205 {
return _M_param.a(); }
5212 {
return _M_param.b(); }
5219 {
return _M_param; }
5227 { _M_param = __param; }
5246 template<
typename _UniformRandomNumberGenerator>
5249 {
return this->
operator()(__urng, _M_param); }
5251 template<
typename _UniformRandomNumberGenerator>
5253 operator()(_UniformRandomNumberGenerator& __urng,
5254 const param_type& __p);
5256 template<
typename _ForwardIterator,
5257 typename _UniformRandomNumberGenerator>
5259 __generate(_ForwardIterator __f, _ForwardIterator __t,
5260 _UniformRandomNumberGenerator& __urng)
5261 { this->__generate(__f, __t, __urng, _M_param); }
5263 template<
typename _ForwardIterator,
5264 typename _UniformRandomNumberGenerator>
5266 __generate(_ForwardIterator __f, _ForwardIterator __t,
5267 _UniformRandomNumberGenerator& __urng,
5268 const param_type& __p)
5269 { this->__generate_impl(__f, __t, __urng, __p); }
5271 template<
typename _UniformRandomNumberGenerator>
5274 _UniformRandomNumberGenerator& __urng,
5275 const param_type& __p)
5276 { this->__generate_impl(__f, __t, __urng, __p); }
5285 {
return __d1._M_param == __d2._M_param; }
5288 template<
typename _ForwardIterator,
5289 typename _UniformRandomNumberGenerator>
5291 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5292 _UniformRandomNumberGenerator& __urng,
5293 const param_type& __p);
5295 param_type _M_param;
5298#if __cpp_impl_three_way_comparison < 201907L
5303 template<
typename _RealType>
5307 {
return !(__d1 == __d2); }
5320 template<
typename _RealType,
typename _CharT,
typename _Traits>
5335 template<
typename _RealType,
typename _CharT,
typename _Traits>
5347 template<
typename _IntType =
int>
5351 "result_type must be an integral type");
5364 : _M_prob(), _M_cp()
5367 template<
typename _InputIterator>
5369 _InputIterator __wend)
5370 : _M_prob(__wbegin, __wend), _M_cp()
5371 { _M_initialize(); }
5374 : _M_prob(__wil.begin(), __wil.end()), _M_cp()
5375 { _M_initialize(); }
5377 template<
typename _Func>
5378 param_type(
size_t __nw,
double __xmin,
double __xmax,
5386 probabilities()
const
5391 {
return __p1._M_prob == __p2._M_prob; }
5393#if __cpp_impl_three_way_comparison < 201907L
5396 {
return !(__p1 == __p2); }
5411 template<
typename _InputIterator>
5413 _InputIterator __wend)
5414 : _M_param(__wbegin, __wend)
5417 discrete_distribution(initializer_list<double> __wl)
5421 template<
typename _Func>
5422 discrete_distribution(
size_t __nw,
double __xmin,
double __xmax,
5424 : _M_param(__nw, __xmin, __xmax, __fw)
5428 discrete_distribution(
const param_type& __p)
5445 return _M_param._M_prob.
empty()
5454 {
return _M_param; }
5462 { _M_param = __param; }
5477 return _M_param._M_prob.
empty()
5484 template<
typename _UniformRandomNumberGenerator>
5487 {
return this->
operator()(__urng, _M_param); }
5489 template<
typename _UniformRandomNumberGenerator>
5491 operator()(_UniformRandomNumberGenerator& __urng,
5492 const param_type& __p);
5494 template<
typename _ForwardIterator,
5495 typename _UniformRandomNumberGenerator>
5497 __generate(_ForwardIterator __f, _ForwardIterator __t,
5498 _UniformRandomNumberGenerator& __urng)
5499 { this->__generate(__f, __t, __urng, _M_param); }
5501 template<
typename _ForwardIterator,
5502 typename _UniformRandomNumberGenerator>
5504 __generate(_ForwardIterator __f, _ForwardIterator __t,
5505 _UniformRandomNumberGenerator& __urng,
5506 const param_type& __p)
5507 { this->__generate_impl(__f, __t, __urng, __p); }
5509 template<
typename _UniformRandomNumberGenerator>
5512 _UniformRandomNumberGenerator& __urng,
5513 const param_type& __p)
5514 { this->__generate_impl(__f, __t, __urng, __p); }
5523 {
return __d1._M_param == __d2._M_param; }
5535 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5551 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5557 template<
typename _ForwardIterator,
5558 typename _UniformRandomNumberGenerator>
5560 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5561 _UniformRandomNumberGenerator& __urng,
5567#if __cpp_impl_three_way_comparison < 201907L
5572 template<
typename _IntType>
5576 {
return !(__d1 == __d2); }
5585 template<
typename _RealType =
double>
5589 "result_type must be a floating point type");
5602 : _M_int(), _M_den(), _M_cp()
5605 template<
typename _InputIteratorB,
typename _InputIteratorW>
5607 _InputIteratorB __bend,
5608 _InputIteratorW __wbegin);
5610 template<
typename _Func>
5613 template<
typename _Func>
5614 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5627 __tmp[1] = _RealType(1);
5640 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
5642#if __cpp_impl_three_way_comparison < 201907L
5645 {
return !(__p1 == __p2); }
5661 template<
typename _InputIteratorB,
typename _InputIteratorW>
5663 _InputIteratorB __bend,
5664 _InputIteratorW __wbegin)
5665 : _M_param(__bfirst, __bend, __wbegin)
5668 template<
typename _Func>
5669 piecewise_constant_distribution(initializer_list<_RealType> __bl,
5671 : _M_param(__bl, __fw)
5674 template<
typename _Func>
5675 piecewise_constant_distribution(
size_t __nw,
5676 _RealType __xmin, _RealType __xmax,
5678 : _M_param(__nw, __xmin, __xmax, __fw)
5682 piecewise_constant_distribution(
const param_type& __p)
5699 if (_M_param._M_int.
empty())
5702 __tmp[1] = _RealType(1);
5706 return _M_param._M_int;
5715 return _M_param._M_den.
empty()
5724 {
return _M_param; }
5732 { _M_param = __param; }
5740 return _M_param._M_int.
empty()
5750 return _M_param._M_int.
empty()
5757 template<
typename _UniformRandomNumberGenerator>
5760 {
return this->
operator()(__urng, _M_param); }
5762 template<
typename _UniformRandomNumberGenerator>
5764 operator()(_UniformRandomNumberGenerator& __urng,
5765 const param_type& __p);
5767 template<
typename _ForwardIterator,
5768 typename _UniformRandomNumberGenerator>
5770 __generate(_ForwardIterator __f, _ForwardIterator __t,
5771 _UniformRandomNumberGenerator& __urng)
5772 { this->__generate(__f, __t, __urng, _M_param); }
5774 template<
typename _ForwardIterator,
5775 typename _UniformRandomNumberGenerator>
5777 __generate(_ForwardIterator __f, _ForwardIterator __t,
5778 _UniformRandomNumberGenerator& __urng,
5779 const param_type& __p)
5780 { this->__generate_impl(__f, __t, __urng, __p); }
5782 template<
typename _UniformRandomNumberGenerator>
5785 _UniformRandomNumberGenerator& __urng,
5786 const param_type& __p)
5787 { this->__generate_impl(__f, __t, __urng, __p); }
5796 {
return __d1._M_param == __d2._M_param; }
5809 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5825 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5831 template<
typename _ForwardIterator,
5832 typename _UniformRandomNumberGenerator>
5834 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5835 _UniformRandomNumberGenerator& __urng,
5841#if __cpp_impl_three_way_comparison < 201907L
5846 template<
typename _RealType>
5850 {
return !(__d1 == __d2); }
5859 template<
typename _RealType =
double>
5863 "result_type must be a floating point type");
5876 : _M_int(), _M_den(), _M_cp(), _M_m()
5879 template<
typename _InputIteratorB,
typename _InputIteratorW>
5881 _InputIteratorB __bend,
5882 _InputIteratorW __wbegin);
5884 template<
typename _Func>
5887 template<
typename _Func>
5888 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5901 __tmp[1] = _RealType(1);
5914 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
5916#if __cpp_impl_three_way_comparison < 201907L
5919 {
return !(__p1 == __p2); }
5936 template<
typename _InputIteratorB,
typename _InputIteratorW>
5938 _InputIteratorB __bend,
5939 _InputIteratorW __wbegin)
5940 : _M_param(__bfirst, __bend, __wbegin)
5943 template<
typename _Func>
5944 piecewise_linear_distribution(initializer_list<_RealType> __bl,
5946 : _M_param(__bl, __fw)
5949 template<
typename _Func>
5950 piecewise_linear_distribution(
size_t __nw,
5951 _RealType __xmin, _RealType __xmax,
5953 : _M_param(__nw, __xmin, __xmax, __fw)
5957 piecewise_linear_distribution(
const param_type& __p)
5974 if (_M_param._M_int.
empty())
5977 __tmp[1] = _RealType(1);
5981 return _M_param._M_int;
5991 return _M_param._M_den.
empty()
6000 {
return _M_param; }
6008 { _M_param = __param; }
6016 return _M_param._M_int.
empty()
6026 return _M_param._M_int.
empty()
6033 template<
typename _UniformRandomNumberGenerator>
6036 {
return this->
operator()(__urng, _M_param); }
6038 template<
typename _UniformRandomNumberGenerator>
6040 operator()(_UniformRandomNumberGenerator& __urng,
6041 const param_type& __p);
6043 template<
typename _ForwardIterator,
6044 typename _UniformRandomNumberGenerator>
6046 __generate(_ForwardIterator __f, _ForwardIterator __t,
6047 _UniformRandomNumberGenerator& __urng)
6048 { this->__generate(__f, __t, __urng, _M_param); }
6050 template<
typename _ForwardIterator,
6051 typename _UniformRandomNumberGenerator>
6053 __generate(_ForwardIterator __f, _ForwardIterator __t,
6054 _UniformRandomNumberGenerator& __urng,
6055 const param_type& __p)
6056 { this->__generate_impl(__f, __t, __urng, __p); }
6058 template<
typename _UniformRandomNumberGenerator>
6061 _UniformRandomNumberGenerator& __urng,
6062 const param_type& __p)
6063 { this->__generate_impl(__f, __t, __urng, __p); }
6072 {
return __d1._M_param == __d2._M_param; }
6085 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6101 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6107 template<
typename _ForwardIterator,
6108 typename _UniformRandomNumberGenerator>
6110 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6111 _UniformRandomNumberGenerator& __urng,
6117#if __cpp_impl_three_way_comparison < 201907L
6122 template<
typename _RealType>
6126 {
return !(__d1 == __d2); }
6154 template<
typename _IntType,
typename = _Require<is_
integral<_IntType>>>
6157 template<
typename _InputIterator>
6158 seed_seq(_InputIterator __begin, _InputIterator __end);
6161 template<
typename _RandomAccessIterator>
6163 generate(_RandomAccessIterator __begin, _RandomAccessIterator __end);
6166 size_t size() const noexcept
6167 {
return _M_v.
size(); }
6169 template<
typename _OutputIterator>
6171 param(_OutputIterator __dest)
const
6172 { std::copy(_M_v.
begin(), _M_v.
end(), __dest); }
6186_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...