36 namespace std _GLIBCXX_VISIBILITY(default)
38 _GLIBCXX_BEGIN_NAMESPACE_VERSION
55 template<
typename _RealType,
size_t __bits,
56 typename _UniformRandomNumberGenerator>
60 _GLIBCXX_END_NAMESPACE_VERSION
67 _GLIBCXX_BEGIN_NAMESPACE_VERSION
69 template<
typename _UIntType,
size_t __w,
70 bool = __w < static_cast<size_t>
73 {
static const _UIntType __value = 0; };
75 template<
typename _UIntType,
size_t __w>
76 struct _Shift<_UIntType, __w, true>
77 {
static const _UIntType __value = _UIntType(1) << __w; };
80 int __which = ((__s <= __CHAR_BIT__ *
sizeof (int))
81 + (__s <= __CHAR_BIT__ *
sizeof (long))
82 + (__s <= __CHAR_BIT__ *
sizeof (
long long))
85 struct _Select_uint_least_t
87 static_assert(__which < 0,
88 "sorry, would be too much trouble for a slow result");
92 struct _Select_uint_least_t<__s, 4>
93 {
typedef unsigned int type; };
96 struct _Select_uint_least_t<__s, 3>
97 {
typedef unsigned long type; };
100 struct _Select_uint_least_t<__s, 2>
101 {
typedef unsigned long long type; };
103 #ifdef _GLIBCXX_USE_INT128
105 struct _Select_uint_least_t<__s, 1>
106 {
typedef unsigned __int128 type; };
110 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
111 bool __big_enough = (!(__m & (__m - 1))
112 || (_Tp(-1) - __c) / __a >= __m - 1),
113 bool __schrage_ok = __m % __a < __m / __a>
116 typedef typename _Select_uint_least_t<
std::__lg(__a)
120 {
return static_cast<_Tp
>((_Tp2(__a) * __x + __c) % __m); }
124 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c>
125 struct _Mod<_Tp, __m, __a, __c, false, true>
134 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
bool __s>
135 struct _Mod<_Tp, __m, __a, __c, true, __s>
140 _Tp __res = __a * __x + __c;
147 template<
typename _Tp, _Tp __m, _Tp __a = 1, _Tp __c = 0>
150 {
return _Mod<_Tp, __m, __a, __c>::__calc(__x); }
153 template<
typename _Tp>
157 return ((__x - 1) & __x) == 0;
164 template<
typename _Engine,
typename _DInputType>
168 "template argument not a floating point type");
171 _Adaptor(_Engine& __g)
176 {
return _DInputType(0); }
180 {
return _DInputType(1); }
199 _GLIBCXX_END_NAMESPACE_VERSION
202 _GLIBCXX_BEGIN_NAMESPACE_VERSION
242 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
245 static_assert(std::is_unsigned<_UIntType>::value,
"template argument "
246 "substituting _UIntType not an unsigned integral type");
247 static_assert(__m == 0u || (__a < __m && __c < __m),
248 "template argument substituting __m out of bounds");
279 template<
typename _Sseq,
typename =
typename
280 std::enable_if<!std::is_same<_Sseq, linear_congruential_engine>::value>
302 template<
typename _Sseq>
303 typename std::enable_if<std::is_class<_Sseq>::value>::type
314 {
return __c == 0u ? 1u : 0u; }
329 for (; __z != 0ULL; --__z)
339 _M_x = __detail::__mod<_UIntType, __m, __a, __c>(_M_x);
357 {
return __lhs._M_x == __rhs._M_x; }
367 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
368 _UIntType1 __m1,
typename _CharT,
typename _Traits>
370 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
372 __a1, __c1, __m1>& __lcr);
387 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
388 _UIntType1 __m1,
typename _CharT,
typename _Traits>
409 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
415 {
return !(__lhs == __rhs); }
446 template<
typename _UIntType,
size_t __w,
447 size_t __n,
size_t __m,
size_t __r,
448 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
449 _UIntType __b,
size_t __t,
450 _UIntType __c,
size_t __l, _UIntType __f>
453 static_assert(std::is_unsigned<_UIntType>::value,
"template argument "
454 "substituting _UIntType not an unsigned integral type");
455 static_assert(1u <= __m && __m <= __n,
456 "template argument substituting __m out of bounds");
457 static_assert(__r <= __w,
"template argument substituting "
459 static_assert(__u <= __w,
"template argument substituting "
461 static_assert(__s <= __w,
"template argument substituting "
463 static_assert(__t <= __w,
"template argument substituting "
465 static_assert(__l <= __w,
"template argument substituting "
468 "template argument substituting __w out of bound");
469 static_assert(__a <= (__detail::_Shift<_UIntType, __w>::__value - 1),
470 "template argument substituting __a out of bound");
471 static_assert(__b <= (__detail::_Shift<_UIntType, __w>::__value - 1),
472 "template argument substituting __b out of bound");
473 static_assert(__c <= (__detail::_Shift<_UIntType, __w>::__value - 1),
474 "template argument substituting __c out of bound");
475 static_assert(__d <= (__detail::_Shift<_UIntType, __w>::__value - 1),
476 "template argument substituting __d out of bound");
477 static_assert(__f <= (__detail::_Shift<_UIntType, __w>::__value - 1),
478 "template argument substituting __f out of bound");
485 static constexpr
size_t word_size = __w;
486 static constexpr
size_t state_size = __n;
487 static constexpr
size_t shift_size = __m;
488 static constexpr
size_t mask_bits = __r;
490 static constexpr
size_t tempering_u = __u;
492 static constexpr
size_t tempering_s = __s;
494 static constexpr
size_t tempering_t = __t;
496 static constexpr
size_t tempering_l = __l;
497 static constexpr
result_type initialization_multiplier = __f;
511 template<
typename _Sseq,
typename =
typename
512 std::enable_if<!std::is_same<_Sseq, mersenne_twister_engine>::value>
521 template<
typename _Sseq>
522 typename std::enable_if<std::is_class<_Sseq>::value>::type
537 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
543 discard(
unsigned long long __z);
563 {
return (
std::equal(__lhs._M_x, __lhs._M_x + state_size, __rhs._M_x)
564 && __lhs._M_p == __rhs._M_p); }
578 template<
typename _UIntType1,
579 size_t __w1,
size_t __n1,
580 size_t __m1,
size_t __r1,
581 _UIntType1 __a1,
size_t __u1,
582 _UIntType1 __d1,
size_t __s1,
583 _UIntType1 __b1,
size_t __t1,
584 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
585 typename _CharT,
typename _Traits>
587 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
589 __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
604 template<
typename _UIntType1,
605 size_t __w1,
size_t __n1,
606 size_t __m1,
size_t __r1,
607 _UIntType1 __a1,
size_t __u1,
608 _UIntType1 __d1,
size_t __s1,
609 _UIntType1 __b1,
size_t __t1,
610 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
611 typename _CharT,
typename _Traits>
615 __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
621 _UIntType _M_x[state_size];
637 template<
typename _UIntType,
size_t __w,
638 size_t __n,
size_t __m,
size_t __r,
639 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
640 _UIntType __b,
size_t __t,
641 _UIntType __c,
size_t __l, _UIntType __f>
644 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __lhs,
646 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __rhs)
647 {
return !(__lhs == __rhs); }
665 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
668 static_assert(std::is_unsigned<_UIntType>::value,
"template argument "
669 "substituting _UIntType not an unsigned integral type");
670 static_assert(0u < __s && __s < __r,
671 "template argument substituting __s out of bounds");
673 "template argument substituting __w out of bounds");
680 static constexpr
size_t word_size = __w;
681 static constexpr
size_t short_lag = __s;
682 static constexpr
size_t long_lag = __r;
683 static constexpr
result_type default_seed = 19780503u;
699 template<
typename _Sseq,
typename =
typename
700 std::enable_if<!std::is_same<_Sseq, subtract_with_carry_engine>::value>
725 template<
typename _Sseq>
726 typename std::enable_if<std::is_class<_Sseq>::value>::type
743 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
751 for (; __z != 0ULL; --__z)
776 {
return (
std::equal(__lhs._M_x, __lhs._M_x + long_lag, __rhs._M_x)
777 && __lhs._M_carry == __rhs._M_carry
778 && __lhs._M_p == __rhs._M_p); }
792 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
793 typename _CharT,
typename _Traits>
795 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
811 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
812 typename _CharT,
typename _Traits>
820 _UIntType _M_x[long_lag];
837 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
843 {
return !(__lhs == __rhs); }
852 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
855 static_assert(1 <= __r && __r <= __p,
856 "template argument substituting __r out of bounds");
860 typedef typename _RandomNumberEngine::result_type
result_type;
863 static constexpr
size_t block_size = __p;
864 static constexpr
size_t used_block = __r;
872 : _M_b(), _M_n(0) { }
882 : _M_b(__rng), _M_n(0) { }
892 : _M_b(std::move(__rng)), _M_n(0) { }
902 : _M_b(__s), _M_n(0) { }
909 template<
typename _Sseq,
typename =
typename
910 std::enable_if<!std::is_same<_Sseq, discard_block_engine>::value
911 && !std::is_same<_Sseq, _RandomNumberEngine>::value>
945 template<
typename _Sseq>
957 const _RandomNumberEngine&
981 for (; __z != 0ULL; --__z)
1005 {
return __lhs._M_b == __rhs._M_b && __lhs._M_n == __rhs._M_n; }
1018 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1019 typename _CharT,
typename _Traits>
1021 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1036 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1037 typename _CharT,
typename _Traits>
1044 _RandomNumberEngine _M_b;
1059 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
1065 {
return !(__lhs == __rhs); }
1072 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1075 static_assert(std::is_unsigned<_UIntType>::value,
"template argument "
1076 "substituting _UIntType not an unsigned integral type");
1078 "template argument substituting __w out of bounds");
1110 : _M_b(std::move(__rng)) { }
1127 template<
typename _Sseq,
typename =
typename
1128 std::enable_if<!std::is_same<_Sseq, independent_bits_engine>::value
1129 && !std::is_same<_Sseq, _RandomNumberEngine>::value>
1157 template<
typename _Sseq>
1166 const _RandomNumberEngine&
1182 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1190 for (; __z != 0ULL; --__z)
1215 {
return __lhs._M_b == __rhs._M_b; }
1229 template<
typename _CharT,
typename _Traits>
1233 __w, _UIntType>& __x)
1240 _RandomNumberEngine _M_b;
1255 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1261 {
return !(__lhs == __rhs); }
1273 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType,
1274 typename _CharT,
typename _Traits>
1276 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1278 __w, _UIntType>& __x)
1290 template<
typename _RandomNumberEngine,
size_t __k>
1293 static_assert(1u <= __k,
"template argument substituting "
1294 "__k out of bound");
1298 typedef typename _RandomNumberEngine::result_type
result_type;
1300 static constexpr
size_t table_size = __k;
1309 { _M_initialize(); }
1320 { _M_initialize(); }
1330 : _M_b(std::move(__rng))
1331 { _M_initialize(); }
1342 { _M_initialize(); }
1349 template<
typename _Sseq,
typename =
typename
1350 std::enable_if<!std::is_same<_Sseq, shuffle_order_engine>::value
1351 && !std::is_same<_Sseq, _RandomNumberEngine>::value>
1356 { _M_initialize(); }
1385 template<
typename _Sseq>
1396 const _RandomNumberEngine&
1420 for (; __z != 0ULL; --__z)
1444 {
return (__lhs._M_b == __rhs._M_b
1445 &&
std::equal(__lhs._M_v, __lhs._M_v + __k, __rhs._M_v)
1446 && __lhs._M_y == __rhs._M_y); }
1459 template<
typename _RandomNumberEngine1,
size_t __k1,
1460 typename _CharT,
typename _Traits>
1462 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1477 template<
typename _RandomNumberEngine1,
size_t __k1,
1478 typename _CharT,
typename _Traits>
1484 void _M_initialize()
1486 for (
size_t __i = 0; __i < __k; ++__i)
1491 _RandomNumberEngine _M_b;
1507 template<
typename _RandomNumberEngine,
size_t __k>
1513 {
return !(__lhs == __rhs); }
1519 typedef linear_congruential_engine<uint_fast32_t, 16807UL, 0UL, 2147483647UL>
1550 0xb5026f5aa96619e9ULL, 29,
1551 0x5555555555555555ULL, 17,
1552 0x71d67fffeda60000ULL, 37,
1553 0xfff7eee000000000ULL, 43,
1582 #ifdef _GLIBCXX_USE_RANDOM_TR1
1596 random_device(
const std::string& __token =
"mt19937")
1597 { _M_init_pretr1(__token); }
1612 entropy() const noexcept
1618 #ifdef _GLIBCXX_USE_RANDOM_TR1
1619 return this->_M_getval();
1621 return this->_M_getval_pretr1();
1626 random_device(
const random_device&) =
delete;
1627 void operator=(
const random_device&) =
delete;
1664 template<
typename _IntType =
int>
1668 "template argument not an integral type");
1681 : _M_a(__a), _M_b(__b)
1683 _GLIBCXX_DEBUG_ASSERT(_M_a <= _M_b);
1696 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
1710 : _M_param(__a, __b)
1728 {
return _M_param.a(); }
1732 {
return _M_param.b(); }
1739 {
return _M_param; }
1747 { _M_param = __param; }
1754 {
return this->a(); }
1761 {
return this->b(); }
1766 template<
typename _UniformRandomNumberGenerator>
1769 {
return this->
operator()(__urng, _M_param); }
1771 template<
typename _UniformRandomNumberGenerator>
1773 operator()(_UniformRandomNumberGenerator& __urng,
1774 const param_type& __p);
1776 template<
typename _ForwardIterator,
1777 typename _UniformRandomNumberGenerator>
1779 __generate(_ForwardIterator __f, _ForwardIterator __t,
1780 _UniformRandomNumberGenerator& __urng)
1781 { this->__generate(__f, __t, __urng, _M_param); }
1783 template<
typename _ForwardIterator,
1784 typename _UniformRandomNumberGenerator>
1786 __generate(_ForwardIterator __f, _ForwardIterator __t,
1787 _UniformRandomNumberGenerator& __urng,
1788 const param_type& __p)
1789 { this->__generate_impl(__f, __t, __urng, __p); }
1791 template<
typename _UniformRandomNumberGenerator>
1794 _UniformRandomNumberGenerator& __urng,
1795 const param_type& __p)
1796 { this->__generate_impl(__f, __t, __urng, __p); }
1805 {
return __d1._M_param == __d2._M_param; }
1808 template<
typename _ForwardIterator,
1809 typename _UniformRandomNumberGenerator>
1811 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
1812 _UniformRandomNumberGenerator& __urng,
1813 const param_type& __p);
1815 param_type _M_param;
1822 template<
typename _IntType>
1826 {
return !(__d1 == __d2); }
1838 template<
typename _IntType,
typename _CharT,
typename _Traits>
1840 operator<<(std::basic_ostream<_CharT, _Traits>&,
1852 template<
typename _IntType,
typename _CharT,
typename _Traits>
1865 template<
typename _RealType =
double>
1869 "template argument not a floating point type");
1881 _RealType __b = _RealType(1))
1882 : _M_a(__a), _M_b(__b)
1884 _GLIBCXX_DEBUG_ASSERT(_M_a <= _M_b);
1897 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
1913 _RealType __b = _RealType(1))
1914 : _M_param(__a, __b)
1932 {
return _M_param.a(); }
1936 {
return _M_param.b(); }
1943 {
return _M_param; }
1951 { _M_param = __param; }
1958 {
return this->a(); }
1965 {
return this->b(); }
1970 template<
typename _UniformRandomNumberGenerator>
1973 {
return this->
operator()(__urng, _M_param); }
1975 template<
typename _UniformRandomNumberGenerator>
1977 operator()(_UniformRandomNumberGenerator& __urng,
1978 const param_type& __p)
1980 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
1982 return (__aurng() * (__p.b() - __p.a())) + __p.a();
1985 template<
typename _ForwardIterator,
1986 typename _UniformRandomNumberGenerator>
1988 __generate(_ForwardIterator __f, _ForwardIterator __t,
1989 _UniformRandomNumberGenerator& __urng)
1990 { this->__generate(__f, __t, __urng, _M_param); }
1992 template<
typename _ForwardIterator,
1993 typename _UniformRandomNumberGenerator>
1995 __generate(_ForwardIterator __f, _ForwardIterator __t,
1996 _UniformRandomNumberGenerator& __urng,
1997 const param_type& __p)
1998 { this->__generate_impl(__f, __t, __urng, __p); }
2000 template<
typename _UniformRandomNumberGenerator>
2003 _UniformRandomNumberGenerator& __urng,
2004 const param_type& __p)
2005 { this->__generate_impl(__f, __t, __urng, __p); }
2014 {
return __d1._M_param == __d2._M_param; }
2017 template<
typename _ForwardIterator,
2018 typename _UniformRandomNumberGenerator>
2020 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2021 _UniformRandomNumberGenerator& __urng,
2022 const param_type& __p);
2024 param_type _M_param;
2031 template<
typename _IntType>
2035 {
return !(__d1 == __d2); }
2047 template<
typename _RealType,
typename _CharT,
typename _Traits>
2049 operator<<(std::basic_ostream<_CharT, _Traits>&,
2061 template<
typename _RealType,
typename _CharT,
typename _Traits>
2083 template<
typename _RealType =
double>
2087 "template argument not a floating point type");
2099 _RealType __stddev = _RealType(1))
2100 : _M_mean(__mean), _M_stddev(__stddev)
2102 _GLIBCXX_DEBUG_ASSERT(_M_stddev > _RealType(0));
2111 {
return _M_stddev; }
2115 {
return (__p1._M_mean == __p2._M_mean
2116 && __p1._M_stddev == __p2._M_stddev); }
2120 _RealType _M_stddev;
2131 : _M_param(__mean, __stddev), _M_saved_available(false)
2136 : _M_param(__p), _M_saved_available(false)
2144 { _M_saved_available =
false; }
2151 {
return _M_param.mean(); }
2158 {
return _M_param.stddev(); }
2165 {
return _M_param; }
2173 { _M_param = __param; }
2192 template<
typename _UniformRandomNumberGenerator>
2195 {
return this->
operator()(__urng, _M_param); }
2197 template<
typename _UniformRandomNumberGenerator>
2199 operator()(_UniformRandomNumberGenerator& __urng,
2200 const param_type& __p);
2202 template<
typename _ForwardIterator,
2203 typename _UniformRandomNumberGenerator>
2205 __generate(_ForwardIterator __f, _ForwardIterator __t,
2206 _UniformRandomNumberGenerator& __urng)
2207 { this->__generate(__f, __t, __urng, _M_param); }
2209 template<
typename _ForwardIterator,
2210 typename _UniformRandomNumberGenerator>
2212 __generate(_ForwardIterator __f, _ForwardIterator __t,
2213 _UniformRandomNumberGenerator& __urng,
2214 const param_type& __p)
2215 { this->__generate_impl(__f, __t, __urng, __p); }
2217 template<
typename _UniformRandomNumberGenerator>
2220 _UniformRandomNumberGenerator& __urng,
2221 const param_type& __p)
2222 { this->__generate_impl(__f, __t, __urng, __p); }
2229 template<
typename _RealType1>
2244 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2246 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2259 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2265 template<
typename _ForwardIterator,
2266 typename _UniformRandomNumberGenerator>
2268 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2269 _UniformRandomNumberGenerator& __urng,
2270 const param_type& __p);
2272 param_type _M_param;
2274 bool _M_saved_available;
2280 template<
typename _RealType>
2284 {
return !(__d1 == __d2); }
2296 template<
typename _RealType =
double>
2300 "template argument not a floating point type");
2312 _RealType __s = _RealType(1))
2313 : _M_m(__m), _M_s(__s)
2326 {
return __p1._M_m == __p2._M_m && __p1._M_s == __p2._M_s; }
2335 _RealType __s = _RealType(1))
2336 : _M_param(__m, __s), _M_nd()
2341 : _M_param(__p), _M_nd()
2356 {
return _M_param.m(); }
2360 {
return _M_param.s(); }
2367 {
return _M_param; }
2375 { _M_param = __param; }
2394 template<
typename _UniformRandomNumberGenerator>
2397 {
return this->
operator()(__urng, _M_param); }
2399 template<
typename _UniformRandomNumberGenerator>
2401 operator()(_UniformRandomNumberGenerator& __urng,
2402 const param_type& __p)
2403 {
return std::exp(__p.s() * _M_nd(__urng) + __p.m()); }
2405 template<
typename _ForwardIterator,
2406 typename _UniformRandomNumberGenerator>
2408 __generate(_ForwardIterator __f, _ForwardIterator __t,
2409 _UniformRandomNumberGenerator& __urng)
2410 { this->__generate(__f, __t, __urng, _M_param); }
2412 template<
typename _ForwardIterator,
2413 typename _UniformRandomNumberGenerator>
2415 __generate(_ForwardIterator __f, _ForwardIterator __t,
2416 _UniformRandomNumberGenerator& __urng,
2417 const param_type& __p)
2418 { this->__generate_impl(__f, __t, __urng, __p); }
2420 template<
typename _UniformRandomNumberGenerator>
2423 _UniformRandomNumberGenerator& __urng,
2424 const param_type& __p)
2425 { this->__generate_impl(__f, __t, __urng, __p); }
2435 {
return (__d1._M_param == __d2._M_param
2436 && __d1._M_nd == __d2._M_nd); }
2448 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2450 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2463 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2469 template<
typename _ForwardIterator,
2470 typename _UniformRandomNumberGenerator>
2472 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2473 _UniformRandomNumberGenerator& __urng,
2474 const param_type& __p);
2476 param_type _M_param;
2484 template<
typename _RealType>
2488 {
return !(__d1 == __d2); }
2500 template<
typename _RealType =
double>
2504 "template argument not a floating point type");
2516 param_type(_RealType __alpha_val = _RealType(1),
2517 _RealType __beta_val = _RealType(1))
2518 : _M_alpha(__alpha_val), _M_beta(__beta_val)
2520 _GLIBCXX_DEBUG_ASSERT(_M_alpha > _RealType(0));
2526 {
return _M_alpha; }
2533 operator==(
const param_type& __p1,
const param_type& __p2)
2534 {
return (__p1._M_alpha == __p2._M_alpha
2535 && __p1._M_beta == __p2._M_beta); }
2544 _RealType _M_malpha, _M_a2;
2554 _RealType __beta_val = _RealType(1))
2555 : _M_param(__alpha_val, __beta_val), _M_nd()
2560 : _M_param(__p), _M_nd()
2575 {
return _M_param.alpha(); }
2582 {
return _M_param.beta(); }
2589 {
return _M_param; }
2597 { _M_param = __param; }
2616 template<
typename _UniformRandomNumberGenerator>
2619 {
return this->
operator()(__urng, _M_param); }
2621 template<
typename _UniformRandomNumberGenerator>
2623 operator()(_UniformRandomNumberGenerator& __urng,
2624 const param_type& __p);
2626 template<
typename _ForwardIterator,
2627 typename _UniformRandomNumberGenerator>
2629 __generate(_ForwardIterator __f, _ForwardIterator __t,
2630 _UniformRandomNumberGenerator& __urng)
2631 { this->__generate(__f, __t, __urng, _M_param); }
2633 template<
typename _ForwardIterator,
2634 typename _UniformRandomNumberGenerator>
2636 __generate(_ForwardIterator __f, _ForwardIterator __t,
2637 _UniformRandomNumberGenerator& __urng,
2638 const param_type& __p)
2639 { this->__generate_impl(__f, __t, __urng, __p); }
2641 template<
typename _UniformRandomNumberGenerator>
2644 _UniformRandomNumberGenerator& __urng,
2645 const param_type& __p)
2646 { this->__generate_impl(__f, __t, __urng, __p); }
2656 {
return (__d1._M_param == __d2._M_param
2657 && __d1._M_nd == __d2._M_nd); }
2669 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2671 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2683 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2689 template<
typename _ForwardIterator,
2690 typename _UniformRandomNumberGenerator>
2692 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2693 _UniformRandomNumberGenerator& __urng,
2694 const param_type& __p);
2696 param_type _M_param;
2704 template<
typename _RealType>
2708 {
return !(__d1 == __d2); }
2717 template<
typename _RealType =
double>
2721 "template argument not a floating point type");
2742 {
return __p1._M_n == __p2._M_n; }
2750 : _M_param(__n), _M_gd(__n / 2)
2755 : _M_param(__p), _M_gd(__p.n() / 2)
2770 {
return _M_param.n(); }
2777 {
return _M_param; }
2785 { _M_param = __param; }
2804 template<
typename _UniformRandomNumberGenerator>
2807 {
return 2 * _M_gd(__urng); }
2809 template<
typename _UniformRandomNumberGenerator>
2811 operator()(_UniformRandomNumberGenerator& __urng,
2812 const param_type& __p)
2816 return 2 * _M_gd(__urng, param_type(__p.n() / 2));
2819 template<
typename _ForwardIterator,
2820 typename _UniformRandomNumberGenerator>
2822 __generate(_ForwardIterator __f, _ForwardIterator __t,
2823 _UniformRandomNumberGenerator& __urng)
2824 { this->__generate_impl(__f, __t, __urng); }
2826 template<
typename _ForwardIterator,
2827 typename _UniformRandomNumberGenerator>
2829 __generate(_ForwardIterator __f, _ForwardIterator __t,
2830 _UniformRandomNumberGenerator& __urng,
2831 const param_type& __p)
2834 this->__generate_impl(__f, __t, __urng, __p2); }
2836 template<
typename _UniformRandomNumberGenerator>
2839 _UniformRandomNumberGenerator& __urng)
2840 { this->__generate_impl(__f, __t, __urng); }
2842 template<
typename _UniformRandomNumberGenerator>
2845 _UniformRandomNumberGenerator& __urng,
2846 const param_type& __p)
2849 this->__generate_impl(__f, __t, __urng, __p2); }
2859 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
2871 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2873 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2886 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2892 template<
typename _ForwardIterator,
2893 typename _UniformRandomNumberGenerator>
2895 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2896 _UniformRandomNumberGenerator& __urng);
2898 template<
typename _ForwardIterator,
2899 typename _UniformRandomNumberGenerator>
2901 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2902 _UniformRandomNumberGenerator& __urng,
2906 param_type _M_param;
2914 template<
typename _RealType>
2918 {
return !(__d1 == __d2); }
2927 template<
typename _RealType =
double>
2931 "template argument not a floating point type");
2942 param_type(_RealType __a = _RealType(0),
2943 _RealType __b = _RealType(1))
2944 : _M_a(__a), _M_b(__b)
2956 operator==(
const param_type& __p1,
const param_type& __p2)
2957 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
2966 _RealType __b = _RealType(1))
2967 : _M_param(__a, __b)
2987 {
return _M_param.a(); }
2991 {
return _M_param.b(); }
2998 {
return _M_param; }
3006 { _M_param = __param; }
3025 template<
typename _UniformRandomNumberGenerator>
3028 {
return this->
operator()(__urng, _M_param); }
3030 template<
typename _UniformRandomNumberGenerator>
3032 operator()(_UniformRandomNumberGenerator& __urng,
3033 const param_type& __p);
3035 template<
typename _ForwardIterator,
3036 typename _UniformRandomNumberGenerator>
3038 __generate(_ForwardIterator __f, _ForwardIterator __t,
3039 _UniformRandomNumberGenerator& __urng)
3040 { this->__generate(__f, __t, __urng, _M_param); }
3042 template<
typename _ForwardIterator,
3043 typename _UniformRandomNumberGenerator>
3045 __generate(_ForwardIterator __f, _ForwardIterator __t,
3046 _UniformRandomNumberGenerator& __urng,
3047 const param_type& __p)
3048 { this->__generate_impl(__f, __t, __urng, __p); }
3050 template<
typename _UniformRandomNumberGenerator>
3053 _UniformRandomNumberGenerator& __urng,
3054 const param_type& __p)
3055 { this->__generate_impl(__f, __t, __urng, __p); }
3064 {
return __d1._M_param == __d2._M_param; }
3067 template<
typename _ForwardIterator,
3068 typename _UniformRandomNumberGenerator>
3070 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3071 _UniformRandomNumberGenerator& __urng,
3072 const param_type& __p);
3074 param_type _M_param;
3081 template<
typename _RealType>
3085 {
return !(__d1 == __d2); }
3097 template<
typename _RealType,
typename _CharT,
typename _Traits>
3099 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3112 template<
typename _RealType,
typename _CharT,
typename _Traits>
3128 template<
typename _RealType =
double>
3132 "template argument not a floating point type");
3143 param_type(_RealType __m = _RealType(1),
3144 _RealType __n = _RealType(1))
3145 : _M_m(__m), _M_n(__n)
3157 operator==(
const param_type& __p1,
const param_type& __p2)
3158 {
return __p1._M_m == __p2._M_m && __p1._M_n == __p2._M_n; }
3167 _RealType __n = _RealType(1))
3168 : _M_param(__m, __n), _M_gd_x(__m / 2), _M_gd_y(__n / 2)
3173 : _M_param(__p), _M_gd_x(__p.m() / 2), _M_gd_y(__p.n() / 2)
3191 {
return _M_param.m(); }
3195 {
return _M_param.n(); }
3202 {
return _M_param; }
3210 { _M_param = __param; }
3229 template<
typename _UniformRandomNumberGenerator>
3232 {
return (_M_gd_x(__urng) * n()) / (_M_gd_y(__urng) * m()); }
3234 template<
typename _UniformRandomNumberGenerator>
3236 operator()(_UniformRandomNumberGenerator& __urng,
3237 const param_type& __p)
3241 return ((_M_gd_x(__urng, param_type(__p.m() / 2)) * n())
3242 / (_M_gd_y(__urng, param_type(__p.n() / 2)) * m()));
3245 template<
typename _ForwardIterator,
3246 typename _UniformRandomNumberGenerator>
3248 __generate(_ForwardIterator __f, _ForwardIterator __t,
3249 _UniformRandomNumberGenerator& __urng)
3250 { this->__generate_impl(__f, __t, __urng); }
3252 template<
typename _ForwardIterator,
3253 typename _UniformRandomNumberGenerator>
3255 __generate(_ForwardIterator __f, _ForwardIterator __t,
3256 _UniformRandomNumberGenerator& __urng,
3257 const param_type& __p)
3258 { this->__generate_impl(__f, __t, __urng, __p); }
3260 template<
typename _UniformRandomNumberGenerator>
3263 _UniformRandomNumberGenerator& __urng)
3264 { this->__generate_impl(__f, __t, __urng); }
3266 template<
typename _UniformRandomNumberGenerator>
3269 _UniformRandomNumberGenerator& __urng,
3270 const param_type& __p)
3271 { this->__generate_impl(__f, __t, __urng, __p); }
3281 {
return (__d1._M_param == __d2._M_param
3282 && __d1._M_gd_x == __d2._M_gd_x
3283 && __d1._M_gd_y == __d2._M_gd_y); }
3295 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3297 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3310 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3316 template<
typename _ForwardIterator,
3317 typename _UniformRandomNumberGenerator>
3319 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3320 _UniformRandomNumberGenerator& __urng);
3322 template<
typename _ForwardIterator,
3323 typename _UniformRandomNumberGenerator>
3325 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3326 _UniformRandomNumberGenerator& __urng,
3327 const param_type& __p);
3329 param_type _M_param;
3337 template<
typename _RealType>
3341 {
return !(__d1 == __d2); }
3352 template<
typename _RealType =
double>
3356 "template argument not a floating point type");
3367 param_type(_RealType __n = _RealType(1))
3376 operator==(
const param_type& __p1,
const param_type& __p2)
3377 {
return __p1._M_n == __p2._M_n; }
3385 : _M_param(__n), _M_nd(), _M_gd(__n / 2, 2)
3390 : _M_param(__p), _M_nd(), _M_gd(__p.n() / 2, 2)
3408 {
return _M_param.n(); }
3415 {
return _M_param; }
3423 { _M_param = __param; }
3442 template<
typename _UniformRandomNumberGenerator>
3445 {
return _M_nd(__urng) *
std::sqrt(n() / _M_gd(__urng)); }
3447 template<
typename _UniformRandomNumberGenerator>
3449 operator()(_UniformRandomNumberGenerator& __urng,
3450 const param_type& __p)
3455 const result_type __g = _M_gd(__urng, param_type(__p.n() / 2, 2));
3456 return _M_nd(__urng) *
std::sqrt(__p.n() / __g);
3459 template<
typename _ForwardIterator,
3460 typename _UniformRandomNumberGenerator>
3462 __generate(_ForwardIterator __f, _ForwardIterator __t,
3463 _UniformRandomNumberGenerator& __urng)
3464 { this->__generate_impl(__f, __t, __urng); }
3466 template<
typename _ForwardIterator,
3467 typename _UniformRandomNumberGenerator>
3469 __generate(_ForwardIterator __f, _ForwardIterator __t,
3470 _UniformRandomNumberGenerator& __urng,
3471 const param_type& __p)
3472 { this->__generate_impl(__f, __t, __urng, __p); }
3474 template<
typename _UniformRandomNumberGenerator>
3477 _UniformRandomNumberGenerator& __urng)
3478 { this->__generate_impl(__f, __t, __urng); }
3480 template<
typename _UniformRandomNumberGenerator>
3483 _UniformRandomNumberGenerator& __urng,
3484 const param_type& __p)
3485 { this->__generate_impl(__f, __t, __urng, __p); }
3495 {
return (__d1._M_param == __d2._M_param
3496 && __d1._M_nd == __d2._M_nd && __d1._M_gd == __d2._M_gd); }
3508 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3510 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3523 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3529 template<
typename _ForwardIterator,
3530 typename _UniformRandomNumberGenerator>
3532 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3533 _UniformRandomNumberGenerator& __urng);
3534 template<
typename _ForwardIterator,
3535 typename _UniformRandomNumberGenerator>
3537 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3538 _UniformRandomNumberGenerator& __urng,
3539 const param_type& __p);
3541 param_type _M_param;
3550 template<
typename _RealType>
3554 {
return !(__d1 == __d2); }
3582 param_type(
double __p = 0.5)
3585 _GLIBCXX_DEBUG_ASSERT((_M_p >= 0.0) && (_M_p <= 1.0));
3593 operator==(
const param_type& __p1,
const param_type& __p2)
3594 {
return __p1._M_p == __p2._M_p; }
3630 {
return _M_param.p(); }
3637 {
return _M_param; }
3645 { _M_param = __param; }
3664 template<
typename _UniformRandomNumberGenerator>
3667 {
return this->
operator()(__urng, _M_param); }
3669 template<
typename _UniformRandomNumberGenerator>
3671 operator()(_UniformRandomNumberGenerator& __urng,
3672 const param_type& __p)
3674 __detail::_Adaptor<_UniformRandomNumberGenerator, double>
3676 if ((__aurng() - __aurng.min())
3677 < __p.p() * (__aurng.max() - __aurng.min()))
3682 template<
typename _ForwardIterator,
3683 typename _UniformRandomNumberGenerator>
3685 __generate(_ForwardIterator __f, _ForwardIterator __t,
3686 _UniformRandomNumberGenerator& __urng)
3687 { this->__generate(__f, __t, __urng, _M_param); }
3689 template<
typename _ForwardIterator,
3690 typename _UniformRandomNumberGenerator>
3692 __generate(_ForwardIterator __f, _ForwardIterator __t,
3693 _UniformRandomNumberGenerator& __urng,
const param_type& __p)
3694 { this->__generate_impl(__f, __t, __urng, __p); }
3696 template<
typename _UniformRandomNumberGenerator>
3699 _UniformRandomNumberGenerator& __urng,
3700 const param_type& __p)
3701 { this->__generate_impl(__f, __t, __urng, __p); }
3710 {
return __d1._M_param == __d2._M_param; }
3713 template<
typename _ForwardIterator,
3714 typename _UniformRandomNumberGenerator>
3716 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3717 _UniformRandomNumberGenerator& __urng,
3718 const param_type& __p);
3720 param_type _M_param;
3730 {
return !(__d1 == __d2); }
3742 template<
typename _CharT,
typename _Traits>
3744 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3756 template<
typename _CharT,
typename _Traits>
3775 template<
typename _IntType =
int>
3779 "template argument not an integral type");
3791 param_type(_IntType __t = _IntType(1),
double __p = 0.5)
3792 : _M_t(__t), _M_p(__p)
3794 _GLIBCXX_DEBUG_ASSERT((_M_t >= _IntType(0))
3809 operator==(
const param_type& __p1,
const param_type& __p2)
3810 {
return __p1._M_t == __p2._M_t && __p1._M_p == __p2._M_p; }
3820 #if _GLIBCXX_USE_C99_MATH_TR1
3821 double _M_d1, _M_d2, _M_s1, _M_s2, _M_c,
3822 _M_a1, _M_a123, _M_s, _M_lf, _M_lp1p;
3831 : _M_param(__t, __p), _M_nd()
3836 : _M_param(__p), _M_nd()
3851 {
return _M_param.t(); }
3858 {
return _M_param.p(); }
3865 {
return _M_param; }
3873 { _M_param = __param; }
3887 {
return _M_param.t(); }
3892 template<
typename _UniformRandomNumberGenerator>
3895 {
return this->
operator()(__urng, _M_param); }
3897 template<
typename _UniformRandomNumberGenerator>
3899 operator()(_UniformRandomNumberGenerator& __urng,
3900 const param_type& __p);
3902 template<
typename _ForwardIterator,
3903 typename _UniformRandomNumberGenerator>
3905 __generate(_ForwardIterator __f, _ForwardIterator __t,
3906 _UniformRandomNumberGenerator& __urng)
3907 { this->__generate(__f, __t, __urng, _M_param); }
3909 template<
typename _ForwardIterator,
3910 typename _UniformRandomNumberGenerator>
3912 __generate(_ForwardIterator __f, _ForwardIterator __t,
3913 _UniformRandomNumberGenerator& __urng,
3914 const param_type& __p)
3915 { this->__generate_impl(__f, __t, __urng, __p); }
3917 template<
typename _UniformRandomNumberGenerator>
3920 _UniformRandomNumberGenerator& __urng,
3921 const param_type& __p)
3922 { this->__generate_impl(__f, __t, __urng, __p); }
3932 #ifdef _GLIBCXX_USE_C99_MATH_TR1
3933 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
3935 {
return __d1._M_param == __d2._M_param; }
3948 template<
typename _IntType1,
3949 typename _CharT,
typename _Traits>
3951 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3964 template<
typename _IntType1,
3965 typename _CharT,
typename _Traits>
3971 template<
typename _ForwardIterator,
3972 typename _UniformRandomNumberGenerator>
3974 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3975 _UniformRandomNumberGenerator& __urng,
3976 const param_type& __p);
3978 template<
typename _UniformRandomNumberGenerator>
3980 _M_waiting(_UniformRandomNumberGenerator& __urng,
3981 _IntType __t,
double __q);
3983 param_type _M_param;
3992 template<
typename _IntType>
3996 {
return !(__d1 == __d2); }
4006 template<
typename _IntType =
int>
4010 "template argument not an integral type");
4022 param_type(
double __p = 0.5)
4025 _GLIBCXX_DEBUG_ASSERT((_M_p > 0.0) && (_M_p < 1.0));
4034 operator==(
const param_type& __p1,
const param_type& __p2)
4035 {
return __p1._M_p == __p2._M_p; }
4040 { _M_log_1_p =
std::log(1.0 - _M_p); }
4071 {
return _M_param.p(); }
4078 {
return _M_param; }
4086 { _M_param = __param; }
4105 template<
typename _UniformRandomNumberGenerator>
4108 {
return this->
operator()(__urng, _M_param); }
4110 template<
typename _UniformRandomNumberGenerator>
4112 operator()(_UniformRandomNumberGenerator& __urng,
4113 const param_type& __p);
4115 template<
typename _ForwardIterator,
4116 typename _UniformRandomNumberGenerator>
4118 __generate(_ForwardIterator __f, _ForwardIterator __t,
4119 _UniformRandomNumberGenerator& __urng)
4120 { this->__generate(__f, __t, __urng, _M_param); }
4122 template<
typename _ForwardIterator,
4123 typename _UniformRandomNumberGenerator>
4125 __generate(_ForwardIterator __f, _ForwardIterator __t,
4126 _UniformRandomNumberGenerator& __urng,
4127 const param_type& __p)
4128 { this->__generate_impl(__f, __t, __urng, __p); }
4130 template<
typename _UniformRandomNumberGenerator>
4133 _UniformRandomNumberGenerator& __urng,
4134 const param_type& __p)
4135 { this->__generate_impl(__f, __t, __urng, __p); }
4144 {
return __d1._M_param == __d2._M_param; }
4147 template<
typename _ForwardIterator,
4148 typename _UniformRandomNumberGenerator>
4150 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4151 _UniformRandomNumberGenerator& __urng,
4152 const param_type& __p);
4154 param_type _M_param;
4161 template<
typename _IntType>
4165 {
return !(__d1 == __d2); }
4177 template<
typename _IntType,
4178 typename _CharT,
typename _Traits>
4180 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4192 template<
typename _IntType,
4193 typename _CharT,
typename _Traits>
4206 template<
typename _IntType =
int>
4210 "template argument not an integral type");
4221 param_type(_IntType __k = 1,
double __p = 0.5)
4222 : _M_k(__k), _M_p(__p)
4224 _GLIBCXX_DEBUG_ASSERT((_M_k > 0) && (_M_p > 0.0) && (_M_p <= 1.0));
4236 operator==(
const param_type& __p1,
const param_type& __p2)
4237 {
return __p1._M_k == __p2._M_k && __p1._M_p == __p2._M_p; }
4246 : _M_param(__k, __p), _M_gd(__k, (1.0 - __p) / __p)
4251 : _M_param(__p), _M_gd(__p.
k(), (1.0 - __p.
p()) / __p.
p())
4266 {
return _M_param.k(); }
4273 {
return _M_param.p(); }
4280 {
return _M_param; }
4288 { _M_param = __param; }
4307 template<
typename _UniformRandomNumberGenerator>
4309 operator()(_UniformRandomNumberGenerator& __urng);
4311 template<
typename _UniformRandomNumberGenerator>
4313 operator()(_UniformRandomNumberGenerator& __urng,
4314 const param_type& __p);
4316 template<
typename _ForwardIterator,
4317 typename _UniformRandomNumberGenerator>
4319 __generate(_ForwardIterator __f, _ForwardIterator __t,
4320 _UniformRandomNumberGenerator& __urng)
4321 { this->__generate_impl(__f, __t, __urng); }
4323 template<
typename _ForwardIterator,
4324 typename _UniformRandomNumberGenerator>
4326 __generate(_ForwardIterator __f, _ForwardIterator __t,
4327 _UniformRandomNumberGenerator& __urng,
4328 const param_type& __p)
4329 { this->__generate_impl(__f, __t, __urng, __p); }
4331 template<
typename _UniformRandomNumberGenerator>
4334 _UniformRandomNumberGenerator& __urng)
4335 { this->__generate_impl(__f, __t, __urng); }
4337 template<
typename _UniformRandomNumberGenerator>
4340 _UniformRandomNumberGenerator& __urng,
4341 const param_type& __p)
4342 { this->__generate_impl(__f, __t, __urng, __p); }
4352 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
4365 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4367 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4380 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4386 template<
typename _ForwardIterator,
4387 typename _UniformRandomNumberGenerator>
4389 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4390 _UniformRandomNumberGenerator& __urng);
4391 template<
typename _ForwardIterator,
4392 typename _UniformRandomNumberGenerator>
4394 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4395 _UniformRandomNumberGenerator& __urng,
4396 const param_type& __p);
4398 param_type _M_param;
4406 template<
typename _IntType>
4410 {
return !(__d1 == __d2); }
4428 template<
typename _IntType =
int>
4432 "template argument not an integral type");
4444 param_type(
double __mean = 1.0)
4447 _GLIBCXX_DEBUG_ASSERT(_M_mean > 0.0);
4456 operator==(
const param_type& __p1,
const param_type& __p2)
4457 {
return __p1._M_mean == __p2._M_mean; }
4467 #if _GLIBCXX_USE_C99_MATH_TR1
4468 double _M_lfm, _M_sm, _M_d, _M_scx, _M_1cx, _M_c2b, _M_cb;
4475 : _M_param(__mean), _M_nd()
4480 : _M_param(__p), _M_nd()
4495 {
return _M_param.mean(); }
4502 {
return _M_param; }
4510 { _M_param = __param; }
4529 template<
typename _UniformRandomNumberGenerator>
4532 {
return this->
operator()(__urng, _M_param); }
4534 template<
typename _UniformRandomNumberGenerator>
4536 operator()(_UniformRandomNumberGenerator& __urng,
4537 const param_type& __p);
4539 template<
typename _ForwardIterator,
4540 typename _UniformRandomNumberGenerator>
4542 __generate(_ForwardIterator __f, _ForwardIterator __t,
4543 _UniformRandomNumberGenerator& __urng)
4544 { this->__generate(__f, __t, __urng, _M_param); }
4546 template<
typename _ForwardIterator,
4547 typename _UniformRandomNumberGenerator>
4549 __generate(_ForwardIterator __f, _ForwardIterator __t,
4550 _UniformRandomNumberGenerator& __urng,
4551 const param_type& __p)
4552 { this->__generate_impl(__f, __t, __urng, __p); }
4554 template<
typename _UniformRandomNumberGenerator>
4557 _UniformRandomNumberGenerator& __urng,
4558 const param_type& __p)
4559 { this->__generate_impl(__f, __t, __urng, __p); }
4569 #ifdef _GLIBCXX_USE_C99_MATH_TR1
4570 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
4572 {
return __d1._M_param == __d2._M_param; }
4585 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4587 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4600 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4606 template<
typename _ForwardIterator,
4607 typename _UniformRandomNumberGenerator>
4609 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4610 _UniformRandomNumberGenerator& __urng,
4611 const param_type& __p);
4613 param_type _M_param;
4622 template<
typename _IntType>
4626 {
return !(__d1 == __d2); }
4644 template<
typename _RealType =
double>
4648 "template argument not a floating point type");
4659 param_type(_RealType __lambda = _RealType(1))
4660 : _M_lambda(__lambda)
4662 _GLIBCXX_DEBUG_ASSERT(_M_lambda > _RealType(0));
4667 {
return _M_lambda; }
4670 operator==(
const param_type& __p1,
const param_type& __p2)
4671 {
return __p1._M_lambda == __p2._M_lambda; }
4674 _RealType _M_lambda;
4684 : _M_param(__lambda)
4705 {
return _M_param.lambda(); }
4712 {
return _M_param; }
4720 { _M_param = __param; }
4739 template<
typename _UniformRandomNumberGenerator>
4742 {
return this->
operator()(__urng, _M_param); }
4744 template<
typename _UniformRandomNumberGenerator>
4746 operator()(_UniformRandomNumberGenerator& __urng,
4747 const param_type& __p)
4749 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
4754 template<
typename _ForwardIterator,
4755 typename _UniformRandomNumberGenerator>
4757 __generate(_ForwardIterator __f, _ForwardIterator __t,
4758 _UniformRandomNumberGenerator& __urng)
4759 { this->__generate(__f, __t, __urng, _M_param); }
4761 template<
typename _ForwardIterator,
4762 typename _UniformRandomNumberGenerator>
4764 __generate(_ForwardIterator __f, _ForwardIterator __t,
4765 _UniformRandomNumberGenerator& __urng,
4766 const param_type& __p)
4767 { this->__generate_impl(__f, __t, __urng, __p); }
4769 template<
typename _UniformRandomNumberGenerator>
4772 _UniformRandomNumberGenerator& __urng,
4773 const param_type& __p)
4774 { this->__generate_impl(__f, __t, __urng, __p); }
4783 {
return __d1._M_param == __d2._M_param; }
4786 template<
typename _ForwardIterator,
4787 typename _UniformRandomNumberGenerator>
4789 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4790 _UniformRandomNumberGenerator& __urng,
4791 const param_type& __p);
4793 param_type _M_param;
4800 template<
typename _RealType>
4804 {
return !(__d1 == __d2); }
4816 template<
typename _RealType,
typename _CharT,
typename _Traits>
4818 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4831 template<
typename _RealType,
typename _CharT,
typename _Traits>
4846 template<
typename _RealType =
double>
4850 "template argument not a floating point type");
4861 param_type(_RealType __a = _RealType(1),
4862 _RealType __b = _RealType(1))
4863 : _M_a(__a), _M_b(__b)
4875 operator==(
const param_type& __p1,
const param_type& __p2)
4876 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
4885 _RealType __b = _RealType(1))
4886 : _M_param(__a, __b)
4906 {
return _M_param.a(); }
4913 {
return _M_param.b(); }
4920 {
return _M_param; }
4928 { _M_param = __param; }
4947 template<
typename _UniformRandomNumberGenerator>
4950 {
return this->
operator()(__urng, _M_param); }
4952 template<
typename _UniformRandomNumberGenerator>
4954 operator()(_UniformRandomNumberGenerator& __urng,
4955 const param_type& __p);
4957 template<
typename _ForwardIterator,
4958 typename _UniformRandomNumberGenerator>
4960 __generate(_ForwardIterator __f, _ForwardIterator __t,
4961 _UniformRandomNumberGenerator& __urng)
4962 { this->__generate(__f, __t, __urng, _M_param); }
4964 template<
typename _ForwardIterator,
4965 typename _UniformRandomNumberGenerator>
4967 __generate(_ForwardIterator __f, _ForwardIterator __t,
4968 _UniformRandomNumberGenerator& __urng,
4969 const param_type& __p)
4970 { this->__generate_impl(__f, __t, __urng, __p); }
4972 template<
typename _UniformRandomNumberGenerator>
4975 _UniformRandomNumberGenerator& __urng,
4976 const param_type& __p)
4977 { this->__generate_impl(__f, __t, __urng, __p); }
4986 {
return __d1._M_param == __d2._M_param; }
4989 template<
typename _ForwardIterator,
4990 typename _UniformRandomNumberGenerator>
4992 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4993 _UniformRandomNumberGenerator& __urng,
4994 const param_type& __p);
4996 param_type _M_param;
5003 template<
typename _RealType>
5007 {
return !(__d1 == __d2); }
5019 template<
typename _RealType,
typename _CharT,
typename _Traits>
5021 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5034 template<
typename _RealType,
typename _CharT,
typename _Traits>
5049 template<
typename _RealType =
double>
5053 "template argument not a floating point type");
5064 param_type(_RealType __a = _RealType(0),
5065 _RealType __b = _RealType(1))
5066 : _M_a(__a), _M_b(__b)
5078 operator==(
const param_type& __p1,
const param_type& __p2)
5079 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
5088 _RealType __b = _RealType(1))
5089 : _M_param(__a, __b)
5109 {
return _M_param.a(); }
5116 {
return _M_param.b(); }
5123 {
return _M_param; }
5131 { _M_param = __param; }
5150 template<
typename _UniformRandomNumberGenerator>
5153 {
return this->
operator()(__urng, _M_param); }
5155 template<
typename _UniformRandomNumberGenerator>
5157 operator()(_UniformRandomNumberGenerator& __urng,
5158 const param_type& __p);
5160 template<
typename _ForwardIterator,
5161 typename _UniformRandomNumberGenerator>
5163 __generate(_ForwardIterator __f, _ForwardIterator __t,
5164 _UniformRandomNumberGenerator& __urng)
5165 { this->__generate(__f, __t, __urng, _M_param); }
5167 template<
typename _ForwardIterator,
5168 typename _UniformRandomNumberGenerator>
5170 __generate(_ForwardIterator __f, _ForwardIterator __t,
5171 _UniformRandomNumberGenerator& __urng,
5172 const param_type& __p)
5173 { this->__generate_impl(__f, __t, __urng, __p); }
5175 template<
typename _UniformRandomNumberGenerator>
5178 _UniformRandomNumberGenerator& __urng,
5179 const param_type& __p)
5180 { this->__generate_impl(__f, __t, __urng, __p); }
5189 {
return __d1._M_param == __d2._M_param; }
5192 template<
typename _ForwardIterator,
5193 typename _UniformRandomNumberGenerator>
5195 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5196 _UniformRandomNumberGenerator& __urng,
5197 const param_type& __p);
5199 param_type _M_param;
5206 template<
typename _RealType>
5210 {
return !(__d1 == __d2); }
5222 template<
typename _RealType,
typename _CharT,
typename _Traits>
5224 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5237 template<
typename _RealType,
typename _CharT,
typename _Traits>
5249 template<
typename _IntType =
int>
5253 "template argument not an integral type");
5265 : _M_prob(), _M_cp()
5268 template<
typename _InputIterator>
5269 param_type(_InputIterator __wbegin,
5270 _InputIterator __wend)
5271 : _M_prob(__wbegin, __wend), _M_cp()
5272 { _M_initialize(); }
5275 : _M_prob(__wil.begin(), __wil.end()), _M_cp()
5276 { _M_initialize(); }
5278 template<
typename _Func>
5279 param_type(
size_t __nw,
double __xmin,
double __xmax,
5283 param_type(
const param_type&) =
default;
5284 param_type& operator=(
const param_type&) =
default;
5287 probabilities()
const
5291 operator==(
const param_type& __p1,
const param_type& __p2)
5292 {
return __p1._M_prob == __p2._M_prob; }
5306 template<
typename _InputIterator>
5308 _InputIterator __wend)
5309 : _M_param(__wbegin, __wend)
5312 discrete_distribution(initializer_list<double> __wl)
5316 template<
typename _Func>
5317 discrete_distribution(
size_t __nw,
double __xmin,
double __xmax,
5319 : _M_param(__nw, __xmin, __xmax, __fw)
5323 discrete_distribution(
const param_type& __p)
5340 return _M_param._M_prob.
empty()
5349 {
return _M_param; }
5357 { _M_param = __param; }
5372 return _M_param._M_prob.
empty()
5379 template<
typename _UniformRandomNumberGenerator>
5382 {
return this->
operator()(__urng, _M_param); }
5384 template<
typename _UniformRandomNumberGenerator>
5386 operator()(_UniformRandomNumberGenerator& __urng,
5387 const param_type& __p);
5389 template<
typename _ForwardIterator,
5390 typename _UniformRandomNumberGenerator>
5392 __generate(_ForwardIterator __f, _ForwardIterator __t,
5393 _UniformRandomNumberGenerator& __urng)
5394 { this->__generate(__f, __t, __urng, _M_param); }
5396 template<
typename _ForwardIterator,
5397 typename _UniformRandomNumberGenerator>
5399 __generate(_ForwardIterator __f, _ForwardIterator __t,
5400 _UniformRandomNumberGenerator& __urng,
5401 const param_type& __p)
5402 { this->__generate_impl(__f, __t, __urng, __p); }
5404 template<
typename _UniformRandomNumberGenerator>
5407 _UniformRandomNumberGenerator& __urng,
5408 const param_type& __p)
5409 { this->__generate_impl(__f, __t, __urng, __p); }
5418 {
return __d1._M_param == __d2._M_param; }
5430 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5432 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5446 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5452 template<
typename _ForwardIterator,
5453 typename _UniformRandomNumberGenerator>
5455 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5456 _UniformRandomNumberGenerator& __urng,
5457 const param_type& __p);
5459 param_type _M_param;
5466 template<
typename _IntType>
5470 {
return !(__d1 == __d2); }
5479 template<
typename _RealType =
double>
5483 "template argument not a floating point type");
5495 : _M_int(), _M_den(), _M_cp()
5498 template<
typename _InputIteratorB,
typename _InputIteratorW>
5499 param_type(_InputIteratorB __bfirst,
5500 _InputIteratorB __bend,
5501 _InputIteratorW __wbegin);
5503 template<
typename _Func>
5506 template<
typename _Func>
5507 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5511 param_type(
const param_type&) =
default;
5512 param_type& operator=(
const param_type&) =
default;
5520 __tmp[1] = _RealType(1);
5532 operator==(
const param_type& __p1,
const param_type& __p2)
5533 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
5549 template<
typename _InputIteratorB,
typename _InputIteratorW>
5551 _InputIteratorB __bend,
5552 _InputIteratorW __wbegin)
5553 : _M_param(__bfirst, __bend, __wbegin)
5556 template<
typename _Func>
5557 piecewise_constant_distribution(initializer_list<_RealType> __bl,
5559 : _M_param(__bl, __fw)
5562 template<
typename _Func>
5563 piecewise_constant_distribution(
size_t __nw,
5564 _RealType __xmin, _RealType __xmax,
5566 : _M_param(__nw, __xmin, __xmax, __fw)
5570 piecewise_constant_distribution(
const param_type& __p)
5587 if (_M_param._M_int.
empty())
5590 __tmp[1] = _RealType(1);
5594 return _M_param._M_int;
5603 return _M_param._M_den.
empty()
5612 {
return _M_param; }
5620 { _M_param = __param; }
5628 return _M_param._M_int.
empty()
5638 return _M_param._M_int.
empty()
5645 template<
typename _UniformRandomNumberGenerator>
5648 {
return this->
operator()(__urng, _M_param); }
5650 template<
typename _UniformRandomNumberGenerator>
5652 operator()(_UniformRandomNumberGenerator& __urng,
5653 const param_type& __p);
5655 template<
typename _ForwardIterator,
5656 typename _UniformRandomNumberGenerator>
5658 __generate(_ForwardIterator __f, _ForwardIterator __t,
5659 _UniformRandomNumberGenerator& __urng)
5660 { this->__generate(__f, __t, __urng, _M_param); }
5662 template<
typename _ForwardIterator,
5663 typename _UniformRandomNumberGenerator>
5665 __generate(_ForwardIterator __f, _ForwardIterator __t,
5666 _UniformRandomNumberGenerator& __urng,
5667 const param_type& __p)
5668 { this->__generate_impl(__f, __t, __urng, __p); }
5670 template<
typename _UniformRandomNumberGenerator>
5673 _UniformRandomNumberGenerator& __urng,
5674 const param_type& __p)
5675 { this->__generate_impl(__f, __t, __urng, __p); }
5684 {
return __d1._M_param == __d2._M_param; }
5697 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5699 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5713 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5719 template<
typename _ForwardIterator,
5720 typename _UniformRandomNumberGenerator>
5722 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5723 _UniformRandomNumberGenerator& __urng,
5724 const param_type& __p);
5726 param_type _M_param;
5733 template<
typename _RealType>
5737 {
return !(__d1 == __d2); }
5746 template<
typename _RealType =
double>
5750 "template argument not a floating point type");
5762 : _M_int(), _M_den(), _M_cp(), _M_m()
5765 template<
typename _InputIteratorB,
typename _InputIteratorW>
5766 param_type(_InputIteratorB __bfirst,
5767 _InputIteratorB __bend,
5768 _InputIteratorW __wbegin);
5770 template<
typename _Func>
5773 template<
typename _Func>
5774 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5778 param_type(
const param_type&) =
default;
5779 param_type& operator=(
const param_type&) =
default;
5787 __tmp[1] = _RealType(1);
5799 operator==(
const param_type& __p1,
const param_type& __p2)
5800 {
return (__p1._M_int == __p2._M_int
5801 && __p1._M_den == __p2._M_den); }
5818 template<
typename _InputIteratorB,
typename _InputIteratorW>
5820 _InputIteratorB __bend,
5821 _InputIteratorW __wbegin)
5822 : _M_param(__bfirst, __bend, __wbegin)
5825 template<
typename _Func>
5826 piecewise_linear_distribution(initializer_list<_RealType> __bl,
5828 : _M_param(__bl, __fw)
5831 template<
typename _Func>
5832 piecewise_linear_distribution(
size_t __nw,
5833 _RealType __xmin, _RealType __xmax,
5835 : _M_param(__nw, __xmin, __xmax, __fw)
5839 piecewise_linear_distribution(
const param_type& __p)
5856 if (_M_param._M_int.
empty())
5859 __tmp[1] = _RealType(1);
5863 return _M_param._M_int;
5873 return _M_param._M_den.
empty()
5882 {
return _M_param; }
5890 { _M_param = __param; }
5898 return _M_param._M_int.
empty()
5908 return _M_param._M_int.
empty()
5915 template<
typename _UniformRandomNumberGenerator>
5918 {
return this->
operator()(__urng, _M_param); }
5920 template<
typename _UniformRandomNumberGenerator>
5922 operator()(_UniformRandomNumberGenerator& __urng,
5923 const param_type& __p);
5925 template<
typename _ForwardIterator,
5926 typename _UniformRandomNumberGenerator>
5928 __generate(_ForwardIterator __f, _ForwardIterator __t,
5929 _UniformRandomNumberGenerator& __urng)
5930 { this->__generate(__f, __t, __urng, _M_param); }
5932 template<
typename _ForwardIterator,
5933 typename _UniformRandomNumberGenerator>
5935 __generate(_ForwardIterator __f, _ForwardIterator __t,
5936 _UniformRandomNumberGenerator& __urng,
5937 const param_type& __p)
5938 { this->__generate_impl(__f, __t, __urng, __p); }
5940 template<
typename _UniformRandomNumberGenerator>
5943 _UniformRandomNumberGenerator& __urng,
5944 const param_type& __p)
5945 { this->__generate_impl(__f, __t, __urng, __p); }
5954 {
return __d1._M_param == __d2._M_param; }
5967 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5969 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5983 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5989 template<
typename _ForwardIterator,
5990 typename _UniformRandomNumberGenerator>
5992 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5993 _UniformRandomNumberGenerator& __urng,
5994 const param_type& __p);
5996 param_type _M_param;
6003 template<
typename _RealType>
6007 {
return !(__d1 == __d2); }
6036 template<
typename _IntType>
6039 template<
typename _InputIterator>
6040 seed_seq(_InputIterator __begin, _InputIterator __end);
6043 template<
typename _RandomAccessIterator>
6045 generate(_RandomAccessIterator __begin, _RandomAccessIterator __end);
6049 {
return _M_v.
size(); }
6051 template<
typename OutputIterator>
6053 param(OutputIterator __dest)
const
6054 { std::copy(_M_v.
begin(), _M_v.
end(), __dest); }
6065 _GLIBCXX_END_NAMESPACE_VERSION
void param(const param_type &__param)
Sets the parameter set of the distribution.
_IntType k() const
Return the parameter of the distribution.
reference front() noexcept
std::vector< double > densities() const
Returns a vector of the probability densities.
static constexpr _Tp min() noexcept
discard_block_engine()
Constructs a default discard_block_engine engine.
void param(const param_type &__param)
Sets the parameter set of the distribution.
_RandomNumberEngine::result_type result_type
result_type max() const
Returns the least upper bound value of the distribution.
static constexpr result_type min()
Gets the minimum value in the generated random number range.
void seed(result_type __s=default_seed)
Reseeds the linear_congruential_engine random number generator engine sequence to the seed __s...
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 ...
shuffle_order_engine()
Constructs a default shuffle_order_engine engine.
void reset()
Resets the distribution state.
void seed(result_type __s)
Reseeds the discard_block_engine object with the default seed for the underlying base class generator...
void reset()
Resets the distribution state.
A piecewise_constant_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 operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
size_type size() const noexcept
void discard(unsigned long long __z)
Discard a sequence of random numbers.
param_type param() const
Returns the parameter set of the distribution.
One of the math functors.
Properties of fundamental types.
void param(const param_type &__param)
Sets the parameter set of the distribution.
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...
void param(const param_type &__param)
Sets the parameter set of the distribution.
Uniform continuous distribution for random numbers.
An exponential continuous distribution for random numbers.
friend bool operator==(const extreme_value_distribution &__d1, const extreme_value_distribution &__d2)
Return true if two extreme value distributions have the same parameters.
mersenne_twister_engine(_Sseq &__q)
Constructs a mersenne_twister_engine random number generator engine seeded from the seed sequence __q...
shuffle_order_engine(const _RandomNumberEngine &__rng)
Copy constructs a shuffle_order_engine engine.
result_type max() const
Returns the inclusive upper bound of the distribution range.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void reset()
Resets the distribution state.
double p() const
Returns the distribution p parameter.
result_type min() const
Returns the greatest lower bound value of the distribution.
uniform_real_distribution(_RealType __a=_RealType(0), _RealType __b=_RealType(1))
Constructs a uniform_real_distribution object.
double p() const
Return the parameter of the distribution.
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...
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...
_RealType b() const
Return the parameter of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
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...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type min() const
Returns the greatest lower bound value of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
A cauchy_distribution random number distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
static constexpr result_type min()
Gets the inclusive minimum value of the range of random integers returned by this generator...
discard_block_engine(_Sseq &__q)
Generator construct a discard_block_engine engine.
complex< _Tp > exp(const complex< _Tp > &)
Return complex base e exponential of z.
A student_t_distribution random number distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
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...
gamma_distribution(_RealType __alpha_val=_RealType(1), _RealType __beta_val=_RealType(1))
Constructs a gamma distribution with parameters and .
complex< _Tp > log(const complex< _Tp > &)
Return complex natural logarithm of z.
param_type param() const
Returns the parameter set of the distribution.
_RealType beta() const
Returns the of the 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.
bool equal(_IIter1 __first1, _IIter1 __last1, _IIter2 __first2, _IIter2 __last2, _BinaryPredicate __binary_pred)
Tests a range for element-wise equality.
void seed(_Sseq &__q)
Reseeds the discard_block_engine object with the given seed sequence.
void seed(result_type __s)
Reseeds the shuffle_order_engine object with the default seed for the underlying base class generator...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
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...
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...
std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, bitset< _Nb > &__x)
Global I/O operators for bitsets.
discard_block_engine(_RandomNumberEngine &&__rng)
Move constructs a discard_block_engine engine.
uint_least32_t result_type
reference back() noexcept
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.
uniform_int_distribution(_IntType __a=0, _IntType __b=std::numeric_limits< _IntType >::max())
Constructs a uniform distribution object.
friend bool operator==(const shuffle_order_engine &__lhs, const shuffle_order_engine &__rhs)
_RealType stddev() const
Returns the standard deviation of the distribution.
The Marsaglia-Zaman generator.
friend bool operator==(const piecewise_linear_distribution &__d1, const piecewise_linear_distribution &__d2)
Return true if two piecewise linear distributions have the same parameters.
A lognormal_distribution random number distribution.
independent_bits_engine(const _RandomNumberEngine &__rng)
Copy constructs a independent_bits_engine engine.
param_type param() const
Returns the parameter set of the distribution.
static constexpr result_type max()
void param(const param_type &__param)
Sets the parameter set of the distribution.
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.
static constexpr result_type increment
const _RandomNumberEngine & base() const noexcept
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 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...
A model of a linear congruential random number generator.
friend bool operator==(const exponential_distribution &__d1, const exponential_distribution &__d2)
Return true if two exponential distributions have the same parameters.
friend bool operator==(const weibull_distribution &__d1, const weibull_distribution &__d2)
Return true if two Weibull distributions have the same parameters.
A discrete binomial random number distribution.
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine object.
void seed(_Sseq &__q)
Reseeds the shuffle_order_engine object with the given seed sequence.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void discard(unsigned long long __z)
A weibull_distribution random number distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
discard_block_engine(result_type __s)
Seed constructs a discard_block_engine engine.
result_type max() const
Returns the least upper bound value of the distribution.
discard_block_engine(const _RandomNumberEngine &__rng)
Copy constructs a discard_block_engine engine.
result_type max() const
Returns the least upper bound value of the distribution.
linear_congruential_engine(result_type __s=default_seed)
Constructs a linear_congruential_engine random number generator engine with seed __s. The default seed value is 1.
result_type min() const
Returns the greatest lower bound value of the distribution.
static constexpr result_type min()
Gets the smallest possible value in the output range.
param_type param() const
Returns the parameter set of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
_GLIBCXX14_CONSTEXPR const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
friend bool operator==(const discrete_distribution &__d1, const discrete_distribution &__d2)
Return true if two discrete distributions have the same parameters.
bernoulli_distribution(double __p=0.5)
Constructs a Bernoulli distribution with likelihood p.
void seed()
Reseeds the independent_bits_engine object with the default seed for the underlying base class genera...
_RealType mean() const
Returns the mean of the distribution.
complex< _Tp > sqrt(const complex< _Tp > &)
Return complex square root of z.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
shuffle_order_engine(_Sseq &__q)
Generator construct a shuffle_order_engine engine.
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::chi_squared_distribution< _RealType1 > &__x)
Extracts a chi_squared_distribution random number distribution __x from the input stream __is...
void seed(_Sseq &__q)
Reseeds the independent_bits_engine object with the given seed sequence.
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...
void discard(unsigned long long __z)
Discard a sequence of random numbers.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::poisson_distribution< _IntType1 > &__x)
Extracts a poisson_distribution random number distribution __x from the input stream __is...
param_type param() const
Returns the parameter set 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...
A gamma continuous distribution for random numbers.
void reset()
Resets the distribution state.
result_type min() const
Returns the inclusive lower bound of the distribution range.
static constexpr result_type max()
Gets the maximum value in the generated random number range.
void reset()
Resets the distribution state.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
subtract_with_carry_engine(result_type __sd=default_seed)
Constructs an explicitly seeded % subtract_with_carry_engine random number generator.
result_type max() const
Returns the least upper bound value of the distribution.
Produces random numbers by combining random numbers from some base engine to produce random numbers w...
void seed()
Reseeds the discard_block_engine object with the default seed for the underlying base class generator...
mersenne_twister_engine< uint_fast32_t, 32, 624, 397, 31, 0x9908b0dfUL, 11, 0xffffffffUL, 7, 0x9d2c5680UL, 15, 0xefc60000UL, 18, 1812433253UL > mt19937
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.
bool empty() const noexcept
_RealType b() const
Return the parameter of the distribution.
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 ...
result_type max() const
Returns the inclusive upper bound of the distribution range.
result_type max() const
Returns the least upper bound value of the distribution.
_RealType alpha() const
Returns the of the distribution.
param_type param() const
Returns the parameter set of the distribution.
normal_distribution(result_type __mean=result_type(0), result_type __stddev=result_type(1))
double p() const
Returns the p parameter 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...
void seed(result_type __s)
Reseeds the independent_bits_engine object with the default seed for the underlying base class genera...
void reset()
Resets the distribution state.
A negative_binomial_distribution random number 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.
param_type param() const
Returns the parameter set of the distribution.
linear_congruential_engine< uint_fast32_t, 48271UL, 0UL, 2147483647UL > minstd_rand
void param(const param_type &__param)
Sets the parameter set of the distribution.
_RandomNumberEngine::result_type result_type
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...
param_type param() const
Returns the parameter set of the distribution.
result_type operator()()
Gets the next value in the generated random number sequence.
void param(const param_type &__param)
Sets the parameter set of the distribution.
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...
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
A extreme_value_distribution random number distribution.
independent_bits_engine(_Sseq &__q)
Generator construct a independent_bits_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 inclusive maximum value of the range of random integers returned by this generator...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void param(const param_type &__param)
Sets the parameter set 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...
_RealType a() const
Return the parameter of the distribution.
double p() const
Returns the distribution parameter p.
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...
void reset()
Resets the distribution state.
A discrete Poisson random number distribution.
param_type param() const
Returns the parameter set of the distribution.
static constexpr result_type min()
Gets the minimum value in the generated random number range.
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 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.
static constexpr result_type multiplier
void reset()
Resets the distribution state.
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
result_type max() const
Returns the least upper bound value of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
independent_bits_engine()
Constructs a default independent_bits_engine engine.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type max() const
Returns the least upper bound value of the distribution.
A Bernoulli random number distribution.
_RealType generate_canonical(_UniformRandomNumberGenerator &__g)
A function template for converting the output of a (integral) uniform random number generator to a fl...
Template class basic_ostream.
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...
param_type param() const
Returns the parameter set of the distribution.
void param(const param_type &__param)
Sets the parameter set of the 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...
The seed_seq class generates sequences of seeds for random number generators.
A piecewise_linear_distribution random number distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
Uniform discrete distribution for random numbers. A discrete random distribution on the range with e...
static constexpr result_type max()
Gets the maximum value in the generated random number range.
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...
friend bool operator==(const geometric_distribution &__d1, const geometric_distribution &__d2)
Return true if two geometric distributions have the same parameters.
_RealType a() const
Return the parameter of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
param_type param() const
Returns the parameter set of the distribution.
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine object.
void param(const param_type &__param)
Sets the parameter set of the distribution.
A normal continuous distribution for random numbers.
static constexpr result_type max()
Gets the largest possible value in the output range.
result_type operator()()
Gets the next random number in the sequence.
shuffle_order_engine(_RandomNumberEngine &&__rng)
Move constructs a shuffle_order_engine engine.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
shuffle_order_engine(result_type __s)
Seed constructs a shuffle_order_engine engine.
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...
mersenne_twister_engine< uint_fast64_t, 64, 312, 156, 31, 0xb5026f5aa96619e9ULL, 29, 0x5555555555555555ULL, 17, 0x71d67fffeda60000ULL, 37, 0xfff7eee000000000ULL, 43, 6364136223846793005ULL > mt19937_64
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
linear_congruential_engine< uint_fast32_t, 16807UL, 0UL, 2147483647UL > minstd_rand0
friend bool operator==(const uniform_real_distribution &__d1, const uniform_real_distribution &__d2)
Return true if two uniform real distributions have the same parameters.
iterator begin() noexcept
void reset()
Resets the distribution state.
void param(const param_type &__param)
Sets the parameter set of the distribution.
friend bool operator==(const cauchy_distribution &__d1, const cauchy_distribution &__d2)
Return true if two Cauchy distributions have the same parameters.
static constexpr result_type min()
Gets the smallest possible value in the output range.
param_type param() const
Returns the parameter set of the distribution.
static constexpr _Tp lowest() noexcept
void reset()
Resets the distribution state.
result_type max() const
Returns the least upper bound value of the 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 param(const param_type &__param)
Sets the parameter set of the distribution.
result_type operator()()
Gets the next random number in the sequence.
__gnu_cxx::__promote_2< _Tpx, _Tpy >::__type beta(_Tpx __x, _Tpy __y)
5.2.1.3 Beta functions.
result_type min() const
Returns the greatest lower bound value of the distribution.
A discrete geometric random number distribution.
param_type param() const
Returns the parameter set of the distribution.
void seed()
Reseeds the shuffle_order_engine object with the default seed for the underlying base class generator...
param_type param() const
Returns the parameter set of the distribution.
static constexpr result_type max()
Gets the largest possible value in the output range.
result_type max() const
Returns the least upper bound value of the distribution.
std::vector< double > densities() const
Return a vector of the probability densities of the distribution.
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...
result_type max() const
Returns the least upper bound value of the distribution.
friend bool operator==(const uniform_int_distribution &__d1, const uniform_int_distribution &__d2)
Return true if two uniform integer distributions have the same parameters.
independent_bits_engine(_RandomNumberEngine &&__rng)
Move constructs a independent_bits_engine engine.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void reset()
Resets the distribution state.
void seed(result_type __sd=default_seed)
Seeds the initial state of the random number generator.
result_type min() const
Returns the inclusive lower bound of the distribution range.
param_type param() const
Returns the parameter set of the distribution.
double mean() const
Returns the distribution parameter mean.
static constexpr _Tp max() noexcept
Template class basic_istream.
A discrete_distribution random number distribution.
A chi_squared_distribution random number distribution.
static constexpr result_type min()
result_type operator()()
Gets the next value in the generated random number sequence.
result_type max() const
Returns the least upper bound value of the distribution.
subtract_with_carry_engine(_Sseq &__q)
Constructs a subtract_with_carry_engine random number engine seeded from the seed sequence __q...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void reset()
Resets the distribution state.
independent_bits_engine(result_type __s)
Seed constructs a independent_bits_engine engine.
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 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 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...
_IntType t() const
Returns the distribution t parameter.
std::vector< double > probabilities() const
Returns the probabilities of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
std::vector< _RealType > intervals() const
Returns a vector of the intervals.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend bool operator==(const bernoulli_distribution &__d1, const bernoulli_distribution &__d2)
Return true if two Bernoulli distributions have the same parameters.
result_type min() const
Returns the greatest lower bound value of the distribution.
void reset()
Resets the distribution state.
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.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
_GLIBCXX14_CONSTEXPR const _Tp & max(const _Tp &, const _Tp &)
This does what you think it does.
constexpr int __lg(int __n)
This is a helper function for the sort routines and for random.tcc.
linear_congruential_engine(_Sseq &__q)
Constructs a linear_congruential_engine random number generator engine seeded from the seed sequence ...
A fisher_f_distribution random number distribution.
param_type param() const
Returns the parameter set of the distribution.
void reset()
Resets the distribution state.
friend bool operator==(const discard_block_engine &__lhs, const discard_block_engine &__rhs)
Compares two discard_block_engine random number generator objects of the same type for equality...
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.