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>
71 (std::numeric_limits<_UIntType>::digits)>
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>
167 static_assert(std::is_floating_point<_DInputType>::value,
168 "template argument not a floating point type");
171 _Adaptor(_Engine& __g)
176 {
return _DInputType(0); }
180 {
return _DInputType(1); }
191 std::numeric_limits<_DInputType>::digits,
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");
252 typedef _UIntType result_type;
255 static constexpr result_type multiplier = __a;
257 static constexpr result_type increment = __c;
259 static constexpr result_type
modulus = __m;
260 static constexpr result_type default_seed = 1u;
279 template<
typename _Sseq,
typename =
typename
280 std::enable_if<!std::is_same<_Sseq, linear_congruential_engine>::value>
293 seed(result_type __s = default_seed);
302 template<
typename _Sseq>
303 typename std::enable_if<std::is_class<_Sseq>::value>::type
312 static constexpr result_type
314 {
return __c == 0u ? 1u : 0u; }
319 static constexpr result_type
327 discard(
unsigned long long __z)
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>
369 friend std::basic_ostream<_CharT, _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>
389 friend std::basic_istream<_CharT, _Traits>&
390 operator>>(std::basic_istream<_CharT, _Traits>& __is,
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 "
467 static_assert(__w <= std::numeric_limits<_UIntType>::digits,
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");
482 typedef _UIntType result_type;
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;
489 static constexpr result_type xor_mask = __a;
490 static constexpr
size_t tempering_u = __u;
491 static constexpr result_type tempering_d = __d;
492 static constexpr
size_t tempering_s = __s;
493 static constexpr result_type tempering_b = __b;
494 static constexpr
size_t tempering_t = __t;
495 static constexpr result_type tempering_c = __c;
496 static constexpr
size_t tempering_l = __l;
497 static constexpr result_type initialization_multiplier = __f;
498 static constexpr result_type default_seed = 5489u;
511 template<
typename _Sseq,
typename =
typename
512 std::enable_if<!std::is_same<_Sseq, mersenne_twister_engine>::value>
519 seed(result_type __sd = default_seed);
521 template<
typename _Sseq>
522 typename std::enable_if<std::is_class<_Sseq>::value>::type
528 static constexpr result_type
535 static constexpr result_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>
586 friend std::basic_ostream<_CharT, _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>
612 friend std::basic_istream<_CharT, _Traits>&
613 operator>>(std::basic_istream<_CharT, _Traits>& __is,
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); }
669 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
670 class subtract_with_carry_engine
672 static_assert(std::is_unsigned<_UIntType>::value,
"template argument "
673 "substituting _UIntType not an unsigned integral type");
674 static_assert(0u < __s && __s < __r,
675 "template argument substituting __s out of bounds");
676 static_assert(0u < __w && __w <= std::numeric_limits<_UIntType>::digits,
677 "template argument substituting __w out of bounds");
681 typedef _UIntType result_type;
684 static constexpr
size_t word_size = __w;
685 static constexpr
size_t short_lag = __s;
686 static constexpr
size_t long_lag = __r;
687 static constexpr result_type default_seed = 19780503u;
694 subtract_with_carry_engine(result_type __sd = default_seed)
703 template<
typename _Sseq,
typename =
typename
704 std::enable_if<!std::is_same<_Sseq, subtract_with_carry_engine>::value>
707 subtract_with_carry_engine(_Sseq& __q)
723 seed(result_type __sd = default_seed);
729 template<
typename _Sseq>
730 typename std::enable_if<std::is_class<_Sseq>::value>::type
737 static constexpr result_type
745 static constexpr result_type
747 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
753 discard(
unsigned long long __z)
755 for (; __z != 0ULL; --__z)
778 operator==(
const subtract_with_carry_engine& __lhs,
779 const subtract_with_carry_engine& __rhs)
780 {
return (std::equal(__lhs._M_x, __lhs._M_x + long_lag, __rhs._M_x)
781 && __lhs._M_carry == __rhs._M_carry
782 && __lhs._M_p == __rhs._M_p); }
796 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
797 typename _CharT,
typename _Traits>
798 friend std::basic_ostream<_CharT, _Traits>&
799 operator<<(std::basic_ostream<_CharT, _Traits>&,
800 const std::subtract_with_carry_engine<_UIntType1, __w1,
815 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
816 typename _CharT,
typename _Traits>
817 friend std::basic_istream<_CharT, _Traits>&
818 operator>>(std::basic_istream<_CharT, _Traits>&,
819 std::subtract_with_carry_engine<_UIntType1, __w1,
823 _UIntType _M_x[long_lag];
840 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
842 operator!=(
const std::subtract_with_carry_engine<_UIntType, __w,
844 const std::subtract_with_carry_engine<_UIntType, __w,
846 {
return !(__lhs == __rhs); }
855 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
858 static_assert(1 <= __r && __r <= __p,
859 "template argument substituting __r out of bounds");
863 typedef typename _RandomNumberEngine::result_type result_type;
866 static constexpr
size_t block_size = __p;
867 static constexpr
size_t used_block = __r;
875 : _M_b(), _M_n(0) { }
885 : _M_b(__rng), _M_n(0) { }
905 : _M_b(__s), _M_n(0) { }
912 template<
typename _Sseq,
typename =
typename
913 std::enable_if<!std::is_same<_Sseq, discard_block_engine>::value
914 && !std::is_same<_Sseq, _RandomNumberEngine>::value>
937 seed(result_type __s)
948 template<
typename _Sseq>
960 const _RandomNumberEngine&
961 base()
const noexcept
967 static constexpr result_type
974 static constexpr result_type
982 discard(
unsigned long long __z)
984 for (; __z != 0ULL; --__z)
1006 operator==(
const discard_block_engine& __lhs,
1007 const discard_block_engine& __rhs)
1008 {
return __lhs._M_b == __rhs._M_b && __lhs._M_n == __rhs._M_n; }
1021 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1022 typename _CharT,
typename _Traits>
1023 friend std::basic_ostream<_CharT, _Traits>&
1024 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1039 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1040 typename _CharT,
typename _Traits>
1041 friend std::basic_istream<_CharT, _Traits>&
1042 operator>>(std::basic_istream<_CharT, _Traits>& __is,
1047 _RandomNumberEngine _M_b;
1062 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
1068 {
return !(__lhs == __rhs); }
1075 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1078 static_assert(std::is_unsigned<_UIntType>::value,
"template argument "
1079 "substituting _UIntType not an unsigned integral type");
1080 static_assert(0u < __w && __w <= std::numeric_limits<_UIntType>::digits,
1081 "template argument substituting __w out of bounds");
1085 typedef _UIntType result_type;
1130 template<
typename _Sseq,
typename =
typename
1131 std::enable_if<!std::is_same<_Sseq, independent_bits_engine>::value
1132 && !std::is_same<_Sseq, _RandomNumberEngine>::value>
1152 seed(result_type __s)
1160 template<
typename _Sseq>
1169 const _RandomNumberEngine&
1170 base()
const noexcept
1176 static constexpr result_type
1183 static constexpr result_type
1185 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1191 discard(
unsigned long long __z)
1193 for (; __z != 0ULL; --__z)
1216 operator==(
const independent_bits_engine& __lhs,
1217 const independent_bits_engine& __rhs)
1218 {
return __lhs._M_b == __rhs._M_b; }
1232 template<
typename _CharT,
typename _Traits>
1233 friend std::basic_istream<_CharT, _Traits>&
1234 operator>>(std::basic_istream<_CharT, _Traits>& __is,
1236 __w, _UIntType>& __x)
1243 _RandomNumberEngine _M_b;
1258 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1264 {
return !(__lhs == __rhs); }
1276 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType,
1277 typename _CharT,
typename _Traits>
1278 std::basic_ostream<_CharT, _Traits>&
1279 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1281 __w, _UIntType>& __x)
1293 template<
typename _RandomNumberEngine,
size_t __k>
1296 static_assert(1u <= __k,
"template argument substituting "
1297 "__k out of bound");
1301 typedef typename _RandomNumberEngine::result_type result_type;
1303 static constexpr
size_t table_size = __k;
1312 { _M_initialize(); }
1323 { _M_initialize(); }
1334 { _M_initialize(); }
1345 { _M_initialize(); }
1352 template<
typename _Sseq,
typename =
typename
1353 std::enable_if<!std::is_same<_Sseq, shuffle_order_engine>::value
1354 && !std::is_same<_Sseq, _RandomNumberEngine>::value>
1359 { _M_initialize(); }
1377 seed(result_type __s)
1388 template<
typename _Sseq>
1399 const _RandomNumberEngine&
1400 base()
const noexcept
1406 static constexpr result_type
1413 static constexpr result_type
1421 discard(
unsigned long long __z)
1423 for (; __z != 0ULL; --__z)
1445 operator==(
const shuffle_order_engine& __lhs,
1446 const shuffle_order_engine& __rhs)
1447 {
return (__lhs._M_b == __rhs._M_b
1448 &&
std::equal(__lhs._M_v, __lhs._M_v + __k, __rhs._M_v)
1449 && __lhs._M_y == __rhs._M_y); }
1462 template<
typename _RandomNumberEngine1,
size_t __k1,
1463 typename _CharT,
typename _Traits>
1464 friend std::basic_ostream<_CharT, _Traits>&
1465 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1480 template<
typename _RandomNumberEngine1,
size_t __k1,
1481 typename _CharT,
typename _Traits>
1482 friend std::basic_istream<_CharT, _Traits>&
1483 operator>>(std::basic_istream<_CharT, _Traits>& __is,
1487 void _M_initialize()
1489 for (
size_t __i = 0; __i < __k; ++__i)
1494 _RandomNumberEngine _M_b;
1495 result_type _M_v[__k];
1510 template<
typename _RandomNumberEngine,
size_t __k>
1516 {
return !(__lhs == __rhs); }
1522 typedef linear_congruential_engine<uint_fast32_t, 16807UL, 0UL, 2147483647UL>
1553 0xb5026f5aa96619e9ULL, 29,
1554 0x5555555555555555ULL, 17,
1555 0x71d67fffeda60000ULL, 37,
1556 0xfff7eee000000000ULL, 43,
1559 typedef subtract_with_carry_engine<uint_fast32_t, 24, 10, 24>
1562 typedef subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>
1585 #ifdef _GLIBCXX_USE_RANDOM_TR1
1599 random_device(
const std::string& __token =
"mt19937")
1600 { _M_init_pretr1(__token); }
1606 static constexpr result_type
1610 static constexpr result_type
1615 entropy() const noexcept
1621 #ifdef _GLIBCXX_USE_RANDOM_TR1
1622 return this->_M_getval();
1624 return this->_M_getval_pretr1();
1629 random_device(
const random_device&) =
delete;
1630 void operator=(
const random_device&) =
delete;
1638 result_type _M_getval();
1639 result_type _M_getval_pretr1();
1667 template<
typename _IntType =
int>
1670 static_assert(std::is_integral<_IntType>::value,
1671 "template argument not an integral type");
1675 typedef _IntType result_type;
1682 param_type(_IntType __a = 0,
1684 : _M_a(__a), _M_b(__b)
1686 _GLIBCXX_DEBUG_ASSERT(_M_a <= _M_b);
1698 operator==(
const param_type& __p1,
const param_type& __p2)
1699 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
1713 : _M_param(__a, __b)
1731 {
return _M_param.a(); }
1735 {
return _M_param.b(); }
1742 {
return _M_param; }
1749 param(
const param_type& __param)
1750 { _M_param = __param; }
1757 {
return this->a(); }
1764 {
return this->b(); }
1769 template<
typename _UniformRandomNumberGenerator>
1771 operator()(_UniformRandomNumberGenerator& __urng)
1772 {
return this->operator()(__urng, _M_param); }
1774 template<
typename _UniformRandomNumberGenerator>
1776 operator()(_UniformRandomNumberGenerator& __urng,
1777 const param_type& __p);
1779 template<
typename _ForwardIterator,
1780 typename _UniformRandomNumberGenerator>
1782 __generate(_ForwardIterator __f, _ForwardIterator __t,
1783 _UniformRandomNumberGenerator& __urng)
1784 { this->__generate(__f, __t, __urng, _M_param); }
1786 template<
typename _ForwardIterator,
1787 typename _UniformRandomNumberGenerator>
1789 __generate(_ForwardIterator __f, _ForwardIterator __t,
1790 _UniformRandomNumberGenerator& __urng,
1791 const param_type& __p)
1792 { this->__generate_impl(__f, __t, __urng, __p); }
1794 template<
typename _UniformRandomNumberGenerator>
1796 __generate(result_type* __f, result_type* __t,
1797 _UniformRandomNumberGenerator& __urng,
1798 const param_type& __p)
1799 { this->__generate_impl(__f, __t, __urng, __p); }
1808 {
return __d1._M_param == __d2._M_param; }
1811 template<
typename _ForwardIterator,
1812 typename _UniformRandomNumberGenerator>
1814 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
1815 _UniformRandomNumberGenerator& __urng,
1816 const param_type& __p);
1818 param_type _M_param;
1825 template<
typename _IntType>
1829 {
return !(__d1 == __d2); }
1841 template<
typename _IntType,
typename _CharT,
typename _Traits>
1842 std::basic_ostream<_CharT, _Traits>&
1843 operator<<(std::basic_ostream<_CharT, _Traits>&,
1855 template<
typename _IntType,
typename _CharT,
typename _Traits>
1856 std::basic_istream<_CharT, _Traits>&
1857 operator>>(std::basic_istream<_CharT, _Traits>&,
1868 template<
typename _RealType =
double>
1871 static_assert(std::is_floating_point<_RealType>::value,
1872 "template argument not a floating point type");
1876 typedef _RealType result_type;
1883 param_type(_RealType __a = _RealType(0),
1884 _RealType __b = _RealType(1))
1885 : _M_a(__a), _M_b(__b)
1887 _GLIBCXX_DEBUG_ASSERT(_M_a <= _M_b);
1899 operator==(
const param_type& __p1,
const param_type& __p2)
1900 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
1916 _RealType __b = _RealType(1))
1917 : _M_param(__a, __b)
1935 {
return _M_param.a(); }
1939 {
return _M_param.b(); }
1946 {
return _M_param; }
1953 param(
const param_type& __param)
1954 { _M_param = __param; }
1961 {
return this->a(); }
1968 {
return this->b(); }
1973 template<
typename _UniformRandomNumberGenerator>
1975 operator()(_UniformRandomNumberGenerator& __urng)
1976 {
return this->operator()(__urng, _M_param); }
1978 template<
typename _UniformRandomNumberGenerator>
1980 operator()(_UniformRandomNumberGenerator& __urng,
1981 const param_type& __p)
1983 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
1985 return (__aurng() * (__p.b() - __p.a())) + __p.a();
1988 template<
typename _ForwardIterator,
1989 typename _UniformRandomNumberGenerator>
1991 __generate(_ForwardIterator __f, _ForwardIterator __t,
1992 _UniformRandomNumberGenerator& __urng)
1993 { this->__generate(__f, __t, __urng, _M_param); }
1995 template<
typename _ForwardIterator,
1996 typename _UniformRandomNumberGenerator>
1998 __generate(_ForwardIterator __f, _ForwardIterator __t,
1999 _UniformRandomNumberGenerator& __urng,
2000 const param_type& __p)
2001 { this->__generate_impl(__f, __t, __urng, __p); }
2003 template<
typename _UniformRandomNumberGenerator>
2005 __generate(result_type* __f, result_type* __t,
2006 _UniformRandomNumberGenerator& __urng,
2007 const param_type& __p)
2008 { this->__generate_impl(__f, __t, __urng, __p); }
2017 {
return __d1._M_param == __d2._M_param; }
2020 template<
typename _ForwardIterator,
2021 typename _UniformRandomNumberGenerator>
2023 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2024 _UniformRandomNumberGenerator& __urng,
2025 const param_type& __p);
2027 param_type _M_param;
2034 template<
typename _IntType>
2038 {
return !(__d1 == __d2); }
2050 template<
typename _RealType,
typename _CharT,
typename _Traits>
2051 std::basic_ostream<_CharT, _Traits>&
2052 operator<<(std::basic_ostream<_CharT, _Traits>&,
2064 template<
typename _RealType,
typename _CharT,
typename _Traits>
2065 std::basic_istream<_CharT, _Traits>&
2066 operator>>(std::basic_istream<_CharT, _Traits>&,
2086 template<
typename _RealType =
double>
2089 static_assert(std::is_floating_point<_RealType>::value,
2090 "template argument not a floating point type");
2094 typedef _RealType result_type;
2101 param_type(_RealType __mean = _RealType(0),
2102 _RealType __stddev = _RealType(1))
2103 : _M_mean(__mean), _M_stddev(__stddev)
2105 _GLIBCXX_DEBUG_ASSERT(_M_stddev > _RealType(0));
2114 {
return _M_stddev; }
2117 operator==(
const param_type& __p1,
const param_type& __p2)
2118 {
return (__p1._M_mean == __p2._M_mean
2119 && __p1._M_stddev == __p2._M_stddev); }
2123 _RealType _M_stddev;
2133 result_type __stddev = result_type(1))
2134 : _M_param(__mean, __stddev), _M_saved_available(
false)
2139 : _M_param(__p), _M_saved_available(
false)
2147 { _M_saved_available =
false; }
2154 {
return _M_param.mean(); }
2161 {
return _M_param.stddev(); }
2168 {
return _M_param; }
2175 param(
const param_type& __param)
2176 { _M_param = __param; }
2183 {
return std::numeric_limits<result_type>::lowest(); }
2195 template<
typename _UniformRandomNumberGenerator>
2197 operator()(_UniformRandomNumberGenerator& __urng)
2198 {
return this->operator()(__urng, _M_param); }
2200 template<
typename _UniformRandomNumberGenerator>
2202 operator()(_UniformRandomNumberGenerator& __urng,
2203 const param_type& __p);
2205 template<
typename _ForwardIterator,
2206 typename _UniformRandomNumberGenerator>
2208 __generate(_ForwardIterator __f, _ForwardIterator __t,
2209 _UniformRandomNumberGenerator& __urng)
2210 { this->__generate(__f, __t, __urng, _M_param); }
2212 template<
typename _ForwardIterator,
2213 typename _UniformRandomNumberGenerator>
2215 __generate(_ForwardIterator __f, _ForwardIterator __t,
2216 _UniformRandomNumberGenerator& __urng,
2217 const param_type& __p)
2218 { this->__generate_impl(__f, __t, __urng, __p); }
2220 template<
typename _UniformRandomNumberGenerator>
2222 __generate(result_type* __f, result_type* __t,
2223 _UniformRandomNumberGenerator& __urng,
2224 const param_type& __p)
2225 { this->__generate_impl(__f, __t, __urng, __p); }
2232 template<
typename _RealType1>
2247 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2248 friend std::basic_ostream<_CharT, _Traits>&
2249 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2262 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2263 friend std::basic_istream<_CharT, _Traits>&
2264 operator>>(std::basic_istream<_CharT, _Traits>& __is,
2268 template<
typename _ForwardIterator,
2269 typename _UniformRandomNumberGenerator>
2271 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2272 _UniformRandomNumberGenerator& __urng,
2273 const param_type& __p);
2275 param_type _M_param;
2276 result_type _M_saved;
2277 bool _M_saved_available;
2283 template<
typename _RealType>
2287 {
return !(__d1 == __d2); }
2299 template<
typename _RealType =
double>
2302 static_assert(std::is_floating_point<_RealType>::value,
2303 "template argument not a floating point type");
2307 typedef _RealType result_type;
2314 param_type(_RealType __m = _RealType(0),
2315 _RealType __s = _RealType(1))
2316 : _M_m(__m), _M_s(__s)
2328 operator==(
const param_type& __p1,
const param_type& __p2)
2329 {
return __p1._M_m == __p2._M_m && __p1._M_s == __p2._M_s; }
2338 _RealType __s = _RealType(1))
2339 : _M_param(__m, __s), _M_nd()
2344 : _M_param(__p), _M_nd()
2359 {
return _M_param.m(); }
2363 {
return _M_param.s(); }
2370 {
return _M_param; }
2377 param(
const param_type& __param)
2378 { _M_param = __param; }
2385 {
return result_type(0); }
2397 template<
typename _UniformRandomNumberGenerator>
2399 operator()(_UniformRandomNumberGenerator& __urng)
2400 {
return this->operator()(__urng, _M_param); }
2402 template<
typename _UniformRandomNumberGenerator>
2404 operator()(_UniformRandomNumberGenerator& __urng,
2405 const param_type& __p)
2406 {
return std::exp(__p.s() * _M_nd(__urng) + __p.m()); }
2408 template<
typename _ForwardIterator,
2409 typename _UniformRandomNumberGenerator>
2411 __generate(_ForwardIterator __f, _ForwardIterator __t,
2412 _UniformRandomNumberGenerator& __urng)
2413 { this->__generate(__f, __t, __urng, _M_param); }
2415 template<
typename _ForwardIterator,
2416 typename _UniformRandomNumberGenerator>
2418 __generate(_ForwardIterator __f, _ForwardIterator __t,
2419 _UniformRandomNumberGenerator& __urng,
2420 const param_type& __p)
2421 { this->__generate_impl(__f, __t, __urng, __p); }
2423 template<
typename _UniformRandomNumberGenerator>
2425 __generate(result_type* __f, result_type* __t,
2426 _UniformRandomNumberGenerator& __urng,
2427 const param_type& __p)
2428 { this->__generate_impl(__f, __t, __urng, __p); }
2438 {
return (__d1._M_param == __d2._M_param
2439 && __d1._M_nd == __d2._M_nd); }
2451 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2452 friend std::basic_ostream<_CharT, _Traits>&
2453 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2466 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2467 friend std::basic_istream<_CharT, _Traits>&
2468 operator>>(std::basic_istream<_CharT, _Traits>& __is,
2472 template<
typename _ForwardIterator,
2473 typename _UniformRandomNumberGenerator>
2475 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2476 _UniformRandomNumberGenerator& __urng,
2477 const param_type& __p);
2479 param_type _M_param;
2487 template<
typename _RealType>
2491 {
return !(__d1 == __d2); }
2503 template<
typename _RealType =
double>
2506 static_assert(std::is_floating_point<_RealType>::value,
2507 "template argument not a floating point type");
2511 typedef _RealType result_type;
2519 param_type(_RealType __alpha_val = _RealType(1),
2520 _RealType __beta_val = _RealType(1))
2521 : _M_alpha(__alpha_val), _M_beta(__beta_val)
2523 _GLIBCXX_DEBUG_ASSERT(_M_alpha > _RealType(0));
2529 {
return _M_alpha; }
2536 operator==(
const param_type& __p1,
const param_type& __p2)
2537 {
return (__p1._M_alpha == __p2._M_alpha
2538 && __p1._M_beta == __p2._M_beta); }
2547 _RealType _M_malpha, _M_a2;
2557 _RealType __beta_val = _RealType(1))
2558 : _M_param(__alpha_val, __beta_val), _M_nd()
2563 : _M_param(__p), _M_nd()
2578 {
return _M_param.alpha(); }
2585 {
return _M_param.beta(); }
2592 {
return _M_param; }
2599 param(
const param_type& __param)
2600 { _M_param = __param; }
2607 {
return result_type(0); }
2619 template<
typename _UniformRandomNumberGenerator>
2621 operator()(_UniformRandomNumberGenerator& __urng)
2622 {
return this->operator()(__urng, _M_param); }
2624 template<
typename _UniformRandomNumberGenerator>
2626 operator()(_UniformRandomNumberGenerator& __urng,
2627 const param_type& __p);
2629 template<
typename _ForwardIterator,
2630 typename _UniformRandomNumberGenerator>
2632 __generate(_ForwardIterator __f, _ForwardIterator __t,
2633 _UniformRandomNumberGenerator& __urng)
2634 { this->__generate(__f, __t, __urng, _M_param); }
2636 template<
typename _ForwardIterator,
2637 typename _UniformRandomNumberGenerator>
2639 __generate(_ForwardIterator __f, _ForwardIterator __t,
2640 _UniformRandomNumberGenerator& __urng,
2641 const param_type& __p)
2642 { this->__generate_impl(__f, __t, __urng, __p); }
2644 template<
typename _UniformRandomNumberGenerator>
2646 __generate(result_type* __f, result_type* __t,
2647 _UniformRandomNumberGenerator& __urng,
2648 const param_type& __p)
2649 { this->__generate_impl(__f, __t, __urng, __p); }
2659 {
return (__d1._M_param == __d2._M_param
2660 && __d1._M_nd == __d2._M_nd); }
2672 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2673 friend std::basic_ostream<_CharT, _Traits>&
2674 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2686 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2687 friend std::basic_istream<_CharT, _Traits>&
2688 operator>>(std::basic_istream<_CharT, _Traits>& __is,
2692 template<
typename _ForwardIterator,
2693 typename _UniformRandomNumberGenerator>
2695 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2696 _UniformRandomNumberGenerator& __urng,
2697 const param_type& __p);
2699 param_type _M_param;
2707 template<
typename _RealType>
2711 {
return !(__d1 == __d2); }
2720 template<
typename _RealType =
double>
2723 static_assert(std::is_floating_point<_RealType>::value,
2724 "template argument not a floating point type");
2728 typedef _RealType result_type;
2735 param_type(_RealType __n = _RealType(1))
2744 operator==(
const param_type& __p1,
const param_type& __p2)
2745 {
return __p1._M_n == __p2._M_n; }
2753 : _M_param(__n), _M_gd(__n / 2)
2758 : _M_param(__p), _M_gd(__p.n() / 2)
2773 {
return _M_param.n(); }
2780 {
return _M_param; }
2787 param(
const param_type& __param)
2788 { _M_param = __param; }
2795 {
return result_type(0); }
2807 template<
typename _UniformRandomNumberGenerator>
2809 operator()(_UniformRandomNumberGenerator& __urng)
2810 {
return 2 * _M_gd(__urng); }
2812 template<
typename _UniformRandomNumberGenerator>
2814 operator()(_UniformRandomNumberGenerator& __urng,
2815 const param_type& __p)
2819 return 2 * _M_gd(__urng, param_type(__p.n() / 2));
2822 template<
typename _ForwardIterator,
2823 typename _UniformRandomNumberGenerator>
2825 __generate(_ForwardIterator __f, _ForwardIterator __t,
2826 _UniformRandomNumberGenerator& __urng)
2827 { this->__generate_impl(__f, __t, __urng); }
2829 template<
typename _ForwardIterator,
2830 typename _UniformRandomNumberGenerator>
2832 __generate(_ForwardIterator __f, _ForwardIterator __t,
2833 _UniformRandomNumberGenerator& __urng,
2834 const param_type& __p)
2837 this->__generate_impl(__f, __t, __urng, __p2); }
2839 template<
typename _UniformRandomNumberGenerator>
2841 __generate(result_type* __f, result_type* __t,
2842 _UniformRandomNumberGenerator& __urng)
2843 { this->__generate_impl(__f, __t, __urng); }
2845 template<
typename _UniformRandomNumberGenerator>
2847 __generate(result_type* __f, result_type* __t,
2848 _UniformRandomNumberGenerator& __urng,
2849 const param_type& __p)
2852 this->__generate_impl(__f, __t, __urng, __p2); }
2862 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
2874 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2875 friend std::basic_ostream<_CharT, _Traits>&
2876 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2889 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2890 friend std::basic_istream<_CharT, _Traits>&
2891 operator>>(std::basic_istream<_CharT, _Traits>& __is,
2895 template<
typename _ForwardIterator,
2896 typename _UniformRandomNumberGenerator>
2898 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2899 _UniformRandomNumberGenerator& __urng);
2901 template<
typename _ForwardIterator,
2902 typename _UniformRandomNumberGenerator>
2904 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2905 _UniformRandomNumberGenerator& __urng,
2909 param_type _M_param;
2917 template<
typename _RealType>
2921 {
return !(__d1 == __d2); }
2930 template<
typename _RealType =
double>
2933 static_assert(std::is_floating_point<_RealType>::value,
2934 "template argument not a floating point type");
2938 typedef _RealType result_type;
2945 param_type(_RealType __a = _RealType(0),
2946 _RealType __b = _RealType(1))
2947 : _M_a(__a), _M_b(__b)
2959 operator==(
const param_type& __p1,
const param_type& __p2)
2960 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
2969 _RealType __b = _RealType(1))
2970 : _M_param(__a, __b)
2990 {
return _M_param.a(); }
2994 {
return _M_param.b(); }
3001 {
return _M_param; }
3008 param(
const param_type& __param)
3009 { _M_param = __param; }
3016 {
return std::numeric_limits<result_type>::lowest(); }
3028 template<
typename _UniformRandomNumberGenerator>
3030 operator()(_UniformRandomNumberGenerator& __urng)
3031 {
return this->operator()(__urng, _M_param); }
3033 template<
typename _UniformRandomNumberGenerator>
3035 operator()(_UniformRandomNumberGenerator& __urng,
3036 const param_type& __p);
3038 template<
typename _ForwardIterator,
3039 typename _UniformRandomNumberGenerator>
3041 __generate(_ForwardIterator __f, _ForwardIterator __t,
3042 _UniformRandomNumberGenerator& __urng)
3043 { this->__generate(__f, __t, __urng, _M_param); }
3045 template<
typename _ForwardIterator,
3046 typename _UniformRandomNumberGenerator>
3048 __generate(_ForwardIterator __f, _ForwardIterator __t,
3049 _UniformRandomNumberGenerator& __urng,
3050 const param_type& __p)
3051 { this->__generate_impl(__f, __t, __urng, __p); }
3053 template<
typename _UniformRandomNumberGenerator>
3055 __generate(result_type* __f, result_type* __t,
3056 _UniformRandomNumberGenerator& __urng,
3057 const param_type& __p)
3058 { this->__generate_impl(__f, __t, __urng, __p); }
3067 {
return __d1._M_param == __d2._M_param; }
3070 template<
typename _ForwardIterator,
3071 typename _UniformRandomNumberGenerator>
3073 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3074 _UniformRandomNumberGenerator& __urng,
3075 const param_type& __p);
3077 param_type _M_param;
3084 template<
typename _RealType>
3088 {
return !(__d1 == __d2); }
3100 template<
typename _RealType,
typename _CharT,
typename _Traits>
3101 std::basic_ostream<_CharT, _Traits>&
3102 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3115 template<
typename _RealType,
typename _CharT,
typename _Traits>
3116 std::basic_istream<_CharT, _Traits>&
3117 operator>>(std::basic_istream<_CharT, _Traits>& __is,
3131 template<
typename _RealType =
double>
3134 static_assert(std::is_floating_point<_RealType>::value,
3135 "template argument not a floating point type");
3139 typedef _RealType result_type;
3146 param_type(_RealType __m = _RealType(1),
3147 _RealType __n = _RealType(1))
3148 : _M_m(__m), _M_n(__n)
3160 operator==(
const param_type& __p1,
const param_type& __p2)
3161 {
return __p1._M_m == __p2._M_m && __p1._M_n == __p2._M_n; }
3170 _RealType __n = _RealType(1))
3171 : _M_param(__m, __n), _M_gd_x(__m / 2), _M_gd_y(__n / 2)
3176 : _M_param(__p), _M_gd_x(__p.m() / 2), _M_gd_y(__p.n() / 2)
3194 {
return _M_param.m(); }
3198 {
return _M_param.n(); }
3205 {
return _M_param; }
3212 param(
const param_type& __param)
3213 { _M_param = __param; }
3220 {
return result_type(0); }
3232 template<
typename _UniformRandomNumberGenerator>
3234 operator()(_UniformRandomNumberGenerator& __urng)
3235 {
return (_M_gd_x(__urng) * n()) / (_M_gd_y(__urng) * m()); }
3237 template<
typename _UniformRandomNumberGenerator>
3239 operator()(_UniformRandomNumberGenerator& __urng,
3240 const param_type& __p)
3244 return ((_M_gd_x(__urng, param_type(__p.m() / 2)) * n())
3245 / (_M_gd_y(__urng, param_type(__p.n() / 2)) * m()));
3248 template<
typename _ForwardIterator,
3249 typename _UniformRandomNumberGenerator>
3251 __generate(_ForwardIterator __f, _ForwardIterator __t,
3252 _UniformRandomNumberGenerator& __urng)
3253 { this->__generate_impl(__f, __t, __urng); }
3255 template<
typename _ForwardIterator,
3256 typename _UniformRandomNumberGenerator>
3258 __generate(_ForwardIterator __f, _ForwardIterator __t,
3259 _UniformRandomNumberGenerator& __urng,
3260 const param_type& __p)
3261 { this->__generate_impl(__f, __t, __urng, __p); }
3263 template<
typename _UniformRandomNumberGenerator>
3265 __generate(result_type* __f, result_type* __t,
3266 _UniformRandomNumberGenerator& __urng)
3267 { this->__generate_impl(__f, __t, __urng); }
3269 template<
typename _UniformRandomNumberGenerator>
3271 __generate(result_type* __f, result_type* __t,
3272 _UniformRandomNumberGenerator& __urng,
3273 const param_type& __p)
3274 { this->__generate_impl(__f, __t, __urng, __p); }
3284 {
return (__d1._M_param == __d2._M_param
3285 && __d1._M_gd_x == __d2._M_gd_x
3286 && __d1._M_gd_y == __d2._M_gd_y); }
3298 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3299 friend std::basic_ostream<_CharT, _Traits>&
3300 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3313 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3314 friend std::basic_istream<_CharT, _Traits>&
3315 operator>>(std::basic_istream<_CharT, _Traits>& __is,
3319 template<
typename _ForwardIterator,
3320 typename _UniformRandomNumberGenerator>
3322 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3323 _UniformRandomNumberGenerator& __urng);
3325 template<
typename _ForwardIterator,
3326 typename _UniformRandomNumberGenerator>
3328 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3329 _UniformRandomNumberGenerator& __urng,
3330 const param_type& __p);
3332 param_type _M_param;
3340 template<
typename _RealType>
3344 {
return !(__d1 == __d2); }
3355 template<
typename _RealType =
double>
3358 static_assert(std::is_floating_point<_RealType>::value,
3359 "template argument not a floating point type");
3363 typedef _RealType result_type;
3370 param_type(_RealType __n = _RealType(1))
3379 operator==(
const param_type& __p1,
const param_type& __p2)
3380 {
return __p1._M_n == __p2._M_n; }
3388 : _M_param(__n), _M_nd(), _M_gd(__n / 2, 2)
3393 : _M_param(__p), _M_nd(), _M_gd(__p.n() / 2, 2)
3411 {
return _M_param.n(); }
3418 {
return _M_param; }
3425 param(
const param_type& __param)
3426 { _M_param = __param; }
3433 {
return std::numeric_limits<result_type>::lowest(); }
3445 template<
typename _UniformRandomNumberGenerator>
3447 operator()(_UniformRandomNumberGenerator& __urng)
3448 {
return _M_nd(__urng) * std::sqrt(n() / _M_gd(__urng)); }
3450 template<
typename _UniformRandomNumberGenerator>
3452 operator()(_UniformRandomNumberGenerator& __urng,
3453 const param_type& __p)
3458 const result_type __g = _M_gd(__urng, param_type(__p.n() / 2, 2));
3459 return _M_nd(__urng) * std::sqrt(__p.n() / __g);
3462 template<
typename _ForwardIterator,
3463 typename _UniformRandomNumberGenerator>
3465 __generate(_ForwardIterator __f, _ForwardIterator __t,
3466 _UniformRandomNumberGenerator& __urng)
3467 { this->__generate_impl(__f, __t, __urng); }
3469 template<
typename _ForwardIterator,
3470 typename _UniformRandomNumberGenerator>
3472 __generate(_ForwardIterator __f, _ForwardIterator __t,
3473 _UniformRandomNumberGenerator& __urng,
3474 const param_type& __p)
3475 { this->__generate_impl(__f, __t, __urng, __p); }
3477 template<
typename _UniformRandomNumberGenerator>
3479 __generate(result_type* __f, result_type* __t,
3480 _UniformRandomNumberGenerator& __urng)
3481 { this->__generate_impl(__f, __t, __urng); }
3483 template<
typename _UniformRandomNumberGenerator>
3485 __generate(result_type* __f, result_type* __t,
3486 _UniformRandomNumberGenerator& __urng,
3487 const param_type& __p)
3488 { this->__generate_impl(__f, __t, __urng, __p); }
3498 {
return (__d1._M_param == __d2._M_param
3499 && __d1._M_nd == __d2._M_nd && __d1._M_gd == __d2._M_gd); }
3511 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3512 friend std::basic_ostream<_CharT, _Traits>&
3513 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3526 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3527 friend std::basic_istream<_CharT, _Traits>&
3528 operator>>(std::basic_istream<_CharT, _Traits>& __is,
3532 template<
typename _ForwardIterator,
3533 typename _UniformRandomNumberGenerator>
3535 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3536 _UniformRandomNumberGenerator& __urng);
3537 template<
typename _ForwardIterator,
3538 typename _UniformRandomNumberGenerator>
3540 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3541 _UniformRandomNumberGenerator& __urng,
3542 const param_type& __p);
3544 param_type _M_param;
3553 template<
typename _RealType>
3557 {
return !(__d1 == __d2); }
3588 _GLIBCXX_DEBUG_ASSERT((_M_p >= 0.0) && (_M_p <= 1.0));
3597 {
return __p1._M_p == __p2._M_p; }
3633 {
return _M_param.p(); }
3640 {
return _M_param; }
3648 { _M_param = __param; }
3667 template<
typename _UniformRandomNumberGenerator>
3670 {
return this->
operator()(__urng, _M_param); }
3672 template<
typename _UniformRandomNumberGenerator>
3674 operator()(_UniformRandomNumberGenerator& __urng,
3675 const param_type& __p)
3677 __detail::_Adaptor<_UniformRandomNumberGenerator, double>
3679 if ((__aurng() - __aurng.min())
3680 < __p.p() * (__aurng.max() - __aurng.min()))
3685 template<
typename _ForwardIterator,
3686 typename _UniformRandomNumberGenerator>
3688 __generate(_ForwardIterator __f, _ForwardIterator __t,
3689 _UniformRandomNumberGenerator& __urng)
3690 { this->__generate(__f, __t, __urng, _M_param); }
3692 template<
typename _ForwardIterator,
3693 typename _UniformRandomNumberGenerator>
3695 __generate(_ForwardIterator __f, _ForwardIterator __t,
3696 _UniformRandomNumberGenerator& __urng,
const param_type& __p)
3697 { this->__generate_impl(__f, __t, __urng, __p); }
3699 template<
typename _UniformRandomNumberGenerator>
3701 __generate(result_type* __f, result_type* __t,
3702 _UniformRandomNumberGenerator& __urng,
3703 const param_type& __p)
3704 { this->__generate_impl(__f, __t, __urng, __p); }
3713 {
return __d1._M_param == __d2._M_param; }
3716 template<
typename _ForwardIterator,
3717 typename _UniformRandomNumberGenerator>
3719 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3720 _UniformRandomNumberGenerator& __urng,
3721 const param_type& __p);
3723 param_type _M_param;
3733 {
return !(__d1 == __d2); }
3745 template<
typename _CharT,
typename _Traits>
3746 std::basic_ostream<_CharT, _Traits>&
3747 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3759 template<
typename _CharT,
typename _Traits>
3760 std::basic_istream<_CharT, _Traits>&
3778 template<
typename _IntType =
int>
3781 static_assert(std::is_integral<_IntType>::value,
3782 "template argument not an integral type");
3786 typedef _IntType result_type;
3794 param_type(_IntType __t = _IntType(1),
double __p = 0.5)
3795 : _M_t(__t), _M_p(__p)
3797 _GLIBCXX_DEBUG_ASSERT((_M_t >= _IntType(0))
3812 operator==(
const param_type& __p1,
const param_type& __p2)
3813 {
return __p1._M_t == __p2._M_t && __p1._M_p == __p2._M_p; }
3823 #if _GLIBCXX_USE_C99_MATH_TR1
3824 double _M_d1, _M_d2, _M_s1, _M_s2, _M_c,
3825 _M_a1, _M_a123, _M_s, _M_lf, _M_lp1p;
3834 : _M_param(__t, __p), _M_nd()
3839 : _M_param(__p), _M_nd()
3854 {
return _M_param.t(); }
3861 {
return _M_param.p(); }
3868 {
return _M_param; }
3875 param(
const param_type& __param)
3876 { _M_param = __param; }
3890 {
return _M_param.t(); }
3895 template<
typename _UniformRandomNumberGenerator>
3897 operator()(_UniformRandomNumberGenerator& __urng)
3898 {
return this->operator()(__urng, _M_param); }
3900 template<
typename _UniformRandomNumberGenerator>
3902 operator()(_UniformRandomNumberGenerator& __urng,
3903 const param_type& __p);
3905 template<
typename _ForwardIterator,
3906 typename _UniformRandomNumberGenerator>
3908 __generate(_ForwardIterator __f, _ForwardIterator __t,
3909 _UniformRandomNumberGenerator& __urng)
3910 { this->__generate(__f, __t, __urng, _M_param); }
3912 template<
typename _ForwardIterator,
3913 typename _UniformRandomNumberGenerator>
3915 __generate(_ForwardIterator __f, _ForwardIterator __t,
3916 _UniformRandomNumberGenerator& __urng,
3917 const param_type& __p)
3918 { this->__generate_impl(__f, __t, __urng, __p); }
3920 template<
typename _UniformRandomNumberGenerator>
3922 __generate(result_type* __f, result_type* __t,
3923 _UniformRandomNumberGenerator& __urng,
3924 const param_type& __p)
3925 { this->__generate_impl(__f, __t, __urng, __p); }
3935 #ifdef _GLIBCXX_USE_C99_MATH_TR1
3936 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
3938 {
return __d1._M_param == __d2._M_param; }
3951 template<
typename _IntType1,
3952 typename _CharT,
typename _Traits>
3953 friend std::basic_ostream<_CharT, _Traits>&
3954 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3967 template<
typename _IntType1,
3968 typename _CharT,
typename _Traits>
3969 friend std::basic_istream<_CharT, _Traits>&
3970 operator>>(std::basic_istream<_CharT, _Traits>& __is,
3974 template<
typename _ForwardIterator,
3975 typename _UniformRandomNumberGenerator>
3977 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3978 _UniformRandomNumberGenerator& __urng,
3979 const param_type& __p);
3981 template<
typename _UniformRandomNumberGenerator>
3983 _M_waiting(_UniformRandomNumberGenerator& __urng,
3984 _IntType __t,
double __q);
3986 param_type _M_param;
3995 template<
typename _IntType>
3999 {
return !(__d1 == __d2); }
4009 template<
typename _IntType =
int>
4012 static_assert(std::is_integral<_IntType>::value,
4013 "template argument not an integral type");
4017 typedef _IntType result_type;
4025 param_type(
double __p = 0.5)
4028 _GLIBCXX_DEBUG_ASSERT((_M_p > 0.0) && (_M_p < 1.0));
4037 operator==(
const param_type& __p1,
const param_type& __p2)
4038 {
return __p1._M_p == __p2._M_p; }
4043 { _M_log_1_p = std::log(1.0 - _M_p); }
4074 {
return _M_param.p(); }
4081 {
return _M_param; }
4088 param(
const param_type& __param)
4089 { _M_param = __param; }
4108 template<
typename _UniformRandomNumberGenerator>
4110 operator()(_UniformRandomNumberGenerator& __urng)
4111 {
return this->operator()(__urng, _M_param); }
4113 template<
typename _UniformRandomNumberGenerator>
4115 operator()(_UniformRandomNumberGenerator& __urng,
4116 const param_type& __p);
4118 template<
typename _ForwardIterator,
4119 typename _UniformRandomNumberGenerator>
4121 __generate(_ForwardIterator __f, _ForwardIterator __t,
4122 _UniformRandomNumberGenerator& __urng)
4123 { this->__generate(__f, __t, __urng, _M_param); }
4125 template<
typename _ForwardIterator,
4126 typename _UniformRandomNumberGenerator>
4128 __generate(_ForwardIterator __f, _ForwardIterator __t,
4129 _UniformRandomNumberGenerator& __urng,
4130 const param_type& __p)
4131 { this->__generate_impl(__f, __t, __urng, __p); }
4133 template<
typename _UniformRandomNumberGenerator>
4135 __generate(result_type* __f, result_type* __t,
4136 _UniformRandomNumberGenerator& __urng,
4137 const param_type& __p)
4138 { this->__generate_impl(__f, __t, __urng, __p); }
4147 {
return __d1._M_param == __d2._M_param; }
4150 template<
typename _ForwardIterator,
4151 typename _UniformRandomNumberGenerator>
4153 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4154 _UniformRandomNumberGenerator& __urng,
4155 const param_type& __p);
4157 param_type _M_param;
4164 template<
typename _IntType>
4168 {
return !(__d1 == __d2); }
4180 template<
typename _IntType,
4181 typename _CharT,
typename _Traits>
4182 std::basic_ostream<_CharT, _Traits>&
4183 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4195 template<
typename _IntType,
4196 typename _CharT,
typename _Traits>
4197 std::basic_istream<_CharT, _Traits>&
4198 operator>>(std::basic_istream<_CharT, _Traits>& __is,
4209 template<
typename _IntType =
int>
4212 static_assert(std::is_integral<_IntType>::value,
4213 "template argument not an integral type");
4217 typedef _IntType result_type;
4224 param_type(_IntType __k = 1,
double __p = 0.5)
4225 : _M_k(__k), _M_p(__p)
4227 _GLIBCXX_DEBUG_ASSERT((_M_k > 0) && (_M_p > 0.0) && (_M_p <= 1.0));
4239 operator==(
const param_type& __p1,
const param_type& __p2)
4240 {
return __p1._M_k == __p2._M_k && __p1._M_p == __p2._M_p; }
4249 : _M_param(__k, __p), _M_gd(__k, (1.0 - __p) / __p)
4254 : _M_param(__p), _M_gd(__p.k(), (1.0 - __p.p()) / __p.p())
4269 {
return _M_param.k(); }
4276 {
return _M_param.p(); }
4283 {
return _M_param; }
4290 param(
const param_type& __param)
4291 { _M_param = __param; }
4298 {
return result_type(0); }
4310 template<
typename _UniformRandomNumberGenerator>
4312 operator()(_UniformRandomNumberGenerator& __urng);
4314 template<
typename _UniformRandomNumberGenerator>
4316 operator()(_UniformRandomNumberGenerator& __urng,
4317 const param_type& __p);
4319 template<
typename _ForwardIterator,
4320 typename _UniformRandomNumberGenerator>
4322 __generate(_ForwardIterator __f, _ForwardIterator __t,
4323 _UniformRandomNumberGenerator& __urng)
4324 { this->__generate_impl(__f, __t, __urng); }
4326 template<
typename _ForwardIterator,
4327 typename _UniformRandomNumberGenerator>
4329 __generate(_ForwardIterator __f, _ForwardIterator __t,
4330 _UniformRandomNumberGenerator& __urng,
4331 const param_type& __p)
4332 { this->__generate_impl(__f, __t, __urng, __p); }
4334 template<
typename _UniformRandomNumberGenerator>
4336 __generate(result_type* __f, result_type* __t,
4337 _UniformRandomNumberGenerator& __urng)
4338 { this->__generate_impl(__f, __t, __urng); }
4340 template<
typename _UniformRandomNumberGenerator>
4342 __generate(result_type* __f, result_type* __t,
4343 _UniformRandomNumberGenerator& __urng,
4344 const param_type& __p)
4345 { this->__generate_impl(__f, __t, __urng, __p); }
4355 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
4368 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4369 friend std::basic_ostream<_CharT, _Traits>&
4370 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4383 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4384 friend std::basic_istream<_CharT, _Traits>&
4385 operator>>(std::basic_istream<_CharT, _Traits>& __is,
4389 template<
typename _ForwardIterator,
4390 typename _UniformRandomNumberGenerator>
4392 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4393 _UniformRandomNumberGenerator& __urng);
4394 template<
typename _ForwardIterator,
4395 typename _UniformRandomNumberGenerator>
4397 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4398 _UniformRandomNumberGenerator& __urng,
4399 const param_type& __p);
4401 param_type _M_param;
4409 template<
typename _IntType>
4413 {
return !(__d1 == __d2); }
4431 template<
typename _IntType =
int>
4434 static_assert(std::is_integral<_IntType>::value,
4435 "template argument not an integral type");
4439 typedef _IntType result_type;
4447 param_type(
double __mean = 1.0)
4450 _GLIBCXX_DEBUG_ASSERT(_M_mean > 0.0);
4459 operator==(
const param_type& __p1,
const param_type& __p2)
4460 {
return __p1._M_mean == __p2._M_mean; }
4470 #if _GLIBCXX_USE_C99_MATH_TR1
4471 double _M_lfm, _M_sm, _M_d, _M_scx, _M_1cx, _M_c2b, _M_cb;
4478 : _M_param(__mean), _M_nd()
4483 : _M_param(__p), _M_nd()
4498 {
return _M_param.mean(); }
4505 {
return _M_param; }
4512 param(
const param_type& __param)
4513 { _M_param = __param; }
4532 template<
typename _UniformRandomNumberGenerator>
4534 operator()(_UniformRandomNumberGenerator& __urng)
4535 {
return this->operator()(__urng, _M_param); }
4537 template<
typename _UniformRandomNumberGenerator>
4539 operator()(_UniformRandomNumberGenerator& __urng,
4540 const param_type& __p);
4542 template<
typename _ForwardIterator,
4543 typename _UniformRandomNumberGenerator>
4545 __generate(_ForwardIterator __f, _ForwardIterator __t,
4546 _UniformRandomNumberGenerator& __urng)
4547 { this->__generate(__f, __t, __urng, _M_param); }
4549 template<
typename _ForwardIterator,
4550 typename _UniformRandomNumberGenerator>
4552 __generate(_ForwardIterator __f, _ForwardIterator __t,
4553 _UniformRandomNumberGenerator& __urng,
4554 const param_type& __p)
4555 { this->__generate_impl(__f, __t, __urng, __p); }
4557 template<
typename _UniformRandomNumberGenerator>
4559 __generate(result_type* __f, result_type* __t,
4560 _UniformRandomNumberGenerator& __urng,
4561 const param_type& __p)
4562 { this->__generate_impl(__f, __t, __urng, __p); }
4572 #ifdef _GLIBCXX_USE_C99_MATH_TR1
4573 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
4575 {
return __d1._M_param == __d2._M_param; }
4588 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4589 friend std::basic_ostream<_CharT, _Traits>&
4590 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4603 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4604 friend std::basic_istream<_CharT, _Traits>&
4605 operator>>(std::basic_istream<_CharT, _Traits>& __is,
4609 template<
typename _ForwardIterator,
4610 typename _UniformRandomNumberGenerator>
4612 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4613 _UniformRandomNumberGenerator& __urng,
4614 const param_type& __p);
4616 param_type _M_param;
4625 template<
typename _IntType>
4629 {
return !(__d1 == __d2); }
4647 template<
typename _RealType =
double>
4650 static_assert(std::is_floating_point<_RealType>::value,
4651 "template argument not a floating point type");
4655 typedef _RealType result_type;
4662 param_type(_RealType __lambda = _RealType(1))
4663 : _M_lambda(__lambda)
4665 _GLIBCXX_DEBUG_ASSERT(_M_lambda > _RealType(0));
4670 {
return _M_lambda; }
4673 operator==(
const param_type& __p1,
const param_type& __p2)
4674 {
return __p1._M_lambda == __p2._M_lambda; }
4677 _RealType _M_lambda;
4687 : _M_param(__lambda)
4708 {
return _M_param.lambda(); }
4715 {
return _M_param; }
4722 param(
const param_type& __param)
4723 { _M_param = __param; }
4730 {
return result_type(0); }
4742 template<
typename _UniformRandomNumberGenerator>
4744 operator()(_UniformRandomNumberGenerator& __urng)
4745 {
return this->operator()(__urng, _M_param); }
4747 template<
typename _UniformRandomNumberGenerator>
4749 operator()(_UniformRandomNumberGenerator& __urng,
4750 const param_type& __p)
4752 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
4754 return -std::log(result_type(1) - __aurng()) / __p.lambda();
4757 template<
typename _ForwardIterator,
4758 typename _UniformRandomNumberGenerator>
4760 __generate(_ForwardIterator __f, _ForwardIterator __t,
4761 _UniformRandomNumberGenerator& __urng)
4762 { this->__generate(__f, __t, __urng, _M_param); }
4764 template<
typename _ForwardIterator,
4765 typename _UniformRandomNumberGenerator>
4767 __generate(_ForwardIterator __f, _ForwardIterator __t,
4768 _UniformRandomNumberGenerator& __urng,
4769 const param_type& __p)
4770 { this->__generate_impl(__f, __t, __urng, __p); }
4772 template<
typename _UniformRandomNumberGenerator>
4774 __generate(result_type* __f, result_type* __t,
4775 _UniformRandomNumberGenerator& __urng,
4776 const param_type& __p)
4777 { this->__generate_impl(__f, __t, __urng, __p); }
4786 {
return __d1._M_param == __d2._M_param; }
4789 template<
typename _ForwardIterator,
4790 typename _UniformRandomNumberGenerator>
4792 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4793 _UniformRandomNumberGenerator& __urng,
4794 const param_type& __p);
4796 param_type _M_param;
4803 template<
typename _RealType>
4807 {
return !(__d1 == __d2); }
4819 template<
typename _RealType,
typename _CharT,
typename _Traits>
4820 std::basic_ostream<_CharT, _Traits>&
4821 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4834 template<
typename _RealType,
typename _CharT,
typename _Traits>
4835 std::basic_istream<_CharT, _Traits>&
4836 operator>>(std::basic_istream<_CharT, _Traits>& __is,
4849 template<
typename _RealType =
double>
4852 static_assert(std::is_floating_point<_RealType>::value,
4853 "template argument not a floating point type");
4857 typedef _RealType result_type;
4864 param_type(_RealType __a = _RealType(1),
4865 _RealType __b = _RealType(1))
4866 : _M_a(__a), _M_b(__b)
4878 operator==(
const param_type& __p1,
const param_type& __p2)
4879 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
4888 _RealType __b = _RealType(1))
4889 : _M_param(__a, __b)
4909 {
return _M_param.a(); }
4916 {
return _M_param.b(); }
4923 {
return _M_param; }
4930 param(
const param_type& __param)
4931 { _M_param = __param; }
4938 {
return result_type(0); }
4950 template<
typename _UniformRandomNumberGenerator>
4952 operator()(_UniformRandomNumberGenerator& __urng)
4953 {
return this->operator()(__urng, _M_param); }
4955 template<
typename _UniformRandomNumberGenerator>
4957 operator()(_UniformRandomNumberGenerator& __urng,
4958 const param_type& __p);
4960 template<
typename _ForwardIterator,
4961 typename _UniformRandomNumberGenerator>
4963 __generate(_ForwardIterator __f, _ForwardIterator __t,
4964 _UniformRandomNumberGenerator& __urng)
4965 { this->__generate(__f, __t, __urng, _M_param); }
4967 template<
typename _ForwardIterator,
4968 typename _UniformRandomNumberGenerator>
4970 __generate(_ForwardIterator __f, _ForwardIterator __t,
4971 _UniformRandomNumberGenerator& __urng,
4972 const param_type& __p)
4973 { this->__generate_impl(__f, __t, __urng, __p); }
4975 template<
typename _UniformRandomNumberGenerator>
4977 __generate(result_type* __f, result_type* __t,
4978 _UniformRandomNumberGenerator& __urng,
4979 const param_type& __p)
4980 { this->__generate_impl(__f, __t, __urng, __p); }
4989 {
return __d1._M_param == __d2._M_param; }
4992 template<
typename _ForwardIterator,
4993 typename _UniformRandomNumberGenerator>
4995 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4996 _UniformRandomNumberGenerator& __urng,
4997 const param_type& __p);
4999 param_type _M_param;
5006 template<
typename _RealType>
5010 {
return !(__d1 == __d2); }
5022 template<
typename _RealType,
typename _CharT,
typename _Traits>
5023 std::basic_ostream<_CharT, _Traits>&
5024 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5037 template<
typename _RealType,
typename _CharT,
typename _Traits>
5038 std::basic_istream<_CharT, _Traits>&
5039 operator>>(std::basic_istream<_CharT, _Traits>& __is,
5052 template<
typename _RealType =
double>
5055 static_assert(std::is_floating_point<_RealType>::value,
5056 "template argument not a floating point type");
5060 typedef _RealType result_type;
5067 param_type(_RealType __a = _RealType(0),
5068 _RealType __b = _RealType(1))
5069 : _M_a(__a), _M_b(__b)
5081 operator==(
const param_type& __p1,
const param_type& __p2)
5082 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
5091 _RealType __b = _RealType(1))
5092 : _M_param(__a, __b)
5112 {
return _M_param.a(); }
5119 {
return _M_param.b(); }
5126 {
return _M_param; }
5133 param(
const param_type& __param)
5134 { _M_param = __param; }
5141 {
return std::numeric_limits<result_type>::lowest(); }
5153 template<
typename _UniformRandomNumberGenerator>
5155 operator()(_UniformRandomNumberGenerator& __urng)
5156 {
return this->operator()(__urng, _M_param); }
5158 template<
typename _UniformRandomNumberGenerator>
5160 operator()(_UniformRandomNumberGenerator& __urng,
5161 const param_type& __p);
5163 template<
typename _ForwardIterator,
5164 typename _UniformRandomNumberGenerator>
5166 __generate(_ForwardIterator __f, _ForwardIterator __t,
5167 _UniformRandomNumberGenerator& __urng)
5168 { this->__generate(__f, __t, __urng, _M_param); }
5170 template<
typename _ForwardIterator,
5171 typename _UniformRandomNumberGenerator>
5173 __generate(_ForwardIterator __f, _ForwardIterator __t,
5174 _UniformRandomNumberGenerator& __urng,
5175 const param_type& __p)
5176 { this->__generate_impl(__f, __t, __urng, __p); }
5178 template<
typename _UniformRandomNumberGenerator>
5180 __generate(result_type* __f, result_type* __t,
5181 _UniformRandomNumberGenerator& __urng,
5182 const param_type& __p)
5183 { this->__generate_impl(__f, __t, __urng, __p); }
5192 {
return __d1._M_param == __d2._M_param; }
5195 template<
typename _ForwardIterator,
5196 typename _UniformRandomNumberGenerator>
5198 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5199 _UniformRandomNumberGenerator& __urng,
5200 const param_type& __p);
5202 param_type _M_param;
5209 template<
typename _RealType>
5213 {
return !(__d1 == __d2); }
5225 template<
typename _RealType,
typename _CharT,
typename _Traits>
5226 std::basic_ostream<_CharT, _Traits>&
5227 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5240 template<
typename _RealType,
typename _CharT,
typename _Traits>
5241 std::basic_istream<_CharT, _Traits>&
5242 operator>>(std::basic_istream<_CharT, _Traits>& __is,
5252 template<
typename _IntType =
int>
5255 static_assert(std::is_integral<_IntType>::value,
5256 "template argument not an integral type");
5260 typedef _IntType result_type;
5268 : _M_prob(), _M_cp()
5271 template<
typename _InputIterator>
5272 param_type(_InputIterator __wbegin,
5273 _InputIterator __wend)
5274 : _M_prob(__wbegin, __wend), _M_cp()
5275 { _M_initialize(); }
5277 param_type(initializer_list<double> __wil)
5278 : _M_prob(__wil.begin(), __wil.end()), _M_cp()
5279 { _M_initialize(); }
5281 template<
typename _Func>
5282 param_type(
size_t __nw,
double __xmin,
double __xmax,
5286 param_type(
const param_type&) =
default;
5287 param_type& operator=(
const param_type&) =
default;
5290 probabilities()
const
5294 operator==(
const param_type& __p1,
const param_type& __p2)
5295 {
return __p1._M_prob == __p2._M_prob; }
5309 template<
typename _InputIterator>
5311 _InputIterator __wend)
5312 : _M_param(__wbegin, __wend)
5319 template<
typename _Func>
5322 : _M_param(__nw, __xmin, __xmax, __fw)
5341 probabilities()
const
5343 return _M_param._M_prob.
empty()
5352 {
return _M_param; }
5359 param(
const param_type& __param)
5360 { _M_param = __param; }
5367 {
return result_type(0); }
5375 return _M_param._M_prob.empty()
5376 ? result_type(0) : result_type(_M_param._M_prob.size() - 1);
5382 template<
typename _UniformRandomNumberGenerator>
5384 operator()(_UniformRandomNumberGenerator& __urng)
5385 {
return this->operator()(__urng, _M_param); }
5387 template<
typename _UniformRandomNumberGenerator>
5389 operator()(_UniformRandomNumberGenerator& __urng,
5390 const param_type& __p);
5392 template<
typename _ForwardIterator,
5393 typename _UniformRandomNumberGenerator>
5395 __generate(_ForwardIterator __f, _ForwardIterator __t,
5396 _UniformRandomNumberGenerator& __urng)
5397 { this->__generate(__f, __t, __urng, _M_param); }
5399 template<
typename _ForwardIterator,
5400 typename _UniformRandomNumberGenerator>
5402 __generate(_ForwardIterator __f, _ForwardIterator __t,
5403 _UniformRandomNumberGenerator& __urng,
5404 const param_type& __p)
5405 { this->__generate_impl(__f, __t, __urng, __p); }
5407 template<
typename _UniformRandomNumberGenerator>
5409 __generate(result_type* __f, result_type* __t,
5410 _UniformRandomNumberGenerator& __urng,
5411 const param_type& __p)
5412 { this->__generate_impl(__f, __t, __urng, __p); }
5421 {
return __d1._M_param == __d2._M_param; }
5433 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5434 friend std::basic_ostream<_CharT, _Traits>&
5435 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5449 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5450 friend std::basic_istream<_CharT, _Traits>&
5451 operator>>(std::basic_istream<_CharT, _Traits>& __is,
5455 template<
typename _ForwardIterator,
5456 typename _UniformRandomNumberGenerator>
5458 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5459 _UniformRandomNumberGenerator& __urng,
5460 const param_type& __p);
5462 param_type _M_param;
5469 template<
typename _IntType>
5473 {
return !(__d1 == __d2); }
5482 template<
typename _RealType =
double>
5485 static_assert(std::is_floating_point<_RealType>::value,
5486 "template argument not a floating point type");
5490 typedef _RealType result_type;
5498 : _M_int(), _M_den(), _M_cp()
5501 template<
typename _InputIteratorB,
typename _InputIteratorW>
5502 param_type(_InputIteratorB __bfirst,
5503 _InputIteratorB __bend,
5504 _InputIteratorW __wbegin);
5506 template<
typename _Func>
5507 param_type(initializer_list<_RealType> __bi, _Func __fw);
5509 template<
typename _Func>
5510 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5514 param_type(
const param_type&) =
default;
5515 param_type& operator=(
const param_type&) =
default;
5523 __tmp[1] = _RealType(1);
5535 operator==(
const param_type& __p1,
const param_type& __p2)
5536 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
5552 template<
typename _InputIteratorB,
typename _InputIteratorW>
5554 _InputIteratorB __bend,
5555 _InputIteratorW __wbegin)
5556 : _M_param(__bfirst, __bend, __wbegin)
5559 template<
typename _Func>
5562 : _M_param(__bl, __fw)
5565 template<
typename _Func>
5567 _RealType __xmin, _RealType __xmax,
5569 : _M_param(__nw, __xmin, __xmax, __fw)
5590 if (_M_param._M_int.empty())
5593 __tmp[1] = _RealType(1);
5597 return _M_param._M_int;
5606 return _M_param._M_den.
empty()
5615 {
return _M_param; }
5622 param(
const param_type& __param)
5623 { _M_param = __param; }
5631 return _M_param._M_int.empty()
5632 ? result_type(0) : _M_param._M_int.front();
5641 return _M_param._M_int.empty()
5642 ? result_type(1) : _M_param._M_int.back();
5648 template<
typename _UniformRandomNumberGenerator>
5650 operator()(_UniformRandomNumberGenerator& __urng)
5651 {
return this->operator()(__urng, _M_param); }
5653 template<
typename _UniformRandomNumberGenerator>
5655 operator()(_UniformRandomNumberGenerator& __urng,
5656 const param_type& __p);
5658 template<
typename _ForwardIterator,
5659 typename _UniformRandomNumberGenerator>
5661 __generate(_ForwardIterator __f, _ForwardIterator __t,
5662 _UniformRandomNumberGenerator& __urng)
5663 { this->__generate(__f, __t, __urng, _M_param); }
5665 template<
typename _ForwardIterator,
5666 typename _UniformRandomNumberGenerator>
5668 __generate(_ForwardIterator __f, _ForwardIterator __t,
5669 _UniformRandomNumberGenerator& __urng,
5670 const param_type& __p)
5671 { this->__generate_impl(__f, __t, __urng, __p); }
5673 template<
typename _UniformRandomNumberGenerator>
5675 __generate(result_type* __f, result_type* __t,
5676 _UniformRandomNumberGenerator& __urng,
5677 const param_type& __p)
5678 { this->__generate_impl(__f, __t, __urng, __p); }
5687 {
return __d1._M_param == __d2._M_param; }
5700 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5701 friend std::basic_ostream<_CharT, _Traits>&
5702 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5716 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5717 friend std::basic_istream<_CharT, _Traits>&
5718 operator>>(std::basic_istream<_CharT, _Traits>& __is,
5722 template<
typename _ForwardIterator,
5723 typename _UniformRandomNumberGenerator>
5725 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5726 _UniformRandomNumberGenerator& __urng,
5727 const param_type& __p);
5729 param_type _M_param;
5736 template<
typename _RealType>
5740 {
return !(__d1 == __d2); }
5749 template<
typename _RealType =
double>
5752 static_assert(std::is_floating_point<_RealType>::value,
5753 "template argument not a floating point type");
5757 typedef _RealType result_type;
5765 : _M_int(), _M_den(), _M_cp(), _M_m()
5768 template<
typename _InputIteratorB,
typename _InputIteratorW>
5769 param_type(_InputIteratorB __bfirst,
5770 _InputIteratorB __bend,
5771 _InputIteratorW __wbegin);
5773 template<
typename _Func>
5774 param_type(initializer_list<_RealType> __bl, _Func __fw);
5776 template<
typename _Func>
5777 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5781 param_type(
const param_type&) =
default;
5782 param_type& operator=(
const param_type&) =
default;
5790 __tmp[1] = _RealType(1);
5802 operator==(
const param_type& __p1,
const param_type& __p2)
5803 {
return (__p1._M_int == __p2._M_int
5804 && __p1._M_den == __p2._M_den); }
5821 template<
typename _InputIteratorB,
typename _InputIteratorW>
5823 _InputIteratorB __bend,
5824 _InputIteratorW __wbegin)
5825 : _M_param(__bfirst, __bend, __wbegin)
5828 template<
typename _Func>
5831 : _M_param(__bl, __fw)
5834 template<
typename _Func>
5836 _RealType __xmin, _RealType __xmax,
5838 : _M_param(__nw, __xmin, __xmax, __fw)
5859 if (_M_param._M_int.empty())
5862 __tmp[1] = _RealType(1);
5866 return _M_param._M_int;
5876 return _M_param._M_den.
empty()
5885 {
return _M_param; }
5892 param(
const param_type& __param)
5893 { _M_param = __param; }
5901 return _M_param._M_int.empty()
5902 ? result_type(0) : _M_param._M_int.front();
5911 return _M_param._M_int.empty()
5912 ? result_type(1) : _M_param._M_int.back();
5918 template<
typename _UniformRandomNumberGenerator>
5920 operator()(_UniformRandomNumberGenerator& __urng)
5921 {
return this->operator()(__urng, _M_param); }
5923 template<
typename _UniformRandomNumberGenerator>
5925 operator()(_UniformRandomNumberGenerator& __urng,
5926 const param_type& __p);
5928 template<
typename _ForwardIterator,
5929 typename _UniformRandomNumberGenerator>
5931 __generate(_ForwardIterator __f, _ForwardIterator __t,
5932 _UniformRandomNumberGenerator& __urng)
5933 { this->__generate(__f, __t, __urng, _M_param); }
5935 template<
typename _ForwardIterator,
5936 typename _UniformRandomNumberGenerator>
5938 __generate(_ForwardIterator __f, _ForwardIterator __t,
5939 _UniformRandomNumberGenerator& __urng,
5940 const param_type& __p)
5941 { this->__generate_impl(__f, __t, __urng, __p); }
5943 template<
typename _UniformRandomNumberGenerator>
5945 __generate(result_type* __f, result_type* __t,
5946 _UniformRandomNumberGenerator& __urng,
5947 const param_type& __p)
5948 { this->__generate_impl(__f, __t, __urng, __p); }
5957 {
return __d1._M_param == __d2._M_param; }
5970 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5971 friend std::basic_ostream<_CharT, _Traits>&
5972 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5986 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5987 friend std::basic_istream<_CharT, _Traits>&
5988 operator>>(std::basic_istream<_CharT, _Traits>& __is,
5992 template<
typename _ForwardIterator,
5993 typename _UniformRandomNumberGenerator>
5995 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5996 _UniformRandomNumberGenerator& __urng,
5997 const param_type& __p);
5999 param_type _M_param;
6006 template<
typename _RealType>
6010 {
return !(__d1 == __d2); }
6039 template<
typename _IntType>
6040 seed_seq(std::initializer_list<_IntType> il);
6042 template<
typename _InputIterator>
6043 seed_seq(_InputIterator __begin, _InputIterator __end);
6046 template<
typename _RandomAccessIterator>
6048 generate(_RandomAccessIterator __begin, _RandomAccessIterator __end);
6052 {
return _M_v.
size(); }
6054 template<
typename OutputIterator>
6056 param(OutputIterator __dest)
const
6057 { std::copy(_M_v.
begin(), _M_v.
end(), __dest); }
6068 _GLIBCXX_END_NAMESPACE_VERSION
One of the math functors.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
The seed_seq class generates sequences of seeds for random number generators.
A discrete binomial random number distribution.
result_type max() const
Returns the least upper bound value of the distribution.
param_type param() const
Returns the parameter set of the distribution.
bool empty() const noexcept
An exponential continuous distribution for random numbers.
A negative_binomial_distribution random number distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
A chi_squared_distribution random number distribution.
Uniform continuous distribution for random numbers.
A discrete geometric random number distribution.
A discrete_distribution random number distribution.
A model of a linear congruential random number generator.
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.
uint_least32_t result_type
friend bool operator==(const bernoulli_distribution &__d1, const bernoulli_distribution &__d2)
Return true if two Bernoulli distributions have the same parameters.
double p() const
Returns the p parameter of the distribution.
A Bernoulli random number distribution.
bool operator!=(const std::piecewise_linear_distribution< _RealType > &__d1, const std::piecewise_linear_distribution< _RealType > &__d2)
Return true if two piecewise linear distributions have different parameters.
ISO C++ entities toplevel namespace is std.
const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
A weibull_distribution random number distribution.
mersenne_twister_engine< uint_fast32_t, 32, 624, 397, 31, 0x9908b0dfUL, 11, 0xffffffffUL, 7, 0x9d2c5680UL, 15, 0xefc60000UL, 18, 1812433253UL > mt19937
bool equal(_II1 __first1, _II1 __last1, _II2 __first2)
Tests a range for element-wise equality.
Uniform discrete distribution for random numbers. A discrete random distribution on the range with e...
void reset()
Resets the distribution state.
iterator begin() noexcept
_RealType generate_canonical(_UniformRandomNumberGenerator &__g)
A function template for converting the output of a (integral) uniform random number generator to a fl...
A piecewise_constant_distribution random number distribution.
A fisher_f_distribution random number distribution.
A normal continuous distribution for random numbers.
A gamma continuous distribution for random numbers.
A lognormal_distribution random number distribution.
bernoulli_distribution(double __p=0.5)
Constructs a Bernoulli distribution with likelihood p.
basic_istream< _CharT, _Traits > & operator>>(basic_istream< _CharT, _Traits > &__is, basic_string< _CharT, _Traits, _Alloc > &__str)
Read stream into a string.
A discrete Poisson random number distribution.
A student_t_distribution random number distribution.
size_type size() const noexcept
void param(const param_type &__param)
Sets the parameter set of the distribution.
mersenne_twister_engine< uint_fast64_t, 64, 312, 156, 31, 0xb5026f5aa96619e9ULL, 29, 0x5555555555555555ULL, 17, 0x71d67fffeda60000ULL, 37, 0xfff7eee000000000ULL, 43, 6364136223846793005ULL > mt19937_64
A standard container which offers fixed time access to individual elements in any order...
A piecewise_linear_distribution random number distribution.
A cauchy_distribution random number distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
linear_congruential_engine< uint_fast32_t, 48271UL, 0UL, 2147483647UL > minstd_rand
A extreme_value_distribution random number distribution.
linear_congruential_engine< uint_fast32_t, 16807UL, 0UL, 2147483647UL > minstd_rand0
Produces random numbers by combining random numbers from some base engine to produce random numbers w...