37 namespace std _GLIBCXX_VISIBILITY(default)
39 _GLIBCXX_BEGIN_NAMESPACE_VERSION
56 template<
typename _RealType,
size_t __bits,
57 typename _UniformRandomNumberGenerator>
66 template<
typename _UIntType,
size_t __w,
67 bool = __w < static_cast<size_t>
70 {
static const _UIntType __value = 0; };
72 template<
typename _UIntType,
size_t __w>
73 struct _Shift<_UIntType, __w, true>
74 {
static const _UIntType __value = _UIntType(1) << __w; };
77 int __which = ((__s <= __CHAR_BIT__ *
sizeof (int))
78 + (__s <= __CHAR_BIT__ *
sizeof (long))
79 + (__s <= __CHAR_BIT__ *
sizeof (
long long))
82 struct _Select_uint_least_t
84 static_assert(__which < 0,
85 "sorry, would be too much trouble for a slow result");
89 struct _Select_uint_least_t<__s, 4>
90 {
typedef unsigned int type; };
93 struct _Select_uint_least_t<__s, 3>
94 {
typedef unsigned long type; };
97 struct _Select_uint_least_t<__s, 2>
98 {
typedef unsigned long long type; };
100 #ifdef _GLIBCXX_USE_INT128 102 struct _Select_uint_least_t<__s, 1>
103 {
typedef unsigned __int128 type; };
107 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
108 bool __big_enough = (!(__m & (__m - 1))
109 || (_Tp(-1) - __c) / __a >= __m - 1),
110 bool __schrage_ok = __m % __a < __m / __a>
113 typedef typename _Select_uint_least_t<
std::__lg(__a)
117 {
return static_cast<_Tp
>((_Tp2(__a) * __x + __c) % __m); }
121 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c>
122 struct _Mod<_Tp, __m, __a, __c, false, true>
131 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
bool __s>
132 struct _Mod<_Tp, __m, __a, __c, true, __s>
137 _Tp __res = __a * __x + __c;
144 template<
typename _Tp, _Tp __m, _Tp __a = 1, _Tp __c = 0>
147 {
return _Mod<_Tp, __m, __a, __c>::__calc(__x); }
153 template<
typename _Engine,
typename _DInputType>
157 "template argument must be a floating point type");
160 _Adaptor(_Engine& __g)
165 {
return _DInputType(0); }
169 {
return _DInputType(1); }
188 template<
typename _Sseq>
189 using __seed_seq_generate_t = decltype(
190 std::declval<_Sseq&>().generate(std::declval<uint_least32_t*>(),
191 std::declval<uint_least32_t*>()));
195 template<
typename _Sseq,
typename _Engine,
typename _Res,
196 typename _GenerateCheck = __seed_seq_generate_t<_Sseq>>
197 using __is_seed_seq = __and_<
198 __not_<is_same<__remove_cvref_t<_Sseq>, _Engine>>,
199 is_unsigned<typename _Sseq::result_type>,
200 __not_<is_convertible<_Sseq, _Res>>
243 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
246 static_assert(std::is_unsigned<_UIntType>::value,
247 "result_type must be an unsigned integral type");
248 static_assert(__m == 0u || (__a < __m && __c < __m),
249 "template argument substituting __m out of bounds");
251 template<
typename _Sseq>
252 using _If_seed_seq =
typename enable_if<__detail::__is_seed_seq<
291 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
312 template<
typename _Sseq>
324 {
return __c == 0u ? 1u : 0u; }
339 for (; __z != 0ULL; --__z)
349 _M_x = __detail::__mod<_UIntType, __m, __a, __c>(_M_x);
367 {
return __lhs._M_x == __rhs._M_x; }
377 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
378 _UIntType1 __m1,
typename _CharT,
typename _Traits>
380 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
382 __a1, __c1, __m1>& __lcr);
397 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
398 _UIntType1 __m1,
typename _CharT,
typename _Traits>
419 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
425 {
return !(__lhs == __rhs); }
456 template<
typename _UIntType,
size_t __w,
457 size_t __n,
size_t __m,
size_t __r,
458 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
459 _UIntType __b,
size_t __t,
460 _UIntType __c,
size_t __l, _UIntType __f>
463 static_assert(std::is_unsigned<_UIntType>::value,
464 "result_type must be an unsigned integral type");
465 static_assert(1u <= __m && __m <= __n,
466 "template argument substituting __m out of bounds");
467 static_assert(__r <= __w,
"template argument substituting " 469 static_assert(__u <= __w,
"template argument substituting " 471 static_assert(__s <= __w,
"template argument substituting " 473 static_assert(__t <= __w,
"template argument substituting " 475 static_assert(__l <= __w,
"template argument substituting " 478 "template argument substituting __w out of bound");
479 static_assert(__a <= (__detail::_Shift<_UIntType, __w>::__value - 1),
480 "template argument substituting __a out of bound");
481 static_assert(__b <= (__detail::_Shift<_UIntType, __w>::__value - 1),
482 "template argument substituting __b out of bound");
483 static_assert(__c <= (__detail::_Shift<_UIntType, __w>::__value - 1),
484 "template argument substituting __c out of bound");
485 static_assert(__d <= (__detail::_Shift<_UIntType, __w>::__value - 1),
486 "template argument substituting __d out of bound");
487 static_assert(__f <= (__detail::_Shift<_UIntType, __w>::__value - 1),
488 "template argument substituting __f out of bound");
490 template<
typename _Sseq>
491 using _If_seed_seq =
typename enable_if<__detail::__is_seed_seq<
499 static constexpr
size_t word_size = __w;
500 static constexpr
size_t state_size = __n;
501 static constexpr
size_t shift_size = __m;
502 static constexpr
size_t mask_bits = __r;
504 static constexpr
size_t tempering_u = __u;
506 static constexpr
size_t tempering_s = __s;
508 static constexpr
size_t tempering_t = __t;
510 static constexpr
size_t tempering_l = __l;
511 static constexpr
result_type initialization_multiplier = __f;
528 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
536 template<
typename _Sseq>
552 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
558 discard(
unsigned long long __z);
578 {
return (
std::equal(__lhs._M_x, __lhs._M_x + state_size, __rhs._M_x)
579 && __lhs._M_p == __rhs._M_p); }
593 template<
typename _UIntType1,
594 size_t __w1,
size_t __n1,
595 size_t __m1,
size_t __r1,
596 _UIntType1 __a1,
size_t __u1,
597 _UIntType1 __d1,
size_t __s1,
598 _UIntType1 __b1,
size_t __t1,
599 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
600 typename _CharT,
typename _Traits>
602 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
604 __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
619 template<
typename _UIntType1,
620 size_t __w1,
size_t __n1,
621 size_t __m1,
size_t __r1,
622 _UIntType1 __a1,
size_t __u1,
623 _UIntType1 __d1,
size_t __s1,
624 _UIntType1 __b1,
size_t __t1,
625 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
626 typename _CharT,
typename _Traits>
630 __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
636 _UIntType _M_x[state_size];
652 template<
typename _UIntType,
size_t __w,
653 size_t __n,
size_t __m,
size_t __r,
654 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
655 _UIntType __b,
size_t __t,
656 _UIntType __c,
size_t __l, _UIntType __f>
659 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __lhs,
661 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __rhs)
662 {
return !(__lhs == __rhs); }
680 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
683 static_assert(std::is_unsigned<_UIntType>::value,
684 "result_type must be an unsigned integral type");
685 static_assert(0u < __s && __s < __r,
688 "template argument substituting __w out of bounds");
690 template<
typename _Sseq>
691 using _If_seed_seq =
typename enable_if<__detail::__is_seed_seq<
699 static constexpr
size_t word_size = __w;
700 static constexpr
size_t short_lag = __s;
701 static constexpr
size_t long_lag = __r;
702 static constexpr
result_type default_seed = 19780503u;
721 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
745 template<
typename _Sseq>
763 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
771 for (; __z != 0ULL; --__z)
796 {
return (
std::equal(__lhs._M_x, __lhs._M_x + long_lag, __rhs._M_x)
797 && __lhs._M_carry == __rhs._M_carry
798 && __lhs._M_p == __rhs._M_p); }
812 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
813 typename _CharT,
typename _Traits>
815 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
831 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
832 typename _CharT,
typename _Traits>
840 _UIntType _M_x[long_lag];
857 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
863 {
return !(__lhs == __rhs); }
872 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
875 static_assert(1 <= __r && __r <= __p,
876 "template argument substituting __r out of bounds");
880 typedef typename _RandomNumberEngine::result_type
result_type;
882 template<
typename _Sseq>
883 using _If_seed_seq =
typename enable_if<__detail::__is_seed_seq<
887 static constexpr
size_t block_size = __p;
888 static constexpr
size_t used_block = __r;
896 : _M_b(), _M_n(0) { }
906 : _M_b(__rng), _M_n(0) { }
916 : _M_b(
std::move(__rng)), _M_n(0) { }
926 : _M_b(__s), _M_n(0) { }
933 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
966 template<
typename _Sseq>
978 const _RandomNumberEngine&
1002 for (; __z != 0ULL; --__z)
1026 {
return __lhs._M_b == __rhs._M_b && __lhs._M_n == __rhs._M_n; }
1039 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1040 typename _CharT,
typename _Traits>
1042 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1057 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1058 typename _CharT,
typename _Traits>
1065 _RandomNumberEngine _M_b;
1080 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
1086 {
return !(__lhs == __rhs); }
1093 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1096 static_assert(std::is_unsigned<_UIntType>::value,
1097 "result_type must be an unsigned integral type");
1099 "template argument substituting __w out of bounds");
1101 template<
typename _Sseq>
1102 using _If_seed_seq =
typename enable_if<__detail::__is_seed_seq<
1135 : _M_b(
std::move(__rng)) { }
1152 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1179 template<
typename _Sseq>
1188 const _RandomNumberEngine&
1204 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1212 for (; __z != 0ULL; --__z)
1237 {
return __lhs._M_b == __rhs._M_b; }
1251 template<
typename _CharT,
typename _Traits>
1255 __w, _UIntType>& __x)
1262 _RandomNumberEngine _M_b;
1277 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1283 {
return !(__lhs == __rhs); }
1295 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType,
1296 typename _CharT,
typename _Traits>
1298 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1300 __w, _UIntType>& __x)
1312 template<
typename _RandomNumberEngine,
size_t __k>
1315 static_assert(1u <= __k,
"template argument substituting " 1316 "__k out of bound");
1320 typedef typename _RandomNumberEngine::result_type
result_type;
1322 template<
typename _Sseq>
1323 using _If_seed_seq =
typename enable_if<__detail::__is_seed_seq<
1326 static constexpr
size_t table_size = __k;
1335 { _M_initialize(); }
1346 { _M_initialize(); }
1356 : _M_b(
std::move(__rng))
1357 { _M_initialize(); }
1368 { _M_initialize(); }
1375 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1379 { _M_initialize(); }
1408 template<
typename _Sseq>
1419 const _RandomNumberEngine&
1443 for (; __z != 0ULL; --__z)
1467 {
return (__lhs._M_b == __rhs._M_b
1468 &&
std::equal(__lhs._M_v, __lhs._M_v + __k, __rhs._M_v)
1469 && __lhs._M_y == __rhs._M_y); }
1482 template<
typename _RandomNumberEngine1,
size_t __k1,
1483 typename _CharT,
typename _Traits>
1485 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1500 template<
typename _RandomNumberEngine1,
size_t __k1,
1501 typename _CharT,
typename _Traits>
1507 void _M_initialize()
1509 for (
size_t __i = 0; __i < __k; ++__i)
1514 _RandomNumberEngine _M_b;
1530 template<
typename _RandomNumberEngine,
size_t __k>
1536 {
return !(__lhs == __rhs); }
1542 typedef linear_congruential_engine<uint_fast32_t, 16807UL, 0UL, 2147483647UL>
1573 0xb5026f5aa96619e9ULL, 29,
1574 0x5555555555555555ULL, 17,
1575 0x71d67fffeda60000ULL, 37,
1576 0xfff7eee000000000ULL, 43,
1605 #ifdef _GLIBCXX_USE_DEV_RANDOM 1614 random_device() { _M_init_pretr1(
"mt19937"); }
1618 { _M_init_pretr1(__token); }
1630 entropy() const noexcept
1632 #ifdef _GLIBCXX_USE_DEV_RANDOM 1633 return this->_M_getentropy();
1642 #ifdef _GLIBCXX_USE_DEV_RANDOM 1643 return this->_M_getval();
1645 return this->_M_getval_pretr1();
1650 random_device(
const random_device&) =
delete;
1651 void operator=(
const random_device&) =
delete;
1661 double _M_getentropy() const noexcept;
1690 template<
typename _IntType>
1694 {
return !(__d1 == __d2); }
1706 template<
typename _IntType,
typename _CharT,
typename _Traits>
1708 operator<<(std::basic_ostream<_CharT, _Traits>&,
1720 template<
typename _IntType,
typename _CharT,
typename _Traits>
1733 template<
typename _RealType =
double>
1737 "result_type must be a floating point type");
1751 param_type(_RealType __a, _RealType __b = _RealType(1))
1752 : _M_a(__a), _M_b(__b)
1754 __glibcxx_assert(_M_a <= _M_b);
1767 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
1771 {
return !(__p1 == __p2); }
1794 : _M_param(__a, __b)
1812 {
return _M_param.a(); }
1816 {
return _M_param.b(); }
1823 {
return _M_param; }
1831 { _M_param = __param; }
1838 {
return this->a(); }
1845 {
return this->b(); }
1850 template<
typename _UniformRandomNumberGenerator>
1853 {
return this->
operator()(__urng, _M_param); }
1855 template<
typename _UniformRandomNumberGenerator>
1857 operator()(_UniformRandomNumberGenerator& __urng,
1858 const param_type& __p)
1860 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
1862 return (__aurng() * (__p.b() - __p.a())) + __p.a();
1865 template<
typename _ForwardIterator,
1866 typename _UniformRandomNumberGenerator>
1868 __generate(_ForwardIterator __f, _ForwardIterator __t,
1869 _UniformRandomNumberGenerator& __urng)
1870 { this->__generate(__f, __t, __urng, _M_param); }
1872 template<
typename _ForwardIterator,
1873 typename _UniformRandomNumberGenerator>
1875 __generate(_ForwardIterator __f, _ForwardIterator __t,
1876 _UniformRandomNumberGenerator& __urng,
1877 const param_type& __p)
1878 { this->__generate_impl(__f, __t, __urng, __p); }
1880 template<
typename _UniformRandomNumberGenerator>
1883 _UniformRandomNumberGenerator& __urng,
1884 const param_type& __p)
1885 { this->__generate_impl(__f, __t, __urng, __p); }
1894 {
return __d1._M_param == __d2._M_param; }
1897 template<
typename _ForwardIterator,
1898 typename _UniformRandomNumberGenerator>
1900 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
1901 _UniformRandomNumberGenerator& __urng,
1902 const param_type& __p);
1904 param_type _M_param;
1911 template<
typename _IntType>
1915 {
return !(__d1 == __d2); }
1927 template<
typename _RealType,
typename _CharT,
typename _Traits>
1929 operator<<(std::basic_ostream<_CharT, _Traits>&,
1941 template<
typename _RealType,
typename _CharT,
typename _Traits>
1963 template<
typename _RealType =
double>
1967 "result_type must be a floating point type");
1981 param_type(_RealType __mean, _RealType __stddev = _RealType(1))
1982 : _M_mean(__mean), _M_stddev(__stddev)
1984 __glibcxx_assert(_M_stddev > _RealType(0));
1993 {
return _M_stddev; }
1997 {
return (__p1._M_mean == __p2._M_mean
1998 && __p1._M_stddev == __p2._M_stddev); }
2002 {
return !(__p1 == __p2); }
2006 _RealType _M_stddev;
2019 : _M_param(__mean, __stddev), _M_saved_available(false)
2024 : _M_param(__p), _M_saved_available(false)
2032 { _M_saved_available =
false; }
2039 {
return _M_param.mean(); }
2046 {
return _M_param.stddev(); }
2053 {
return _M_param; }
2061 { _M_param = __param; }
2080 template<
typename _UniformRandomNumberGenerator>
2083 {
return this->
operator()(__urng, _M_param); }
2085 template<
typename _UniformRandomNumberGenerator>
2087 operator()(_UniformRandomNumberGenerator& __urng,
2088 const param_type& __p);
2090 template<
typename _ForwardIterator,
2091 typename _UniformRandomNumberGenerator>
2093 __generate(_ForwardIterator __f, _ForwardIterator __t,
2094 _UniformRandomNumberGenerator& __urng)
2095 { this->__generate(__f, __t, __urng, _M_param); }
2097 template<
typename _ForwardIterator,
2098 typename _UniformRandomNumberGenerator>
2100 __generate(_ForwardIterator __f, _ForwardIterator __t,
2101 _UniformRandomNumberGenerator& __urng,
2102 const param_type& __p)
2103 { this->__generate_impl(__f, __t, __urng, __p); }
2105 template<
typename _UniformRandomNumberGenerator>
2108 _UniformRandomNumberGenerator& __urng,
2109 const param_type& __p)
2110 { this->__generate_impl(__f, __t, __urng, __p); }
2117 template<
typename _RealType1>
2132 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2134 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2147 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2153 template<
typename _ForwardIterator,
2154 typename _UniformRandomNumberGenerator>
2156 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2157 _UniformRandomNumberGenerator& __urng,
2158 const param_type& __p);
2160 param_type _M_param;
2162 bool _M_saved_available;
2168 template<
typename _RealType>
2172 {
return !(__d1 == __d2); }
2184 template<
typename _RealType =
double>
2188 "result_type must be a floating point type");
2202 param_type(_RealType __m, _RealType __s = _RealType(1))
2203 : _M_m(__m), _M_s(__s)
2216 {
return __p1._M_m == __p2._M_m && __p1._M_s == __p2._M_s; }
2220 {
return !(__p1 == __p2); }
2231 : _M_param(__m, __s), _M_nd()
2235 lognormal_distribution(
const param_type& __p)
2236 : _M_param(__p), _M_nd()
2251 {
return _M_param.m(); }
2255 {
return _M_param.s(); }
2262 {
return _M_param; }
2270 { _M_param = __param; }
2289 template<
typename _UniformRandomNumberGenerator>
2292 {
return this->
operator()(__urng, _M_param); }
2294 template<
typename _UniformRandomNumberGenerator>
2296 operator()(_UniformRandomNumberGenerator& __urng,
2297 const param_type& __p)
2298 {
return std::exp(__p.s() * _M_nd(__urng) + __p.m()); }
2300 template<
typename _ForwardIterator,
2301 typename _UniformRandomNumberGenerator>
2303 __generate(_ForwardIterator __f, _ForwardIterator __t,
2304 _UniformRandomNumberGenerator& __urng)
2305 { this->__generate(__f, __t, __urng, _M_param); }
2307 template<
typename _ForwardIterator,
2308 typename _UniformRandomNumberGenerator>
2310 __generate(_ForwardIterator __f, _ForwardIterator __t,
2311 _UniformRandomNumberGenerator& __urng,
2312 const param_type& __p)
2313 { this->__generate_impl(__f, __t, __urng, __p); }
2315 template<
typename _UniformRandomNumberGenerator>
2318 _UniformRandomNumberGenerator& __urng,
2319 const param_type& __p)
2320 { this->__generate_impl(__f, __t, __urng, __p); }
2330 {
return (__d1._M_param == __d2._M_param
2331 && __d1._M_nd == __d2._M_nd); }
2343 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2345 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2358 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2364 template<
typename _ForwardIterator,
2365 typename _UniformRandomNumberGenerator>
2367 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2368 _UniformRandomNumberGenerator& __urng,
2369 const param_type& __p);
2371 param_type _M_param;
2379 template<
typename _RealType>
2383 {
return !(__d1 == __d2); }
2395 template<
typename _RealType =
double>
2399 "result_type must be a floating point type");
2414 param_type(_RealType __alpha_val, _RealType __beta_val = _RealType(1))
2415 : _M_alpha(__alpha_val), _M_beta(__beta_val)
2417 __glibcxx_assert(_M_alpha > _RealType(0));
2423 {
return _M_alpha; }
2431 {
return (__p1._M_alpha == __p2._M_alpha
2432 && __p1._M_beta == __p2._M_beta); }
2436 {
return !(__p1 == __p2); }
2445 _RealType _M_malpha, _M_a2;
2460 _RealType __beta_val = _RealType(1))
2461 : _M_param(__alpha_val, __beta_val), _M_nd()
2466 : _M_param(__p), _M_nd()
2481 {
return _M_param.alpha(); }
2488 {
return _M_param.beta(); }
2495 {
return _M_param; }
2503 { _M_param = __param; }
2522 template<
typename _UniformRandomNumberGenerator>
2525 {
return this->
operator()(__urng, _M_param); }
2527 template<
typename _UniformRandomNumberGenerator>
2529 operator()(_UniformRandomNumberGenerator& __urng,
2530 const param_type& __p);
2532 template<
typename _ForwardIterator,
2533 typename _UniformRandomNumberGenerator>
2535 __generate(_ForwardIterator __f, _ForwardIterator __t,
2536 _UniformRandomNumberGenerator& __urng)
2537 { this->__generate(__f, __t, __urng, _M_param); }
2539 template<
typename _ForwardIterator,
2540 typename _UniformRandomNumberGenerator>
2542 __generate(_ForwardIterator __f, _ForwardIterator __t,
2543 _UniformRandomNumberGenerator& __urng,
2544 const param_type& __p)
2545 { this->__generate_impl(__f, __t, __urng, __p); }
2547 template<
typename _UniformRandomNumberGenerator>
2550 _UniformRandomNumberGenerator& __urng,
2551 const param_type& __p)
2552 { this->__generate_impl(__f, __t, __urng, __p); }
2562 {
return (__d1._M_param == __d2._M_param
2563 && __d1._M_nd == __d2._M_nd); }
2575 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2577 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2589 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2595 template<
typename _ForwardIterator,
2596 typename _UniformRandomNumberGenerator>
2598 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2599 _UniformRandomNumberGenerator& __urng,
2600 const param_type& __p);
2602 param_type _M_param;
2610 template<
typename _RealType>
2614 {
return !(__d1 == __d2); }
2623 template<
typename _RealType =
double>
2627 "result_type must be a floating point type");
2651 {
return __p1._M_n == __p2._M_n; }
2655 {
return !(__p1 == __p2); }
2665 : _M_param(__n), _M_gd(__n / 2)
2669 chi_squared_distribution(
const param_type& __p)
2670 : _M_param(__p), _M_gd(__p.n() / 2)
2685 {
return _M_param.n(); }
2692 {
return _M_param; }
2724 template<
typename _UniformRandomNumberGenerator>
2727 {
return 2 * _M_gd(__urng); }
2729 template<
typename _UniformRandomNumberGenerator>
2731 operator()(_UniformRandomNumberGenerator& __urng,
2732 const param_type& __p)
2736 return 2 * _M_gd(__urng, param_type(__p.n() / 2));
2739 template<
typename _ForwardIterator,
2740 typename _UniformRandomNumberGenerator>
2742 __generate(_ForwardIterator __f, _ForwardIterator __t,
2743 _UniformRandomNumberGenerator& __urng)
2744 { this->__generate_impl(__f, __t, __urng); }
2746 template<
typename _ForwardIterator,
2747 typename _UniformRandomNumberGenerator>
2749 __generate(_ForwardIterator __f, _ForwardIterator __t,
2750 _UniformRandomNumberGenerator& __urng,
2751 const param_type& __p)
2754 this->__generate_impl(__f, __t, __urng, __p2); }
2756 template<
typename _UniformRandomNumberGenerator>
2759 _UniformRandomNumberGenerator& __urng)
2760 { this->__generate_impl(__f, __t, __urng); }
2762 template<
typename _UniformRandomNumberGenerator>
2765 _UniformRandomNumberGenerator& __urng,
2766 const param_type& __p)
2769 this->__generate_impl(__f, __t, __urng, __p2); }
2779 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
2791 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2793 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2806 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2812 template<
typename _ForwardIterator,
2813 typename _UniformRandomNumberGenerator>
2815 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2816 _UniformRandomNumberGenerator& __urng);
2818 template<
typename _ForwardIterator,
2819 typename _UniformRandomNumberGenerator>
2821 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2822 _UniformRandomNumberGenerator& __urng,
2826 param_type _M_param;
2834 template<
typename _RealType>
2838 {
return !(__d1 == __d2); }
2847 template<
typename _RealType =
double>
2851 "result_type must be a floating point type");
2865 param_type(_RealType __a, _RealType __b = _RealType(1))
2866 : _M_a(__a), _M_b(__b)
2879 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
2883 {
return !(__p1 == __p2); }
2894 : _M_param(__a, __b)
2898 cauchy_distribution(
const param_type& __p)
2914 {
return _M_param.a(); }
2918 {
return _M_param.b(); }
2925 {
return _M_param; }
2933 { _M_param = __param; }
2952 template<
typename _UniformRandomNumberGenerator>
2955 {
return this->
operator()(__urng, _M_param); }
2957 template<
typename _UniformRandomNumberGenerator>
2959 operator()(_UniformRandomNumberGenerator& __urng,
2960 const param_type& __p);
2962 template<
typename _ForwardIterator,
2963 typename _UniformRandomNumberGenerator>
2965 __generate(_ForwardIterator __f, _ForwardIterator __t,
2966 _UniformRandomNumberGenerator& __urng)
2967 { this->__generate(__f, __t, __urng, _M_param); }
2969 template<
typename _ForwardIterator,
2970 typename _UniformRandomNumberGenerator>
2972 __generate(_ForwardIterator __f, _ForwardIterator __t,
2973 _UniformRandomNumberGenerator& __urng,
2974 const param_type& __p)
2975 { this->__generate_impl(__f, __t, __urng, __p); }
2977 template<
typename _UniformRandomNumberGenerator>
2980 _UniformRandomNumberGenerator& __urng,
2981 const param_type& __p)
2982 { this->__generate_impl(__f, __t, __urng, __p); }
2991 {
return __d1._M_param == __d2._M_param; }
2994 template<
typename _ForwardIterator,
2995 typename _UniformRandomNumberGenerator>
2997 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2998 _UniformRandomNumberGenerator& __urng,
2999 const param_type& __p);
3001 param_type _M_param;
3008 template<
typename _RealType>
3012 {
return !(__d1 == __d2); }
3024 template<
typename _RealType,
typename _CharT,
typename _Traits>
3026 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3039 template<
typename _RealType,
typename _CharT,
typename _Traits>
3055 template<
typename _RealType =
double>
3059 "result_type must be a floating point type");
3073 param_type(_RealType __m, _RealType __n = _RealType(1))
3074 : _M_m(__m), _M_n(__n)
3087 {
return __p1._M_m == __p2._M_m && __p1._M_n == __p2._M_n; }
3091 {
return !(__p1 == __p2); }
3102 _RealType __n = _RealType(1))
3103 : _M_param(__m, __n), _M_gd_x(__m / 2), _M_gd_y(__n / 2)
3107 fisher_f_distribution(
const param_type& __p)
3108 : _M_param(__p), _M_gd_x(__p.m() / 2), _M_gd_y(__p.n() / 2)
3126 {
return _M_param.m(); }
3130 {
return _M_param.n(); }
3137 {
return _M_param; }
3145 { _M_param = __param; }
3164 template<
typename _UniformRandomNumberGenerator>
3167 {
return (_M_gd_x(__urng) * n()) / (_M_gd_y(__urng) * m()); }
3169 template<
typename _UniformRandomNumberGenerator>
3171 operator()(_UniformRandomNumberGenerator& __urng,
3172 const param_type& __p)
3176 return ((_M_gd_x(__urng, param_type(__p.m() / 2)) * n())
3177 / (_M_gd_y(__urng, param_type(__p.n() / 2)) * m()));
3180 template<
typename _ForwardIterator,
3181 typename _UniformRandomNumberGenerator>
3183 __generate(_ForwardIterator __f, _ForwardIterator __t,
3184 _UniformRandomNumberGenerator& __urng)
3185 { this->__generate_impl(__f, __t, __urng); }
3187 template<
typename _ForwardIterator,
3188 typename _UniformRandomNumberGenerator>
3190 __generate(_ForwardIterator __f, _ForwardIterator __t,
3191 _UniformRandomNumberGenerator& __urng,
3192 const param_type& __p)
3193 { this->__generate_impl(__f, __t, __urng, __p); }
3195 template<
typename _UniformRandomNumberGenerator>
3198 _UniformRandomNumberGenerator& __urng)
3199 { this->__generate_impl(__f, __t, __urng); }
3201 template<
typename _UniformRandomNumberGenerator>
3204 _UniformRandomNumberGenerator& __urng,
3205 const param_type& __p)
3206 { this->__generate_impl(__f, __t, __urng, __p); }
3216 {
return (__d1._M_param == __d2._M_param
3217 && __d1._M_gd_x == __d2._M_gd_x
3218 && __d1._M_gd_y == __d2._M_gd_y); }
3230 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3232 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3245 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3251 template<
typename _ForwardIterator,
3252 typename _UniformRandomNumberGenerator>
3254 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3255 _UniformRandomNumberGenerator& __urng);
3257 template<
typename _ForwardIterator,
3258 typename _UniformRandomNumberGenerator>
3260 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3261 _UniformRandomNumberGenerator& __urng,
3262 const param_type& __p);
3264 param_type _M_param;
3272 template<
typename _RealType>
3276 {
return !(__d1 == __d2); }
3287 template<
typename _RealType =
double>
3291 "result_type must be a floating point type");
3315 {
return __p1._M_n == __p2._M_n; }
3319 {
return !(__p1 == __p2); }
3329 : _M_param(__n), _M_nd(), _M_gd(__n / 2, 2)
3333 student_t_distribution(
const param_type& __p)
3334 : _M_param(__p), _M_nd(), _M_gd(__p.n() / 2, 2)
3352 {
return _M_param.n(); }
3359 {
return _M_param; }
3367 { _M_param = __param; }
3386 template<
typename _UniformRandomNumberGenerator>
3389 {
return _M_nd(__urng) *
std::sqrt(n() / _M_gd(__urng)); }
3391 template<
typename _UniformRandomNumberGenerator>
3393 operator()(_UniformRandomNumberGenerator& __urng,
3394 const param_type& __p)
3399 const result_type __g = _M_gd(__urng, param_type(__p.n() / 2, 2));
3400 return _M_nd(__urng) *
std::sqrt(__p.n() / __g);
3403 template<
typename _ForwardIterator,
3404 typename _UniformRandomNumberGenerator>
3406 __generate(_ForwardIterator __f, _ForwardIterator __t,
3407 _UniformRandomNumberGenerator& __urng)
3408 { this->__generate_impl(__f, __t, __urng); }
3410 template<
typename _ForwardIterator,
3411 typename _UniformRandomNumberGenerator>
3413 __generate(_ForwardIterator __f, _ForwardIterator __t,
3414 _UniformRandomNumberGenerator& __urng,
3415 const param_type& __p)
3416 { this->__generate_impl(__f, __t, __urng, __p); }
3418 template<
typename _UniformRandomNumberGenerator>
3421 _UniformRandomNumberGenerator& __urng)
3422 { this->__generate_impl(__f, __t, __urng); }
3424 template<
typename _UniformRandomNumberGenerator>
3427 _UniformRandomNumberGenerator& __urng,
3428 const param_type& __p)
3429 { this->__generate_impl(__f, __t, __urng, __p); }
3439 {
return (__d1._M_param == __d2._M_param
3440 && __d1._M_nd == __d2._M_nd && __d1._M_gd == __d2._M_gd); }
3452 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3454 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3467 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3473 template<
typename _ForwardIterator,
3474 typename _UniformRandomNumberGenerator>
3476 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3477 _UniformRandomNumberGenerator& __urng);
3478 template<
typename _ForwardIterator,
3479 typename _UniformRandomNumberGenerator>
3481 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3482 _UniformRandomNumberGenerator& __urng,
3483 const param_type& __p);
3485 param_type _M_param;
3494 template<
typename _RealType>
3498 {
return !(__d1 == __d2); }
3532 __glibcxx_assert((_M_p >= 0.0) && (_M_p <= 1.0));
3541 {
return __p1._M_p == __p2._M_p; }
3545 {
return !(__p1 == __p2); }
3586 {
return _M_param.p(); }
3593 {
return _M_param; }
3601 { _M_param = __param; }
3620 template<
typename _UniformRandomNumberGenerator>
3623 {
return this->
operator()(__urng, _M_param); }
3625 template<
typename _UniformRandomNumberGenerator>
3627 operator()(_UniformRandomNumberGenerator& __urng,
3628 const param_type& __p)
3630 __detail::_Adaptor<_UniformRandomNumberGenerator, double>
3632 if ((__aurng() - __aurng.min())
3633 < __p.p() * (__aurng.max() - __aurng.min()))
3638 template<
typename _ForwardIterator,
3639 typename _UniformRandomNumberGenerator>
3641 __generate(_ForwardIterator __f, _ForwardIterator __t,
3642 _UniformRandomNumberGenerator& __urng)
3643 { this->__generate(__f, __t, __urng, _M_param); }
3645 template<
typename _ForwardIterator,
3646 typename _UniformRandomNumberGenerator>
3648 __generate(_ForwardIterator __f, _ForwardIterator __t,
3649 _UniformRandomNumberGenerator& __urng,
const param_type& __p)
3650 { this->__generate_impl(__f, __t, __urng, __p); }
3652 template<
typename _UniformRandomNumberGenerator>
3655 _UniformRandomNumberGenerator& __urng,
3656 const param_type& __p)
3657 { this->__generate_impl(__f, __t, __urng, __p); }
3666 {
return __d1._M_param == __d2._M_param; }
3669 template<
typename _ForwardIterator,
3670 typename _UniformRandomNumberGenerator>
3672 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3673 _UniformRandomNumberGenerator& __urng,
3674 const param_type& __p);
3676 param_type _M_param;
3686 {
return !(__d1 == __d2); }
3698 template<
typename _CharT,
typename _Traits>
3700 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3712 template<
typename _CharT,
typename _Traits>
3731 template<
typename _IntType =
int>
3735 "result_type must be an integral type");
3751 : _M_t(__t), _M_p(__p)
3753 __glibcxx_assert((_M_t >= _IntType(0))
3769 {
return __p1._M_t == __p2._M_t && __p1._M_p == __p2._M_p; }
3773 {
return !(__p1 == __p2); }
3783 #if _GLIBCXX_USE_C99_MATH_TR1 3784 double _M_d1, _M_d2, _M_s1, _M_s2, _M_c,
3785 _M_a1, _M_a123, _M_s, _M_lf, _M_lp1p;
3796 : _M_param(__t, __p), _M_nd()
3800 binomial_distribution(
const param_type& __p)
3801 : _M_param(__p), _M_nd()
3816 {
return _M_param.t(); }
3823 {
return _M_param.p(); }
3830 {
return _M_param; }
3838 { _M_param = __param; }
3852 {
return _M_param.t(); }
3857 template<
typename _UniformRandomNumberGenerator>
3860 {
return this->
operator()(__urng, _M_param); }
3862 template<
typename _UniformRandomNumberGenerator>
3864 operator()(_UniformRandomNumberGenerator& __urng,
3865 const param_type& __p);
3867 template<
typename _ForwardIterator,
3868 typename _UniformRandomNumberGenerator>
3870 __generate(_ForwardIterator __f, _ForwardIterator __t,
3871 _UniformRandomNumberGenerator& __urng)
3872 { this->__generate(__f, __t, __urng, _M_param); }
3874 template<
typename _ForwardIterator,
3875 typename _UniformRandomNumberGenerator>
3877 __generate(_ForwardIterator __f, _ForwardIterator __t,
3878 _UniformRandomNumberGenerator& __urng,
3879 const param_type& __p)
3880 { this->__generate_impl(__f, __t, __urng, __p); }
3882 template<
typename _UniformRandomNumberGenerator>
3885 _UniformRandomNumberGenerator& __urng,
3886 const param_type& __p)
3887 { this->__generate_impl(__f, __t, __urng, __p); }
3897 #ifdef _GLIBCXX_USE_C99_MATH_TR1 3898 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
3900 {
return __d1._M_param == __d2._M_param; }
3913 template<
typename _IntType1,
3914 typename _CharT,
typename _Traits>
3916 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3929 template<
typename _IntType1,
3930 typename _CharT,
typename _Traits>
3936 template<
typename _ForwardIterator,
3937 typename _UniformRandomNumberGenerator>
3939 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3940 _UniformRandomNumberGenerator& __urng,
3941 const param_type& __p);
3943 template<
typename _UniformRandomNumberGenerator>
3945 _M_waiting(_UniformRandomNumberGenerator& __urng,
3946 _IntType __t,
double __q);
3948 param_type _M_param;
3957 template<
typename _IntType>
3961 {
return !(__d1 == __d2); }
3971 template<
typename _IntType =
int>
3975 "result_type must be an integral type");
3993 __glibcxx_assert((_M_p > 0.0) && (_M_p < 1.0));
4003 {
return __p1._M_p == __p2._M_p; }
4007 {
return !(__p1 == __p2); }
4012 { _M_log_1_p =
std::log(1.0 - _M_p); }
4029 geometric_distribution(
const param_type& __p)
4046 {
return _M_param.p(); }
4053 {
return _M_param; }
4061 { _M_param = __param; }
4080 template<
typename _UniformRandomNumberGenerator>
4083 {
return this->
operator()(__urng, _M_param); }
4085 template<
typename _UniformRandomNumberGenerator>
4087 operator()(_UniformRandomNumberGenerator& __urng,
4088 const param_type& __p);
4090 template<
typename _ForwardIterator,
4091 typename _UniformRandomNumberGenerator>
4093 __generate(_ForwardIterator __f, _ForwardIterator __t,
4094 _UniformRandomNumberGenerator& __urng)
4095 { this->__generate(__f, __t, __urng, _M_param); }
4097 template<
typename _ForwardIterator,
4098 typename _UniformRandomNumberGenerator>
4100 __generate(_ForwardIterator __f, _ForwardIterator __t,
4101 _UniformRandomNumberGenerator& __urng,
4102 const param_type& __p)
4103 { this->__generate_impl(__f, __t, __urng, __p); }
4105 template<
typename _UniformRandomNumberGenerator>
4108 _UniformRandomNumberGenerator& __urng,
4109 const param_type& __p)
4110 { this->__generate_impl(__f, __t, __urng, __p); }
4119 {
return __d1._M_param == __d2._M_param; }
4122 template<
typename _ForwardIterator,
4123 typename _UniformRandomNumberGenerator>
4125 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4126 _UniformRandomNumberGenerator& __urng,
4127 const param_type& __p);
4129 param_type _M_param;
4136 template<
typename _IntType>
4140 {
return !(__d1 == __d2); }
4152 template<
typename _IntType,
4153 typename _CharT,
typename _Traits>
4155 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4167 template<
typename _IntType,
4168 typename _CharT,
typename _Traits>
4181 template<
typename _IntType =
int>
4185 "result_type must be an integral type");
4200 : _M_k(__k), _M_p(__p)
4202 __glibcxx_assert((_M_k > 0) && (_M_p > 0.0) && (_M_p <= 1.0));
4215 {
return __p1._M_k == __p2._M_k && __p1._M_p == __p2._M_p; }
4219 {
return !(__p1 == __p2); }
4230 : _M_param(__k, __p), _M_gd(__k, (1.0 - __p) / __p)
4234 negative_binomial_distribution(
const param_type& __p)
4235 : _M_param(__p), _M_gd(__p.
k(), (1.0 - __p.
p()) / __p.
p())
4250 {
return _M_param.k(); }
4257 {
return _M_param.p(); }
4264 {
return _M_param; }
4272 { _M_param = __param; }
4291 template<
typename _UniformRandomNumberGenerator>
4293 operator()(_UniformRandomNumberGenerator& __urng);
4295 template<
typename _UniformRandomNumberGenerator>
4297 operator()(_UniformRandomNumberGenerator& __urng,
4298 const param_type& __p);
4300 template<
typename _ForwardIterator,
4301 typename _UniformRandomNumberGenerator>
4303 __generate(_ForwardIterator __f, _ForwardIterator __t,
4304 _UniformRandomNumberGenerator& __urng)
4305 { this->__generate_impl(__f, __t, __urng); }
4307 template<
typename _ForwardIterator,
4308 typename _UniformRandomNumberGenerator>
4310 __generate(_ForwardIterator __f, _ForwardIterator __t,
4311 _UniformRandomNumberGenerator& __urng,
4312 const param_type& __p)
4313 { this->__generate_impl(__f, __t, __urng, __p); }
4315 template<
typename _UniformRandomNumberGenerator>
4318 _UniformRandomNumberGenerator& __urng)
4319 { this->__generate_impl(__f, __t, __urng); }
4321 template<
typename _UniformRandomNumberGenerator>
4324 _UniformRandomNumberGenerator& __urng,
4325 const param_type& __p)
4326 { this->__generate_impl(__f, __t, __urng, __p); }
4336 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
4349 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4351 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4364 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4370 template<
typename _ForwardIterator,
4371 typename _UniformRandomNumberGenerator>
4373 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4374 _UniformRandomNumberGenerator& __urng);
4375 template<
typename _ForwardIterator,
4376 typename _UniformRandomNumberGenerator>
4378 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4379 _UniformRandomNumberGenerator& __urng,
4380 const param_type& __p);
4382 param_type _M_param;
4390 template<
typename _IntType>
4394 {
return !(__d1 == __d2); }
4412 template<
typename _IntType =
int>
4416 "result_type must be an integral type");
4434 __glibcxx_assert(_M_mean > 0.0);
4444 {
return __p1._M_mean == __p2._M_mean; }
4448 {
return !(__p1 == __p2); }
4458 #if _GLIBCXX_USE_C99_MATH_TR1 4459 double _M_lfm, _M_sm, _M_d, _M_scx, _M_1cx, _M_c2b, _M_cb;
4469 : _M_param(__mean), _M_nd()
4473 poisson_distribution(
const param_type& __p)
4474 : _M_param(__p), _M_nd()
4489 {
return _M_param.mean(); }
4496 {
return _M_param; }
4504 { _M_param = __param; }
4523 template<
typename _UniformRandomNumberGenerator>
4526 {
return this->
operator()(__urng, _M_param); }
4528 template<
typename _UniformRandomNumberGenerator>
4530 operator()(_UniformRandomNumberGenerator& __urng,
4531 const param_type& __p);
4533 template<
typename _ForwardIterator,
4534 typename _UniformRandomNumberGenerator>
4536 __generate(_ForwardIterator __f, _ForwardIterator __t,
4537 _UniformRandomNumberGenerator& __urng)
4538 { this->__generate(__f, __t, __urng, _M_param); }
4540 template<
typename _ForwardIterator,
4541 typename _UniformRandomNumberGenerator>
4543 __generate(_ForwardIterator __f, _ForwardIterator __t,
4544 _UniformRandomNumberGenerator& __urng,
4545 const param_type& __p)
4546 { this->__generate_impl(__f, __t, __urng, __p); }
4548 template<
typename _UniformRandomNumberGenerator>
4551 _UniformRandomNumberGenerator& __urng,
4552 const param_type& __p)
4553 { this->__generate_impl(__f, __t, __urng, __p); }
4563 #ifdef _GLIBCXX_USE_C99_MATH_TR1 4564 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
4566 {
return __d1._M_param == __d2._M_param; }
4579 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4581 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4594 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4600 template<
typename _ForwardIterator,
4601 typename _UniformRandomNumberGenerator>
4603 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4604 _UniformRandomNumberGenerator& __urng,
4605 const param_type& __p);
4607 param_type _M_param;
4616 template<
typename _IntType>
4620 {
return !(__d1 == __d2); }
4638 template<
typename _RealType =
double>
4642 "result_type must be a floating point type");
4657 : _M_lambda(__lambda)
4659 __glibcxx_assert(_M_lambda > _RealType(0));
4664 {
return _M_lambda; }
4668 {
return __p1._M_lambda == __p2._M_lambda; }
4672 {
return !(__p1 == __p2); }
4675 _RealType _M_lambda;
4691 : _M_param(__lambda)
4712 {
return _M_param.lambda(); }
4719 {
return _M_param; }
4727 { _M_param = __param; }
4746 template<
typename _UniformRandomNumberGenerator>
4749 {
return this->
operator()(__urng, _M_param); }
4751 template<
typename _UniformRandomNumberGenerator>
4753 operator()(_UniformRandomNumberGenerator& __urng,
4754 const param_type& __p)
4756 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
4761 template<
typename _ForwardIterator,
4762 typename _UniformRandomNumberGenerator>
4764 __generate(_ForwardIterator __f, _ForwardIterator __t,
4765 _UniformRandomNumberGenerator& __urng)
4766 { this->__generate(__f, __t, __urng, _M_param); }
4768 template<
typename _ForwardIterator,
4769 typename _UniformRandomNumberGenerator>
4771 __generate(_ForwardIterator __f, _ForwardIterator __t,
4772 _UniformRandomNumberGenerator& __urng,
4773 const param_type& __p)
4774 { this->__generate_impl(__f, __t, __urng, __p); }
4776 template<
typename _UniformRandomNumberGenerator>
4779 _UniformRandomNumberGenerator& __urng,
4780 const param_type& __p)
4781 { this->__generate_impl(__f, __t, __urng, __p); }
4790 {
return __d1._M_param == __d2._M_param; }
4793 template<
typename _ForwardIterator,
4794 typename _UniformRandomNumberGenerator>
4796 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4797 _UniformRandomNumberGenerator& __urng,
4798 const param_type& __p);
4800 param_type _M_param;
4807 template<
typename _RealType>
4811 {
return !(__d1 == __d2); }
4823 template<
typename _RealType,
typename _CharT,
typename _Traits>
4825 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4838 template<
typename _RealType,
typename _CharT,
typename _Traits>
4853 template<
typename _RealType =
double>
4857 "result_type must be a floating point type");
4871 param_type(_RealType __a, _RealType __b = _RealType(1.0))
4872 : _M_a(__a), _M_b(__b)
4885 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
4889 {
return !(__p1 == __p2); }
4900 : _M_param(__a, __b)
4904 weibull_distribution(
const param_type& __p)
4920 {
return _M_param.a(); }
4927 {
return _M_param.b(); }
4934 {
return _M_param; }
4942 { _M_param = __param; }
4961 template<
typename _UniformRandomNumberGenerator>
4964 {
return this->
operator()(__urng, _M_param); }
4966 template<
typename _UniformRandomNumberGenerator>
4968 operator()(_UniformRandomNumberGenerator& __urng,
4969 const param_type& __p);
4971 template<
typename _ForwardIterator,
4972 typename _UniformRandomNumberGenerator>
4974 __generate(_ForwardIterator __f, _ForwardIterator __t,
4975 _UniformRandomNumberGenerator& __urng)
4976 { this->__generate(__f, __t, __urng, _M_param); }
4978 template<
typename _ForwardIterator,
4979 typename _UniformRandomNumberGenerator>
4981 __generate(_ForwardIterator __f, _ForwardIterator __t,
4982 _UniformRandomNumberGenerator& __urng,
4983 const param_type& __p)
4984 { this->__generate_impl(__f, __t, __urng, __p); }
4986 template<
typename _UniformRandomNumberGenerator>
4989 _UniformRandomNumberGenerator& __urng,
4990 const param_type& __p)
4991 { this->__generate_impl(__f, __t, __urng, __p); }
5000 {
return __d1._M_param == __d2._M_param; }
5003 template<
typename _ForwardIterator,
5004 typename _UniformRandomNumberGenerator>
5006 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5007 _UniformRandomNumberGenerator& __urng,
5008 const param_type& __p);
5010 param_type _M_param;
5017 template<
typename _RealType>
5021 {
return !(__d1 == __d2); }
5033 template<
typename _RealType,
typename _CharT,
typename _Traits>
5035 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5048 template<
typename _RealType,
typename _CharT,
typename _Traits>
5063 template<
typename _RealType =
double>
5067 "result_type must be a floating point type");
5081 param_type(_RealType __a, _RealType __b = _RealType(1.0))
5082 : _M_a(__a), _M_b(__b)
5095 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
5099 {
return !(__p1 == __p2); }
5110 : _M_param(__a, __b)
5114 extreme_value_distribution(
const param_type& __p)
5130 {
return _M_param.a(); }
5137 {
return _M_param.b(); }
5144 {
return _M_param; }
5152 { _M_param = __param; }
5171 template<
typename _UniformRandomNumberGenerator>
5174 {
return this->
operator()(__urng, _M_param); }
5176 template<
typename _UniformRandomNumberGenerator>
5178 operator()(_UniformRandomNumberGenerator& __urng,
5179 const param_type& __p);
5181 template<
typename _ForwardIterator,
5182 typename _UniformRandomNumberGenerator>
5184 __generate(_ForwardIterator __f, _ForwardIterator __t,
5185 _UniformRandomNumberGenerator& __urng)
5186 { this->__generate(__f, __t, __urng, _M_param); }
5188 template<
typename _ForwardIterator,
5189 typename _UniformRandomNumberGenerator>
5191 __generate(_ForwardIterator __f, _ForwardIterator __t,
5192 _UniformRandomNumberGenerator& __urng,
5193 const param_type& __p)
5194 { this->__generate_impl(__f, __t, __urng, __p); }
5196 template<
typename _UniformRandomNumberGenerator>
5199 _UniformRandomNumberGenerator& __urng,
5200 const param_type& __p)
5201 { this->__generate_impl(__f, __t, __urng, __p); }
5210 {
return __d1._M_param == __d2._M_param; }
5213 template<
typename _ForwardIterator,
5214 typename _UniformRandomNumberGenerator>
5216 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5217 _UniformRandomNumberGenerator& __urng,
5218 const param_type& __p);
5220 param_type _M_param;
5227 template<
typename _RealType>
5231 {
return !(__d1 == __d2); }
5243 template<
typename _RealType,
typename _CharT,
typename _Traits>
5245 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5258 template<
typename _RealType,
typename _CharT,
typename _Traits>
5270 template<
typename _IntType =
int>
5274 "result_type must be an integral type");
5287 : _M_prob(), _M_cp()
5290 template<
typename _InputIterator>
5292 _InputIterator __wend)
5293 : _M_prob(__wbegin, __wend), _M_cp()
5294 { _M_initialize(); }
5297 : _M_prob(__wil.begin(), __wil.end()), _M_cp()
5298 { _M_initialize(); }
5300 template<
typename _Func>
5301 param_type(
size_t __nw,
double __xmin,
double __xmax,
5309 probabilities()
const 5314 {
return __p1._M_prob == __p2._M_prob; }
5318 {
return !(__p1 == __p2); }
5332 template<
typename _InputIterator>
5334 _InputIterator __wend)
5335 : _M_param(__wbegin, __wend)
5338 discrete_distribution(initializer_list<double> __wl)
5342 template<
typename _Func>
5343 discrete_distribution(
size_t __nw,
double __xmin,
double __xmax,
5345 : _M_param(__nw, __xmin, __xmax, __fw)
5349 discrete_distribution(
const param_type& __p)
5366 return _M_param._M_prob.
empty()
5375 {
return _M_param; }
5383 { _M_param = __param; }
5398 return _M_param._M_prob.
empty()
5405 template<
typename _UniformRandomNumberGenerator>
5408 {
return this->
operator()(__urng, _M_param); }
5410 template<
typename _UniformRandomNumberGenerator>
5412 operator()(_UniformRandomNumberGenerator& __urng,
5413 const param_type& __p);
5415 template<
typename _ForwardIterator,
5416 typename _UniformRandomNumberGenerator>
5418 __generate(_ForwardIterator __f, _ForwardIterator __t,
5419 _UniformRandomNumberGenerator& __urng)
5420 { this->__generate(__f, __t, __urng, _M_param); }
5422 template<
typename _ForwardIterator,
5423 typename _UniformRandomNumberGenerator>
5425 __generate(_ForwardIterator __f, _ForwardIterator __t,
5426 _UniformRandomNumberGenerator& __urng,
5427 const param_type& __p)
5428 { this->__generate_impl(__f, __t, __urng, __p); }
5430 template<
typename _UniformRandomNumberGenerator>
5433 _UniformRandomNumberGenerator& __urng,
5434 const param_type& __p)
5435 { this->__generate_impl(__f, __t, __urng, __p); }
5444 {
return __d1._M_param == __d2._M_param; }
5456 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5458 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5472 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5478 template<
typename _ForwardIterator,
5479 typename _UniformRandomNumberGenerator>
5481 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5482 _UniformRandomNumberGenerator& __urng,
5483 const param_type& __p);
5485 param_type _M_param;
5492 template<
typename _IntType>
5496 {
return !(__d1 == __d2); }
5505 template<
typename _RealType =
double>
5509 "result_type must be a floating point type");
5522 : _M_int(), _M_den(), _M_cp()
5525 template<
typename _InputIteratorB,
typename _InputIteratorW>
5527 _InputIteratorB __bend,
5528 _InputIteratorW __wbegin);
5530 template<
typename _Func>
5533 template<
typename _Func>
5534 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5547 __tmp[1] = _RealType(1);
5560 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
5564 {
return !(__p1 == __p2); }
5579 template<
typename _InputIteratorB,
typename _InputIteratorW>
5581 _InputIteratorB __bend,
5582 _InputIteratorW __wbegin)
5583 : _M_param(__bfirst, __bend, __wbegin)
5586 template<
typename _Func>
5587 piecewise_constant_distribution(initializer_list<_RealType> __bl,
5589 : _M_param(__bl, __fw)
5592 template<
typename _Func>
5593 piecewise_constant_distribution(
size_t __nw,
5594 _RealType __xmin, _RealType __xmax,
5596 : _M_param(__nw, __xmin, __xmax, __fw)
5600 piecewise_constant_distribution(
const param_type& __p)
5617 if (_M_param._M_int.
empty())
5620 __tmp[1] = _RealType(1);
5624 return _M_param._M_int;
5633 return _M_param._M_den.
empty()
5642 {
return _M_param; }
5650 { _M_param = __param; }
5658 return _M_param._M_int.
empty()
5668 return _M_param._M_int.
empty()
5675 template<
typename _UniformRandomNumberGenerator>
5678 {
return this->
operator()(__urng, _M_param); }
5680 template<
typename _UniformRandomNumberGenerator>
5682 operator()(_UniformRandomNumberGenerator& __urng,
5683 const param_type& __p);
5685 template<
typename _ForwardIterator,
5686 typename _UniformRandomNumberGenerator>
5688 __generate(_ForwardIterator __f, _ForwardIterator __t,
5689 _UniformRandomNumberGenerator& __urng)
5690 { this->__generate(__f, __t, __urng, _M_param); }
5692 template<
typename _ForwardIterator,
5693 typename _UniformRandomNumberGenerator>
5695 __generate(_ForwardIterator __f, _ForwardIterator __t,
5696 _UniformRandomNumberGenerator& __urng,
5697 const param_type& __p)
5698 { this->__generate_impl(__f, __t, __urng, __p); }
5700 template<
typename _UniformRandomNumberGenerator>
5703 _UniformRandomNumberGenerator& __urng,
5704 const param_type& __p)
5705 { this->__generate_impl(__f, __t, __urng, __p); }
5714 {
return __d1._M_param == __d2._M_param; }
5727 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5729 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5743 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5749 template<
typename _ForwardIterator,
5750 typename _UniformRandomNumberGenerator>
5752 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5753 _UniformRandomNumberGenerator& __urng,
5754 const param_type& __p);
5756 param_type _M_param;
5763 template<
typename _RealType>
5767 {
return !(__d1 == __d2); }
5776 template<
typename _RealType =
double>
5780 "result_type must be a floating point type");
5793 : _M_int(), _M_den(), _M_cp(), _M_m()
5796 template<
typename _InputIteratorB,
typename _InputIteratorW>
5798 _InputIteratorB __bend,
5799 _InputIteratorW __wbegin);
5801 template<
typename _Func>
5804 template<
typename _Func>
5805 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5818 __tmp[1] = _RealType(1);
5831 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
5835 {
return !(__p1 == __p2); }
5851 template<
typename _InputIteratorB,
typename _InputIteratorW>
5853 _InputIteratorB __bend,
5854 _InputIteratorW __wbegin)
5855 : _M_param(__bfirst, __bend, __wbegin)
5858 template<
typename _Func>
5859 piecewise_linear_distribution(initializer_list<_RealType> __bl,
5861 : _M_param(__bl, __fw)
5864 template<
typename _Func>
5865 piecewise_linear_distribution(
size_t __nw,
5866 _RealType __xmin, _RealType __xmax,
5868 : _M_param(__nw, __xmin, __xmax, __fw)
5872 piecewise_linear_distribution(
const param_type& __p)
5889 if (_M_param._M_int.
empty())
5892 __tmp[1] = _RealType(1);
5896 return _M_param._M_int;
5906 return _M_param._M_den.
empty()
5915 {
return _M_param; }
5923 { _M_param = __param; }
5931 return _M_param._M_int.
empty()
5941 return _M_param._M_int.
empty()
5948 template<
typename _UniformRandomNumberGenerator>
5951 {
return this->
operator()(__urng, _M_param); }
5953 template<
typename _UniformRandomNumberGenerator>
5955 operator()(_UniformRandomNumberGenerator& __urng,
5956 const param_type& __p);
5958 template<
typename _ForwardIterator,
5959 typename _UniformRandomNumberGenerator>
5961 __generate(_ForwardIterator __f, _ForwardIterator __t,
5962 _UniformRandomNumberGenerator& __urng)
5963 { this->__generate(__f, __t, __urng, _M_param); }
5965 template<
typename _ForwardIterator,
5966 typename _UniformRandomNumberGenerator>
5968 __generate(_ForwardIterator __f, _ForwardIterator __t,
5969 _UniformRandomNumberGenerator& __urng,
5970 const param_type& __p)
5971 { this->__generate_impl(__f, __t, __urng, __p); }
5973 template<
typename _UniformRandomNumberGenerator>
5976 _UniformRandomNumberGenerator& __urng,
5977 const param_type& __p)
5978 { this->__generate_impl(__f, __t, __urng, __p); }
5987 {
return __d1._M_param == __d2._M_param; }
6000 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6002 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
6016 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6022 template<
typename _ForwardIterator,
6023 typename _UniformRandomNumberGenerator>
6025 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6026 _UniformRandomNumberGenerator& __urng,
6027 const param_type& __p);
6029 param_type _M_param;
6036 template<
typename _RealType>
6040 {
return !(__d1 == __d2); }
6068 template<
typename _IntType>
6071 template<
typename _InputIterator>
6072 seed_seq(_InputIterator __begin, _InputIterator __end);
6075 template<
typename _RandomAccessIterator>
6077 generate(_RandomAccessIterator __begin, _RandomAccessIterator __end);
6080 size_t size() const noexcept
6081 {
return _M_v.
size(); }
6083 template<
typename _OutputIterator>
6085 param(_OutputIterator __dest)
const 6086 { std::copy(_M_v.
begin(), _M_v.
end(), __dest); }
6100 _GLIBCXX_END_NAMESPACE_VERSION
A discrete Poisson random number 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 weibull_distribution &__d1, const weibull_distribution &__d2)
Return true if two Weibull distributions have the same parameters.
static constexpr result_type min()
Gets the smallest possible value in the output range.
bool equal(_IIter1 __first1, _IIter1 __last1, _IIter2 __first2, _IIter2 __last2, _BinaryPredicate __binary_pred)
Tests a range for element-wise equality.
friend bool operator==(const geometric_distribution &__d1, const geometric_distribution &__d2)
Return true if two geometric distributions have the same parameters.
void reset()
Resets the distribution state.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
param_type param() const
Returns the parameter set of the distribution.
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine object.
discard_block_engine(_Sseq &__q)
Generator construct a discard_block_engine engine.
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...
void discard(unsigned long long __z)
_If_seed_seq< _Sseq > seed(_Sseq &__q)
Reseeds the discard_block_engine object with the given seed sequence.
void seed(result_type __s)
Reseeds the discard_block_engine object with the default seed for the underlying base class generator...
A discrete binomial random number distribution.
double p() const
Return the parameter of the distribution.
_IntType k() const
Return the parameter of the distribution.
uniform_real_distribution(_RealType __a, _RealType __b=_RealType(1))
Constructs a uniform_real_distribution object.
result_type min() const
Returns the greatest lower bound value of the distribution.
subtract_with_carry_engine(result_type __sd)
Constructs an explicitly seeded subtract_with_carry_engine random number generator.
linear_congruential_engine(result_type __s)
Constructs a linear_congruential_engine random number generator engine with seed __s. The default seed value is 1.
static constexpr result_type max()
Gets the largest possible value in the output range.
void param(const param_type &__param)
Sets the parameter set of the distribution.
param_type param() const
Returns the parameter set of the distribution.
gamma_distribution(_RealType __alpha_val, _RealType __beta_val=_RealType(1))
Constructs a gamma distribution with parameters and .
shuffle_order_engine()
Constructs a default shuffle_order_engine engine.
void seed()
Reseeds the independent_bits_engine object with the default seed for the underlying base class genera...
void reset()
Resets the distribution state.
shuffle_order_engine(_RandomNumberEngine &&__rng)
Move constructs a shuffle_order_engine engine.
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
mersenne_twister_engine< uint_fast32_t, 32, 624, 397, 31, 0x9908b0dfUL, 11, 0xffffffffUL, 7, 0x9d2c5680UL, 15, 0xefc60000UL, 18, 1812433253UL > mt19937
ISO C++ entities toplevel namespace is std.
gamma_distribution()
Constructs a gamma distribution with parameters 1 and 1.
A lognormal_distribution random number distribution.
bernoulli_distribution()
Constructs a Bernoulli distribution with likelihood 0.5.
_GLIBCXX_END_NAMESPACE_CXX11 typedef basic_string< char > string
A string of char.
static constexpr result_type increment
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
exponential_distribution()
Constructs an exponential distribution with inverse scale parameter 1.0.
void reset()
Resets the distribution state.
An exponential continuous distribution for random numbers.
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...
linear_congruential_engine< uint_fast32_t, 48271UL, 0UL, 2147483647UL > minstd_rand
Properties of fundamental types.
result_type min() const
Returns the greatest lower bound value of the distribution.
uniform_real_distribution()
Constructs a uniform_real_distribution object.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type max() const
Returns the inclusive upper bound of the distribution range.
void param(const param_type &__param)
Sets the parameter set of the distribution.
linear_congruential_engine()
Constructs a linear_congruential_engine random number generator engine with seed 1.
A discrete geometric random number distribution.
result_type max() const
Returns the least upper bound value of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::lognormal_distribution< _RealType1 > &__x)
Extracts a lognormal_distribution random number distribution __x from the input stream __is...
friend bool operator==(const exponential_distribution &__d1, const exponential_distribution &__d2)
Return true if two exponential distributions have the same parameters.
friend bool operator==(const 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 uniform_real_distribution &__d1, const uniform_real_distribution &__d2)
Return true if two uniform real distributions have the same parameters.
constexpr int __lg(int __n)
This is a helper function for the sort routines and for random.tcc.
independent_bits_engine(_Sseq &__q)
Generator construct a independent_bits_engine engine.
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...
void seed(result_type __s=default_seed)
Reseeds the linear_congruential_engine random number generator engine sequence to the seed __s...
param_type param() const
Returns the parameter set of the distribution.
A piecewise_constant_distribution random number distribution.
friend bool operator==(const negative_binomial_distribution &__d1, const negative_binomial_distribution &__d2)
Return true if two negative binomial distributions have the same parameters and the sequences that wo...
void discard(unsigned long long __z)
Discard a sequence of random numbers.
std::vector< double > probabilities() const
Returns the probabilities 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 poisson_distribution &__d1, const poisson_distribution &__d2)
Return true if two Poisson distributions have the same parameters and the sequences that would be gen...
A gamma continuous distribution for random numbers.
_If_seed_seq< _Sseq > seed(_Sseq &__q)
Reseeds the shuffle_order_engine object with the given seed sequence.
friend bool operator==(const extreme_value_distribution &__d1, const extreme_value_distribution &__d2)
Return true if two extreme value distributions have the same parameters.
void reset()
Resets the distribution state.
_RealType beta() const
Returns the 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.
shuffle_order_engine(_Sseq &__q)
Generator construct a shuffle_order_engine engine.
reference front() noexcept
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::mersenne_twister_engine< _UIntType1, __w1, __n1, __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1, __l1, __f1 > &__x)
Extracts the current state of a % mersenne_twister_engine random number generator engine __x from the...
static constexpr result_type min()
Gets the inclusive minimum value of the range of random integers returned by this generator...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
A weibull_distribution random number distribution.
uint_least32_t result_type
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...
linear_congruential_engine< uint_fast32_t, 16807UL, 0UL, 2147483647UL > minstd_rand0
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
param_type param() const
Returns the parameter set of the distribution.
Uniform continuous distribution for random numbers.
void reset()
Resets the distribution state.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine object.
result_type operator()()
Gets the next value in the generated random number sequence.
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::linear_congruential_engine< _UIntType1, __a1, __c1, __m1 > &__lcr)
Sets the state of the engine by reading its textual representation from __is.
independent_bits_engine(result_type __s)
Seed constructs a independent_bits_engine engine.
friend bool operator==(const discrete_distribution &__d1, const discrete_distribution &__d2)
Return true if two discrete distributions have the same parameters.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void param(const param_type &__param)
Sets the parameter set of the distribution.
Uniform discrete distribution for random numbers. A discrete random distribution on the range with e...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
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...
static constexpr result_type max()
Template class basic_ostream.
static constexpr result_type min()
Gets the minimum value in the generated random number range.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
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 ...
_RealType b() const
Return the parameter of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
std::vector< double > densities() const
Returns a vector of the probability densities.
A chi_squared_distribution random number distribution.
std::vector< _RealType > intervals() const
Returns a vector of the intervals.
_RealType a() const
Return the parameter of the distribution.
result_type operator()()
Gets the next value in the generated random number sequence.
void seed(result_type __s)
Reseeds the independent_bits_engine object with the default seed for the underlying base class genera...
_RealType mean() const
Returns the mean of the distribution.
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...
size_type size() const noexcept
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
A extreme_value_distribution random number distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
complex< _Tp > sqrt(const complex< _Tp > &)
Return complex square root of z.
complex< _Tp > exp(const complex< _Tp > &)
Return complex base e exponential of z.
void param(const param_type &__param)
Sets the parameter set of the distribution.
double p() const
Returns the p parameter of the distribution.
discard_block_engine()
Constructs a default discard_block_engine engine.
param_type param() const
Returns the parameter set of the distribution.
_GLIBCXX_NODISCARD bool empty() const noexcept
static constexpr result_type multiplier
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 inclusive lower bound of the distribution range.
Template class basic_istream.
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 min() const
Returns the greatest lower bound value of the distribution.
_IntType t() const
Returns the distribution t parameter.
linear_congruential_engine(_Sseq &__q)
Constructs a linear_congruential_engine random number generator engine seeded from the seed sequence ...
static constexpr result_type min()
Gets the minimum 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 ...
const _RandomNumberEngine & base() const noexcept
independent_bits_engine()
Constructs a default independent_bits_engine engine.
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...
static constexpr result_type max()
Gets the largest possible value in the output range.
_RealType a() const
Return the parameter of the distribution.
shuffle_order_engine(result_type __s)
Seed constructs a 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...
_RandomNumberEngine::result_type result_type
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.
void reset()
Resets the distribution state.
void reset()
Resets the distribution state.
result_type max() const
Returns the least upper bound value of the distribution.
iterator begin() noexcept
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...
_RealType alpha() const
Returns the of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, bitset< _Nb > &__x)
Global I/O operators for bitsets.
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 shuffle_order_engine object with the default seed for the underlying base class generator...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type max() const
Returns the least upper bound value of the distribution.
static constexpr result_type max()
Gets the maximum value in the generated random number range.
_If_seed_seq< _Sseq > seed(_Sseq &__q)
Reseeds the independent_bits_engine object with the given seed sequence.
_RandomNumberEngine::result_type result_type
param_type param() const
Returns the parameter set of the distribution.
static constexpr result_type min()
Gets the smallest possible value in the output range.
A fisher_f_distribution random number distribution.
param_type param() const
Returns the parameter set of the distribution.
shuffle_order_engine(const _RandomNumberEngine &__rng)
Copy constructs a shuffle_order_engine engine.
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 ...
void param(const param_type &__param)
Sets the parameter set of the distribution.
discard_block_engine(const _RandomNumberEngine &__rng)
Copy constructs a discard_block_engine engine.
double mean() const
Returns the distribution parameter mean.
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...
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
param_type param() const
Returns the parameter set of the distribution.
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...
result_type operator()()
Gets the next random number in the sequence.
exponential_distribution(_RealType __lambda)
Constructs an exponential distribution with inverse scale parameter .
param_type param() const
Returns the parameter set of the distribution.
param_type param() const
Returns 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...
void reset()
Resets the distribution state.
void reset()
Resets the distribution state.
void param(const param_type &__param)
Sets the parameter set of the distribution.
friend bool operator==(const piecewise_constant_distribution &__d1, const piecewise_constant_distribution &__d2)
Return true if two piecewise constant distributions have the same parameters.
result_type min() const
Returns the greatest lower 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...
void reset()
Resets the distribution state.
void param(const param_type &__param)
Sets the parameter set of the distribution.
reference back() noexcept
result_type max() const
Returns the least upper bound value of the distribution.
normal_distribution(result_type __mean, result_type __stddev=result_type(1))
result_type min() const
Returns the greatest lower bound value of the distribution.
A model of a linear congruential random number generator.
result_type max() const
Returns the least upper bound value of the distribution.
complex< _Tp > log(const complex< _Tp > &)
Return complex natural logarithm of z.
void reset()
Resets the distribution state.
result_type operator()()
Gets the next random number in the sequence.
result_type min() const
Returns the greatest lower bound value of the distribution.
param_type param() const
Returns the parameter set of the distribution.
static constexpr _Tp lowest() noexcept
void reset()
Resets the distribution state.
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::gamma_distribution< _RealType1 > &__x)
Extracts a gamma_distribution random number distribution __x from the input stream __is...
void discard(unsigned long long __z)
Discard a sequence of random numbers.
static constexpr _Tp min() noexcept
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...
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 operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
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...
void discard(unsigned long long __z)
Discard a sequence of random numbers.
result_type max() const
Returns the least upper bound value of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
_RealType stddev() const
Returns the standard deviation of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend bool operator==(const shuffle_order_engine &__lhs, const shuffle_order_engine &__rhs)
_GLIBCXX14_CONSTEXPR const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
friend bool operator==(const cauchy_distribution &__d1, const cauchy_distribution &__d2)
Return true if two Cauchy distributions have the same parameters.
void param(const param_type &__param)
Sets the parameter set of the distribution.
friend bool operator==(const bernoulli_distribution &__d1, const bernoulli_distribution &__d2)
Return true if two Bernoulli distributions have the same parameters.
independent_bits_engine(const _RandomNumberEngine &__rng)
Copy constructs a independent_bits_engine engine.
A negative_binomial_distribution random number distribution.
Produces random numbers by combining random numbers from some base engine to produce random numbers w...
std::vector< _RealType > intervals() const
Return the intervals of the distribution.
__gnu_cxx::__promote_2< _Tpa, _Tpb >::__type beta(_Tpa __a, _Tpb __b)
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.
One of the math functors.
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.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
_RealType lambda() const
Returns the inverse scale parameter of the distribution.
result_type min() const
Returns the greatest lower 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...
subtract_with_carry_engine(_Sseq &__q)
Constructs a subtract_with_carry_engine random number engine seeded from the seed sequence __q...
param_type param() const
Returns the parameter set of the distribution.
discard_block_engine(result_type __s)
Seed constructs a discard_block_engine engine.
static constexpr _Tp max() noexcept
A student_t_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...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type max() const
Returns the least upper bound value of the distribution.
A normal continuous distribution for random numbers.
static constexpr result_type max()
Gets the maximum value in the generated random number range.
void reset()
Resets the distribution state.
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 min() const
Returns the greatest lower bound value of the distribution.
void seed(result_type __sd=default_seed)
Seeds the initial state of the random number generator.
A piecewise_linear_distribution random number distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
double p() const
Returns the distribution parameter p.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
std::vector< double > densities() const
Return a vector of the probability densities of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::student_t_distribution< _RealType1 > &__x)
Extracts a student_t_distribution random number distribution __x from the input stream __is...
double p() const
Returns the distribution p parameter.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type min() const
Returns the greatest lower bound value of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::chi_squared_distribution< _RealType1 > &__x)
Extracts a chi_squared_distribution random number distribution __x from the input stream __is...
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...
static constexpr result_type min()
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void reset()
Resets the distribution state.
independent_bits_engine(_RandomNumberEngine &&__rng)
Move constructs a independent_bits_engine engine.
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...
_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.
The Marsaglia-Zaman generator.
_GLIBCXX14_CONSTEXPR const _Tp & max(const _Tp &, const _Tp &)
This does what you think it does.
param_type param() const
Returns the parameter set of the distribution.
A discrete_distribution random number distribution.
param_type param() const
Returns the parameter set of the distribution.
_RealType b() const
Return the parameter of the distribution.
param_type param() const
Returns the parameter set of the distribution.
A Bernoulli random number distribution.
param_type param() const
Returns the parameter set of the distribution.
void reset()
Resets the distribution state.
mersenne_twister_engine< uint_fast64_t, 64, 312, 156, 31, 0xb5026f5aa96619e9ULL, 29, 0x5555555555555555ULL, 17, 0x71d67fffeda60000ULL, 37, 0xfff7eee000000000ULL, 43, 6364136223846793005ULL > mt19937_64
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.
bernoulli_distribution(double __p)
Constructs a Bernoulli distribution with likelihood p.
The seed_seq class generates sequences of seeds for random number generators.
friend bool operator==(const lognormal_distribution &__d1, const lognormal_distribution &__d2)
Return true if two lognormal distributions have the same parameters and the sequences that would be g...
param_type param() const
Returns the parameter set of the distribution.
A cauchy_distribution random number distribution.
void reset()
Resets the distribution state.
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(_RandomNumberEngine &&__rng)
Move constructs a discard_block_engine engine.
result_type max() const
Returns the least upper bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void seed()
Reseeds the discard_block_engine object with the default seed for the underlying base class generator...
Define a member typedef type only if a boolean constant is true.