37 namespace std _GLIBCXX_VISIBILITY(default)
39 _GLIBCXX_BEGIN_NAMESPACE_VERSION
56 template<
typename _RealType,
size_t __bits,
57 typename _UniformRandomNumberGenerator>
61 _GLIBCXX_END_NAMESPACE_VERSION
68 _GLIBCXX_BEGIN_NAMESPACE_VERSION
70 template<
typename _UIntType,
size_t __w,
71 bool = __w < static_cast<size_t>
74 {
static const _UIntType __value = 0; };
76 template<
typename _UIntType,
size_t __w>
77 struct _Shift<_UIntType, __w, true>
78 {
static const _UIntType __value = _UIntType(1) << __w; };
81 int __which = ((__s <= __CHAR_BIT__ *
sizeof (int))
82 + (__s <= __CHAR_BIT__ *
sizeof (long))
83 + (__s <= __CHAR_BIT__ *
sizeof (
long long))
86 struct _Select_uint_least_t
88 static_assert(__which < 0,
89 "sorry, would be too much trouble for a slow result");
93 struct _Select_uint_least_t<__s, 4>
94 {
typedef unsigned int type; };
97 struct _Select_uint_least_t<__s, 3>
98 {
typedef unsigned long type; };
101 struct _Select_uint_least_t<__s, 2>
102 {
typedef unsigned long long type; };
104 #ifdef _GLIBCXX_USE_INT128 106 struct _Select_uint_least_t<__s, 1>
107 {
typedef unsigned __int128 type; };
111 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
112 bool __big_enough = (!(__m & (__m - 1))
113 || (_Tp(-1) - __c) / __a >= __m - 1),
114 bool __schrage_ok = __m % __a < __m / __a>
117 typedef typename _Select_uint_least_t<
std::__lg(__a)
121 {
return static_cast<_Tp
>((_Tp2(__a) * __x + __c) % __m); }
125 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c>
126 struct _Mod<_Tp, __m, __a, __c, false, true>
135 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
bool __s>
136 struct _Mod<_Tp, __m, __a, __c, true, __s>
141 _Tp __res = __a * __x + __c;
148 template<
typename _Tp, _Tp __m, _Tp __a = 1, _Tp __c = 0>
151 {
return _Mod<_Tp, __m, __a, __c>::__calc(__x); }
157 template<
typename _Engine,
typename _DInputType>
161 "template argument must be a floating point type");
164 _Adaptor(_Engine& __g)
169 {
return _DInputType(0); }
173 {
return _DInputType(1); }
192 _GLIBCXX_END_NAMESPACE_VERSION
195 _GLIBCXX_BEGIN_NAMESPACE_VERSION
235 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
238 static_assert(std::is_unsigned<_UIntType>::value,
239 "result_type must be an unsigned integral type");
240 static_assert(__m == 0u || (__a < __m && __c < __m),
241 "template argument substituting __m out of bounds");
248 static constexpr result_type multiplier = __a;
250 static constexpr result_type increment = __c;
253 static constexpr result_type default_seed = 1u;
272 template<
typename _Sseq,
typename =
typename 273 std::enable_if<!std::is_same<_Sseq, linear_congruential_engine>::value>
286 seed(result_type __s = default_seed);
295 template<
typename _Sseq>
296 typename std::enable_if<std::is_class<_Sseq>::value>::type
305 static constexpr result_type
307 {
return __c == 0u ? 1u : 0u; }
312 static constexpr result_type
322 for (; __z != 0ULL; --__z)
332 _M_x = __detail::__mod<_UIntType, __m, __a, __c>(_M_x);
350 {
return __lhs._M_x == __rhs._M_x; }
360 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
361 _UIntType1 __m1,
typename _CharT,
typename _Traits>
363 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
365 __a1, __c1, __m1>& __lcr);
380 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
381 _UIntType1 __m1,
typename _CharT,
typename _Traits>
402 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
408 {
return !(__lhs == __rhs); }
439 template<
typename _UIntType,
size_t __w,
440 size_t __n,
size_t __m,
size_t __r,
441 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
442 _UIntType __b,
size_t __t,
443 _UIntType __c,
size_t __l, _UIntType __f>
446 static_assert(std::is_unsigned<_UIntType>::value,
447 "result_type must be an unsigned integral type");
448 static_assert(1u <= __m && __m <= __n,
449 "template argument substituting __m out of bounds");
450 static_assert(__r <= __w,
"template argument substituting " 452 static_assert(__u <= __w,
"template argument substituting " 454 static_assert(__s <= __w,
"template argument substituting " 456 static_assert(__t <= __w,
"template argument substituting " 458 static_assert(__l <= __w,
"template argument substituting " 461 "template argument substituting __w out of bound");
462 static_assert(__a <= (__detail::_Shift<_UIntType, __w>::__value - 1),
463 "template argument substituting __a out of bound");
464 static_assert(__b <= (__detail::_Shift<_UIntType, __w>::__value - 1),
465 "template argument substituting __b out of bound");
466 static_assert(__c <= (__detail::_Shift<_UIntType, __w>::__value - 1),
467 "template argument substituting __c out of bound");
468 static_assert(__d <= (__detail::_Shift<_UIntType, __w>::__value - 1),
469 "template argument substituting __d out of bound");
470 static_assert(__f <= (__detail::_Shift<_UIntType, __w>::__value - 1),
471 "template argument substituting __f out of bound");
478 static constexpr
size_t word_size = __w;
479 static constexpr
size_t state_size = __n;
480 static constexpr
size_t shift_size = __m;
481 static constexpr
size_t mask_bits = __r;
482 static constexpr result_type xor_mask = __a;
483 static constexpr
size_t tempering_u = __u;
484 static constexpr result_type tempering_d = __d;
485 static constexpr
size_t tempering_s = __s;
486 static constexpr result_type tempering_b = __b;
487 static constexpr
size_t tempering_t = __t;
488 static constexpr result_type tempering_c = __c;
489 static constexpr
size_t tempering_l = __l;
490 static constexpr result_type initialization_multiplier = __f;
491 static constexpr result_type default_seed = 5489u;
504 template<
typename _Sseq,
typename =
typename 505 std::enable_if<!std::is_same<_Sseq, mersenne_twister_engine>::value>
512 seed(result_type __sd = default_seed);
514 template<
typename _Sseq>
515 typename std::enable_if<std::is_class<_Sseq>::value>::type
521 static constexpr result_type
528 static constexpr result_type
530 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
536 discard(
unsigned long long __z);
556 {
return (
std::equal(__lhs._M_x, __lhs._M_x + state_size, __rhs._M_x)
557 && __lhs._M_p == __rhs._M_p); }
571 template<
typename _UIntType1,
572 size_t __w1,
size_t __n1,
573 size_t __m1,
size_t __r1,
574 _UIntType1 __a1,
size_t __u1,
575 _UIntType1 __d1,
size_t __s1,
576 _UIntType1 __b1,
size_t __t1,
577 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
578 typename _CharT,
typename _Traits>
580 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
582 __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
597 template<
typename _UIntType1,
598 size_t __w1,
size_t __n1,
599 size_t __m1,
size_t __r1,
600 _UIntType1 __a1,
size_t __u1,
601 _UIntType1 __d1,
size_t __s1,
602 _UIntType1 __b1,
size_t __t1,
603 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
604 typename _CharT,
typename _Traits>
608 __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
614 _UIntType _M_x[state_size];
630 template<
typename _UIntType,
size_t __w,
631 size_t __n,
size_t __m,
size_t __r,
632 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
633 _UIntType __b,
size_t __t,
634 _UIntType __c,
size_t __l, _UIntType __f>
637 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __lhs,
639 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __rhs)
640 {
return !(__lhs == __rhs); }
658 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
661 static_assert(std::is_unsigned<_UIntType>::value,
662 "result_type must be an unsigned integral type");
663 static_assert(0u < __s && __s < __r,
666 "template argument substituting __w out of bounds");
673 static constexpr
size_t word_size = __w;
674 static constexpr
size_t short_lag = __s;
675 static constexpr
size_t long_lag = __r;
676 static constexpr result_type default_seed = 19780503u;
692 template<
typename _Sseq,
typename =
typename 693 std::enable_if<!std::is_same<_Sseq, subtract_with_carry_engine>::value>
712 seed(result_type __sd = default_seed);
718 template<
typename _Sseq>
719 typename std::enable_if<std::is_class<_Sseq>::value>::type
726 static constexpr result_type
734 static constexpr result_type
736 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
744 for (; __z != 0ULL; --__z)
769 {
return (
std::equal(__lhs._M_x, __lhs._M_x + long_lag, __rhs._M_x)
770 && __lhs._M_carry == __rhs._M_carry
771 && __lhs._M_p == __rhs._M_p); }
785 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
786 typename _CharT,
typename _Traits>
788 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
804 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
805 typename _CharT,
typename _Traits>
813 _UIntType _M_x[long_lag];
830 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
836 {
return !(__lhs == __rhs); }
845 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
848 static_assert(1 <= __r && __r <= __p,
849 "template argument substituting __r out of bounds");
853 typedef typename _RandomNumberEngine::result_type
result_type;
856 static constexpr
size_t block_size = __p;
857 static constexpr
size_t used_block = __r;
865 : _M_b(), _M_n(0) { }
875 : _M_b(__rng), _M_n(0) { }
885 : _M_b(
std::move(__rng)), _M_n(0) { }
895 : _M_b(__s), _M_n(0) { }
902 template<
typename _Sseq,
typename =
typename 903 std::enable_if<!std::is_same<_Sseq, discard_block_engine>::value
904 && !std::is_same<_Sseq, _RandomNumberEngine>::value>
938 template<
typename _Sseq>
950 const _RandomNumberEngine&
957 static constexpr result_type
964 static constexpr result_type
974 for (; __z != 0ULL; --__z)
998 {
return __lhs._M_b == __rhs._M_b && __lhs._M_n == __rhs._M_n; }
1011 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1012 typename _CharT,
typename _Traits>
1014 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1029 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1030 typename _CharT,
typename _Traits>
1037 _RandomNumberEngine _M_b;
1052 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
1058 {
return !(__lhs == __rhs); }
1065 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1068 static_assert(std::is_unsigned<_UIntType>::value,
1069 "result_type must be an unsigned integral type");
1071 "template argument substituting __w out of bounds");
1103 : _M_b(
std::move(__rng)) { }
1120 template<
typename _Sseq,
typename =
typename 1121 std::enable_if<!std::is_same<_Sseq, independent_bits_engine>::value
1122 && !std::is_same<_Sseq, _RandomNumberEngine>::value>
1150 template<
typename _Sseq>
1159 const _RandomNumberEngine&
1166 static constexpr result_type
1173 static constexpr result_type
1175 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1183 for (; __z != 0ULL; --__z)
1208 {
return __lhs._M_b == __rhs._M_b; }
1222 template<
typename _CharT,
typename _Traits>
1226 __w, _UIntType>& __x)
1233 _RandomNumberEngine _M_b;
1248 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1254 {
return !(__lhs == __rhs); }
1266 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType,
1267 typename _CharT,
typename _Traits>
1269 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1271 __w, _UIntType>& __x)
1283 template<
typename _RandomNumberEngine,
size_t __k>
1286 static_assert(1u <= __k,
"template argument substituting " 1287 "__k out of bound");
1291 typedef typename _RandomNumberEngine::result_type
result_type;
1293 static constexpr
size_t table_size = __k;
1302 { _M_initialize(); }
1313 { _M_initialize(); }
1323 : _M_b(
std::move(__rng))
1324 { _M_initialize(); }
1335 { _M_initialize(); }
1342 template<
typename _Sseq,
typename =
typename 1343 std::enable_if<!std::is_same<_Sseq, shuffle_order_engine>::value
1344 && !std::is_same<_Sseq, _RandomNumberEngine>::value>
1349 { _M_initialize(); }
1378 template<
typename _Sseq>
1389 const _RandomNumberEngine&
1396 static constexpr result_type
1403 static constexpr result_type
1413 for (; __z != 0ULL; --__z)
1437 {
return (__lhs._M_b == __rhs._M_b
1438 &&
std::equal(__lhs._M_v, __lhs._M_v + __k, __rhs._M_v)
1439 && __lhs._M_y == __rhs._M_y); }
1452 template<
typename _RandomNumberEngine1,
size_t __k1,
1453 typename _CharT,
typename _Traits>
1455 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1470 template<
typename _RandomNumberEngine1,
size_t __k1,
1471 typename _CharT,
typename _Traits>
1477 void _M_initialize()
1479 for (
size_t __i = 0; __i < __k; ++__i)
1484 _RandomNumberEngine _M_b;
1485 result_type _M_v[__k];
1500 template<
typename _RandomNumberEngine,
size_t __k>
1506 {
return !(__lhs == __rhs); }
1543 0xb5026f5aa96619e9ULL, 29,
1544 0x5555555555555555ULL, 17,
1545 0x71d67fffeda60000ULL, 37,
1546 0xfff7eee000000000ULL, 43,
1575 #ifdef _GLIBCXX_USE_RANDOM_TR1 1590 { _M_init_pretr1(__token); }
1596 static constexpr result_type
1600 static constexpr result_type
1605 entropy()
const noexcept
1611 #ifdef _GLIBCXX_USE_RANDOM_TR1 1612 return this->_M_getval();
1614 return this->_M_getval_pretr1();
1628 result_type _M_getval();
1629 result_type _M_getval_pretr1();
1658 template<
typename _IntType>
1662 {
return !(__d1 == __d2); }
1674 template<
typename _IntType,
typename _CharT,
typename _Traits>
1676 operator<<(std::basic_ostream<_CharT, _Traits>&,
1688 template<
typename _IntType,
typename _CharT,
typename _Traits>
1701 template<
typename _RealType =
double>
1705 "result_type must be a floating point type");
1718 _RealType __b = _RealType(1))
1719 : _M_a(__a), _M_b(__b)
1721 __glibcxx_assert(_M_a <= _M_b);
1734 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
1738 {
return !(__p1 == __p2); }
1754 _RealType __b = _RealType(1))
1755 : _M_param(__a, __b)
1773 {
return _M_param.a(); }
1777 {
return _M_param.b(); }
1784 {
return _M_param; }
1792 { _M_param = __param; }
1799 {
return this->a(); }
1806 {
return this->b(); }
1811 template<
typename _UniformRandomNumberGenerator>
1814 {
return this->operator()(__urng, _M_param); }
1816 template<
typename _UniformRandomNumberGenerator>
1818 operator()(_UniformRandomNumberGenerator& __urng,
1821 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
1823 return (__aurng() * (__p.b() - __p.a())) + __p.a();
1826 template<
typename _ForwardIterator,
1827 typename _UniformRandomNumberGenerator>
1829 __generate(_ForwardIterator __f, _ForwardIterator __t,
1830 _UniformRandomNumberGenerator& __urng)
1831 { this->__generate(__f, __t, __urng, _M_param); }
1833 template<
typename _ForwardIterator,
1834 typename _UniformRandomNumberGenerator>
1836 __generate(_ForwardIterator __f, _ForwardIterator __t,
1837 _UniformRandomNumberGenerator& __urng,
1839 { this->__generate_impl(__f, __t, __urng, __p); }
1841 template<
typename _UniformRandomNumberGenerator>
1843 __generate(result_type* __f, result_type* __t,
1844 _UniformRandomNumberGenerator& __urng,
1846 { this->__generate_impl(__f, __t, __urng, __p); }
1855 {
return __d1._M_param == __d2._M_param; }
1858 template<
typename _ForwardIterator,
1859 typename _UniformRandomNumberGenerator>
1861 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
1862 _UniformRandomNumberGenerator& __urng,
1872 template<
typename _IntType>
1876 {
return !(__d1 == __d2); }
1888 template<
typename _RealType,
typename _CharT,
typename _Traits>
1890 operator<<(std::basic_ostream<_CharT, _Traits>&,
1902 template<
typename _RealType,
typename _CharT,
typename _Traits>
1924 template<
typename _RealType =
double>
1928 "result_type must be a floating point type");
1941 _RealType __stddev = _RealType(1))
1942 : _M_mean(__mean), _M_stddev(__stddev)
1944 __glibcxx_assert(_M_stddev > _RealType(0));
1953 {
return _M_stddev; }
1957 {
return (__p1._M_mean == __p2._M_mean
1958 && __p1._M_stddev == __p2._M_stddev); }
1962 {
return !(__p1 == __p2); }
1966 _RealType _M_stddev;
1976 result_type __stddev = result_type(1))
1977 : _M_param(__mean, __stddev), _M_saved_available(false)
1982 : _M_param(__p), _M_saved_available(
false)
1990 { _M_saved_available =
false; }
1997 {
return _M_param.mean(); }
2004 {
return _M_param.stddev(); }
2011 {
return _M_param; }
2019 { _M_param = __param; }
2038 template<
typename _UniformRandomNumberGenerator>
2041 {
return this->operator()(__urng, _M_param); }
2043 template<
typename _UniformRandomNumberGenerator>
2045 operator()(_UniformRandomNumberGenerator& __urng,
2046 const param_type& __p);
2048 template<
typename _ForwardIterator,
2049 typename _UniformRandomNumberGenerator>
2051 __generate(_ForwardIterator __f, _ForwardIterator __t,
2052 _UniformRandomNumberGenerator& __urng)
2053 { this->__generate(__f, __t, __urng, _M_param); }
2055 template<
typename _ForwardIterator,
2056 typename _UniformRandomNumberGenerator>
2058 __generate(_ForwardIterator __f, _ForwardIterator __t,
2059 _UniformRandomNumberGenerator& __urng,
2060 const param_type& __p)
2061 { this->__generate_impl(__f, __t, __urng, __p); }
2063 template<
typename _UniformRandomNumberGenerator>
2065 __generate(result_type* __f, result_type* __t,
2066 _UniformRandomNumberGenerator& __urng,
2067 const param_type& __p)
2068 { this->__generate_impl(__f, __t, __urng, __p); }
2075 template<
typename _RealType1>
2090 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2092 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2105 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2111 template<
typename _ForwardIterator,
2112 typename _UniformRandomNumberGenerator>
2114 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2115 _UniformRandomNumberGenerator& __urng,
2116 const param_type& __p);
2118 param_type _M_param;
2119 result_type _M_saved;
2120 bool _M_saved_available;
2126 template<
typename _RealType>
2130 {
return !(__d1 == __d2); }
2142 template<
typename _RealType =
double>
2146 "result_type must be a floating point type");
2159 _RealType __s = _RealType(1))
2160 : _M_m(__m), _M_s(__s)
2173 {
return __p1._M_m == __p2._M_m && __p1._M_s == __p2._M_s; }
2177 {
return !(__p1 == __p2); }
2186 _RealType __s = _RealType(1))
2187 : _M_param(__m, __s), _M_nd()
2192 : _M_param(__p), _M_nd()
2207 {
return _M_param.m(); }
2211 {
return _M_param.s(); }
2218 {
return _M_param; }
2226 { _M_param = __param; }
2233 {
return result_type(0); }
2245 template<
typename _UniformRandomNumberGenerator>
2248 {
return this->operator()(__urng, _M_param); }
2250 template<
typename _UniformRandomNumberGenerator>
2252 operator()(_UniformRandomNumberGenerator& __urng,
2254 {
return std::exp(__p.s() * _M_nd(__urng) + __p.m()); }
2256 template<
typename _ForwardIterator,
2257 typename _UniformRandomNumberGenerator>
2259 __generate(_ForwardIterator __f, _ForwardIterator __t,
2260 _UniformRandomNumberGenerator& __urng)
2261 { this->__generate(__f, __t, __urng, _M_param); }
2263 template<
typename _ForwardIterator,
2264 typename _UniformRandomNumberGenerator>
2266 __generate(_ForwardIterator __f, _ForwardIterator __t,
2267 _UniformRandomNumberGenerator& __urng,
2269 { this->__generate_impl(__f, __t, __urng, __p); }
2271 template<
typename _UniformRandomNumberGenerator>
2273 __generate(result_type* __f, result_type* __t,
2274 _UniformRandomNumberGenerator& __urng,
2276 { this->__generate_impl(__f, __t, __urng, __p); }
2286 {
return (__d1._M_param == __d2._M_param
2287 && __d1._M_nd == __d2._M_nd); }
2299 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2301 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2314 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2320 template<
typename _ForwardIterator,
2321 typename _UniformRandomNumberGenerator>
2323 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2324 _UniformRandomNumberGenerator& __urng,
2335 template<
typename _RealType>
2339 {
return !(__d1 == __d2); }
2351 template<
typename _RealType =
double>
2355 "result_type must be a floating point type");
2368 param_type(_RealType __alpha_val = _RealType(1),
2369 _RealType __beta_val = _RealType(1))
2370 : _M_alpha(__alpha_val), _M_beta(__beta_val)
2372 __glibcxx_assert(_M_alpha > _RealType(0));
2378 {
return _M_alpha; }
2385 operator==(
const param_type& __p1,
const param_type& __p2)
2386 {
return (__p1._M_alpha == __p2._M_alpha
2387 && __p1._M_beta == __p2._M_beta); }
2390 operator!=(
const param_type& __p1,
const param_type& __p2)
2391 {
return !(__p1 == __p2); }
2400 _RealType _M_malpha, _M_a2;
2410 _RealType __beta_val = _RealType(1))
2411 : _M_param(__alpha_val, __beta_val), _M_nd()
2416 : _M_param(__p), _M_nd()
2431 {
return _M_param.alpha(); }
2438 {
return _M_param.beta(); }
2445 {
return _M_param; }
2453 { _M_param = __param; }
2460 {
return result_type(0); }
2472 template<
typename _UniformRandomNumberGenerator>
2475 {
return this->operator()(__urng, _M_param); }
2477 template<
typename _UniformRandomNumberGenerator>
2479 operator()(_UniformRandomNumberGenerator& __urng,
2480 const param_type& __p);
2482 template<
typename _ForwardIterator,
2483 typename _UniformRandomNumberGenerator>
2485 __generate(_ForwardIterator __f, _ForwardIterator __t,
2486 _UniformRandomNumberGenerator& __urng)
2487 { this->__generate(__f, __t, __urng, _M_param); }
2489 template<
typename _ForwardIterator,
2490 typename _UniformRandomNumberGenerator>
2492 __generate(_ForwardIterator __f, _ForwardIterator __t,
2493 _UniformRandomNumberGenerator& __urng,
2494 const param_type& __p)
2495 { this->__generate_impl(__f, __t, __urng, __p); }
2497 template<
typename _UniformRandomNumberGenerator>
2499 __generate(result_type* __f, result_type* __t,
2500 _UniformRandomNumberGenerator& __urng,
2501 const param_type& __p)
2502 { this->__generate_impl(__f, __t, __urng, __p); }
2512 {
return (__d1._M_param == __d2._M_param
2513 && __d1._M_nd == __d2._M_nd); }
2525 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2527 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2539 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2545 template<
typename _ForwardIterator,
2546 typename _UniformRandomNumberGenerator>
2548 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2549 _UniformRandomNumberGenerator& __urng,
2550 const param_type& __p);
2552 param_type _M_param;
2560 template<
typename _RealType>
2564 {
return !(__d1 == __d2); }
2573 template<
typename _RealType =
double>
2577 "result_type must be a floating point type");
2599 {
return __p1._M_n == __p2._M_n; }
2603 {
return !(__p1 == __p2); }
2611 : _M_param(__n), _M_gd(__n / 2)
2616 : _M_param(__p), _M_gd(__p.n() / 2)
2631 {
return _M_param.n(); }
2638 {
return _M_param; }
2650 _M_gd.param(param_type{__param.n() / 2});
2658 {
return result_type(0); }
2670 template<
typename _UniformRandomNumberGenerator>
2673 {
return 2 * _M_gd(__urng); }
2675 template<
typename _UniformRandomNumberGenerator>
2677 operator()(_UniformRandomNumberGenerator& __urng,
2682 return 2 * _M_gd(__urng, param_type(__p.n() / 2));
2685 template<
typename _ForwardIterator,
2686 typename _UniformRandomNumberGenerator>
2688 __generate(_ForwardIterator __f, _ForwardIterator __t,
2689 _UniformRandomNumberGenerator& __urng)
2690 { this->__generate_impl(__f, __t, __urng); }
2692 template<
typename _ForwardIterator,
2693 typename _UniformRandomNumberGenerator>
2695 __generate(_ForwardIterator __f, _ForwardIterator __t,
2696 _UniformRandomNumberGenerator& __urng,
2700 this->__generate_impl(__f, __t, __urng, __p2); }
2702 template<
typename _UniformRandomNumberGenerator>
2704 __generate(result_type* __f, result_type* __t,
2705 _UniformRandomNumberGenerator& __urng)
2706 { this->__generate_impl(__f, __t, __urng); }
2708 template<
typename _UniformRandomNumberGenerator>
2710 __generate(result_type* __f, result_type* __t,
2711 _UniformRandomNumberGenerator& __urng,
2715 this->__generate_impl(__f, __t, __urng, __p2); }
2725 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
2737 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2739 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2752 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2758 template<
typename _ForwardIterator,
2759 typename _UniformRandomNumberGenerator>
2761 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2762 _UniformRandomNumberGenerator& __urng);
2764 template<
typename _ForwardIterator,
2765 typename _UniformRandomNumberGenerator>
2767 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2768 _UniformRandomNumberGenerator& __urng,
2780 template<
typename _RealType>
2784 {
return !(__d1 == __d2); }
2793 template<
typename _RealType =
double>
2797 "result_type must be a floating point type");
2810 _RealType __b = _RealType(1))
2811 : _M_a(__a), _M_b(__b)
2824 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
2828 {
return !(__p1 == __p2); }
2837 _RealType __b = _RealType(1))
2838 : _M_param(__a, __b)
2858 {
return _M_param.a(); }
2862 {
return _M_param.b(); }
2869 {
return _M_param; }
2877 { _M_param = __param; }
2896 template<
typename _UniformRandomNumberGenerator>
2899 {
return this->operator()(__urng, _M_param); }
2901 template<
typename _UniformRandomNumberGenerator>
2903 operator()(_UniformRandomNumberGenerator& __urng,
2906 template<
typename _ForwardIterator,
2907 typename _UniformRandomNumberGenerator>
2909 __generate(_ForwardIterator __f, _ForwardIterator __t,
2910 _UniformRandomNumberGenerator& __urng)
2911 { this->__generate(__f, __t, __urng, _M_param); }
2913 template<
typename _ForwardIterator,
2914 typename _UniformRandomNumberGenerator>
2916 __generate(_ForwardIterator __f, _ForwardIterator __t,
2917 _UniformRandomNumberGenerator& __urng,
2919 { this->__generate_impl(__f, __t, __urng, __p); }
2921 template<
typename _UniformRandomNumberGenerator>
2923 __generate(result_type* __f, result_type* __t,
2924 _UniformRandomNumberGenerator& __urng,
2926 { this->__generate_impl(__f, __t, __urng, __p); }
2935 {
return __d1._M_param == __d2._M_param; }
2938 template<
typename _ForwardIterator,
2939 typename _UniformRandomNumberGenerator>
2941 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2942 _UniformRandomNumberGenerator& __urng,
2952 template<
typename _RealType>
2956 {
return !(__d1 == __d2); }
2968 template<
typename _RealType,
typename _CharT,
typename _Traits>
2970 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2983 template<
typename _RealType,
typename _CharT,
typename _Traits>
2999 template<
typename _RealType =
double>
3003 "result_type must be a floating point type");
3016 _RealType __n = _RealType(1))
3017 : _M_m(__m), _M_n(__n)
3030 {
return __p1._M_m == __p2._M_m && __p1._M_n == __p2._M_n; }
3034 {
return !(__p1 == __p2); }
3043 _RealType __n = _RealType(1))
3044 : _M_param(__m, __n), _M_gd_x(__m / 2), _M_gd_y(__n / 2)
3049 : _M_param(__p), _M_gd_x(__p.m() / 2), _M_gd_y(__p.n() / 2)
3067 {
return _M_param.m(); }
3071 {
return _M_param.n(); }
3078 {
return _M_param; }
3086 { _M_param = __param; }
3093 {
return result_type(0); }
3105 template<
typename _UniformRandomNumberGenerator>
3108 {
return (_M_gd_x(__urng) * n()) / (_M_gd_y(__urng) * m()); }
3110 template<
typename _UniformRandomNumberGenerator>
3112 operator()(_UniformRandomNumberGenerator& __urng,
3117 return ((_M_gd_x(__urng, param_type(__p.m() / 2)) * n())
3118 / (_M_gd_y(__urng, param_type(__p.n() / 2)) * m()));
3121 template<
typename _ForwardIterator,
3122 typename _UniformRandomNumberGenerator>
3124 __generate(_ForwardIterator __f, _ForwardIterator __t,
3125 _UniformRandomNumberGenerator& __urng)
3126 { this->__generate_impl(__f, __t, __urng); }
3128 template<
typename _ForwardIterator,
3129 typename _UniformRandomNumberGenerator>
3131 __generate(_ForwardIterator __f, _ForwardIterator __t,
3132 _UniformRandomNumberGenerator& __urng,
3134 { this->__generate_impl(__f, __t, __urng, __p); }
3136 template<
typename _UniformRandomNumberGenerator>
3138 __generate(result_type* __f, result_type* __t,
3139 _UniformRandomNumberGenerator& __urng)
3140 { this->__generate_impl(__f, __t, __urng); }
3142 template<
typename _UniformRandomNumberGenerator>
3144 __generate(result_type* __f, result_type* __t,
3145 _UniformRandomNumberGenerator& __urng,
3147 { this->__generate_impl(__f, __t, __urng, __p); }
3157 {
return (__d1._M_param == __d2._M_param
3158 && __d1._M_gd_x == __d2._M_gd_x
3159 && __d1._M_gd_y == __d2._M_gd_y); }
3171 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3173 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3186 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3192 template<
typename _ForwardIterator,
3193 typename _UniformRandomNumberGenerator>
3195 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3196 _UniformRandomNumberGenerator& __urng);
3198 template<
typename _ForwardIterator,
3199 typename _UniformRandomNumberGenerator>
3201 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3202 _UniformRandomNumberGenerator& __urng,
3213 template<
typename _RealType>
3217 {
return !(__d1 == __d2); }
3228 template<
typename _RealType =
double>
3232 "result_type must be a floating point type");
3254 {
return __p1._M_n == __p2._M_n; }
3258 {
return !(__p1 == __p2); }
3266 : _M_param(__n), _M_nd(), _M_gd(__n / 2, 2)
3271 : _M_param(__p), _M_nd(), _M_gd(__p.n() / 2, 2)
3289 {
return _M_param.n(); }
3296 {
return _M_param; }
3304 { _M_param = __param; }
3323 template<
typename _UniformRandomNumberGenerator>
3326 {
return _M_nd(__urng) *
std::sqrt(n() / _M_gd(__urng)); }
3328 template<
typename _UniformRandomNumberGenerator>
3330 operator()(_UniformRandomNumberGenerator& __urng,
3336 const result_type __g = _M_gd(__urng, param_type(__p.n() / 2, 2));
3337 return _M_nd(__urng) *
std::sqrt(__p.n() / __g);
3340 template<
typename _ForwardIterator,
3341 typename _UniformRandomNumberGenerator>
3343 __generate(_ForwardIterator __f, _ForwardIterator __t,
3344 _UniformRandomNumberGenerator& __urng)
3345 { this->__generate_impl(__f, __t, __urng); }
3347 template<
typename _ForwardIterator,
3348 typename _UniformRandomNumberGenerator>
3350 __generate(_ForwardIterator __f, _ForwardIterator __t,
3351 _UniformRandomNumberGenerator& __urng,
3353 { this->__generate_impl(__f, __t, __urng, __p); }
3355 template<
typename _UniformRandomNumberGenerator>
3357 __generate(result_type* __f, result_type* __t,
3358 _UniformRandomNumberGenerator& __urng)
3359 { this->__generate_impl(__f, __t, __urng); }
3361 template<
typename _UniformRandomNumberGenerator>
3363 __generate(result_type* __f, result_type* __t,
3364 _UniformRandomNumberGenerator& __urng,
3366 { this->__generate_impl(__f, __t, __urng, __p); }
3376 {
return (__d1._M_param == __d2._M_param
3377 && __d1._M_nd == __d2._M_nd && __d1._M_gd == __d2._M_gd); }
3389 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3391 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3404 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3410 template<
typename _ForwardIterator,
3411 typename _UniformRandomNumberGenerator>
3413 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3414 _UniformRandomNumberGenerator& __urng);
3415 template<
typename _ForwardIterator,
3416 typename _UniformRandomNumberGenerator>
3418 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3419 _UniformRandomNumberGenerator& __urng,
3431 template<
typename _RealType>
3435 {
return !(__d1 == __d2); }
3467 __glibcxx_assert((_M_p >= 0.0) && (_M_p <= 1.0));
3476 {
return __p1._M_p == __p2._M_p; }
3480 {
return !(__p1 == __p2); }
3516 {
return _M_param.p(); }
3523 {
return _M_param; }
3531 { _M_param = __param; }
3550 template<
typename _UniformRandomNumberGenerator>
3553 {
return this->operator()(__urng, _M_param); }
3555 template<
typename _UniformRandomNumberGenerator>
3557 operator()(_UniformRandomNumberGenerator& __urng,
3560 __detail::_Adaptor<_UniformRandomNumberGenerator, double>
3562 if ((__aurng() - __aurng.min())
3563 < __p.p() * (__aurng.max() - __aurng.min()))
3568 template<
typename _ForwardIterator,
3569 typename _UniformRandomNumberGenerator>
3571 __generate(_ForwardIterator __f, _ForwardIterator __t,
3572 _UniformRandomNumberGenerator& __urng)
3573 { this->__generate(__f, __t, __urng, _M_param); }
3575 template<
typename _ForwardIterator,
3576 typename _UniformRandomNumberGenerator>
3578 __generate(_ForwardIterator __f, _ForwardIterator __t,
3579 _UniformRandomNumberGenerator& __urng,
const param_type& __p)
3580 { this->__generate_impl(__f, __t, __urng, __p); }
3582 template<
typename _UniformRandomNumberGenerator>
3584 __generate(result_type* __f, result_type* __t,
3585 _UniformRandomNumberGenerator& __urng,
3587 { this->__generate_impl(__f, __t, __urng, __p); }
3596 {
return __d1._M_param == __d2._M_param; }
3599 template<
typename _ForwardIterator,
3600 typename _UniformRandomNumberGenerator>
3602 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3603 _UniformRandomNumberGenerator& __urng,
3616 {
return !(__d1 == __d2); }
3628 template<
typename _CharT,
typename _Traits>
3630 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3642 template<
typename _CharT,
typename _Traits>
3661 template<
typename _IntType =
int>
3665 "result_type must be an integral type");
3678 param_type(_IntType __t = _IntType(1),
double __p = 0.5)
3679 : _M_t(__t), _M_p(__p)
3681 __glibcxx_assert((_M_t >= _IntType(0))
3696 operator==(
const param_type& __p1,
const param_type& __p2)
3697 {
return __p1._M_t == __p2._M_t && __p1._M_p == __p2._M_p; }
3700 operator!=(
const param_type& __p1,
const param_type& __p2)
3701 {
return !(__p1 == __p2); }
3711 #if _GLIBCXX_USE_C99_MATH_TR1 3712 double _M_d1, _M_d2, _M_s1, _M_s2, _M_c,
3713 _M_a1, _M_a123, _M_s, _M_lf, _M_lp1p;
3722 : _M_param(__t, __p), _M_nd()
3727 : _M_param(__p), _M_nd()
3742 {
return _M_param.t(); }
3749 {
return _M_param.p(); }
3756 {
return _M_param; }
3764 { _M_param = __param; }
3778 {
return _M_param.t(); }
3783 template<
typename _UniformRandomNumberGenerator>
3786 {
return this->operator()(__urng, _M_param); }
3788 template<
typename _UniformRandomNumberGenerator>
3790 operator()(_UniformRandomNumberGenerator& __urng,
3793 template<
typename _ForwardIterator,
3794 typename _UniformRandomNumberGenerator>
3796 __generate(_ForwardIterator __f, _ForwardIterator __t,
3797 _UniformRandomNumberGenerator& __urng)
3798 { this->__generate(__f, __t, __urng, _M_param); }
3800 template<
typename _ForwardIterator,
3801 typename _UniformRandomNumberGenerator>
3803 __generate(_ForwardIterator __f, _ForwardIterator __t,
3804 _UniformRandomNumberGenerator& __urng,
3806 { this->__generate_impl(__f, __t, __urng, __p); }
3808 template<
typename _UniformRandomNumberGenerator>
3811 _UniformRandomNumberGenerator& __urng,
3813 { this->__generate_impl(__f, __t, __urng, __p); }
3823 #ifdef _GLIBCXX_USE_C99_MATH_TR1 3824 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
3826 {
return __d1._M_param == __d2._M_param; }
3839 template<
typename _IntType1,
3840 typename _CharT,
typename _Traits>
3842 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3855 template<
typename _IntType1,
3856 typename _CharT,
typename _Traits>
3862 template<
typename _ForwardIterator,
3863 typename _UniformRandomNumberGenerator>
3865 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3866 _UniformRandomNumberGenerator& __urng,
3869 template<
typename _UniformRandomNumberGenerator>
3871 _M_waiting(_UniformRandomNumberGenerator& __urng,
3872 _IntType __t,
double __q);
3883 template<
typename _IntType>
3887 {
return !(__d1 == __d2); }
3897 template<
typename _IntType =
int>
3901 "result_type must be an integral type");
3917 __glibcxx_assert((_M_p > 0.0) && (_M_p < 1.0));
3926 operator==(
const param_type& __p1,
const param_type& __p2)
3927 {
return __p1._M_p == __p2._M_p; }
3930 operator!=(
const param_type& __p1,
const param_type& __p2)
3931 {
return !(__p1 == __p2); }
3936 { _M_log_1_p =
std::log(1.0 - _M_p); }
3967 {
return _M_param.p(); }
3974 {
return _M_param; }
3982 { _M_param = __param; }
4001 template<
typename _UniformRandomNumberGenerator>
4004 {
return this->operator()(__urng, _M_param); }
4006 template<
typename _UniformRandomNumberGenerator>
4008 operator()(_UniformRandomNumberGenerator& __urng,
4011 template<
typename _ForwardIterator,
4012 typename _UniformRandomNumberGenerator>
4014 __generate(_ForwardIterator __f, _ForwardIterator __t,
4015 _UniformRandomNumberGenerator& __urng)
4016 { this->__generate(__f, __t, __urng, _M_param); }
4018 template<
typename _ForwardIterator,
4019 typename _UniformRandomNumberGenerator>
4021 __generate(_ForwardIterator __f, _ForwardIterator __t,
4022 _UniformRandomNumberGenerator& __urng,
4024 { this->__generate_impl(__f, __t, __urng, __p); }
4026 template<
typename _UniformRandomNumberGenerator>
4029 _UniformRandomNumberGenerator& __urng,
4031 { this->__generate_impl(__f, __t, __urng, __p); }
4040 {
return __d1._M_param == __d2._M_param; }
4043 template<
typename _ForwardIterator,
4044 typename _UniformRandomNumberGenerator>
4046 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4047 _UniformRandomNumberGenerator& __urng,
4057 template<
typename _IntType>
4061 {
return !(__d1 == __d2); }
4073 template<
typename _IntType,
4074 typename _CharT,
typename _Traits>
4076 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4088 template<
typename _IntType,
4089 typename _CharT,
typename _Traits>
4102 template<
typename _IntType =
int>
4106 "result_type must be an integral type");
4118 param_type(_IntType __k = 1,
double __p = 0.5)
4119 : _M_k(__k), _M_p(__p)
4121 __glibcxx_assert((_M_k > 0) && (_M_p > 0.0) && (_M_p <= 1.0));
4134 {
return __p1._M_k == __p2._M_k && __p1._M_p == __p2._M_p; }
4138 {
return !(__p1 == __p2); }
4147 : _M_param(__k, __p), _M_gd(__k, (1.0 - __p) / __p)
4152 : _M_param(__p), _M_gd(__p.k(), (1.0 - __p.p()) / __p.p())
4167 {
return _M_param.k(); }
4174 {
return _M_param.p(); }
4181 {
return _M_param; }
4189 { _M_param = __param; }
4208 template<
typename _UniformRandomNumberGenerator>
4210 operator()(_UniformRandomNumberGenerator& __urng);
4212 template<
typename _UniformRandomNumberGenerator>
4214 operator()(_UniformRandomNumberGenerator& __urng,
4217 template<
typename _ForwardIterator,
4218 typename _UniformRandomNumberGenerator>
4220 __generate(_ForwardIterator __f, _ForwardIterator __t,
4221 _UniformRandomNumberGenerator& __urng)
4222 { this->__generate_impl(__f, __t, __urng); }
4224 template<
typename _ForwardIterator,
4225 typename _UniformRandomNumberGenerator>
4227 __generate(_ForwardIterator __f, _ForwardIterator __t,
4228 _UniformRandomNumberGenerator& __urng,
4230 { this->__generate_impl(__f, __t, __urng, __p); }
4232 template<
typename _UniformRandomNumberGenerator>
4235 _UniformRandomNumberGenerator& __urng)
4236 { this->__generate_impl(__f, __t, __urng); }
4238 template<
typename _UniformRandomNumberGenerator>
4241 _UniformRandomNumberGenerator& __urng,
4243 { this->__generate_impl(__f, __t, __urng, __p); }
4253 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
4266 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4268 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4281 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4287 template<
typename _ForwardIterator,
4288 typename _UniformRandomNumberGenerator>
4290 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4291 _UniformRandomNumberGenerator& __urng);
4292 template<
typename _ForwardIterator,
4293 typename _UniformRandomNumberGenerator>
4295 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4296 _UniformRandomNumberGenerator& __urng,
4307 template<
typename _IntType>
4311 {
return !(__d1 == __d2); }
4329 template<
typename _IntType =
int>
4333 "result_type must be an integral type");
4349 __glibcxx_assert(_M_mean > 0.0);
4358 operator==(
const param_type& __p1,
const param_type& __p2)
4359 {
return __p1._M_mean == __p2._M_mean; }
4362 operator!=(
const param_type& __p1,
const param_type& __p2)
4363 {
return !(__p1 == __p2); }
4373 #if _GLIBCXX_USE_C99_MATH_TR1 4374 double _M_lfm, _M_sm, _M_d, _M_scx, _M_1cx, _M_c2b, _M_cb;
4381 : _M_param(__mean), _M_nd()
4386 : _M_param(__p), _M_nd()
4401 {
return _M_param.mean(); }
4408 {
return _M_param; }
4416 { _M_param = __param; }
4435 template<
typename _UniformRandomNumberGenerator>
4438 {
return this->operator()(__urng, _M_param); }
4440 template<
typename _UniformRandomNumberGenerator>
4442 operator()(_UniformRandomNumberGenerator& __urng,
4445 template<
typename _ForwardIterator,
4446 typename _UniformRandomNumberGenerator>
4448 __generate(_ForwardIterator __f, _ForwardIterator __t,
4449 _UniformRandomNumberGenerator& __urng)
4450 { this->__generate(__f, __t, __urng, _M_param); }
4452 template<
typename _ForwardIterator,
4453 typename _UniformRandomNumberGenerator>
4455 __generate(_ForwardIterator __f, _ForwardIterator __t,
4456 _UniformRandomNumberGenerator& __urng,
4458 { this->__generate_impl(__f, __t, __urng, __p); }
4460 template<
typename _UniformRandomNumberGenerator>
4463 _UniformRandomNumberGenerator& __urng,
4465 { this->__generate_impl(__f, __t, __urng, __p); }
4475 #ifdef _GLIBCXX_USE_C99_MATH_TR1 4476 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
4478 {
return __d1._M_param == __d2._M_param; }
4491 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4493 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4506 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4512 template<
typename _ForwardIterator,
4513 typename _UniformRandomNumberGenerator>
4515 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4516 _UniformRandomNumberGenerator& __urng,
4528 template<
typename _IntType>
4532 {
return !(__d1 == __d2); }
4550 template<
typename _RealType =
double>
4554 "result_type must be a floating point type");
4566 param_type(_RealType __lambda = _RealType(1))
4567 : _M_lambda(__lambda)
4569 __glibcxx_assert(_M_lambda > _RealType(0));
4574 {
return _M_lambda; }
4578 {
return __p1._M_lambda == __p2._M_lambda; }
4582 {
return !(__p1 == __p2); }
4585 _RealType _M_lambda;
4595 : _M_param(__lambda)
4616 {
return _M_param.lambda(); }
4623 {
return _M_param; }
4631 { _M_param = __param; }
4650 template<
typename _UniformRandomNumberGenerator>
4653 {
return this->operator()(__urng, _M_param); }
4655 template<
typename _UniformRandomNumberGenerator>
4657 operator()(_UniformRandomNumberGenerator& __urng,
4660 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
4665 template<
typename _ForwardIterator,
4666 typename _UniformRandomNumberGenerator>
4668 __generate(_ForwardIterator __f, _ForwardIterator __t,
4669 _UniformRandomNumberGenerator& __urng)
4670 { this->__generate(__f, __t, __urng, _M_param); }
4672 template<
typename _ForwardIterator,
4673 typename _UniformRandomNumberGenerator>
4675 __generate(_ForwardIterator __f, _ForwardIterator __t,
4676 _UniformRandomNumberGenerator& __urng,
4678 { this->__generate_impl(__f, __t, __urng, __p); }
4680 template<
typename _UniformRandomNumberGenerator>
4683 _UniformRandomNumberGenerator& __urng,
4685 { this->__generate_impl(__f, __t, __urng, __p); }
4694 {
return __d1._M_param == __d2._M_param; }
4697 template<
typename _ForwardIterator,
4698 typename _UniformRandomNumberGenerator>
4700 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4701 _UniformRandomNumberGenerator& __urng,
4711 template<
typename _RealType>
4715 {
return !(__d1 == __d2); }
4727 template<
typename _RealType,
typename _CharT,
typename _Traits>
4729 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4742 template<
typename _RealType,
typename _CharT,
typename _Traits>
4757 template<
typename _RealType =
double>
4761 "result_type must be a floating point type");
4774 _RealType __b = _RealType(1))
4775 : _M_a(__a), _M_b(__b)
4788 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
4792 {
return !(__p1 == __p2); }
4801 _RealType __b = _RealType(1))
4802 : _M_param(__a, __b)
4822 {
return _M_param.a(); }
4829 {
return _M_param.b(); }
4836 {
return _M_param; }
4844 { _M_param = __param; }
4863 template<
typename _UniformRandomNumberGenerator>
4866 {
return this->operator()(__urng, _M_param); }
4868 template<
typename _UniformRandomNumberGenerator>
4870 operator()(_UniformRandomNumberGenerator& __urng,
4873 template<
typename _ForwardIterator,
4874 typename _UniformRandomNumberGenerator>
4876 __generate(_ForwardIterator __f, _ForwardIterator __t,
4877 _UniformRandomNumberGenerator& __urng)
4878 { this->__generate(__f, __t, __urng, _M_param); }
4880 template<
typename _ForwardIterator,
4881 typename _UniformRandomNumberGenerator>
4883 __generate(_ForwardIterator __f, _ForwardIterator __t,
4884 _UniformRandomNumberGenerator& __urng,
4886 { this->__generate_impl(__f, __t, __urng, __p); }
4888 template<
typename _UniformRandomNumberGenerator>
4891 _UniformRandomNumberGenerator& __urng,
4893 { this->__generate_impl(__f, __t, __urng, __p); }
4902 {
return __d1._M_param == __d2._M_param; }
4905 template<
typename _ForwardIterator,
4906 typename _UniformRandomNumberGenerator>
4908 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4909 _UniformRandomNumberGenerator& __urng,
4919 template<
typename _RealType>
4923 {
return !(__d1 == __d2); }
4935 template<
typename _RealType,
typename _CharT,
typename _Traits>
4937 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4950 template<
typename _RealType,
typename _CharT,
typename _Traits>
4965 template<
typename _RealType =
double>
4969 "result_type must be a floating point type");
4982 _RealType __b = _RealType(1))
4983 : _M_a(__a), _M_b(__b)
4996 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
5000 {
return !(__p1 == __p2); }
5009 _RealType __b = _RealType(1))
5010 : _M_param(__a, __b)
5030 {
return _M_param.a(); }
5037 {
return _M_param.b(); }
5044 {
return _M_param; }
5052 { _M_param = __param; }
5071 template<
typename _UniformRandomNumberGenerator>
5074 {
return this->operator()(__urng, _M_param); }
5076 template<
typename _UniformRandomNumberGenerator>
5078 operator()(_UniformRandomNumberGenerator& __urng,
5081 template<
typename _ForwardIterator,
5082 typename _UniformRandomNumberGenerator>
5084 __generate(_ForwardIterator __f, _ForwardIterator __t,
5085 _UniformRandomNumberGenerator& __urng)
5086 { this->__generate(__f, __t, __urng, _M_param); }
5088 template<
typename _ForwardIterator,
5089 typename _UniformRandomNumberGenerator>
5091 __generate(_ForwardIterator __f, _ForwardIterator __t,
5092 _UniformRandomNumberGenerator& __urng,
5094 { this->__generate_impl(__f, __t, __urng, __p); }
5096 template<
typename _UniformRandomNumberGenerator>
5099 _UniformRandomNumberGenerator& __urng,
5101 { this->__generate_impl(__f, __t, __urng, __p); }
5110 {
return __d1._M_param == __d2._M_param; }
5113 template<
typename _ForwardIterator,
5114 typename _UniformRandomNumberGenerator>
5116 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5117 _UniformRandomNumberGenerator& __urng,
5127 template<
typename _RealType>
5131 {
return !(__d1 == __d2); }
5143 template<
typename _RealType,
typename _CharT,
typename _Traits>
5145 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5158 template<
typename _RealType,
typename _CharT,
typename _Traits>
5170 template<
typename _IntType =
int>
5174 "result_type must be an integral type");
5187 : _M_prob(), _M_cp()
5190 template<
typename _InputIterator>
5191 param_type(_InputIterator __wbegin,
5192 _InputIterator __wend)
5193 : _M_prob(__wbegin, __wend), _M_cp()
5194 { _M_initialize(); }
5197 : _M_prob(__wil.begin(), __wil.end()), _M_cp()
5198 { _M_initialize(); }
5200 template<
typename _Func>
5201 param_type(
size_t __nw,
double __xmin,
double __xmax,
5205 param_type(
const param_type&) =
default;
5206 param_type& operator=(
const param_type&) =
default;
5209 probabilities()
const 5213 operator==(
const param_type& __p1,
const param_type& __p2)
5214 {
return __p1._M_prob == __p2._M_prob; }
5217 operator!=(
const param_type& __p1,
const param_type& __p2)
5218 {
return !(__p1 == __p2); }
5232 template<
typename _InputIterator>
5234 _InputIterator __wend)
5235 : _M_param(__wbegin, __wend)
5242 template<
typename _Func>
5245 : _M_param(__nw, __xmin, __xmax, __fw)
5266 return _M_param._M_prob.empty()
5275 {
return _M_param; }
5283 { _M_param = __param; }
5298 return _M_param._M_prob.empty()
5305 template<
typename _UniformRandomNumberGenerator>
5308 {
return this->operator()(__urng, _M_param); }
5310 template<
typename _UniformRandomNumberGenerator>
5312 operator()(_UniformRandomNumberGenerator& __urng,
5315 template<
typename _ForwardIterator,
5316 typename _UniformRandomNumberGenerator>
5318 __generate(_ForwardIterator __f, _ForwardIterator __t,
5319 _UniformRandomNumberGenerator& __urng)
5320 { this->__generate(__f, __t, __urng, _M_param); }
5322 template<
typename _ForwardIterator,
5323 typename _UniformRandomNumberGenerator>
5325 __generate(_ForwardIterator __f, _ForwardIterator __t,
5326 _UniformRandomNumberGenerator& __urng,
5328 { this->__generate_impl(__f, __t, __urng, __p); }
5330 template<
typename _UniformRandomNumberGenerator>
5333 _UniformRandomNumberGenerator& __urng,
5335 { this->__generate_impl(__f, __t, __urng, __p); }
5344 {
return __d1._M_param == __d2._M_param; }
5356 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5358 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5372 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5378 template<
typename _ForwardIterator,
5379 typename _UniformRandomNumberGenerator>
5381 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5382 _UniformRandomNumberGenerator& __urng,
5392 template<
typename _IntType>
5396 {
return !(__d1 == __d2); }
5405 template<
typename _RealType =
double>
5409 "result_type must be a floating point type");
5422 : _M_int(), _M_den(), _M_cp()
5425 template<
typename _InputIteratorB,
typename _InputIteratorW>
5426 param_type(_InputIteratorB __bfirst,
5427 _InputIteratorB __bend,
5428 _InputIteratorW __wbegin);
5430 template<
typename _Func>
5433 template<
typename _Func>
5434 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5438 param_type(
const param_type&) =
default;
5439 param_type& operator=(
const param_type&) =
default;
5447 __tmp[1] = _RealType(1);
5459 operator==(
const param_type& __p1,
const param_type& __p2)
5460 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
5463 operator!=(
const param_type& __p1,
const param_type& __p2)
5464 {
return !(__p1 == __p2); }
5480 template<
typename _InputIteratorB,
typename _InputIteratorW>
5482 _InputIteratorB __bend,
5483 _InputIteratorW __wbegin)
5484 : _M_param(__bfirst, __bend, __wbegin)
5487 template<
typename _Func>
5490 : _M_param(__bl, __fw)
5493 template<
typename _Func>
5495 _RealType __xmin, _RealType __xmax,
5497 : _M_param(__nw, __xmin, __xmax, __fw)
5518 if (_M_param._M_int.empty())
5521 __tmp[1] = _RealType(1);
5525 return _M_param._M_int;
5534 return _M_param._M_den.empty()
5543 {
return _M_param; }
5551 { _M_param = __param; }
5559 return _M_param._M_int.empty()
5569 return _M_param._M_int.empty()
5576 template<
typename _UniformRandomNumberGenerator>
5579 {
return this->operator()(__urng, _M_param); }
5581 template<
typename _UniformRandomNumberGenerator>
5583 operator()(_UniformRandomNumberGenerator& __urng,
5586 template<
typename _ForwardIterator,
5587 typename _UniformRandomNumberGenerator>
5589 __generate(_ForwardIterator __f, _ForwardIterator __t,
5590 _UniformRandomNumberGenerator& __urng)
5591 { this->__generate(__f, __t, __urng, _M_param); }
5593 template<
typename _ForwardIterator,
5594 typename _UniformRandomNumberGenerator>
5596 __generate(_ForwardIterator __f, _ForwardIterator __t,
5597 _UniformRandomNumberGenerator& __urng,
5599 { this->__generate_impl(__f, __t, __urng, __p); }
5601 template<
typename _UniformRandomNumberGenerator>
5604 _UniformRandomNumberGenerator& __urng,
5606 { this->__generate_impl(__f, __t, __urng, __p); }
5615 {
return __d1._M_param == __d2._M_param; }
5628 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5630 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5644 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5650 template<
typename _ForwardIterator,
5651 typename _UniformRandomNumberGenerator>
5653 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5654 _UniformRandomNumberGenerator& __urng,
5664 template<
typename _RealType>
5668 {
return !(__d1 == __d2); }
5677 template<
typename _RealType =
double>
5681 "result_type must be a floating point type");
5694 : _M_int(), _M_den(), _M_cp(), _M_m()
5697 template<
typename _InputIteratorB,
typename _InputIteratorW>
5698 param_type(_InputIteratorB __bfirst,
5699 _InputIteratorB __bend,
5700 _InputIteratorW __wbegin);
5702 template<
typename _Func>
5705 template<
typename _Func>
5706 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5710 param_type(
const param_type&) =
default;
5711 param_type& operator=(
const param_type&) =
default;
5719 __tmp[1] = _RealType(1);
5731 operator==(
const param_type& __p1,
const param_type& __p2)
5732 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
5735 operator!=(
const param_type& __p1,
const param_type& __p2)
5736 {
return !(__p1 == __p2); }
5753 template<
typename _InputIteratorB,
typename _InputIteratorW>
5755 _InputIteratorB __bend,
5756 _InputIteratorW __wbegin)
5757 : _M_param(__bfirst, __bend, __wbegin)
5760 template<
typename _Func>
5763 : _M_param(__bl, __fw)
5766 template<
typename _Func>
5768 _RealType __xmin, _RealType __xmax,
5770 : _M_param(__nw, __xmin, __xmax, __fw)
5791 if (_M_param._M_int.
empty())
5794 __tmp[1] = _RealType(1);
5798 return _M_param._M_int;
5808 return _M_param._M_den.
empty()
5817 {
return _M_param; }
5825 { _M_param = __param; }
5833 return _M_param._M_int.
empty()
5843 return _M_param._M_int.
empty()
5850 template<
typename _UniformRandomNumberGenerator>
5853 {
return this->operator()(__urng, _M_param); }
5855 template<
typename _UniformRandomNumberGenerator>
5857 operator()(_UniformRandomNumberGenerator& __urng,
5860 template<
typename _ForwardIterator,
5861 typename _UniformRandomNumberGenerator>
5863 __generate(_ForwardIterator __f, _ForwardIterator __t,
5864 _UniformRandomNumberGenerator& __urng)
5865 { this->__generate(__f, __t, __urng, _M_param); }
5867 template<
typename _ForwardIterator,
5868 typename _UniformRandomNumberGenerator>
5870 __generate(_ForwardIterator __f, _ForwardIterator __t,
5871 _UniformRandomNumberGenerator& __urng,
5873 { this->__generate_impl(__f, __t, __urng, __p); }
5875 template<
typename _UniformRandomNumberGenerator>
5878 _UniformRandomNumberGenerator& __urng,
5880 { this->__generate_impl(__f, __t, __urng, __p); }
5889 {
return __d1._M_param == __d2._M_param; }
5902 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5904 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5918 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5924 template<
typename _ForwardIterator,
5925 typename _UniformRandomNumberGenerator>
5927 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5928 _UniformRandomNumberGenerator& __urng,
5938 template<
typename _RealType>
5942 {
return !(__d1 == __d2); }
5970 template<
typename _IntType>
5973 template<
typename _InputIterator>
5974 seed_seq(_InputIterator __begin, _InputIterator __end);
5977 template<
typename _RandomAccessIterator>
5979 generate(_RandomAccessIterator __begin, _RandomAccessIterator __end);
5982 size_t size()
const noexcept
5983 {
return _M_v.size(); }
5985 template<
typename OutputIterator>
5987 param(OutputIterator __dest)
const 5988 { std::copy(_M_v.begin(), _M_v.end(), __dest); }
6002 _GLIBCXX_END_NAMESPACE_VERSION
static constexpr result_type max()
Gets the maximum value in the generated random number range.
Uniform discrete distribution for random numbers. A discrete random distribution on the range with e...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
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...
_RealType mean() const
Returns the mean of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
independent_bits_engine(_RandomNumberEngine &&__rng)
Move constructs a independent_bits_engine engine.
double mean() const
Returns the distribution parameter mean.
uint_least32_t result_type
param_type param() const
Returns the parameter set of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
_IntType k() const
Return the parameter of the distribution.
A chi_squared_distribution random number distribution.
std::vector< _RealType > intervals() const
Returns a vector of the intervals.
param_type param() const
Returns the parameter set of the distribution.
constexpr int __lg(int __n)
This is a helper function for the sort routines and for random.tcc.
void param(const param_type &__param)
Sets the parameter set of the distribution.
_RealType beta() const
Returns the of the distribution.
shuffle_order_engine(const _RandomNumberEngine &__rng)
Copy constructs a shuffle_order_engine engine.
independent_bits_engine()
Constructs a default independent_bits_engine engine.
static constexpr result_type max()
Gets the maximum value in the generated random number range.
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...
A extreme_value_distribution random number distribution.
param_type param() const
Returns the parameter set of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
shuffle_order_engine()
Constructs a default shuffle_order_engine engine.
void seed(result_type __s)
Reseeds the shuffle_order_engine object with the default seed for the underlying base class generator...
result_type min() const
Returns the greatest lower bound value of the distribution.
std::vector< _RealType > intervals() const
Return the intervals of the distribution.
void seed(_Sseq &__q)
Reseeds the shuffle_order_engine object with the given seed sequence.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
_RealType generate_canonical(_UniformRandomNumberGenerator &__g)
A function template for converting the output of a (integral) uniform random number generator to a fl...
void param(const param_type &__param)
Sets the parameter set of the distribution.
_RealType b() const
Return the parameter of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
friend bool operator==(const fisher_f_distribution &__d1, const fisher_f_distribution &__d2)
Return true if two Fisher f distributions have the same parameters and the sequences that would be ge...
result_type 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...
The seed_seq class generates sequences of seeds for random number generators.
A negative_binomial_distribution random number distribution.
A cauchy_distribution random number distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
The Marsaglia-Zaman generator.
void param(const param_type &__param)
Sets the parameter set 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.
result_type max() const
Returns the least upper bound value of the distribution.
param_type param() const
Returns the parameter set of the distribution.
friend bool operator==(const piecewise_constant_distribution &__d1, const piecewise_constant_distribution &__d2)
Return true if two piecewise constant distributions have the same parameters.
bernoulli_distribution(double __p=0.5)
Constructs a Bernoulli distribution with likelihood p.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
_RealType a() const
Return the parameter of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
result_type min() const
Returns the inclusive lower bound of the distribution range.
_IntType t() const
Returns the distribution t parameter.
subtract_with_carry_engine(result_type __sd=default_seed)
Constructs an explicitly seeded % subtract_with_carry_engine random number generator.
void reset()
Resets the distribution state.
A normal continuous distribution for random numbers.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type max() const
Returns the least upper bound value of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
discard_block_engine()
Constructs a default discard_block_engine engine.
void reset()
Resets the distribution state.
A discrete Poisson random number distribution.
friend bool operator==(const weibull_distribution &__d1, const weibull_distribution &__d2)
Return true if two Weibull distributions have the same parameters.
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine object.
void seed(_Sseq &__q)
Reseeds the independent_bits_engine object with the given seed sequence.
result_type max() const
Returns the least upper bound value of the distribution.
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...
_RealType a() const
Return the parameter of the distribution.
double p() const
Return the parameter of the distribution.
One of the math functors.
Properties of fundamental types.
void reset()
Resets the distribution state.
result_type max() const
Returns the least upper bound value of the distribution.
friend bool operator==(const chi_squared_distribution &__d1, const chi_squared_distribution &__d2)
Return true if two Chi-squared distributions have the same parameters and the sequences that would be...
friend bool operator==(const exponential_distribution &__d1, const exponential_distribution &__d2)
Return true if two exponential distributions have the same parameters.
linear_congruential_engine(_Sseq &__q)
Constructs a linear_congruential_engine random number generator engine seeded from the seed sequence ...
friend bool operator==(const uniform_real_distribution &__d1, const uniform_real_distribution &__d2)
Return true if two uniform real distributions have the same parameters.
void param(const param_type &__param)
Sets the parameter set of the distribution.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
A discrete_distribution random number distribution.
A lognormal_distribution random number distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
param_type param() const
Returns the parameter set of the distribution.
shuffle_order_engine(result_type __s)
Seed constructs a shuffle_order_engine engine.
result_type min() const
Returns the greatest lower bound value of the distribution.
void reset()
Resets the distribution state.
An exponential continuous distribution for random numbers.
static constexpr result_type max()
Gets the largest possible value in the output range.
static constexpr result_type min()
Gets the minimum value in the generated random number range.
static constexpr result_type min()
Gets the inclusive minimum value of the range of random integers returned by this generator...
complex< _Tp > sqrt(const complex< _Tp > &)
Return complex square root of z.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
reference front() noexcept
void reset()
Resets the distribution state.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
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...
result_type max() const
Returns the inclusive upper bound of the distribution range.
exponential_distribution(const result_type &__lambda=result_type(1))
Constructs an exponential distribution with inverse scale parameter .
A fisher_f_distribution 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.
param_type param() const
Returns the parameter set of the distribution.
void reset()
Resets the distribution state.
friend bool operator==(const bernoulli_distribution &__d1, const bernoulli_distribution &__d2)
Return true if two Bernoulli distributions have the same parameters.
static constexpr result_type max()
Gets the largest possible value in the output range.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
_RealType stddev() const
Returns the standard deviation of the distribution.
param_type param() const
Returns 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
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 ...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
bool equal(_IIter1 __first1, _IIter1 __last1, _IIter2 __first2, _IIter2 __last2, _BinaryPredicate __binary_pred)
Tests a range for element-wise equality.
result_type max() const
Returns the least upper bound value of the distribution.
A piecewise_constant_distribution random number distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
A gamma continuous distribution for random numbers.
void reset()
Resets the distribution state.
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...
shuffle_order_engine(_RandomNumberEngine &&__rng)
Move constructs a shuffle_order_engine engine.
void reset()
Resets the distribution state.
param_type param() const
Returns the parameter set of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
double p() const
Returns the distribution parameter p.
friend bool operator==(const negative_binomial_distribution &__d1, const negative_binomial_distribution &__d2)
Return true if two negative binomial distributions have the same parameters and the sequences that wo...
param_type param() const
Returns the parameter set of the distribution.
independent_bits_engine(const _RandomNumberEngine &__rng)
Copy constructs a independent_bits_engine engine.
discard_block_engine(_Sseq &__q)
Generator construct a discard_block_engine engine.
Template class basic_ostream.
result_type max() const
Returns the least upper bound value of the distribution.
friend bool operator==(const extreme_value_distribution &__d1, const extreme_value_distribution &__d2)
Return true if two extreme value distributions have the same parameters.
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...
static constexpr result_type max()
void reset()
Resets the distribution state.
static constexpr result_type min()
Gets the smallest possible value in the output range.
reference back() noexcept
A model of a linear congruential random number generator.
result_type min() const
Returns the greatest lower bound value of the distribution.
void reset()
Resets the distribution state.
A student_t_distribution random number distribution.
param_type param() const
Returns the parameter set of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
ISO C++ entities toplevel namespace is std.
result_type max() const
Returns the least upper bound value of the distribution.
double p() const
Returns the distribution p parameter.
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 min()
A piecewise_linear_distribution random number distribution.
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...
void param(const param_type &__param)
Sets the parameter set of the distribution.
double p() const
Returns the p parameter of the distribution.
std::vector< double > densities() const
Return a vector of the probability densities of the distribution.
std::vector< double > densities() const
Returns a vector of the probability densities.
void param(const param_type &__param)
Sets the parameter set of the distribution.
friend bool operator==(const piecewise_linear_distribution &__d1, const piecewise_linear_distribution &__d2)
Return true if two piecewise linear distributions have the same parameters.
_GLIBCXX14_CONSTEXPR const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
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.
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...
void reset()
Resets the distribution state.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend bool operator==(const discrete_distribution &__d1, const discrete_distribution &__d2)
Return true if two discrete distributions have the same parameters.
result_type min() const
Returns the greatest lower bound value of the distribution.
void seed()
Reseeds the discard_block_engine object with the default seed for the underlying base class generator...
void reset()
Resets the distribution state.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine object.
A Bernoulli random number distribution.
complex< _Tp > exp(const complex< _Tp > &)
Return complex base e exponential of z.
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.
_RealType b() const
Return the parameter of the distribution.
_RealType lambda() const
Returns the inverse scale parameter of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
gamma_distribution(_RealType __alpha_val=_RealType(1), _RealType __beta_val=_RealType(1))
Constructs a gamma distribution with parameters and .
void param(const param_type &__param)
Sets the parameter set of the distribution.
mersenne_twister_engine(_Sseq &__q)
Constructs a mersenne_twister_engine random number generator engine seeded from the seed sequence __q...
bool empty() const noexcept
void reset()
Resets the distribution state.
_RealType alpha() const
Returns the of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
friend bool operator==(const geometric_distribution &__d1, const geometric_distribution &__d2)
Return true if two geometric distributions have the same parameters.
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type max() const
Returns the least upper bound value of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, const _Quoted_string< basic_string< _CharT, _Traits, _Alloc > &, _CharT > &__str)
Extractor for delimited strings. The left and right delimiters can be different.
result_type min() const
Returns the greatest lower bound value of the distribution.
param_type param() const
Returns the parameter set of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
A discrete binomial random number distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
static constexpr result_type min()
Gets the smallest possible value in the output range.
void reset()
Resets the distribution state.
linear_congruential_engine< uint_fast32_t, 48271UL, 0UL, 2147483647UL > minstd_rand
param_type param() const
Returns the parameter set of the 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.
discard_block_engine(const _RandomNumberEngine &__rng)
Copy constructs a discard_block_engine engine.
Template class basic_istream.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void seed(_Sseq &__q)
Reseeds the discard_block_engine object with the given seed sequence.
static constexpr result_type max()
Gets the inclusive maximum value of the range of random integers returned by this generator...
subtract_with_carry_engine(_Sseq &__q)
Constructs a subtract_with_carry_engine random number engine seeded from the seed sequence __q...
__gnu_cxx::__promote_2< _Tpa, _Tpb >::__type beta(_Tpa __a, _Tpb __b)
discard_block_engine(result_type __s)
Seed constructs a discard_block_engine engine.
void reset()
Resets the distribution state.
shuffle_order_engine(_Sseq &__q)
Generator construct a shuffle_order_engine engine.
normal_distribution(result_type __mean=result_type(0), result_type __stddev=result_type(1))
_RandomNumberEngine::result_type result_type
friend bool operator==(const cauchy_distribution &__d1, const cauchy_distribution &__d2)
Return true if two Cauchy distributions have the same parameters.
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...
param_type param() const
Returns the parameter set of the distribution.
param_type param() const
Returns the parameter set of the distribution.
discard_block_engine(_RandomNumberEngine &&__rng)
Move constructs a discard_block_engine engine.
param_type param() const
Returns the parameter set of the distribution.
A discrete geometric random number distribution.
result_type max() const
Returns the least upper bound value of the distribution.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
static constexpr _Tp lowest() noexcept
void seed()
Reseeds the independent_bits_engine object with the default seed for the underlying base class genera...
static constexpr result_type min()
Gets the minimum value in the generated random number range.
void param(const param_type &__param)
Sets the parameter set of the distribution.
independent_bits_engine(result_type __s)
Seed constructs a independent_bits_engine engine.
linear_congruential_engine< uint_fast32_t, 16807UL, 0UL, 2147483647UL > minstd_rand0
static constexpr _Tp min() noexcept
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...
mersenne_twister_engine< uint_fast32_t, 32, 624, 397, 31, 0x9908b0dfUL, 11, 0xffffffffUL, 7, 0x9d2c5680UL, 15, 0xefc60000UL, 18, 1812433253UL > mt19937
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...
_GLIBCXX14_CONSTEXPR const _Tp & max(const _Tp &, const _Tp &)
This does what you think it does.
void seed(result_type __s)
Reseeds the independent_bits_engine object with the default seed for the underlying base class genera...
friend bool operator==(const shuffle_order_engine &__lhs, const shuffle_order_engine &__rhs)
static constexpr _Tp max() noexcept
result_type max() const
Returns the least upper bound value of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type operator()()
Gets the next random number in the sequence.
void reset()
Resets the distribution state.
uniform_real_distribution(_RealType __a=_RealType(0), _RealType __b=_RealType(1))
Constructs a uniform_real_distribution object.
std::vector< double > probabilities() const
Returns the probabilities of the distribution.
void discard(unsigned long long __z)
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.
A weibull_distribution random number distribution.
param_type param() const
Returns the parameter set of the distribution.
Uniform continuous distribution for random numbers.
const _RandomNumberEngine & base() const noexcept
independent_bits_engine(_Sseq &__q)
Generator construct a independent_bits_engine engine.
complex< _Tp > log(const complex< _Tp > &)
Return complex natural logarithm of z.
void param(const param_type &__param)
Sets the parameter set of the distribution.
_RandomNumberEngine::result_type result_type
result_type min() const
Returns the greatest lower bound value 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.