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,
1642#if defined _GLIBCXX_USE_DEV_RANDOM
1656 entropy() const noexcept
1658#ifdef _GLIBCXX_USE_DEV_RANDOM
1659 return this->_M_getentropy();
1667 {
return this->_M_getval(); }
1670 random_device(
const random_device&) =
delete;
1671 void operator=(
const random_device&) =
delete;
1681 double _M_getentropy() const noexcept;
1683 void _M_init(const
char*,
size_t);
1713#if __cpp_impl_three_way_comparison < 201907L
1718 template<
typename _IntType>
1722 {
return !(__d1 == __d2); }
1735 template<
typename _IntType,
typename _CharT,
typename _Traits>
1749 template<
typename _IntType,
typename _CharT,
typename _Traits>
1762 template<
typename _RealType =
double>
1766 "result_type must be a floating point type");
1780 param_type(_RealType __a, _RealType __b = _RealType(1))
1781 : _M_a(__a), _M_b(__b)
1783 __glibcxx_assert(_M_a <= _M_b);
1796 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
1798#if __cpp_impl_three_way_comparison < 201907L
1801 {
return !(__p1 == __p2); }
1825 : _M_param(__a, __b)
1843 {
return _M_param.a(); }
1847 {
return _M_param.b(); }
1854 {
return _M_param; }
1862 { _M_param = __param; }
1869 {
return this->a(); }
1876 {
return this->b(); }
1881 template<
typename _UniformRandomNumberGenerator>
1884 {
return this->
operator()(__urng, _M_param); }
1886 template<
typename _UniformRandomNumberGenerator>
1888 operator()(_UniformRandomNumberGenerator& __urng,
1889 const param_type& __p)
1891 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
1893 return (__aurng() * (__p.b() - __p.a())) + __p.a();
1896 template<
typename _ForwardIterator,
1897 typename _UniformRandomNumberGenerator>
1899 __generate(_ForwardIterator __f, _ForwardIterator __t,
1900 _UniformRandomNumberGenerator& __urng)
1901 { this->__generate(__f, __t, __urng, _M_param); }
1903 template<
typename _ForwardIterator,
1904 typename _UniformRandomNumberGenerator>
1906 __generate(_ForwardIterator __f, _ForwardIterator __t,
1907 _UniformRandomNumberGenerator& __urng,
1908 const param_type& __p)
1909 { this->__generate_impl(__f, __t, __urng, __p); }
1911 template<
typename _UniformRandomNumberGenerator>
1914 _UniformRandomNumberGenerator& __urng,
1915 const param_type& __p)
1916 { this->__generate_impl(__f, __t, __urng, __p); }
1925 {
return __d1._M_param == __d2._M_param; }
1928 template<
typename _ForwardIterator,
1929 typename _UniformRandomNumberGenerator>
1931 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
1932 _UniformRandomNumberGenerator& __urng,
1933 const param_type& __p);
1935 param_type _M_param;
1938#if __cpp_impl_three_way_comparison < 201907L
1943 template<
typename _IntType>
1947 {
return !(__d1 == __d2); }
1960 template<
typename _RealType,
typename _CharT,
typename _Traits>
1974 template<
typename _RealType,
typename _CharT,
typename _Traits>
1996 template<
typename _RealType =
double>
2000 "result_type must be a floating point type");
2014 param_type(_RealType __mean, _RealType __stddev = _RealType(1))
2015 : _M_mean(__mean), _M_stddev(__stddev)
2017 __glibcxx_assert(_M_stddev > _RealType(0));
2026 {
return _M_stddev; }
2030 {
return (__p1._M_mean == __p2._M_mean
2031 && __p1._M_stddev == __p2._M_stddev); }
2033#if __cpp_impl_three_way_comparison < 201907L
2036 {
return !(__p1 == __p2); }
2041 _RealType _M_stddev;
2054 : _M_param(__mean, __stddev)
2067 { _M_saved_available =
false; }
2074 {
return _M_param.mean(); }
2081 {
return _M_param.stddev(); }
2088 {
return _M_param; }
2096 { _M_param = __param; }
2115 template<
typename _UniformRandomNumberGenerator>
2118 {
return this->
operator()(__urng, _M_param); }
2120 template<
typename _UniformRandomNumberGenerator>
2122 operator()(_UniformRandomNumberGenerator& __urng,
2123 const param_type& __p);
2125 template<
typename _ForwardIterator,
2126 typename _UniformRandomNumberGenerator>
2128 __generate(_ForwardIterator __f, _ForwardIterator __t,
2129 _UniformRandomNumberGenerator& __urng)
2130 { this->__generate(__f, __t, __urng, _M_param); }
2132 template<
typename _ForwardIterator,
2133 typename _UniformRandomNumberGenerator>
2135 __generate(_ForwardIterator __f, _ForwardIterator __t,
2136 _UniformRandomNumberGenerator& __urng,
2137 const param_type& __p)
2138 { this->__generate_impl(__f, __t, __urng, __p); }
2140 template<
typename _UniformRandomNumberGenerator>
2143 _UniformRandomNumberGenerator& __urng,
2144 const param_type& __p)
2145 { this->__generate_impl(__f, __t, __urng, __p); }
2152 template<
typename _RealType1>
2167 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2182 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2188 template<
typename _ForwardIterator,
2189 typename _UniformRandomNumberGenerator>
2191 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2192 _UniformRandomNumberGenerator& __urng,
2197 bool _M_saved_available =
false;
2200#if __cpp_impl_three_way_comparison < 201907L
2204 template<
typename _RealType>
2208 {
return !(__d1 == __d2); }
2220 template<
typename _RealType =
double>
2224 "result_type must be a floating point type");
2238 param_type(_RealType __m, _RealType __s = _RealType(1))
2239 : _M_m(__m), _M_s(__s)
2252 {
return __p1._M_m == __p2._M_m && __p1._M_s == __p2._M_s; }
2254#if __cpp_impl_three_way_comparison < 201907L
2257 {
return !(__p1 == __p2); }
2269 : _M_param(__m, __s), _M_nd()
2273 lognormal_distribution(
const param_type& __p)
2274 : _M_param(__p), _M_nd()
2289 {
return _M_param.m(); }
2293 {
return _M_param.s(); }
2300 {
return _M_param; }
2308 { _M_param = __param; }
2327 template<
typename _UniformRandomNumberGenerator>
2330 {
return this->
operator()(__urng, _M_param); }
2332 template<
typename _UniformRandomNumberGenerator>
2334 operator()(_UniformRandomNumberGenerator& __urng,
2335 const param_type& __p)
2336 {
return std::exp(__p.s() * _M_nd(__urng) + __p.m()); }
2338 template<
typename _ForwardIterator,
2339 typename _UniformRandomNumberGenerator>
2341 __generate(_ForwardIterator __f, _ForwardIterator __t,
2342 _UniformRandomNumberGenerator& __urng)
2343 { this->__generate(__f, __t, __urng, _M_param); }
2345 template<
typename _ForwardIterator,
2346 typename _UniformRandomNumberGenerator>
2348 __generate(_ForwardIterator __f, _ForwardIterator __t,
2349 _UniformRandomNumberGenerator& __urng,
2350 const param_type& __p)
2351 { this->__generate_impl(__f, __t, __urng, __p); }
2353 template<
typename _UniformRandomNumberGenerator>
2356 _UniformRandomNumberGenerator& __urng,
2357 const param_type& __p)
2358 { this->__generate_impl(__f, __t, __urng, __p); }
2368 {
return (__d1._M_param == __d2._M_param
2369 && __d1._M_nd == __d2._M_nd); }
2381 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2396 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2402 template<
typename _ForwardIterator,
2403 typename _UniformRandomNumberGenerator>
2405 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2406 _UniformRandomNumberGenerator& __urng,
2414#if __cpp_impl_three_way_comparison < 201907L
2418 template<
typename _RealType>
2422 {
return !(__d1 == __d2); }
2434 template<
typename _RealType =
double>
2438 "result_type must be a floating point type");
2453 param_type(_RealType __alpha_val, _RealType __beta_val = _RealType(1))
2454 : _M_alpha(__alpha_val), _M_beta(__beta_val)
2456 __glibcxx_assert(_M_alpha > _RealType(0));
2462 {
return _M_alpha; }
2470 {
return (__p1._M_alpha == __p2._M_alpha
2471 && __p1._M_beta == __p2._M_beta); }
2473#if __cpp_impl_three_way_comparison < 201907L
2476 {
return !(__p1 == __p2); }
2486 _RealType _M_malpha, _M_a2;
2501 _RealType __beta_val = _RealType(1))
2502 : _M_param(__alpha_val, __beta_val), _M_nd()
2507 : _M_param(__p), _M_nd()
2522 {
return _M_param.alpha(); }
2529 {
return _M_param.beta(); }
2536 {
return _M_param; }
2544 { _M_param = __param; }
2563 template<
typename _UniformRandomNumberGenerator>
2566 {
return this->
operator()(__urng, _M_param); }
2568 template<
typename _UniformRandomNumberGenerator>
2570 operator()(_UniformRandomNumberGenerator& __urng,
2571 const param_type& __p);
2573 template<
typename _ForwardIterator,
2574 typename _UniformRandomNumberGenerator>
2576 __generate(_ForwardIterator __f, _ForwardIterator __t,
2577 _UniformRandomNumberGenerator& __urng)
2578 { this->__generate(__f, __t, __urng, _M_param); }
2580 template<
typename _ForwardIterator,
2581 typename _UniformRandomNumberGenerator>
2583 __generate(_ForwardIterator __f, _ForwardIterator __t,
2584 _UniformRandomNumberGenerator& __urng,
2585 const param_type& __p)
2586 { this->__generate_impl(__f, __t, __urng, __p); }
2588 template<
typename _UniformRandomNumberGenerator>
2591 _UniformRandomNumberGenerator& __urng,
2592 const param_type& __p)
2593 { this->__generate_impl(__f, __t, __urng, __p); }
2603 {
return (__d1._M_param == __d2._M_param
2604 && __d1._M_nd == __d2._M_nd); }
2616 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2630 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2636 template<
typename _ForwardIterator,
2637 typename _UniformRandomNumberGenerator>
2639 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2640 _UniformRandomNumberGenerator& __urng,
2648#if __cpp_impl_three_way_comparison < 201907L
2652 template<
typename _RealType>
2656 {
return !(__d1 == __d2); }
2665 template<
typename _RealType =
double>
2669 "result_type must be a floating point type");
2693 {
return __p1._M_n == __p2._M_n; }
2695#if __cpp_impl_three_way_comparison < 201907L
2698 {
return !(__p1 == __p2); }
2709 : _M_param(__n), _M_gd(__n / 2)
2713 chi_squared_distribution(
const param_type& __p)
2714 : _M_param(__p), _M_gd(__p.n() / 2)
2729 {
return _M_param.n(); }
2736 {
return _M_param; }
2768 template<
typename _UniformRandomNumberGenerator>
2771 {
return 2 * _M_gd(__urng); }
2773 template<
typename _UniformRandomNumberGenerator>
2775 operator()(_UniformRandomNumberGenerator& __urng,
2776 const param_type& __p)
2780 return 2 * _M_gd(__urng, param_type(__p.n() / 2));
2783 template<
typename _ForwardIterator,
2784 typename _UniformRandomNumberGenerator>
2786 __generate(_ForwardIterator __f, _ForwardIterator __t,
2787 _UniformRandomNumberGenerator& __urng)
2788 { this->__generate_impl(__f, __t, __urng); }
2790 template<
typename _ForwardIterator,
2791 typename _UniformRandomNumberGenerator>
2793 __generate(_ForwardIterator __f, _ForwardIterator __t,
2794 _UniformRandomNumberGenerator& __urng,
2795 const param_type& __p)
2798 this->__generate_impl(__f, __t, __urng, __p2); }
2800 template<
typename _UniformRandomNumberGenerator>
2803 _UniformRandomNumberGenerator& __urng)
2804 { this->__generate_impl(__f, __t, __urng); }
2806 template<
typename _UniformRandomNumberGenerator>
2809 _UniformRandomNumberGenerator& __urng,
2810 const param_type& __p)
2813 this->__generate_impl(__f, __t, __urng, __p2); }
2823 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
2835 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2850 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2856 template<
typename _ForwardIterator,
2857 typename _UniformRandomNumberGenerator>
2859 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2860 _UniformRandomNumberGenerator& __urng);
2862 template<
typename _ForwardIterator,
2863 typename _UniformRandomNumberGenerator>
2865 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2866 _UniformRandomNumberGenerator& __urng,
2875#if __cpp_impl_three_way_comparison < 201907L
2879 template<
typename _RealType>
2883 {
return !(__d1 == __d2); }
2892 template<
typename _RealType =
double>
2896 "result_type must be a floating point type");
2910 param_type(_RealType __a, _RealType __b = _RealType(1))
2911 : _M_a(__a), _M_b(__b)
2924 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
2926#if __cpp_impl_three_way_comparison < 201907L
2929 {
return !(__p1 == __p2); }
2941 : _M_param(__a, __b)
2945 cauchy_distribution(
const param_type& __p)
2961 {
return _M_param.a(); }
2965 {
return _M_param.b(); }
2972 {
return _M_param; }
2980 { _M_param = __param; }
2999 template<
typename _UniformRandomNumberGenerator>
3002 {
return this->
operator()(__urng, _M_param); }
3004 template<
typename _UniformRandomNumberGenerator>
3006 operator()(_UniformRandomNumberGenerator& __urng,
3007 const param_type& __p);
3009 template<
typename _ForwardIterator,
3010 typename _UniformRandomNumberGenerator>
3012 __generate(_ForwardIterator __f, _ForwardIterator __t,
3013 _UniformRandomNumberGenerator& __urng)
3014 { this->__generate(__f, __t, __urng, _M_param); }
3016 template<
typename _ForwardIterator,
3017 typename _UniformRandomNumberGenerator>
3019 __generate(_ForwardIterator __f, _ForwardIterator __t,
3020 _UniformRandomNumberGenerator& __urng,
3021 const param_type& __p)
3022 { this->__generate_impl(__f, __t, __urng, __p); }
3024 template<
typename _UniformRandomNumberGenerator>
3027 _UniformRandomNumberGenerator& __urng,
3028 const param_type& __p)
3029 { this->__generate_impl(__f, __t, __urng, __p); }
3038 {
return __d1._M_param == __d2._M_param; }
3041 template<
typename _ForwardIterator,
3042 typename _UniformRandomNumberGenerator>
3044 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3045 _UniformRandomNumberGenerator& __urng,
3046 const param_type& __p);
3048 param_type _M_param;
3051#if __cpp_impl_three_way_comparison < 201907L
3056 template<
typename _RealType>
3060 {
return !(__d1 == __d2); }
3073 template<
typename _RealType,
typename _CharT,
typename _Traits>
3088 template<
typename _RealType,
typename _CharT,
typename _Traits>
3104 template<
typename _RealType =
double>
3108 "result_type must be a floating point type");
3122 param_type(_RealType __m, _RealType __n = _RealType(1))
3123 : _M_m(__m), _M_n(__n)
3136 {
return __p1._M_m == __p2._M_m && __p1._M_n == __p2._M_n; }
3138#if __cpp_impl_three_way_comparison < 201907L
3141 {
return !(__p1 == __p2); }
3153 _RealType __n = _RealType(1))
3154 : _M_param(__m, __n), _M_gd_x(__m / 2), _M_gd_y(__n / 2)
3158 fisher_f_distribution(
const param_type& __p)
3159 : _M_param(__p), _M_gd_x(__p.m() / 2), _M_gd_y(__p.n() / 2)
3177 {
return _M_param.m(); }
3181 {
return _M_param.n(); }
3188 {
return _M_param; }
3196 { _M_param = __param; }
3215 template<
typename _UniformRandomNumberGenerator>
3218 {
return (_M_gd_x(__urng) * n()) / (_M_gd_y(__urng) * m()); }
3220 template<
typename _UniformRandomNumberGenerator>
3222 operator()(_UniformRandomNumberGenerator& __urng,
3223 const param_type& __p)
3227 return ((_M_gd_x(__urng, param_type(__p.m() / 2)) * n())
3228 / (_M_gd_y(__urng, param_type(__p.n() / 2)) * m()));
3231 template<
typename _ForwardIterator,
3232 typename _UniformRandomNumberGenerator>
3234 __generate(_ForwardIterator __f, _ForwardIterator __t,
3235 _UniformRandomNumberGenerator& __urng)
3236 { this->__generate_impl(__f, __t, __urng); }
3238 template<
typename _ForwardIterator,
3239 typename _UniformRandomNumberGenerator>
3241 __generate(_ForwardIterator __f, _ForwardIterator __t,
3242 _UniformRandomNumberGenerator& __urng,
3243 const param_type& __p)
3244 { this->__generate_impl(__f, __t, __urng, __p); }
3246 template<
typename _UniformRandomNumberGenerator>
3249 _UniformRandomNumberGenerator& __urng)
3250 { this->__generate_impl(__f, __t, __urng); }
3252 template<
typename _UniformRandomNumberGenerator>
3255 _UniformRandomNumberGenerator& __urng,
3256 const param_type& __p)
3257 { this->__generate_impl(__f, __t, __urng, __p); }
3267 {
return (__d1._M_param == __d2._M_param
3268 && __d1._M_gd_x == __d2._M_gd_x
3269 && __d1._M_gd_y == __d2._M_gd_y); }
3281 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3296 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3302 template<
typename _ForwardIterator,
3303 typename _UniformRandomNumberGenerator>
3305 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3306 _UniformRandomNumberGenerator& __urng);
3308 template<
typename _ForwardIterator,
3309 typename _UniformRandomNumberGenerator>
3311 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3312 _UniformRandomNumberGenerator& __urng,
3320#if __cpp_impl_three_way_comparison < 201907L
3324 template<
typename _RealType>
3328 {
return !(__d1 == __d2); }
3340 template<
typename _RealType =
double>
3344 "result_type must be a floating point type");
3368 {
return __p1._M_n == __p2._M_n; }
3370#if __cpp_impl_three_way_comparison < 201907L
3373 {
return !(__p1 == __p2); }
3384 : _M_param(__n), _M_nd(), _M_gd(__n / 2, 2)
3388 student_t_distribution(
const param_type& __p)
3389 : _M_param(__p), _M_nd(), _M_gd(__p.n() / 2, 2)
3407 {
return _M_param.n(); }
3414 {
return _M_param; }
3422 { _M_param = __param; }
3441 template<
typename _UniformRandomNumberGenerator>
3444 {
return _M_nd(__urng) *
std::sqrt(n() / _M_gd(__urng)); }
3446 template<
typename _UniformRandomNumberGenerator>
3448 operator()(_UniformRandomNumberGenerator& __urng,
3449 const param_type& __p)
3454 const result_type __g = _M_gd(__urng, param_type(__p.n() / 2, 2));
3455 return _M_nd(__urng) *
std::sqrt(__p.n() / __g);
3458 template<
typename _ForwardIterator,
3459 typename _UniformRandomNumberGenerator>
3461 __generate(_ForwardIterator __f, _ForwardIterator __t,
3462 _UniformRandomNumberGenerator& __urng)
3463 { this->__generate_impl(__f, __t, __urng); }
3465 template<
typename _ForwardIterator,
3466 typename _UniformRandomNumberGenerator>
3468 __generate(_ForwardIterator __f, _ForwardIterator __t,
3469 _UniformRandomNumberGenerator& __urng,
3470 const param_type& __p)
3471 { this->__generate_impl(__f, __t, __urng, __p); }
3473 template<
typename _UniformRandomNumberGenerator>
3476 _UniformRandomNumberGenerator& __urng)
3477 { this->__generate_impl(__f, __t, __urng); }
3479 template<
typename _UniformRandomNumberGenerator>
3482 _UniformRandomNumberGenerator& __urng,
3483 const param_type& __p)
3484 { this->__generate_impl(__f, __t, __urng, __p); }
3494 {
return (__d1._M_param == __d2._M_param
3495 && __d1._M_nd == __d2._M_nd && __d1._M_gd == __d2._M_gd); }
3507 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3522 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3528 template<
typename _ForwardIterator,
3529 typename _UniformRandomNumberGenerator>
3531 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3532 _UniformRandomNumberGenerator& __urng);
3533 template<
typename _ForwardIterator,
3534 typename _UniformRandomNumberGenerator>
3536 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3537 _UniformRandomNumberGenerator& __urng,
3546#if __cpp_impl_three_way_comparison < 201907L
3550 template<
typename _RealType>
3554 {
return !(__d1 == __d2); }
3588 __glibcxx_assert((_M_p >= 0.0) && (_M_p <= 1.0));
3597 {
return __p1._M_p == __p2._M_p; }
3599#if __cpp_impl_three_way_comparison < 201907L
3602 {
return !(__p1 == __p2); }
3644 {
return _M_param.p(); }
3651 {
return _M_param; }
3659 { _M_param = __param; }
3678 template<
typename _UniformRandomNumberGenerator>
3681 {
return this->
operator()(__urng, _M_param); }
3683 template<
typename _UniformRandomNumberGenerator>
3685 operator()(_UniformRandomNumberGenerator& __urng,
3686 const param_type& __p)
3688 __detail::_Adaptor<_UniformRandomNumberGenerator, double>
3690 if ((__aurng() - __aurng.min())
3691 < __p.p() * (__aurng.max() - __aurng.min()))
3696 template<
typename _ForwardIterator,
3697 typename _UniformRandomNumberGenerator>
3699 __generate(_ForwardIterator __f, _ForwardIterator __t,
3700 _UniformRandomNumberGenerator& __urng)
3701 { this->__generate(__f, __t, __urng, _M_param); }
3703 template<
typename _ForwardIterator,
3704 typename _UniformRandomNumberGenerator>
3706 __generate(_ForwardIterator __f, _ForwardIterator __t,
3707 _UniformRandomNumberGenerator& __urng,
const param_type& __p)
3708 { this->__generate_impl(__f, __t, __urng, __p); }
3710 template<
typename _UniformRandomNumberGenerator>
3713 _UniformRandomNumberGenerator& __urng,
3714 const param_type& __p)
3715 { this->__generate_impl(__f, __t, __urng, __p); }
3724 {
return __d1._M_param == __d2._M_param; }
3727 template<
typename _ForwardIterator,
3728 typename _UniformRandomNumberGenerator>
3730 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3731 _UniformRandomNumberGenerator& __urng,
3732 const param_type& __p);
3734 param_type _M_param;
3737#if __cpp_impl_three_way_comparison < 201907L
3745 {
return !(__d1 == __d2); }
3758 template<
typename _CharT,
typename _Traits>
3772 template<
typename _CharT,
typename _Traits>
3791 template<
typename _IntType =
int>
3795 "result_type must be an integral type");
3811 : _M_t(__t), _M_p(__p)
3813 __glibcxx_assert((_M_t >= _IntType(0))
3829 {
return __p1._M_t == __p2._M_t && __p1._M_p == __p2._M_p; }
3831#if __cpp_impl_three_way_comparison < 201907L
3834 {
return !(__p1 == __p2); }
3845#if _GLIBCXX_USE_C99_MATH_TR1
3846 double _M_d1, _M_d2, _M_s1, _M_s2, _M_c,
3847 _M_a1, _M_a123, _M_s, _M_lf, _M_lp1p;
3858 : _M_param(__t, __p), _M_nd()
3862 binomial_distribution(
const param_type& __p)
3863 : _M_param(__p), _M_nd()
3878 {
return _M_param.t(); }
3885 {
return _M_param.p(); }
3892 {
return _M_param; }
3900 { _M_param = __param; }
3914 {
return _M_param.t(); }
3919 template<
typename _UniformRandomNumberGenerator>
3922 {
return this->
operator()(__urng, _M_param); }
3924 template<
typename _UniformRandomNumberGenerator>
3926 operator()(_UniformRandomNumberGenerator& __urng,
3927 const param_type& __p);
3929 template<
typename _ForwardIterator,
3930 typename _UniformRandomNumberGenerator>
3932 __generate(_ForwardIterator __f, _ForwardIterator __t,
3933 _UniformRandomNumberGenerator& __urng)
3934 { this->__generate(__f, __t, __urng, _M_param); }
3936 template<
typename _ForwardIterator,
3937 typename _UniformRandomNumberGenerator>
3939 __generate(_ForwardIterator __f, _ForwardIterator __t,
3940 _UniformRandomNumberGenerator& __urng,
3941 const param_type& __p)
3942 { this->__generate_impl(__f, __t, __urng, __p); }
3944 template<
typename _UniformRandomNumberGenerator>
3947 _UniformRandomNumberGenerator& __urng,
3948 const param_type& __p)
3949 { this->__generate_impl(__f, __t, __urng, __p); }
3959#ifdef _GLIBCXX_USE_C99_MATH_TR1
3960 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
3962 {
return __d1._M_param == __d2._M_param; }
3975 template<
typename _IntType1,
3976 typename _CharT,
typename _Traits>
3991 template<
typename _IntType1,
3992 typename _CharT,
typename _Traits>
3998 template<
typename _ForwardIterator,
3999 typename _UniformRandomNumberGenerator>
4001 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4002 _UniformRandomNumberGenerator& __urng,
4005 template<
typename _UniformRandomNumberGenerator>
4007 _M_waiting(_UniformRandomNumberGenerator& __urng,
4008 _IntType __t,
double __q);
4016#if __cpp_impl_three_way_comparison < 201907L
4020 template<
typename _IntType>
4024 {
return !(__d1 == __d2); }
4034 template<
typename _IntType =
int>
4038 "result_type must be an integral type");
4056 __glibcxx_assert((_M_p > 0.0) && (_M_p < 1.0));
4066 {
return __p1._M_p == __p2._M_p; }
4068#if __cpp_impl_three_way_comparison < 201907L
4071 {
return !(__p1 == __p2); }
4077 { _M_log_1_p =
std::log(1.0 - _M_p); }
4094 geometric_distribution(
const param_type& __p)
4111 {
return _M_param.p(); }
4118 {
return _M_param; }
4126 { _M_param = __param; }
4145 template<
typename _UniformRandomNumberGenerator>
4148 {
return this->
operator()(__urng, _M_param); }
4150 template<
typename _UniformRandomNumberGenerator>
4152 operator()(_UniformRandomNumberGenerator& __urng,
4153 const param_type& __p);
4155 template<
typename _ForwardIterator,
4156 typename _UniformRandomNumberGenerator>
4158 __generate(_ForwardIterator __f, _ForwardIterator __t,
4159 _UniformRandomNumberGenerator& __urng)
4160 { this->__generate(__f, __t, __urng, _M_param); }
4162 template<
typename _ForwardIterator,
4163 typename _UniformRandomNumberGenerator>
4165 __generate(_ForwardIterator __f, _ForwardIterator __t,
4166 _UniformRandomNumberGenerator& __urng,
4167 const param_type& __p)
4168 { this->__generate_impl(__f, __t, __urng, __p); }
4170 template<
typename _UniformRandomNumberGenerator>
4173 _UniformRandomNumberGenerator& __urng,
4174 const param_type& __p)
4175 { this->__generate_impl(__f, __t, __urng, __p); }
4184 {
return __d1._M_param == __d2._M_param; }
4187 template<
typename _ForwardIterator,
4188 typename _UniformRandomNumberGenerator>
4190 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4191 _UniformRandomNumberGenerator& __urng,
4192 const param_type& __p);
4194 param_type _M_param;
4197#if __cpp_impl_three_way_comparison < 201907L
4202 template<
typename _IntType>
4206 {
return !(__d1 == __d2); }
4219 template<
typename _IntType,
4220 typename _CharT,
typename _Traits>
4234 template<
typename _IntType,
4235 typename _CharT,
typename _Traits>
4248 template<
typename _IntType =
int>
4252 "result_type must be an integral type");
4267 : _M_k(__k), _M_p(__p)
4269 __glibcxx_assert((_M_k > 0) && (_M_p > 0.0) && (_M_p <= 1.0));
4282 {
return __p1._M_k == __p2._M_k && __p1._M_p == __p2._M_p; }
4284#if __cpp_impl_three_way_comparison < 201907L
4287 {
return !(__p1 == __p2); }
4299 : _M_param(__k, __p), _M_gd(__k, (1.0 - __p) / __p)
4303 negative_binomial_distribution(
const param_type& __p)
4304 : _M_param(__p), _M_gd(__p.
k(), (1.0 - __p.
p()) / __p.
p())
4319 {
return _M_param.k(); }
4326 {
return _M_param.p(); }
4333 {
return _M_param; }
4341 { _M_param = __param; }
4360 template<
typename _UniformRandomNumberGenerator>
4362 operator()(_UniformRandomNumberGenerator& __urng);
4364 template<
typename _UniformRandomNumberGenerator>
4366 operator()(_UniformRandomNumberGenerator& __urng,
4367 const param_type& __p);
4369 template<
typename _ForwardIterator,
4370 typename _UniformRandomNumberGenerator>
4372 __generate(_ForwardIterator __f, _ForwardIterator __t,
4373 _UniformRandomNumberGenerator& __urng)
4374 { this->__generate_impl(__f, __t, __urng); }
4376 template<
typename _ForwardIterator,
4377 typename _UniformRandomNumberGenerator>
4379 __generate(_ForwardIterator __f, _ForwardIterator __t,
4380 _UniformRandomNumberGenerator& __urng,
4381 const param_type& __p)
4382 { this->__generate_impl(__f, __t, __urng, __p); }
4384 template<
typename _UniformRandomNumberGenerator>
4387 _UniformRandomNumberGenerator& __urng)
4388 { this->__generate_impl(__f, __t, __urng); }
4390 template<
typename _UniformRandomNumberGenerator>
4393 _UniformRandomNumberGenerator& __urng,
4394 const param_type& __p)
4395 { this->__generate_impl(__f, __t, __urng, __p); }
4405 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
4418 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4433 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4439 template<
typename _ForwardIterator,
4440 typename _UniformRandomNumberGenerator>
4442 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4443 _UniformRandomNumberGenerator& __urng);
4444 template<
typename _ForwardIterator,
4445 typename _UniformRandomNumberGenerator>
4447 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4448 _UniformRandomNumberGenerator& __urng,
4456#if __cpp_impl_three_way_comparison < 201907L
4460 template<
typename _IntType>
4464 {
return !(__d1 == __d2); }
4482 template<
typename _IntType =
int>
4486 "result_type must be an integral type");
4504 __glibcxx_assert(_M_mean > 0.0);
4514 {
return __p1._M_mean == __p2._M_mean; }
4516#if __cpp_impl_three_way_comparison < 201907L
4519 {
return !(__p1 == __p2); }
4530#if _GLIBCXX_USE_C99_MATH_TR1
4531 double _M_lfm, _M_sm, _M_d, _M_scx, _M_1cx, _M_c2b, _M_cb;
4541 : _M_param(__mean), _M_nd()
4545 poisson_distribution(
const param_type& __p)
4546 : _M_param(__p), _M_nd()
4561 {
return _M_param.mean(); }
4568 {
return _M_param; }
4576 { _M_param = __param; }
4595 template<
typename _UniformRandomNumberGenerator>
4598 {
return this->
operator()(__urng, _M_param); }
4600 template<
typename _UniformRandomNumberGenerator>
4602 operator()(_UniformRandomNumberGenerator& __urng,
4603 const param_type& __p);
4605 template<
typename _ForwardIterator,
4606 typename _UniformRandomNumberGenerator>
4608 __generate(_ForwardIterator __f, _ForwardIterator __t,
4609 _UniformRandomNumberGenerator& __urng)
4610 { this->__generate(__f, __t, __urng, _M_param); }
4612 template<
typename _ForwardIterator,
4613 typename _UniformRandomNumberGenerator>
4615 __generate(_ForwardIterator __f, _ForwardIterator __t,
4616 _UniformRandomNumberGenerator& __urng,
4617 const param_type& __p)
4618 { this->__generate_impl(__f, __t, __urng, __p); }
4620 template<
typename _UniformRandomNumberGenerator>
4623 _UniformRandomNumberGenerator& __urng,
4624 const param_type& __p)
4625 { this->__generate_impl(__f, __t, __urng, __p); }
4635#ifdef _GLIBCXX_USE_C99_MATH_TR1
4636 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
4638 {
return __d1._M_param == __d2._M_param; }
4651 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4666 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4672 template<
typename _ForwardIterator,
4673 typename _UniformRandomNumberGenerator>
4675 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4676 _UniformRandomNumberGenerator& __urng,
4685#if __cpp_impl_three_way_comparison < 201907L
4689 template<
typename _IntType>
4693 {
return !(__d1 == __d2); }
4711 template<
typename _RealType =
double>
4715 "result_type must be a floating point type");
4730 : _M_lambda(__lambda)
4732 __glibcxx_assert(_M_lambda > _RealType(0));
4737 {
return _M_lambda; }
4741 {
return __p1._M_lambda == __p2._M_lambda; }
4743#if __cpp_impl_three_way_comparison < 201907L
4746 {
return !(__p1 == __p2); }
4750 _RealType _M_lambda;
4766 : _M_param(__lambda)
4787 {
return _M_param.lambda(); }
4794 {
return _M_param; }
4802 { _M_param = __param; }
4821 template<
typename _UniformRandomNumberGenerator>
4824 {
return this->
operator()(__urng, _M_param); }
4826 template<
typename _UniformRandomNumberGenerator>
4828 operator()(_UniformRandomNumberGenerator& __urng,
4829 const param_type& __p)
4831 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
4836 template<
typename _ForwardIterator,
4837 typename _UniformRandomNumberGenerator>
4839 __generate(_ForwardIterator __f, _ForwardIterator __t,
4840 _UniformRandomNumberGenerator& __urng)
4841 { this->__generate(__f, __t, __urng, _M_param); }
4843 template<
typename _ForwardIterator,
4844 typename _UniformRandomNumberGenerator>
4846 __generate(_ForwardIterator __f, _ForwardIterator __t,
4847 _UniformRandomNumberGenerator& __urng,
4848 const param_type& __p)
4849 { this->__generate_impl(__f, __t, __urng, __p); }
4851 template<
typename _UniformRandomNumberGenerator>
4854 _UniformRandomNumberGenerator& __urng,
4855 const param_type& __p)
4856 { this->__generate_impl(__f, __t, __urng, __p); }
4865 {
return __d1._M_param == __d2._M_param; }
4868 template<
typename _ForwardIterator,
4869 typename _UniformRandomNumberGenerator>
4871 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4872 _UniformRandomNumberGenerator& __urng,
4873 const param_type& __p);
4875 param_type _M_param;
4878#if __cpp_impl_three_way_comparison < 201907L
4883 template<
typename _RealType>
4887 {
return !(__d1 == __d2); }
4900 template<
typename _RealType,
typename _CharT,
typename _Traits>
4915 template<
typename _RealType,
typename _CharT,
typename _Traits>
4930 template<
typename _RealType =
double>
4934 "result_type must be a floating point type");
4948 param_type(_RealType __a, _RealType __b = _RealType(1.0))
4949 : _M_a(__a), _M_b(__b)
4962 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
4964#if __cpp_impl_three_way_comparison < 201907L
4967 {
return !(__p1 == __p2); }
4979 : _M_param(__a, __b)
4983 weibull_distribution(
const param_type& __p)
4999 {
return _M_param.a(); }
5006 {
return _M_param.b(); }
5013 {
return _M_param; }
5021 { _M_param = __param; }
5040 template<
typename _UniformRandomNumberGenerator>
5043 {
return this->
operator()(__urng, _M_param); }
5045 template<
typename _UniformRandomNumberGenerator>
5047 operator()(_UniformRandomNumberGenerator& __urng,
5048 const param_type& __p);
5050 template<
typename _ForwardIterator,
5051 typename _UniformRandomNumberGenerator>
5053 __generate(_ForwardIterator __f, _ForwardIterator __t,
5054 _UniformRandomNumberGenerator& __urng)
5055 { this->__generate(__f, __t, __urng, _M_param); }
5057 template<
typename _ForwardIterator,
5058 typename _UniformRandomNumberGenerator>
5060 __generate(_ForwardIterator __f, _ForwardIterator __t,
5061 _UniformRandomNumberGenerator& __urng,
5062 const param_type& __p)
5063 { this->__generate_impl(__f, __t, __urng, __p); }
5065 template<
typename _UniformRandomNumberGenerator>
5068 _UniformRandomNumberGenerator& __urng,
5069 const param_type& __p)
5070 { this->__generate_impl(__f, __t, __urng, __p); }
5079 {
return __d1._M_param == __d2._M_param; }
5082 template<
typename _ForwardIterator,
5083 typename _UniformRandomNumberGenerator>
5085 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5086 _UniformRandomNumberGenerator& __urng,
5087 const param_type& __p);
5089 param_type _M_param;
5092#if __cpp_impl_three_way_comparison < 201907L
5097 template<
typename _RealType>
5101 {
return !(__d1 == __d2); }
5114 template<
typename _RealType,
typename _CharT,
typename _Traits>
5129 template<
typename _RealType,
typename _CharT,
typename _Traits>
5144 template<
typename _RealType =
double>
5148 "result_type must be a floating point type");
5162 param_type(_RealType __a, _RealType __b = _RealType(1.0))
5163 : _M_a(__a), _M_b(__b)
5176 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
5178#if __cpp_impl_three_way_comparison < 201907L
5181 {
return !(__p1 == __p2); }
5193 : _M_param(__a, __b)
5197 extreme_value_distribution(
const param_type& __p)
5213 {
return _M_param.a(); }
5220 {
return _M_param.b(); }
5227 {
return _M_param; }
5235 { _M_param = __param; }
5254 template<
typename _UniformRandomNumberGenerator>
5257 {
return this->
operator()(__urng, _M_param); }
5259 template<
typename _UniformRandomNumberGenerator>
5261 operator()(_UniformRandomNumberGenerator& __urng,
5262 const param_type& __p);
5264 template<
typename _ForwardIterator,
5265 typename _UniformRandomNumberGenerator>
5267 __generate(_ForwardIterator __f, _ForwardIterator __t,
5268 _UniformRandomNumberGenerator& __urng)
5269 { this->__generate(__f, __t, __urng, _M_param); }
5271 template<
typename _ForwardIterator,
5272 typename _UniformRandomNumberGenerator>
5274 __generate(_ForwardIterator __f, _ForwardIterator __t,
5275 _UniformRandomNumberGenerator& __urng,
5276 const param_type& __p)
5277 { this->__generate_impl(__f, __t, __urng, __p); }
5279 template<
typename _UniformRandomNumberGenerator>
5282 _UniformRandomNumberGenerator& __urng,
5283 const param_type& __p)
5284 { this->__generate_impl(__f, __t, __urng, __p); }
5293 {
return __d1._M_param == __d2._M_param; }
5296 template<
typename _ForwardIterator,
5297 typename _UniformRandomNumberGenerator>
5299 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5300 _UniformRandomNumberGenerator& __urng,
5301 const param_type& __p);
5303 param_type _M_param;
5306#if __cpp_impl_three_way_comparison < 201907L
5311 template<
typename _RealType>
5315 {
return !(__d1 == __d2); }
5328 template<
typename _RealType,
typename _CharT,
typename _Traits>
5343 template<
typename _RealType,
typename _CharT,
typename _Traits>
5355 template<
typename _IntType =
int>
5359 "result_type must be an integral type");
5372 : _M_prob(), _M_cp()
5375 template<
typename _InputIterator>
5377 _InputIterator __wend)
5378 : _M_prob(__wbegin, __wend), _M_cp()
5379 { _M_initialize(); }
5382 : _M_prob(__wil.begin(), __wil.end()), _M_cp()
5383 { _M_initialize(); }
5385 template<
typename _Func>
5386 param_type(
size_t __nw,
double __xmin,
double __xmax,
5394 probabilities()
const
5399 {
return __p1._M_prob == __p2._M_prob; }
5401#if __cpp_impl_three_way_comparison < 201907L
5404 {
return !(__p1 == __p2); }
5419 template<
typename _InputIterator>
5421 _InputIterator __wend)
5422 : _M_param(__wbegin, __wend)
5425 discrete_distribution(initializer_list<double> __wl)
5429 template<
typename _Func>
5430 discrete_distribution(
size_t __nw,
double __xmin,
double __xmax,
5432 : _M_param(__nw, __xmin, __xmax, __fw)
5436 discrete_distribution(
const param_type& __p)
5453 return _M_param._M_prob.
empty()
5462 {
return _M_param; }
5470 { _M_param = __param; }
5485 return _M_param._M_prob.
empty()
5492 template<
typename _UniformRandomNumberGenerator>
5495 {
return this->
operator()(__urng, _M_param); }
5497 template<
typename _UniformRandomNumberGenerator>
5499 operator()(_UniformRandomNumberGenerator& __urng,
5500 const param_type& __p);
5502 template<
typename _ForwardIterator,
5503 typename _UniformRandomNumberGenerator>
5505 __generate(_ForwardIterator __f, _ForwardIterator __t,
5506 _UniformRandomNumberGenerator& __urng)
5507 { this->__generate(__f, __t, __urng, _M_param); }
5509 template<
typename _ForwardIterator,
5510 typename _UniformRandomNumberGenerator>
5512 __generate(_ForwardIterator __f, _ForwardIterator __t,
5513 _UniformRandomNumberGenerator& __urng,
5514 const param_type& __p)
5515 { this->__generate_impl(__f, __t, __urng, __p); }
5517 template<
typename _UniformRandomNumberGenerator>
5520 _UniformRandomNumberGenerator& __urng,
5521 const param_type& __p)
5522 { this->__generate_impl(__f, __t, __urng, __p); }
5531 {
return __d1._M_param == __d2._M_param; }
5543 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5559 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5565 template<
typename _ForwardIterator,
5566 typename _UniformRandomNumberGenerator>
5568 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5569 _UniformRandomNumberGenerator& __urng,
5575#if __cpp_impl_three_way_comparison < 201907L
5580 template<
typename _IntType>
5584 {
return !(__d1 == __d2); }
5593 template<
typename _RealType =
double>
5597 "result_type must be a floating point type");
5610 : _M_int(), _M_den(), _M_cp()
5613 template<
typename _InputIteratorB,
typename _InputIteratorW>
5615 _InputIteratorB __bend,
5616 _InputIteratorW __wbegin);
5618 template<
typename _Func>
5621 template<
typename _Func>
5622 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5635 __tmp[1] = _RealType(1);
5648 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
5650#if __cpp_impl_three_way_comparison < 201907L
5653 {
return !(__p1 == __p2); }
5669 template<
typename _InputIteratorB,
typename _InputIteratorW>
5671 _InputIteratorB __bend,
5672 _InputIteratorW __wbegin)
5673 : _M_param(__bfirst, __bend, __wbegin)
5676 template<
typename _Func>
5677 piecewise_constant_distribution(initializer_list<_RealType> __bl,
5679 : _M_param(__bl, __fw)
5682 template<
typename _Func>
5683 piecewise_constant_distribution(
size_t __nw,
5684 _RealType __xmin, _RealType __xmax,
5686 : _M_param(__nw, __xmin, __xmax, __fw)
5690 piecewise_constant_distribution(
const param_type& __p)
5707 if (_M_param._M_int.
empty())
5710 __tmp[1] = _RealType(1);
5714 return _M_param._M_int;
5723 return _M_param._M_den.
empty()
5732 {
return _M_param; }
5740 { _M_param = __param; }
5748 return _M_param._M_int.
empty()
5758 return _M_param._M_int.
empty()
5765 template<
typename _UniformRandomNumberGenerator>
5768 {
return this->
operator()(__urng, _M_param); }
5770 template<
typename _UniformRandomNumberGenerator>
5772 operator()(_UniformRandomNumberGenerator& __urng,
5773 const param_type& __p);
5775 template<
typename _ForwardIterator,
5776 typename _UniformRandomNumberGenerator>
5778 __generate(_ForwardIterator __f, _ForwardIterator __t,
5779 _UniformRandomNumberGenerator& __urng)
5780 { this->__generate(__f, __t, __urng, _M_param); }
5782 template<
typename _ForwardIterator,
5783 typename _UniformRandomNumberGenerator>
5785 __generate(_ForwardIterator __f, _ForwardIterator __t,
5786 _UniformRandomNumberGenerator& __urng,
5787 const param_type& __p)
5788 { this->__generate_impl(__f, __t, __urng, __p); }
5790 template<
typename _UniformRandomNumberGenerator>
5793 _UniformRandomNumberGenerator& __urng,
5794 const param_type& __p)
5795 { this->__generate_impl(__f, __t, __urng, __p); }
5804 {
return __d1._M_param == __d2._M_param; }
5817 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5833 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5839 template<
typename _ForwardIterator,
5840 typename _UniformRandomNumberGenerator>
5842 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5843 _UniformRandomNumberGenerator& __urng,
5849#if __cpp_impl_three_way_comparison < 201907L
5854 template<
typename _RealType>
5858 {
return !(__d1 == __d2); }
5867 template<
typename _RealType =
double>
5871 "result_type must be a floating point type");
5884 : _M_int(), _M_den(), _M_cp(), _M_m()
5887 template<
typename _InputIteratorB,
typename _InputIteratorW>
5889 _InputIteratorB __bend,
5890 _InputIteratorW __wbegin);
5892 template<
typename _Func>
5895 template<
typename _Func>
5896 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5909 __tmp[1] = _RealType(1);
5922 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
5924#if __cpp_impl_three_way_comparison < 201907L
5927 {
return !(__p1 == __p2); }
5944 template<
typename _InputIteratorB,
typename _InputIteratorW>
5946 _InputIteratorB __bend,
5947 _InputIteratorW __wbegin)
5948 : _M_param(__bfirst, __bend, __wbegin)
5951 template<
typename _Func>
5952 piecewise_linear_distribution(initializer_list<_RealType> __bl,
5954 : _M_param(__bl, __fw)
5957 template<
typename _Func>
5958 piecewise_linear_distribution(
size_t __nw,
5959 _RealType __xmin, _RealType __xmax,
5961 : _M_param(__nw, __xmin, __xmax, __fw)
5965 piecewise_linear_distribution(
const param_type& __p)
5982 if (_M_param._M_int.
empty())
5985 __tmp[1] = _RealType(1);
5989 return _M_param._M_int;
5999 return _M_param._M_den.
empty()
6008 {
return _M_param; }
6016 { _M_param = __param; }
6024 return _M_param._M_int.
empty()
6034 return _M_param._M_int.
empty()
6041 template<
typename _UniformRandomNumberGenerator>
6044 {
return this->
operator()(__urng, _M_param); }
6046 template<
typename _UniformRandomNumberGenerator>
6048 operator()(_UniformRandomNumberGenerator& __urng,
6049 const param_type& __p);
6051 template<
typename _ForwardIterator,
6052 typename _UniformRandomNumberGenerator>
6054 __generate(_ForwardIterator __f, _ForwardIterator __t,
6055 _UniformRandomNumberGenerator& __urng)
6056 { this->__generate(__f, __t, __urng, _M_param); }
6058 template<
typename _ForwardIterator,
6059 typename _UniformRandomNumberGenerator>
6061 __generate(_ForwardIterator __f, _ForwardIterator __t,
6062 _UniformRandomNumberGenerator& __urng,
6063 const param_type& __p)
6064 { this->__generate_impl(__f, __t, __urng, __p); }
6066 template<
typename _UniformRandomNumberGenerator>
6069 _UniformRandomNumberGenerator& __urng,
6070 const param_type& __p)
6071 { this->__generate_impl(__f, __t, __urng, __p); }
6080 {
return __d1._M_param == __d2._M_param; }
6093 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6109 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6115 template<
typename _ForwardIterator,
6116 typename _UniformRandomNumberGenerator>
6118 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6119 _UniformRandomNumberGenerator& __urng,
6125#if __cpp_impl_three_way_comparison < 201907L
6130 template<
typename _RealType>
6134 {
return !(__d1 == __d2); }
6162 template<
typename _IntType,
typename = _Require<is_
integral<_IntType>>>
6165 template<
typename _InputIterator>
6166 seed_seq(_InputIterator __begin, _InputIterator __end);
6169 template<
typename _RandomAccessIterator>
6171 generate(_RandomAccessIterator __begin, _RandomAccessIterator __end);
6174 size_t size() const noexcept
6175 {
return _M_v.
size(); }
6177 template<
typename _OutputIterator>
6179 param(_OutputIterator __dest)
const
6180 { std::copy(_M_v.
begin(), _M_v.
end(), __dest); }
6194_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...