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");
272 template<
typename _Sseq,
typename =
typename
273 std::enable_if<!std::is_same<_Sseq, linear_congruential_engine>::value>
295 template<
typename _Sseq>
296 typename std::enable_if<std::is_class<_Sseq>::value>::type
307 {
return __c == 0u ? 1u : 0u; }
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;
483 static constexpr
size_t tempering_u = __u;
485 static constexpr
size_t tempering_s = __s;
487 static constexpr
size_t tempering_t = __t;
489 static constexpr
size_t tempering_l = __l;
490 static constexpr
result_type initialization_multiplier = __f;
504 template<
typename _Sseq,
typename =
typename
505 std::enable_if<!std::is_same<_Sseq, mersenne_twister_engine>::value>
514 template<
typename _Sseq>
515 typename std::enable_if<std::is_class<_Sseq>::value>::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>
718 template<
typename _Sseq>
719 typename std::enable_if<std::is_class<_Sseq>::value>::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&
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&
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&
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;
1500 template<
typename _RandomNumberEngine,
size_t __k>
1506 {
return !(__lhs == __rhs); }
1512 typedef linear_congruential_engine<uint_fast32_t, 16807UL, 0UL, 2147483647UL>
1543 0xb5026f5aa96619e9ULL, 29,
1544 0x5555555555555555ULL, 17,
1545 0x71d67fffeda60000ULL, 37,
1546 0xfff7eee000000000ULL, 43,
1575 #ifdef _GLIBCXX_USE_RANDOM_TR1
1589 random_device(
const std::string& __token =
"mt19937")
1590 { _M_init_pretr1(__token); }
1605 entropy() const noexcept
1611 #ifdef _GLIBCXX_USE_RANDOM_TR1
1612 return this->_M_getval();
1614 return this->_M_getval_pretr1();
1619 random_device(
const random_device&) =
delete;
1620 void operator=(
const random_device&) =
delete;
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,
1819 const param_type& __p)
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,
1838 const param_type& __p)
1839 { this->__generate_impl(__f, __t, __urng, __p); }
1841 template<
typename _UniformRandomNumberGenerator>
1844 _UniformRandomNumberGenerator& __urng,
1845 const param_type& __p)
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,
1863 const param_type& __p);
1865 param_type _M_param;
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;
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>
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;
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; }
2245 template<
typename _UniformRandomNumberGenerator>
2248 {
return this->
operator()(__urng, _M_param); }
2250 template<
typename _UniformRandomNumberGenerator>
2252 operator()(_UniformRandomNumberGenerator& __urng,
2253 const param_type& __p)
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,
2268 const param_type& __p)
2269 { this->__generate_impl(__f, __t, __urng, __p); }
2271 template<
typename _UniformRandomNumberGenerator>
2274 _UniformRandomNumberGenerator& __urng,
2275 const param_type& __p)
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,
2325 const param_type& __p);
2327 param_type _M_param;
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; }
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>
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; }
2646 { _M_param = __param; }
2665 template<
typename _UniformRandomNumberGenerator>
2668 {
return 2 * _M_gd(__urng); }
2670 template<
typename _UniformRandomNumberGenerator>
2672 operator()(_UniformRandomNumberGenerator& __urng,
2673 const param_type& __p)
2677 return 2 * _M_gd(__urng, param_type(__p.n() / 2));
2680 template<
typename _ForwardIterator,
2681 typename _UniformRandomNumberGenerator>
2683 __generate(_ForwardIterator __f, _ForwardIterator __t,
2684 _UniformRandomNumberGenerator& __urng)
2685 { this->__generate_impl(__f, __t, __urng); }
2687 template<
typename _ForwardIterator,
2688 typename _UniformRandomNumberGenerator>
2690 __generate(_ForwardIterator __f, _ForwardIterator __t,
2691 _UniformRandomNumberGenerator& __urng,
2692 const param_type& __p)
2695 this->__generate_impl(__f, __t, __urng, __p2); }
2697 template<
typename _UniformRandomNumberGenerator>
2700 _UniformRandomNumberGenerator& __urng)
2701 { this->__generate_impl(__f, __t, __urng); }
2703 template<
typename _UniformRandomNumberGenerator>
2706 _UniformRandomNumberGenerator& __urng,
2707 const param_type& __p)
2710 this->__generate_impl(__f, __t, __urng, __p2); }
2720 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
2732 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2734 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2747 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2753 template<
typename _ForwardIterator,
2754 typename _UniformRandomNumberGenerator>
2756 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2757 _UniformRandomNumberGenerator& __urng);
2759 template<
typename _ForwardIterator,
2760 typename _UniformRandomNumberGenerator>
2762 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2763 _UniformRandomNumberGenerator& __urng,
2767 param_type _M_param;
2775 template<
typename _RealType>
2779 {
return !(__d1 == __d2); }
2788 template<
typename _RealType =
double>
2792 "result_type must be a floating point type");
2804 param_type(_RealType __a = _RealType(0),
2805 _RealType __b = _RealType(1))
2806 : _M_a(__a), _M_b(__b)
2818 operator==(
const param_type& __p1,
const param_type& __p2)
2819 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
2822 operator!=(
const param_type& __p1,
const param_type& __p2)
2823 {
return !(__p1 == __p2); }
2832 _RealType __b = _RealType(1))
2833 : _M_param(__a, __b)
2853 {
return _M_param.a(); }
2857 {
return _M_param.b(); }
2864 {
return _M_param; }
2872 { _M_param = __param; }
2891 template<
typename _UniformRandomNumberGenerator>
2894 {
return this->
operator()(__urng, _M_param); }
2896 template<
typename _UniformRandomNumberGenerator>
2898 operator()(_UniformRandomNumberGenerator& __urng,
2899 const param_type& __p);
2901 template<
typename _ForwardIterator,
2902 typename _UniformRandomNumberGenerator>
2904 __generate(_ForwardIterator __f, _ForwardIterator __t,
2905 _UniformRandomNumberGenerator& __urng)
2906 { this->__generate(__f, __t, __urng, _M_param); }
2908 template<
typename _ForwardIterator,
2909 typename _UniformRandomNumberGenerator>
2911 __generate(_ForwardIterator __f, _ForwardIterator __t,
2912 _UniformRandomNumberGenerator& __urng,
2913 const param_type& __p)
2914 { this->__generate_impl(__f, __t, __urng, __p); }
2916 template<
typename _UniformRandomNumberGenerator>
2919 _UniformRandomNumberGenerator& __urng,
2920 const param_type& __p)
2921 { this->__generate_impl(__f, __t, __urng, __p); }
2930 {
return __d1._M_param == __d2._M_param; }
2933 template<
typename _ForwardIterator,
2934 typename _UniformRandomNumberGenerator>
2936 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2937 _UniformRandomNumberGenerator& __urng,
2938 const param_type& __p);
2940 param_type _M_param;
2947 template<
typename _RealType>
2951 {
return !(__d1 == __d2); }
2963 template<
typename _RealType,
typename _CharT,
typename _Traits>
2965 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2978 template<
typename _RealType,
typename _CharT,
typename _Traits>
2994 template<
typename _RealType =
double>
2998 "result_type must be a floating point type");
3010 param_type(_RealType __m = _RealType(1),
3011 _RealType __n = _RealType(1))
3012 : _M_m(__m), _M_n(__n)
3024 operator==(
const param_type& __p1,
const param_type& __p2)
3025 {
return __p1._M_m == __p2._M_m && __p1._M_n == __p2._M_n; }
3028 operator!=(
const param_type& __p1,
const param_type& __p2)
3029 {
return !(__p1 == __p2); }
3038 _RealType __n = _RealType(1))
3039 : _M_param(__m, __n), _M_gd_x(__m / 2), _M_gd_y(__n / 2)
3044 : _M_param(__p), _M_gd_x(__p.m() / 2), _M_gd_y(__p.n() / 2)
3062 {
return _M_param.m(); }
3066 {
return _M_param.n(); }
3073 {
return _M_param; }
3081 { _M_param = __param; }
3100 template<
typename _UniformRandomNumberGenerator>
3103 {
return (_M_gd_x(__urng) * n()) / (_M_gd_y(__urng) * m()); }
3105 template<
typename _UniformRandomNumberGenerator>
3107 operator()(_UniformRandomNumberGenerator& __urng,
3108 const param_type& __p)
3112 return ((_M_gd_x(__urng, param_type(__p.m() / 2)) * n())
3113 / (_M_gd_y(__urng, param_type(__p.n() / 2)) * m()));
3116 template<
typename _ForwardIterator,
3117 typename _UniformRandomNumberGenerator>
3119 __generate(_ForwardIterator __f, _ForwardIterator __t,
3120 _UniformRandomNumberGenerator& __urng)
3121 { this->__generate_impl(__f, __t, __urng); }
3123 template<
typename _ForwardIterator,
3124 typename _UniformRandomNumberGenerator>
3126 __generate(_ForwardIterator __f, _ForwardIterator __t,
3127 _UniformRandomNumberGenerator& __urng,
3128 const param_type& __p)
3129 { this->__generate_impl(__f, __t, __urng, __p); }
3131 template<
typename _UniformRandomNumberGenerator>
3134 _UniformRandomNumberGenerator& __urng)
3135 { this->__generate_impl(__f, __t, __urng); }
3137 template<
typename _UniformRandomNumberGenerator>
3140 _UniformRandomNumberGenerator& __urng,
3141 const param_type& __p)
3142 { this->__generate_impl(__f, __t, __urng, __p); }
3152 {
return (__d1._M_param == __d2._M_param
3153 && __d1._M_gd_x == __d2._M_gd_x
3154 && __d1._M_gd_y == __d2._M_gd_y); }
3166 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3168 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3181 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3187 template<
typename _ForwardIterator,
3188 typename _UniformRandomNumberGenerator>
3190 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3191 _UniformRandomNumberGenerator& __urng);
3193 template<
typename _ForwardIterator,
3194 typename _UniformRandomNumberGenerator>
3196 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3197 _UniformRandomNumberGenerator& __urng,
3198 const param_type& __p);
3200 param_type _M_param;
3208 template<
typename _RealType>
3212 {
return !(__d1 == __d2); }
3223 template<
typename _RealType =
double>
3227 "result_type must be a floating point type");
3239 param_type(_RealType __n = _RealType(1))
3248 operator==(
const param_type& __p1,
const param_type& __p2)
3249 {
return __p1._M_n == __p2._M_n; }
3252 operator!=(
const param_type& __p1,
const param_type& __p2)
3253 {
return !(__p1 == __p2); }
3261 : _M_param(__n), _M_nd(), _M_gd(__n / 2, 2)
3266 : _M_param(__p), _M_nd(), _M_gd(__p.n() / 2, 2)
3284 {
return _M_param.n(); }
3291 {
return _M_param; }
3299 { _M_param = __param; }
3318 template<
typename _UniformRandomNumberGenerator>
3321 {
return _M_nd(__urng) *
std::sqrt(n() / _M_gd(__urng)); }
3323 template<
typename _UniformRandomNumberGenerator>
3325 operator()(_UniformRandomNumberGenerator& __urng,
3326 const param_type& __p)
3331 const result_type __g = _M_gd(__urng, param_type(__p.n() / 2, 2));
3332 return _M_nd(__urng) *
std::sqrt(__p.n() / __g);
3335 template<
typename _ForwardIterator,
3336 typename _UniformRandomNumberGenerator>
3338 __generate(_ForwardIterator __f, _ForwardIterator __t,
3339 _UniformRandomNumberGenerator& __urng)
3340 { this->__generate_impl(__f, __t, __urng); }
3342 template<
typename _ForwardIterator,
3343 typename _UniformRandomNumberGenerator>
3345 __generate(_ForwardIterator __f, _ForwardIterator __t,
3346 _UniformRandomNumberGenerator& __urng,
3347 const param_type& __p)
3348 { this->__generate_impl(__f, __t, __urng, __p); }
3350 template<
typename _UniformRandomNumberGenerator>
3353 _UniformRandomNumberGenerator& __urng)
3354 { this->__generate_impl(__f, __t, __urng); }
3356 template<
typename _UniformRandomNumberGenerator>
3359 _UniformRandomNumberGenerator& __urng,
3360 const param_type& __p)
3361 { this->__generate_impl(__f, __t, __urng, __p); }
3371 {
return (__d1._M_param == __d2._M_param
3372 && __d1._M_nd == __d2._M_nd && __d1._M_gd == __d2._M_gd); }
3384 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3386 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3399 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3405 template<
typename _ForwardIterator,
3406 typename _UniformRandomNumberGenerator>
3408 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3409 _UniformRandomNumberGenerator& __urng);
3410 template<
typename _ForwardIterator,
3411 typename _UniformRandomNumberGenerator>
3413 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3414 _UniformRandomNumberGenerator& __urng,
3415 const param_type& __p);
3417 param_type _M_param;
3426 template<
typename _RealType>
3430 {
return !(__d1 == __d2); }
3459 param_type(
double __p = 0.5)
3462 __glibcxx_assert((_M_p >= 0.0) && (_M_p <= 1.0));
3470 operator==(
const param_type& __p1,
const param_type& __p2)
3471 {
return __p1._M_p == __p2._M_p; }
3474 operator!=(
const param_type& __p1,
const param_type& __p2)
3475 {
return !(__p1 == __p2); }
3511 {
return _M_param.p(); }
3518 {
return _M_param; }
3526 { _M_param = __param; }
3545 template<
typename _UniformRandomNumberGenerator>
3548 {
return this->
operator()(__urng, _M_param); }
3550 template<
typename _UniformRandomNumberGenerator>
3552 operator()(_UniformRandomNumberGenerator& __urng,
3553 const param_type& __p)
3555 __detail::_Adaptor<_UniformRandomNumberGenerator, double>
3557 if ((__aurng() - __aurng.min())
3558 < __p.p() * (__aurng.max() - __aurng.min()))
3563 template<
typename _ForwardIterator,
3564 typename _UniformRandomNumberGenerator>
3566 __generate(_ForwardIterator __f, _ForwardIterator __t,
3567 _UniformRandomNumberGenerator& __urng)
3568 { this->__generate(__f, __t, __urng, _M_param); }
3570 template<
typename _ForwardIterator,
3571 typename _UniformRandomNumberGenerator>
3573 __generate(_ForwardIterator __f, _ForwardIterator __t,
3574 _UniformRandomNumberGenerator& __urng,
const param_type& __p)
3575 { this->__generate_impl(__f, __t, __urng, __p); }
3577 template<
typename _UniformRandomNumberGenerator>
3580 _UniformRandomNumberGenerator& __urng,
3581 const param_type& __p)
3582 { this->__generate_impl(__f, __t, __urng, __p); }
3591 {
return __d1._M_param == __d2._M_param; }
3594 template<
typename _ForwardIterator,
3595 typename _UniformRandomNumberGenerator>
3597 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3598 _UniformRandomNumberGenerator& __urng,
3599 const param_type& __p);
3601 param_type _M_param;
3611 {
return !(__d1 == __d2); }
3623 template<
typename _CharT,
typename _Traits>
3625 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3637 template<
typename _CharT,
typename _Traits>
3656 template<
typename _IntType =
int>
3660 "result_type must be an integral type");
3673 param_type(_IntType __t = _IntType(1),
double __p = 0.5)
3674 : _M_t(__t), _M_p(__p)
3676 __glibcxx_assert((_M_t >= _IntType(0))
3691 operator==(
const param_type& __p1,
const param_type& __p2)
3692 {
return __p1._M_t == __p2._M_t && __p1._M_p == __p2._M_p; }
3695 operator!=(
const param_type& __p1,
const param_type& __p2)
3696 {
return !(__p1 == __p2); }
3706 #if _GLIBCXX_USE_C99_MATH_TR1
3707 double _M_d1, _M_d2, _M_s1, _M_s2, _M_c,
3708 _M_a1, _M_a123, _M_s, _M_lf, _M_lp1p;
3717 : _M_param(__t, __p), _M_nd()
3722 : _M_param(__p), _M_nd()
3737 {
return _M_param.t(); }
3744 {
return _M_param.p(); }
3751 {
return _M_param; }
3759 { _M_param = __param; }
3773 {
return _M_param.t(); }
3778 template<
typename _UniformRandomNumberGenerator>
3781 {
return this->
operator()(__urng, _M_param); }
3783 template<
typename _UniformRandomNumberGenerator>
3785 operator()(_UniformRandomNumberGenerator& __urng,
3786 const param_type& __p);
3788 template<
typename _ForwardIterator,
3789 typename _UniformRandomNumberGenerator>
3791 __generate(_ForwardIterator __f, _ForwardIterator __t,
3792 _UniformRandomNumberGenerator& __urng)
3793 { this->__generate(__f, __t, __urng, _M_param); }
3795 template<
typename _ForwardIterator,
3796 typename _UniformRandomNumberGenerator>
3798 __generate(_ForwardIterator __f, _ForwardIterator __t,
3799 _UniformRandomNumberGenerator& __urng,
3800 const param_type& __p)
3801 { this->__generate_impl(__f, __t, __urng, __p); }
3803 template<
typename _UniformRandomNumberGenerator>
3806 _UniformRandomNumberGenerator& __urng,
3807 const param_type& __p)
3808 { this->__generate_impl(__f, __t, __urng, __p); }
3818 #ifdef _GLIBCXX_USE_C99_MATH_TR1
3819 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
3821 {
return __d1._M_param == __d2._M_param; }
3834 template<
typename _IntType1,
3835 typename _CharT,
typename _Traits>
3837 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3850 template<
typename _IntType1,
3851 typename _CharT,
typename _Traits>
3857 template<
typename _ForwardIterator,
3858 typename _UniformRandomNumberGenerator>
3860 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3861 _UniformRandomNumberGenerator& __urng,
3862 const param_type& __p);
3864 template<
typename _UniformRandomNumberGenerator>
3866 _M_waiting(_UniformRandomNumberGenerator& __urng,
3867 _IntType __t,
double __q);
3869 param_type _M_param;
3878 template<
typename _IntType>
3882 {
return !(__d1 == __d2); }
3892 template<
typename _IntType =
int>
3896 "result_type must be an integral type");
3909 param_type(
double __p = 0.5)
3912 __glibcxx_assert((_M_p > 0.0) && (_M_p < 1.0));
3921 operator==(
const param_type& __p1,
const param_type& __p2)
3922 {
return __p1._M_p == __p2._M_p; }
3925 operator!=(
const param_type& __p1,
const param_type& __p2)
3926 {
return !(__p1 == __p2); }
3931 { _M_log_1_p =
std::log(1.0 - _M_p); }
3962 {
return _M_param.p(); }
3969 {
return _M_param; }
3977 { _M_param = __param; }
3996 template<
typename _UniformRandomNumberGenerator>
3999 {
return this->
operator()(__urng, _M_param); }
4001 template<
typename _UniformRandomNumberGenerator>
4003 operator()(_UniformRandomNumberGenerator& __urng,
4004 const param_type& __p);
4006 template<
typename _ForwardIterator,
4007 typename _UniformRandomNumberGenerator>
4009 __generate(_ForwardIterator __f, _ForwardIterator __t,
4010 _UniformRandomNumberGenerator& __urng)
4011 { this->__generate(__f, __t, __urng, _M_param); }
4013 template<
typename _ForwardIterator,
4014 typename _UniformRandomNumberGenerator>
4016 __generate(_ForwardIterator __f, _ForwardIterator __t,
4017 _UniformRandomNumberGenerator& __urng,
4018 const param_type& __p)
4019 { this->__generate_impl(__f, __t, __urng, __p); }
4021 template<
typename _UniformRandomNumberGenerator>
4024 _UniformRandomNumberGenerator& __urng,
4025 const param_type& __p)
4026 { this->__generate_impl(__f, __t, __urng, __p); }
4035 {
return __d1._M_param == __d2._M_param; }
4038 template<
typename _ForwardIterator,
4039 typename _UniformRandomNumberGenerator>
4041 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4042 _UniformRandomNumberGenerator& __urng,
4043 const param_type& __p);
4045 param_type _M_param;
4052 template<
typename _IntType>
4056 {
return !(__d1 == __d2); }
4068 template<
typename _IntType,
4069 typename _CharT,
typename _Traits>
4071 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4083 template<
typename _IntType,
4084 typename _CharT,
typename _Traits>
4097 template<
typename _IntType =
int>
4101 "result_type must be an integral type");
4113 param_type(_IntType __k = 1,
double __p = 0.5)
4114 : _M_k(__k), _M_p(__p)
4116 __glibcxx_assert((_M_k > 0) && (_M_p > 0.0) && (_M_p <= 1.0));
4128 operator==(
const param_type& __p1,
const param_type& __p2)
4129 {
return __p1._M_k == __p2._M_k && __p1._M_p == __p2._M_p; }
4132 operator!=(
const param_type& __p1,
const param_type& __p2)
4133 {
return !(__p1 == __p2); }
4142 : _M_param(__k, __p), _M_gd(__k, (1.0 - __p) / __p)
4147 : _M_param(__p), _M_gd(__p.
k(), (1.0 - __p.
p()) / __p.
p())
4162 {
return _M_param.k(); }
4169 {
return _M_param.p(); }
4176 {
return _M_param; }
4184 { _M_param = __param; }
4203 template<
typename _UniformRandomNumberGenerator>
4205 operator()(_UniformRandomNumberGenerator& __urng);
4207 template<
typename _UniformRandomNumberGenerator>
4209 operator()(_UniformRandomNumberGenerator& __urng,
4210 const param_type& __p);
4212 template<
typename _ForwardIterator,
4213 typename _UniformRandomNumberGenerator>
4215 __generate(_ForwardIterator __f, _ForwardIterator __t,
4216 _UniformRandomNumberGenerator& __urng)
4217 { this->__generate_impl(__f, __t, __urng); }
4219 template<
typename _ForwardIterator,
4220 typename _UniformRandomNumberGenerator>
4222 __generate(_ForwardIterator __f, _ForwardIterator __t,
4223 _UniformRandomNumberGenerator& __urng,
4224 const param_type& __p)
4225 { this->__generate_impl(__f, __t, __urng, __p); }
4227 template<
typename _UniformRandomNumberGenerator>
4230 _UniformRandomNumberGenerator& __urng)
4231 { this->__generate_impl(__f, __t, __urng); }
4233 template<
typename _UniformRandomNumberGenerator>
4236 _UniformRandomNumberGenerator& __urng,
4237 const param_type& __p)
4238 { this->__generate_impl(__f, __t, __urng, __p); }
4248 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
4261 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4263 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4276 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4282 template<
typename _ForwardIterator,
4283 typename _UniformRandomNumberGenerator>
4285 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4286 _UniformRandomNumberGenerator& __urng);
4287 template<
typename _ForwardIterator,
4288 typename _UniformRandomNumberGenerator>
4290 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4291 _UniformRandomNumberGenerator& __urng,
4292 const param_type& __p);
4294 param_type _M_param;
4302 template<
typename _IntType>
4306 {
return !(__d1 == __d2); }
4324 template<
typename _IntType =
int>
4328 "result_type must be an integral type");
4341 param_type(
double __mean = 1.0)
4344 __glibcxx_assert(_M_mean > 0.0);
4353 operator==(
const param_type& __p1,
const param_type& __p2)
4354 {
return __p1._M_mean == __p2._M_mean; }
4357 operator!=(
const param_type& __p1,
const param_type& __p2)
4358 {
return !(__p1 == __p2); }
4368 #if _GLIBCXX_USE_C99_MATH_TR1
4369 double _M_lfm, _M_sm, _M_d, _M_scx, _M_1cx, _M_c2b, _M_cb;
4376 : _M_param(__mean), _M_nd()
4381 : _M_param(__p), _M_nd()
4396 {
return _M_param.mean(); }
4403 {
return _M_param; }
4411 { _M_param = __param; }
4430 template<
typename _UniformRandomNumberGenerator>
4433 {
return this->
operator()(__urng, _M_param); }
4435 template<
typename _UniformRandomNumberGenerator>
4437 operator()(_UniformRandomNumberGenerator& __urng,
4438 const param_type& __p);
4440 template<
typename _ForwardIterator,
4441 typename _UniformRandomNumberGenerator>
4443 __generate(_ForwardIterator __f, _ForwardIterator __t,
4444 _UniformRandomNumberGenerator& __urng)
4445 { this->__generate(__f, __t, __urng, _M_param); }
4447 template<
typename _ForwardIterator,
4448 typename _UniformRandomNumberGenerator>
4450 __generate(_ForwardIterator __f, _ForwardIterator __t,
4451 _UniformRandomNumberGenerator& __urng,
4452 const param_type& __p)
4453 { this->__generate_impl(__f, __t, __urng, __p); }
4455 template<
typename _UniformRandomNumberGenerator>
4458 _UniformRandomNumberGenerator& __urng,
4459 const param_type& __p)
4460 { this->__generate_impl(__f, __t, __urng, __p); }
4470 #ifdef _GLIBCXX_USE_C99_MATH_TR1
4471 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
4473 {
return __d1._M_param == __d2._M_param; }
4486 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4488 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4501 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4507 template<
typename _ForwardIterator,
4508 typename _UniformRandomNumberGenerator>
4510 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4511 _UniformRandomNumberGenerator& __urng,
4512 const param_type& __p);
4514 param_type _M_param;
4523 template<
typename _IntType>
4527 {
return !(__d1 == __d2); }
4545 template<
typename _RealType =
double>
4549 "result_type must be a floating point type");
4561 param_type(_RealType __lambda = _RealType(1))
4562 : _M_lambda(__lambda)
4564 __glibcxx_assert(_M_lambda > _RealType(0));
4569 {
return _M_lambda; }
4572 operator==(
const param_type& __p1,
const param_type& __p2)
4573 {
return __p1._M_lambda == __p2._M_lambda; }
4576 operator!=(
const param_type& __p1,
const param_type& __p2)
4577 {
return !(__p1 == __p2); }
4580 _RealType _M_lambda;
4590 : _M_param(__lambda)
4611 {
return _M_param.lambda(); }
4618 {
return _M_param; }
4626 { _M_param = __param; }
4645 template<
typename _UniformRandomNumberGenerator>
4648 {
return this->
operator()(__urng, _M_param); }
4650 template<
typename _UniformRandomNumberGenerator>
4652 operator()(_UniformRandomNumberGenerator& __urng,
4653 const param_type& __p)
4655 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
4660 template<
typename _ForwardIterator,
4661 typename _UniformRandomNumberGenerator>
4663 __generate(_ForwardIterator __f, _ForwardIterator __t,
4664 _UniformRandomNumberGenerator& __urng)
4665 { this->__generate(__f, __t, __urng, _M_param); }
4667 template<
typename _ForwardIterator,
4668 typename _UniformRandomNumberGenerator>
4670 __generate(_ForwardIterator __f, _ForwardIterator __t,
4671 _UniformRandomNumberGenerator& __urng,
4672 const param_type& __p)
4673 { this->__generate_impl(__f, __t, __urng, __p); }
4675 template<
typename _UniformRandomNumberGenerator>
4678 _UniformRandomNumberGenerator& __urng,
4679 const param_type& __p)
4680 { this->__generate_impl(__f, __t, __urng, __p); }
4689 {
return __d1._M_param == __d2._M_param; }
4692 template<
typename _ForwardIterator,
4693 typename _UniformRandomNumberGenerator>
4695 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4696 _UniformRandomNumberGenerator& __urng,
4697 const param_type& __p);
4699 param_type _M_param;
4706 template<
typename _RealType>
4710 {
return !(__d1 == __d2); }
4722 template<
typename _RealType,
typename _CharT,
typename _Traits>
4724 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4737 template<
typename _RealType,
typename _CharT,
typename _Traits>
4752 template<
typename _RealType =
double>
4756 "result_type must be a floating point type");
4768 param_type(_RealType __a = _RealType(1),
4769 _RealType __b = _RealType(1))
4770 : _M_a(__a), _M_b(__b)
4782 operator==(
const param_type& __p1,
const param_type& __p2)
4783 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
4786 operator!=(
const param_type& __p1,
const param_type& __p2)
4787 {
return !(__p1 == __p2); }
4796 _RealType __b = _RealType(1))
4797 : _M_param(__a, __b)
4817 {
return _M_param.a(); }
4824 {
return _M_param.b(); }
4831 {
return _M_param; }
4839 { _M_param = __param; }
4858 template<
typename _UniformRandomNumberGenerator>
4861 {
return this->
operator()(__urng, _M_param); }
4863 template<
typename _UniformRandomNumberGenerator>
4865 operator()(_UniformRandomNumberGenerator& __urng,
4866 const param_type& __p);
4868 template<
typename _ForwardIterator,
4869 typename _UniformRandomNumberGenerator>
4871 __generate(_ForwardIterator __f, _ForwardIterator __t,
4872 _UniformRandomNumberGenerator& __urng)
4873 { this->__generate(__f, __t, __urng, _M_param); }
4875 template<
typename _ForwardIterator,
4876 typename _UniformRandomNumberGenerator>
4878 __generate(_ForwardIterator __f, _ForwardIterator __t,
4879 _UniformRandomNumberGenerator& __urng,
4880 const param_type& __p)
4881 { this->__generate_impl(__f, __t, __urng, __p); }
4883 template<
typename _UniformRandomNumberGenerator>
4886 _UniformRandomNumberGenerator& __urng,
4887 const param_type& __p)
4888 { this->__generate_impl(__f, __t, __urng, __p); }
4897 {
return __d1._M_param == __d2._M_param; }
4900 template<
typename _ForwardIterator,
4901 typename _UniformRandomNumberGenerator>
4903 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4904 _UniformRandomNumberGenerator& __urng,
4905 const param_type& __p);
4907 param_type _M_param;
4914 template<
typename _RealType>
4918 {
return !(__d1 == __d2); }
4930 template<
typename _RealType,
typename _CharT,
typename _Traits>
4932 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4945 template<
typename _RealType,
typename _CharT,
typename _Traits>
4960 template<
typename _RealType =
double>
4964 "result_type must be a floating point type");
4976 param_type(_RealType __a = _RealType(0),
4977 _RealType __b = _RealType(1))
4978 : _M_a(__a), _M_b(__b)
4990 operator==(
const param_type& __p1,
const param_type& __p2)
4991 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
4994 operator!=(
const param_type& __p1,
const param_type& __p2)
4995 {
return !(__p1 == __p2); }
5004 _RealType __b = _RealType(1))
5005 : _M_param(__a, __b)
5025 {
return _M_param.a(); }
5032 {
return _M_param.b(); }
5039 {
return _M_param; }
5047 { _M_param = __param; }
5066 template<
typename _UniformRandomNumberGenerator>
5069 {
return this->
operator()(__urng, _M_param); }
5071 template<
typename _UniformRandomNumberGenerator>
5073 operator()(_UniformRandomNumberGenerator& __urng,
5074 const param_type& __p);
5076 template<
typename _ForwardIterator,
5077 typename _UniformRandomNumberGenerator>
5079 __generate(_ForwardIterator __f, _ForwardIterator __t,
5080 _UniformRandomNumberGenerator& __urng)
5081 { this->__generate(__f, __t, __urng, _M_param); }
5083 template<
typename _ForwardIterator,
5084 typename _UniformRandomNumberGenerator>
5086 __generate(_ForwardIterator __f, _ForwardIterator __t,
5087 _UniformRandomNumberGenerator& __urng,
5088 const param_type& __p)
5089 { this->__generate_impl(__f, __t, __urng, __p); }
5091 template<
typename _UniformRandomNumberGenerator>
5094 _UniformRandomNumberGenerator& __urng,
5095 const param_type& __p)
5096 { this->__generate_impl(__f, __t, __urng, __p); }
5105 {
return __d1._M_param == __d2._M_param; }
5108 template<
typename _ForwardIterator,
5109 typename _UniformRandomNumberGenerator>
5111 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5112 _UniformRandomNumberGenerator& __urng,
5113 const param_type& __p);
5115 param_type _M_param;
5122 template<
typename _RealType>
5126 {
return !(__d1 == __d2); }
5138 template<
typename _RealType,
typename _CharT,
typename _Traits>
5140 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5153 template<
typename _RealType,
typename _CharT,
typename _Traits>
5165 template<
typename _IntType =
int>
5169 "result_type must be an integral type");
5182 : _M_prob(), _M_cp()
5185 template<
typename _InputIterator>
5186 param_type(_InputIterator __wbegin,
5187 _InputIterator __wend)
5188 : _M_prob(__wbegin, __wend), _M_cp()
5189 { _M_initialize(); }
5192 : _M_prob(__wil.begin(), __wil.end()), _M_cp()
5193 { _M_initialize(); }
5195 template<
typename _Func>
5196 param_type(
size_t __nw,
double __xmin,
double __xmax,
5200 param_type(
const param_type&) =
default;
5201 param_type& operator=(
const param_type&) =
default;
5204 probabilities()
const
5208 operator==(
const param_type& __p1,
const param_type& __p2)
5209 {
return __p1._M_prob == __p2._M_prob; }
5212 operator!=(
const param_type& __p1,
const param_type& __p2)
5213 {
return !(__p1 == __p2); }
5227 template<
typename _InputIterator>
5229 _InputIterator __wend)
5230 : _M_param(__wbegin, __wend)
5233 discrete_distribution(initializer_list<double> __wl)
5237 template<
typename _Func>
5238 discrete_distribution(
size_t __nw,
double __xmin,
double __xmax,
5240 : _M_param(__nw, __xmin, __xmax, __fw)
5244 discrete_distribution(
const param_type& __p)
5261 return _M_param._M_prob.
empty()
5270 {
return _M_param; }
5278 { _M_param = __param; }
5293 return _M_param._M_prob.
empty()
5300 template<
typename _UniformRandomNumberGenerator>
5303 {
return this->
operator()(__urng, _M_param); }
5305 template<
typename _UniformRandomNumberGenerator>
5307 operator()(_UniformRandomNumberGenerator& __urng,
5308 const param_type& __p);
5310 template<
typename _ForwardIterator,
5311 typename _UniformRandomNumberGenerator>
5313 __generate(_ForwardIterator __f, _ForwardIterator __t,
5314 _UniformRandomNumberGenerator& __urng)
5315 { this->__generate(__f, __t, __urng, _M_param); }
5317 template<
typename _ForwardIterator,
5318 typename _UniformRandomNumberGenerator>
5320 __generate(_ForwardIterator __f, _ForwardIterator __t,
5321 _UniformRandomNumberGenerator& __urng,
5322 const param_type& __p)
5323 { this->__generate_impl(__f, __t, __urng, __p); }
5325 template<
typename _UniformRandomNumberGenerator>
5328 _UniformRandomNumberGenerator& __urng,
5329 const param_type& __p)
5330 { this->__generate_impl(__f, __t, __urng, __p); }
5339 {
return __d1._M_param == __d2._M_param; }
5351 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5353 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5367 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5373 template<
typename _ForwardIterator,
5374 typename _UniformRandomNumberGenerator>
5376 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5377 _UniformRandomNumberGenerator& __urng,
5378 const param_type& __p);
5380 param_type _M_param;
5387 template<
typename _IntType>
5391 {
return !(__d1 == __d2); }
5400 template<
typename _RealType =
double>
5404 "result_type must be a floating point type");
5417 : _M_int(), _M_den(), _M_cp()
5420 template<
typename _InputIteratorB,
typename _InputIteratorW>
5421 param_type(_InputIteratorB __bfirst,
5422 _InputIteratorB __bend,
5423 _InputIteratorW __wbegin);
5425 template<
typename _Func>
5428 template<
typename _Func>
5429 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5433 param_type(
const param_type&) =
default;
5434 param_type& operator=(
const param_type&) =
default;
5442 __tmp[1] = _RealType(1);
5454 operator==(
const param_type& __p1,
const param_type& __p2)
5455 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
5458 operator!=(
const param_type& __p1,
const param_type& __p2)
5459 {
return !(__p1 == __p2); }
5475 template<
typename _InputIteratorB,
typename _InputIteratorW>
5477 _InputIteratorB __bend,
5478 _InputIteratorW __wbegin)
5479 : _M_param(__bfirst, __bend, __wbegin)
5482 template<
typename _Func>
5483 piecewise_constant_distribution(initializer_list<_RealType> __bl,
5485 : _M_param(__bl, __fw)
5488 template<
typename _Func>
5489 piecewise_constant_distribution(
size_t __nw,
5490 _RealType __xmin, _RealType __xmax,
5492 : _M_param(__nw, __xmin, __xmax, __fw)
5496 piecewise_constant_distribution(
const param_type& __p)
5513 if (_M_param._M_int.
empty())
5516 __tmp[1] = _RealType(1);
5520 return _M_param._M_int;
5529 return _M_param._M_den.
empty()
5538 {
return _M_param; }
5546 { _M_param = __param; }
5554 return _M_param._M_int.
empty()
5564 return _M_param._M_int.
empty()
5571 template<
typename _UniformRandomNumberGenerator>
5574 {
return this->
operator()(__urng, _M_param); }
5576 template<
typename _UniformRandomNumberGenerator>
5578 operator()(_UniformRandomNumberGenerator& __urng,
5579 const param_type& __p);
5581 template<
typename _ForwardIterator,
5582 typename _UniformRandomNumberGenerator>
5584 __generate(_ForwardIterator __f, _ForwardIterator __t,
5585 _UniformRandomNumberGenerator& __urng)
5586 { this->__generate(__f, __t, __urng, _M_param); }
5588 template<
typename _ForwardIterator,
5589 typename _UniformRandomNumberGenerator>
5591 __generate(_ForwardIterator __f, _ForwardIterator __t,
5592 _UniformRandomNumberGenerator& __urng,
5593 const param_type& __p)
5594 { this->__generate_impl(__f, __t, __urng, __p); }
5596 template<
typename _UniformRandomNumberGenerator>
5599 _UniformRandomNumberGenerator& __urng,
5600 const param_type& __p)
5601 { this->__generate_impl(__f, __t, __urng, __p); }
5610 {
return __d1._M_param == __d2._M_param; }
5623 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5625 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5639 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5645 template<
typename _ForwardIterator,
5646 typename _UniformRandomNumberGenerator>
5648 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5649 _UniformRandomNumberGenerator& __urng,
5650 const param_type& __p);
5652 param_type _M_param;
5659 template<
typename _RealType>
5663 {
return !(__d1 == __d2); }
5672 template<
typename _RealType =
double>
5676 "result_type must be a floating point type");
5689 : _M_int(), _M_den(), _M_cp(), _M_m()
5692 template<
typename _InputIteratorB,
typename _InputIteratorW>
5693 param_type(_InputIteratorB __bfirst,
5694 _InputIteratorB __bend,
5695 _InputIteratorW __wbegin);
5697 template<
typename _Func>
5700 template<
typename _Func>
5701 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5705 param_type(
const param_type&) =
default;
5706 param_type& operator=(
const param_type&) =
default;
5714 __tmp[1] = _RealType(1);
5726 operator==(
const param_type& __p1,
const param_type& __p2)
5727 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
5730 operator!=(
const param_type& __p1,
const param_type& __p2)
5731 {
return !(__p1 == __p2); }
5748 template<
typename _InputIteratorB,
typename _InputIteratorW>
5750 _InputIteratorB __bend,
5751 _InputIteratorW __wbegin)
5752 : _M_param(__bfirst, __bend, __wbegin)
5755 template<
typename _Func>
5756 piecewise_linear_distribution(initializer_list<_RealType> __bl,
5758 : _M_param(__bl, __fw)
5761 template<
typename _Func>
5762 piecewise_linear_distribution(
size_t __nw,
5763 _RealType __xmin, _RealType __xmax,
5765 : _M_param(__nw, __xmin, __xmax, __fw)
5769 piecewise_linear_distribution(
const param_type& __p)
5786 if (_M_param._M_int.
empty())
5789 __tmp[1] = _RealType(1);
5793 return _M_param._M_int;
5803 return _M_param._M_den.
empty()
5812 {
return _M_param; }
5820 { _M_param = __param; }
5828 return _M_param._M_int.
empty()
5838 return _M_param._M_int.
empty()
5845 template<
typename _UniformRandomNumberGenerator>
5848 {
return this->
operator()(__urng, _M_param); }
5850 template<
typename _UniformRandomNumberGenerator>
5852 operator()(_UniformRandomNumberGenerator& __urng,
5853 const param_type& __p);
5855 template<
typename _ForwardIterator,
5856 typename _UniformRandomNumberGenerator>
5858 __generate(_ForwardIterator __f, _ForwardIterator __t,
5859 _UniformRandomNumberGenerator& __urng)
5860 { this->__generate(__f, __t, __urng, _M_param); }
5862 template<
typename _ForwardIterator,
5863 typename _UniformRandomNumberGenerator>
5865 __generate(_ForwardIterator __f, _ForwardIterator __t,
5866 _UniformRandomNumberGenerator& __urng,
5867 const param_type& __p)
5868 { this->__generate_impl(__f, __t, __urng, __p); }
5870 template<
typename _UniformRandomNumberGenerator>
5873 _UniformRandomNumberGenerator& __urng,
5874 const param_type& __p)
5875 { this->__generate_impl(__f, __t, __urng, __p); }
5884 {
return __d1._M_param == __d2._M_param; }
5897 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5899 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5913 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5919 template<
typename _ForwardIterator,
5920 typename _UniformRandomNumberGenerator>
5922 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5923 _UniformRandomNumberGenerator& __urng,
5924 const param_type& __p);
5926 param_type _M_param;
5933 template<
typename _RealType>
5937 {
return !(__d1 == __d2); }
5965 template<
typename _IntType>
5968 template<
typename _InputIterator>
5969 seed_seq(_InputIterator __begin, _InputIterator __end);
5972 template<
typename _RandomAccessIterator>
5974 generate(_RandomAccessIterator __begin, _RandomAccessIterator __end);
5977 size_t size() const noexcept
5978 {
return _M_v.
size(); }
5980 template<
typename OutputIterator>
5982 param(OutputIterator __dest)
const
5983 { std::copy(_M_v.
begin(), _M_v.
end(), __dest); }
5997 _GLIBCXX_END_NAMESPACE_VERSION
result_type operator()()
Gets the next random number in the sequence.
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...
static constexpr result_type max()
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::piecewise_linear_distribution< _RealType1 > &__x)
Extracts a piecewise_linear_distribution random number distribution __x from the input stream __is...
static constexpr result_type min()
Gets the minimum value in the generated random number range.
_RealType beta() const
Returns the of the distribution.
void seed(_Sseq &__q)
Reseeds the shuffle_order_engine object with the given seed sequence.
independent_bits_engine(result_type __s)
Seed constructs a independent_bits_engine engine.
result_type min() const
Returns the greatest lower bound value of the distribution.
complex< _Tp > exp(const complex< _Tp > &)
Return complex base e exponential of z.
result_type max() const
Returns the least upper bound value of the distribution.
bool equal(_IIter1 __first1, _IIter1 __last1, _IIter2 __first2, _IIter2 __last2, _BinaryPredicate __binary_pred)
Tests a range for element-wise equality.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine object.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
A gamma continuous distribution for random numbers.
param_type param() const
Returns the parameter set of the distribution.
_GLIBCXX14_CONSTEXPR const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
param_type param() const
Returns the parameter set of the distribution.
void reset()
Resets the distribution state.
result_type min() const
Returns the greatest lower bound value of the distribution.
std::vector< _RealType > intervals() const
Return the intervals of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::linear_congruential_engine< _UIntType1, __a1, __c1, __m1 > &__lcr)
Sets the state of the engine by reading its textual representation from __is.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::student_t_distribution< _RealType1 > &__x)
Extracts a student_t_distribution random number distribution __x from the input stream __is...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
constexpr int __lg(int __n)
This is a helper function for the sort routines and for random.tcc.
subtract_with_carry_engine(result_type __sd=default_seed)
Constructs an explicitly seeded % subtract_with_carry_engine random number generator.
A discrete geometric random number distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine object.
Properties of fundamental types.
static constexpr result_type max()
Gets the maximum value in the generated random number range.
static constexpr result_type max()
Gets the largest possible value in the output range.
Uniform continuous distribution for random numbers.
A fisher_f_distribution random number distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
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.
static constexpr _Tp lowest() noexcept
result_type min() const
Returns the greatest lower bound value of the distribution.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
friend bool operator==(const cauchy_distribution &__d1, const cauchy_distribution &__d2)
Return true if two Cauchy distributions have the same parameters.
void seed(result_type __s)
Reseeds the independent_bits_engine object with the default seed for the underlying base class genera...
_RealType alpha() const
Returns the of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
void reset()
Resets the distribution state.
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.
void seed()
Reseeds the discard_block_engine object with the default seed for the underlying base class generator...
A normal continuous distribution for random numbers.
friend bool operator==(const discrete_distribution &__d1, const discrete_distribution &__d2)
Return true if two discrete distributions have the same parameters.
static constexpr result_type min()
Gets the smallest possible value in the output range.
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.
complex< _Tp > log(const complex< _Tp > &)
Return complex natural logarithm of z.
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.
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.
shuffle_order_engine(_RandomNumberEngine &&__rng)
Move constructs a shuffle_order_engine engine.
shuffle_order_engine(result_type __s)
Seed constructs a shuffle_order_engine engine.
_RandomNumberEngine::result_type result_type
param_type param() const
Returns the parameter set of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
A piecewise_constant_distribution random number distribution.
mersenne_twister_engine< uint_fast32_t, 32, 624, 397, 31, 0x9908b0dfUL, 11, 0xffffffffUL, 7, 0x9d2c5680UL, 15, 0xefc60000UL, 18, 1812433253UL > mt19937
void discard(unsigned long long __z)
Discard a sequence of random numbers.
static constexpr result_type min()
Gets the smallest possible value in the output range.
void param(const param_type &__param)
Sets the parameter set of the distribution.
static constexpr result_type max()
Gets the inclusive maximum value of the range of random integers returned by this generator...
result_type max() const
Returns the inclusive upper bound of the distribution range.
result_type max() const
Returns the least upper bound value of the distribution.
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...
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::negative_binomial_distribution< _IntType1 > &__x)
Extracts a negative_binomial_distribution random number distribution __x from the input stream __is...
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::subtract_with_carry_engine< _UIntType1, __w1, __s1, __r1 > &__x)
Extracts the current state of a % subtract_with_carry_engine random number generator engine __x from ...
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::discard_block_engine< _RandomNumberEngine1, __p1, __r1 > &__x)
Extracts the current state of a % subtract_with_carry_engine random number generator engine __x from ...
result_type max() const
Returns the least upper bound value of the distribution.
result_type operator()()
Gets the next random number in the sequence.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::gamma_distribution< _RealType1 > &__x)
Extracts a gamma_distribution random number distribution __x from the input stream __is...
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.
discard_block_engine()
Constructs a default discard_block_engine engine.
A lognormal_distribution random number distribution.
_RealType mean() const
Returns the mean of the distribution.
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.
result_type min() const
Returns the greatest lower bound value of the distribution.
_RealType a() const
Return the parameter of the distribution.
void seed()
Reseeds the shuffle_order_engine object with the default seed for the underlying base class generator...
The seed_seq class generates sequences of seeds for random number generators.
A model of a linear congruential random number generator.
result_type min() const
Returns the greatest lower bound value of the distribution.
A cauchy_distribution random number distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend bool operator==(const piecewise_constant_distribution &__d1, const piecewise_constant_distribution &__d2)
Return true if two piecewise constant distributions have the same parameters.
result_type max() const
Returns the least upper bound value of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
uniform_real_distribution(_RealType __a=_RealType(0), _RealType __b=_RealType(1))
Constructs a uniform_real_distribution object.
friend bool operator==(const std::normal_distribution< _RealType1 > &__d1, const std::normal_distribution< _RealType1 > &__d2)
Return true if two normal distributions have the same parameters and the sequences that would be gene...
void seed(result_type __s)
Reseeds the discard_block_engine object with the default seed for the underlying base class generator...
void param(const param_type &__param)
Sets the parameter set of the distribution.
void reset()
Resets the distribution state.
static constexpr result_type min()
Gets the minimum value in the generated random number range.
void reset()
Resets the distribution state.
result_type max() const
Returns the least upper bound value of the distribution.
result_type operator()()
Gets the next value in the generated random number sequence.
shuffle_order_engine()
Constructs a default shuffle_order_engine engine.
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...
independent_bits_engine(_Sseq &__q)
Generator construct a independent_bits_engine engine.
void reset()
Resets the distribution state.
std::vector< _RealType > intervals() const
Returns a vector of the intervals.
_IntType t() const
Returns the distribution t parameter.
void reset()
Resets the distribution state.
mersenne_twister_engine(_Sseq &__q)
Constructs a mersenne_twister_engine random number generator engine seeded from the seed sequence __q...
result_type max() const
Returns the least upper bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
_GLIBCXX14_CONSTEXPR const _Tp & max(const _Tp &, const _Tp &)
This does what you think it does.
normal_distribution(result_type __mean=result_type(0), result_type __stddev=result_type(1))
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type max() const
Returns the least upper bound value of the distribution.
static constexpr result_type multiplier
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...
std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, bitset< _Nb > &__x)
Global I/O operators for bitsets.
void reset()
Resets the distribution state.
subtract_with_carry_engine(_Sseq &__q)
Constructs a subtract_with_carry_engine random number engine seeded from the seed sequence __q...
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 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...
friend bool operator==(const extreme_value_distribution &__d1, const extreme_value_distribution &__d2)
Return true if two extreme value distributions have the same parameters.
param_type param() const
Returns the parameter set of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::poisson_distribution< _IntType1 > &__x)
Extracts a poisson_distribution random number distribution __x from the input stream __is...
Template class basic_ostream.
A piecewise_linear_distribution random number distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
_RealType b() const
Return the parameter of the distribution.
A chi_squared_distribution random number distribution.
An exponential continuous distribution for random numbers.
std::vector< double > densities() const
Return a vector of the probability densities of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
param_type param() const
Returns the parameter set of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
friend bool operator==(const exponential_distribution &__d1, const exponential_distribution &__d2)
Return true if two exponential distributions have the same parameters.
result_type max() const
Returns the least upper bound value of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::piecewise_constant_distribution< _RealType1 > &__x)
Extracts a piecewise_constant_distribution random number distribution __x from the input stream __is...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type min() const
Returns the greatest lower bound value of the distribution.
void reset()
Resets the distribution state.
result_type min() const
Returns the greatest lower bound value of the distribution.
void seed()
Reseeds the independent_bits_engine object with the default seed for the underlying base class genera...
void reset()
Resets the distribution state.
A negative_binomial_distribution random number distribution.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
reference back() noexcept
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
A discrete_distribution random number distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
complex< _Tp > sqrt(const complex< _Tp > &)
Return complex square root of z.
param_type param() const
Returns the parameter set of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
void seed(_Sseq &__q)
Reseeds the discard_block_engine object with the given seed sequence.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::binomial_distribution< _IntType1 > &__x)
Extracts a binomial_distribution random number distribution __x from the input stream __is...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
param_type param() const
Returns the parameter set of the distribution.
_IntType k() const
Return the parameter of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::mersenne_twister_engine< _UIntType1, __w1, __n1, __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1, __l1, __f1 > &__x)
Extracts the current state of a % mersenne_twister_engine random number generator engine __x from the...
A weibull_distribution random number distribution.
param_type param() const
Returns the parameter set of the distribution.
gamma_distribution(_RealType __alpha_val=_RealType(1), _RealType __beta_val=_RealType(1))
Constructs a gamma distribution with parameters and .
independent_bits_engine(_RandomNumberEngine &&__rng)
Move constructs a independent_bits_engine engine.
param_type param() const
Returns the parameter set of the distribution.
void reset()
Resets the distribution state.
independent_bits_engine(const _RandomNumberEngine &__rng)
Copy constructs a independent_bits_engine engine.
void reset()
Resets the distribution state.
static constexpr result_type min()
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.
uint_least32_t result_type
reference front() noexcept
void param(const param_type &__param)
Sets the parameter set of the distribution.
friend bool operator==(const mersenne_twister_engine &__lhs, const mersenne_twister_engine &__rhs)
Compares two % mersenne_twister_engine random number generator objects of the same type for equality...
static constexpr _Tp min() noexcept
void param(const param_type &__param)
Sets the parameter set of the 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...
param_type param() const
Returns the parameter set of the distribution.
param_type param() const
Returns the parameter set of the distribution.
double p() const
Return the parameter of the distribution.
shuffle_order_engine(const _RandomNumberEngine &__rng)
Copy constructs a shuffle_order_engine engine.
mersenne_twister_engine< uint_fast64_t, 64, 312, 156, 31, 0xb5026f5aa96619e9ULL, 29, 0x5555555555555555ULL, 17, 0x71d67fffeda60000ULL, 37, 0xfff7eee000000000ULL, 43, 6364136223846793005ULL > mt19937_64
param_type param() const
Returns the parameter set of the distribution.
param_type param() const
Returns the parameter set of the distribution.
void seed(result_type __sd=default_seed)
Seeds the initial state of the random number generator.
discard_block_engine(result_type __s)
Seed constructs a discard_block_engine engine.
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...
discard_block_engine(const _RandomNumberEngine &__rng)
Copy constructs a discard_block_engine engine.
param_type param() const
Returns the parameter set of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void discard(unsigned long long __z)
linear_congruential_engine< uint_fast32_t, 48271UL, 0UL, 2147483647UL > minstd_rand
param_type param() const
Returns the parameter set of the distribution.
friend bool operator==(const piecewise_linear_distribution &__d1, const piecewise_linear_distribution &__d2)
Return true if two piecewise linear distributions have the same parameters.
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
void 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.
_RealType a() const
Return the parameter of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
__gnu_cxx::__promote_2< _Tpa, _Tpb >::__type beta(_Tpa __a, _Tpb __b)
Uniform discrete distribution for random numbers. A discrete random distribution on the range with e...
friend bool operator==(const binomial_distribution &__d1, const binomial_distribution &__d2)
Return true if two binomial distributions have the same parameters and the sequences that would be ge...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
_RandomNumberEngine::result_type result_type
independent_bits_engine()
Constructs a default independent_bits_engine engine.
result_type max() const
Returns the least upper bound value of the distribution.
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...
friend bool operator==(const uniform_real_distribution &__d1, const uniform_real_distribution &__d2)
Return true if two uniform real distributions have the same parameters.
static constexpr result_type increment
friend bool operator==(const bernoulli_distribution &__d1, const bernoulli_distribution &__d2)
Return true if two Bernoulli distributions have the same parameters.
A Bernoulli random number distribution.
_RealType b() const
Return the parameter of the distribution.
Produces random numbers by combining random numbers from some base engine to produce random numbers w...
A discrete Poisson random number distribution.
friend bool operator==(const lognormal_distribution &__d1, const lognormal_distribution &__d2)
Return true if two lognormal distributions have the same parameters and the sequences that would be g...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend bool operator==(const weibull_distribution &__d1, const weibull_distribution &__d2)
Return true if two Weibull distributions have the same parameters.
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...
friend bool operator==(const shuffle_order_engine &__lhs, const shuffle_order_engine &__rhs)
result_type min() const
Returns the greatest lower bound value of the distribution.
static constexpr result_type max()
Gets the largest possible value in the output range.
Template class basic_istream.
void reset()
Resets the distribution state.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::shuffle_order_engine< _RandomNumberEngine1, __k1 > &__x)
Extracts the current state of a % subtract_with_carry_engine random number generator engine __x from ...
linear_congruential_engine(_Sseq &__q)
Constructs a linear_congruential_engine random number generator engine seeded from the seed sequence ...
void seed(result_type __s=default_seed)
Reseeds the linear_congruential_engine random number generator engine sequence to the seed __s...
result_type operator()()
Gets the next value in the generated random number sequence.
result_type max() const
Returns the least upper bound value of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::normal_distribution< _RealType1 > &__x)
Extracts a normal_distribution random number distribution __x from the input stream __is...
friend bool operator==(const 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...
double p() const
Returns the distribution parameter p.
size_type size() const noexcept
const _RandomNumberEngine & base() const noexcept
result_type min() const
Returns the greatest lower bound value of the distribution.
A student_t_distribution random number distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::fisher_f_distribution< _RealType1 > &__x)
Extracts a fisher_f_distribution random number distribution __x from the input stream __is...
param_type param() const
Returns the parameter set of the distribution.
friend bool operator==(const geometric_distribution &__d1, const geometric_distribution &__d2)
Return true if two geometric distributions have the same parameters.
linear_congruential_engine< uint_fast32_t, 16807UL, 0UL, 2147483647UL > minstd_rand0
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.
iterator begin() noexcept
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type min() const
Returns the inclusive lower bound of the distribution range.
A extreme_value_distribution random number distribution.
result_type max() const
Returns the least upper bound value of the distribution.
bool empty() const noexcept
void reset()
Resets the distribution state.
One of the math functors.
A discrete binomial random number distribution.
double mean() const
Returns the distribution parameter mean.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
The Marsaglia-Zaman generator.
double p() const
Returns the p parameter of the distribution.
std::vector< double > densities() const
Returns a vector of the probability densities.
shuffle_order_engine(_Sseq &__q)
Generator construct a shuffle_order_engine engine.
void reset()
Resets the distribution state.
discard_block_engine(_Sseq &__q)
Generator construct a discard_block_engine engine.
static constexpr _Tp max() noexcept
void seed(result_type __s)
Reseeds the shuffle_order_engine object with the default seed for the underlying base class generator...
std::vector< double > probabilities() const
Returns the probabilities of the distribution.
bernoulli_distribution(double __p=0.5)
Constructs a Bernoulli distribution with likelihood p.
static constexpr result_type max()
Gets the maximum value in the generated random number range.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType > &__x)
Extracts the current state of a % subtract_with_carry_engine random number generator engine __x from ...
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::lognormal_distribution< _RealType1 > &__x)
Extracts a lognormal_distribution random number distribution __x from the input stream __is...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::chi_squared_distribution< _RealType1 > &__x)
Extracts a chi_squared_distribution random number distribution __x from the input stream __is...
param_type param() const
Returns the parameter set of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::discrete_distribution< _IntType1 > &__x)
Extracts a discrete_distribution random number distribution __x from the input stream __is...
_RealType generate_canonical(_UniformRandomNumberGenerator &__g)
A function template for converting the output of a (integral) uniform random number generator to a fl...
static constexpr result_type min()
Gets the inclusive minimum value of the range of random integers returned by this generator...
_RealType stddev() const
Returns the standard deviation of the distribution.
double p() const
Returns the distribution p parameter.
void reset()
Resets the distribution state.
discard_block_engine(_RandomNumberEngine &&__rng)
Move constructs a discard_block_engine engine.