37 namespace std _GLIBCXX_VISIBILITY(default)
39 _GLIBCXX_BEGIN_NAMESPACE_VERSION
58 template<
typename _RealType,
size_t __bits,
59 typename _UniformRandomNumberGenerator>
68 template<
typename _UIntType,
size_t __w,
69 bool = __w < static_cast<size_t>
72 {
static const _UIntType __value = 0; };
74 template<
typename _UIntType,
size_t __w>
75 struct _Shift<_UIntType, __w, true>
76 {
static const _UIntType __value = _UIntType(1) << __w; };
79 int __which = ((__s <= __CHAR_BIT__ *
sizeof (int))
80 + (__s <= __CHAR_BIT__ *
sizeof (long))
81 + (__s <= __CHAR_BIT__ *
sizeof (
long long))
84 struct _Select_uint_least_t
86 static_assert(__which < 0,
87 "sorry, would be too much trouble for a slow result");
91 struct _Select_uint_least_t<__s, 4>
92 {
typedef unsigned int type; };
95 struct _Select_uint_least_t<__s, 3>
96 {
typedef unsigned long type; };
99 struct _Select_uint_least_t<__s, 2>
100 {
typedef unsigned long long type; };
102 #ifdef _GLIBCXX_USE_INT128 104 struct _Select_uint_least_t<__s, 1>
105 {
typedef unsigned __int128 type; };
109 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
110 bool __big_enough = (!(__m & (__m - 1))
111 || (_Tp(-1) - __c) / __a >= __m - 1),
112 bool __schrage_ok = __m % __a < __m / __a>
115 typedef typename _Select_uint_least_t<
std::__lg(__a)
119 {
return static_cast<_Tp
>((_Tp2(__a) * __x + __c) % __m); }
123 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c>
124 struct _Mod<_Tp, __m, __a, __c, false, true>
133 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
bool __s>
134 struct _Mod<_Tp, __m, __a, __c, true, __s>
139 _Tp __res = __a * __x + __c;
146 template<
typename _Tp, _Tp __m, _Tp __a = 1, _Tp __c = 0>
149 {
return _Mod<_Tp, __m, __a, __c>::__calc(__x); }
155 template<
typename _Engine,
typename _DInputType>
159 "template argument must be a floating point type");
162 _Adaptor(_Engine& __g)
167 {
return _DInputType(0); }
171 {
return _DInputType(1); }
190 template<
typename _Sseq>
191 using __seed_seq_generate_t = decltype(
192 std::declval<_Sseq&>().generate(std::declval<uint_least32_t*>(),
193 std::declval<uint_least32_t*>()));
197 template<
typename _Sseq,
typename _Engine,
typename _Res,
198 typename _GenerateCheck = __seed_seq_generate_t<_Sseq>>
199 using __is_seed_seq = __and_<
200 __not_<is_same<__remove_cvref_t<_Sseq>, _Engine>>,
201 is_unsigned<typename _Sseq::result_type>,
202 __not_<is_convertible<_Sseq, _Res>>
245 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
248 static_assert(std::is_unsigned<_UIntType>::value,
249 "result_type must be an unsigned integral type");
250 static_assert(__m == 0u || (__a < __m && __c < __m),
251 "template argument substituting __m out of bounds");
253 template<
typename _Sseq>
254 using _If_seed_seq =
typename enable_if<__detail::__is_seed_seq<
293 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
314 template<
typename _Sseq>
326 {
return __c == 0u ? 1u : 0u; }
341 for (; __z != 0ULL; --__z)
351 _M_x = __detail::__mod<_UIntType, __m, __a, __c>(_M_x);
369 {
return __lhs._M_x == __rhs._M_x; }
379 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
380 _UIntType1 __m1,
typename _CharT,
typename _Traits>
382 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
384 __a1, __c1, __m1>& __lcr);
399 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
400 _UIntType1 __m1,
typename _CharT,
typename _Traits>
421 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
427 {
return !(__lhs == __rhs); }
458 template<
typename _UIntType,
size_t __w,
459 size_t __n,
size_t __m,
size_t __r,
460 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
461 _UIntType __b,
size_t __t,
462 _UIntType __c,
size_t __l, _UIntType __f>
465 static_assert(std::is_unsigned<_UIntType>::value,
466 "result_type must be an unsigned integral type");
467 static_assert(1u <= __m && __m <= __n,
468 "template argument substituting __m out of bounds");
469 static_assert(__r <= __w,
"template argument substituting " 471 static_assert(__u <= __w,
"template argument substituting " 473 static_assert(__s <= __w,
"template argument substituting " 475 static_assert(__t <= __w,
"template argument substituting " 477 static_assert(__l <= __w,
"template argument substituting " 480 "template argument substituting __w out of bound");
481 static_assert(__a <= (__detail::_Shift<_UIntType, __w>::__value - 1),
482 "template argument substituting __a out of bound");
483 static_assert(__b <= (__detail::_Shift<_UIntType, __w>::__value - 1),
484 "template argument substituting __b out of bound");
485 static_assert(__c <= (__detail::_Shift<_UIntType, __w>::__value - 1),
486 "template argument substituting __c out of bound");
487 static_assert(__d <= (__detail::_Shift<_UIntType, __w>::__value - 1),
488 "template argument substituting __d out of bound");
489 static_assert(__f <= (__detail::_Shift<_UIntType, __w>::__value - 1),
490 "template argument substituting __f out of bound");
492 template<
typename _Sseq>
493 using _If_seed_seq =
typename enable_if<__detail::__is_seed_seq<
501 static constexpr
size_t word_size = __w;
502 static constexpr
size_t state_size = __n;
503 static constexpr
size_t shift_size = __m;
504 static constexpr
size_t mask_bits = __r;
506 static constexpr
size_t tempering_u = __u;
508 static constexpr
size_t tempering_s = __s;
510 static constexpr
size_t tempering_t = __t;
512 static constexpr
size_t tempering_l = __l;
513 static constexpr
result_type initialization_multiplier = __f;
530 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
538 template<
typename _Sseq>
554 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
560 discard(
unsigned long long __z);
580 {
return (
std::equal(__lhs._M_x, __lhs._M_x + state_size, __rhs._M_x)
581 && __lhs._M_p == __rhs._M_p); }
595 template<
typename _UIntType1,
596 size_t __w1,
size_t __n1,
597 size_t __m1,
size_t __r1,
598 _UIntType1 __a1,
size_t __u1,
599 _UIntType1 __d1,
size_t __s1,
600 _UIntType1 __b1,
size_t __t1,
601 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
602 typename _CharT,
typename _Traits>
604 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
606 __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
621 template<
typename _UIntType1,
622 size_t __w1,
size_t __n1,
623 size_t __m1,
size_t __r1,
624 _UIntType1 __a1,
size_t __u1,
625 _UIntType1 __d1,
size_t __s1,
626 _UIntType1 __b1,
size_t __t1,
627 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
628 typename _CharT,
typename _Traits>
632 __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
638 _UIntType _M_x[state_size];
654 template<
typename _UIntType,
size_t __w,
655 size_t __n,
size_t __m,
size_t __r,
656 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
657 _UIntType __b,
size_t __t,
658 _UIntType __c,
size_t __l, _UIntType __f>
661 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __lhs,
663 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __rhs)
664 {
return !(__lhs == __rhs); }
682 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
685 static_assert(std::is_unsigned<_UIntType>::value,
686 "result_type must be an unsigned integral type");
687 static_assert(0u < __s && __s < __r,
690 "template argument substituting __w out of bounds");
692 template<
typename _Sseq>
693 using _If_seed_seq =
typename enable_if<__detail::__is_seed_seq<
701 static constexpr
size_t word_size = __w;
702 static constexpr
size_t short_lag = __s;
703 static constexpr
size_t long_lag = __r;
704 static constexpr
result_type default_seed = 19780503u;
723 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
747 template<
typename _Sseq>
765 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
773 for (; __z != 0ULL; --__z)
798 {
return (
std::equal(__lhs._M_x, __lhs._M_x + long_lag, __rhs._M_x)
799 && __lhs._M_carry == __rhs._M_carry
800 && __lhs._M_p == __rhs._M_p); }
814 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
815 typename _CharT,
typename _Traits>
817 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
833 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
834 typename _CharT,
typename _Traits>
842 _UIntType _M_x[long_lag];
859 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
865 {
return !(__lhs == __rhs); }
874 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
877 static_assert(1 <= __r && __r <= __p,
878 "template argument substituting __r out of bounds");
882 typedef typename _RandomNumberEngine::result_type
result_type;
884 template<
typename _Sseq>
885 using _If_seed_seq =
typename enable_if<__detail::__is_seed_seq<
889 static constexpr
size_t block_size = __p;
890 static constexpr
size_t used_block = __r;
898 : _M_b(), _M_n(0) { }
908 : _M_b(__rng), _M_n(0) { }
918 : _M_b(
std::
move(__rng)), _M_n(0) { }
928 : _M_b(__s), _M_n(0) { }
935 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
968 template<
typename _Sseq>
980 const _RandomNumberEngine&
1004 for (; __z != 0ULL; --__z)
1028 {
return __lhs._M_b == __rhs._M_b && __lhs._M_n == __rhs._M_n; }
1041 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1042 typename _CharT,
typename _Traits>
1044 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1059 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1060 typename _CharT,
typename _Traits>
1067 _RandomNumberEngine _M_b;
1082 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
1088 {
return !(__lhs == __rhs); }
1095 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1098 static_assert(std::is_unsigned<_UIntType>::value,
1099 "result_type must be an unsigned integral type");
1101 "template argument substituting __w out of bounds");
1103 template<
typename _Sseq>
1104 using _If_seed_seq =
typename enable_if<__detail::__is_seed_seq<
1154 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1181 template<
typename _Sseq>
1190 const _RandomNumberEngine&
1206 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1214 for (; __z != 0ULL; --__z)
1239 {
return __lhs._M_b == __rhs._M_b; }
1253 template<
typename _CharT,
typename _Traits>
1257 __w, _UIntType>& __x)
1264 _RandomNumberEngine _M_b;
1279 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1285 {
return !(__lhs == __rhs); }
1297 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType,
1298 typename _CharT,
typename _Traits>
1300 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1302 __w, _UIntType>& __x)
1314 template<
typename _RandomNumberEngine,
size_t __k>
1317 static_assert(1u <= __k,
"template argument substituting " 1318 "__k out of bound");
1322 typedef typename _RandomNumberEngine::result_type
result_type;
1324 template<
typename _Sseq>
1325 using _If_seed_seq =
typename enable_if<__detail::__is_seed_seq<
1328 static constexpr
size_t table_size = __k;
1337 { _M_initialize(); }
1348 { _M_initialize(); }
1359 { _M_initialize(); }
1370 { _M_initialize(); }
1377 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1381 { _M_initialize(); }
1410 template<
typename _Sseq>
1421 const _RandomNumberEngine&
1445 for (; __z != 0ULL; --__z)
1469 {
return (__lhs._M_b == __rhs._M_b
1470 &&
std::equal(__lhs._M_v, __lhs._M_v + __k, __rhs._M_v)
1471 && __lhs._M_y == __rhs._M_y); }
1484 template<
typename _RandomNumberEngine1,
size_t __k1,
1485 typename _CharT,
typename _Traits>
1487 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1502 template<
typename _RandomNumberEngine1,
size_t __k1,
1503 typename _CharT,
typename _Traits>
1509 void _M_initialize()
1511 for (
size_t __i = 0; __i < __k; ++__i)
1516 _RandomNumberEngine _M_b;
1532 template<
typename _RandomNumberEngine,
size_t __k>
1538 {
return !(__lhs == __rhs); }
1544 typedef linear_congruential_engine<uint_fast32_t, 16807UL, 0UL, 2147483647UL>
1575 0xb5026f5aa96619e9ULL, 29,
1576 0x5555555555555555ULL, 17,
1577 0x71d67fffeda60000ULL, 37,
1578 0xfff7eee000000000ULL, 43,
1612 #if defined _GLIBCXX_USE_DEV_RANDOM 1626 entropy() const noexcept
1628 #ifdef _GLIBCXX_USE_DEV_RANDOM 1629 return this->_M_getentropy();
1637 {
return this->_M_getval(); }
1640 random_device(
const random_device&) =
delete;
1641 void operator=(
const random_device&) =
delete;
1651 double _M_getentropy() const noexcept;
1653 void _M_init(const
char*,
size_t);
1687 template<
typename _IntType>
1691 {
return !(__d1 == __d2); }
1703 template<
typename _IntType,
typename _CharT,
typename _Traits>
1705 operator<<(std::basic_ostream<_CharT, _Traits>&,
1717 template<
typename _IntType,
typename _CharT,
typename _Traits>
1730 template<
typename _RealType =
double>
1734 "result_type must be a floating point type");
1748 param_type(_RealType __a, _RealType __b = _RealType(1))
1749 : _M_a(__a), _M_b(__b)
1751 __glibcxx_assert(_M_a <= _M_b);
1764 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
1768 {
return !(__p1 == __p2); }
1791 : _M_param(__a, __b)
1809 {
return _M_param.a(); }
1813 {
return _M_param.b(); }
1820 {
return _M_param; }
1828 { _M_param = __param; }
1835 {
return this->a(); }
1842 {
return this->b(); }
1847 template<
typename _UniformRandomNumberGenerator>
1850 {
return this->
operator()(__urng, _M_param); }
1852 template<
typename _UniformRandomNumberGenerator>
1854 operator()(_UniformRandomNumberGenerator& __urng,
1855 const param_type& __p)
1857 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
1859 return (__aurng() * (__p.b() - __p.a())) + __p.a();
1862 template<
typename _ForwardIterator,
1863 typename _UniformRandomNumberGenerator>
1865 __generate(_ForwardIterator __f, _ForwardIterator __t,
1866 _UniformRandomNumberGenerator& __urng)
1867 { this->__generate(__f, __t, __urng, _M_param); }
1869 template<
typename _ForwardIterator,
1870 typename _UniformRandomNumberGenerator>
1872 __generate(_ForwardIterator __f, _ForwardIterator __t,
1873 _UniformRandomNumberGenerator& __urng,
1874 const param_type& __p)
1875 { this->__generate_impl(__f, __t, __urng, __p); }
1877 template<
typename _UniformRandomNumberGenerator>
1880 _UniformRandomNumberGenerator& __urng,
1881 const param_type& __p)
1882 { this->__generate_impl(__f, __t, __urng, __p); }
1891 {
return __d1._M_param == __d2._M_param; }
1894 template<
typename _ForwardIterator,
1895 typename _UniformRandomNumberGenerator>
1897 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
1898 _UniformRandomNumberGenerator& __urng,
1899 const param_type& __p);
1901 param_type _M_param;
1908 template<
typename _IntType>
1912 {
return !(__d1 == __d2); }
1924 template<
typename _RealType,
typename _CharT,
typename _Traits>
1926 operator<<(std::basic_ostream<_CharT, _Traits>&,
1938 template<
typename _RealType,
typename _CharT,
typename _Traits>
1960 template<
typename _RealType =
double>
1964 "result_type must be a floating point type");
1978 param_type(_RealType __mean, _RealType __stddev = _RealType(1))
1979 : _M_mean(__mean), _M_stddev(__stddev)
1981 __glibcxx_assert(_M_stddev > _RealType(0));
1990 {
return _M_stddev; }
1994 {
return (__p1._M_mean == __p2._M_mean
1995 && __p1._M_stddev == __p2._M_stddev); }
1999 {
return !(__p1 == __p2); }
2003 _RealType _M_stddev;
2016 : _M_param(__mean, __stddev), _M_saved_available(false)
2021 : _M_param(__p), _M_saved_available(false)
2029 { _M_saved_available =
false; }
2036 {
return _M_param.mean(); }
2043 {
return _M_param.stddev(); }
2050 {
return _M_param; }
2058 { _M_param = __param; }
2077 template<
typename _UniformRandomNumberGenerator>
2080 {
return this->
operator()(__urng, _M_param); }
2082 template<
typename _UniformRandomNumberGenerator>
2084 operator()(_UniformRandomNumberGenerator& __urng,
2085 const param_type& __p);
2087 template<
typename _ForwardIterator,
2088 typename _UniformRandomNumberGenerator>
2090 __generate(_ForwardIterator __f, _ForwardIterator __t,
2091 _UniformRandomNumberGenerator& __urng)
2092 { this->__generate(__f, __t, __urng, _M_param); }
2094 template<
typename _ForwardIterator,
2095 typename _UniformRandomNumberGenerator>
2097 __generate(_ForwardIterator __f, _ForwardIterator __t,
2098 _UniformRandomNumberGenerator& __urng,
2099 const param_type& __p)
2100 { this->__generate_impl(__f, __t, __urng, __p); }
2102 template<
typename _UniformRandomNumberGenerator>
2105 _UniformRandomNumberGenerator& __urng,
2106 const param_type& __p)
2107 { this->__generate_impl(__f, __t, __urng, __p); }
2114 template<
typename _RealType1>
2129 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2131 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2144 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2150 template<
typename _ForwardIterator,
2151 typename _UniformRandomNumberGenerator>
2153 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2154 _UniformRandomNumberGenerator& __urng,
2155 const param_type& __p);
2157 param_type _M_param;
2159 bool _M_saved_available;
2165 template<
typename _RealType>
2169 {
return !(__d1 == __d2); }
2181 template<
typename _RealType =
double>
2185 "result_type must be a floating point type");
2199 param_type(_RealType __m, _RealType __s = _RealType(1))
2200 : _M_m(__m), _M_s(__s)
2213 {
return __p1._M_m == __p2._M_m && __p1._M_s == __p2._M_s; }
2217 {
return !(__p1 == __p2); }
2228 : _M_param(__m, __s), _M_nd()
2232 lognormal_distribution(
const param_type& __p)
2233 : _M_param(__p), _M_nd()
2248 {
return _M_param.m(); }
2252 {
return _M_param.s(); }
2259 {
return _M_param; }
2267 { _M_param = __param; }
2286 template<
typename _UniformRandomNumberGenerator>
2289 {
return this->
operator()(__urng, _M_param); }
2291 template<
typename _UniformRandomNumberGenerator>
2293 operator()(_UniformRandomNumberGenerator& __urng,
2294 const param_type& __p)
2295 {
return std::exp(__p.s() * _M_nd(__urng) + __p.m()); }
2297 template<
typename _ForwardIterator,
2298 typename _UniformRandomNumberGenerator>
2300 __generate(_ForwardIterator __f, _ForwardIterator __t,
2301 _UniformRandomNumberGenerator& __urng)
2302 { this->__generate(__f, __t, __urng, _M_param); }
2304 template<
typename _ForwardIterator,
2305 typename _UniformRandomNumberGenerator>
2307 __generate(_ForwardIterator __f, _ForwardIterator __t,
2308 _UniformRandomNumberGenerator& __urng,
2309 const param_type& __p)
2310 { this->__generate_impl(__f, __t, __urng, __p); }
2312 template<
typename _UniformRandomNumberGenerator>
2315 _UniformRandomNumberGenerator& __urng,
2316 const param_type& __p)
2317 { this->__generate_impl(__f, __t, __urng, __p); }
2327 {
return (__d1._M_param == __d2._M_param
2328 && __d1._M_nd == __d2._M_nd); }
2340 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2342 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2355 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2361 template<
typename _ForwardIterator,
2362 typename _UniformRandomNumberGenerator>
2364 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2365 _UniformRandomNumberGenerator& __urng,
2366 const param_type& __p);
2368 param_type _M_param;
2376 template<
typename _RealType>
2380 {
return !(__d1 == __d2); }
2392 template<
typename _RealType =
double>
2396 "result_type must be a floating point type");
2411 param_type(_RealType __alpha_val, _RealType __beta_val = _RealType(1))
2412 : _M_alpha(__alpha_val), _M_beta(__beta_val)
2414 __glibcxx_assert(_M_alpha > _RealType(0));
2420 {
return _M_alpha; }
2428 {
return (__p1._M_alpha == __p2._M_alpha
2429 && __p1._M_beta == __p2._M_beta); }
2433 {
return !(__p1 == __p2); }
2442 _RealType _M_malpha, _M_a2;
2457 _RealType __beta_val = _RealType(1))
2458 : _M_param(__alpha_val, __beta_val), _M_nd()
2463 : _M_param(__p), _M_nd()
2478 {
return _M_param.alpha(); }
2485 {
return _M_param.beta(); }
2492 {
return _M_param; }
2500 { _M_param = __param; }
2519 template<
typename _UniformRandomNumberGenerator>
2522 {
return this->
operator()(__urng, _M_param); }
2524 template<
typename _UniformRandomNumberGenerator>
2526 operator()(_UniformRandomNumberGenerator& __urng,
2527 const param_type& __p);
2529 template<
typename _ForwardIterator,
2530 typename _UniformRandomNumberGenerator>
2532 __generate(_ForwardIterator __f, _ForwardIterator __t,
2533 _UniformRandomNumberGenerator& __urng)
2534 { this->__generate(__f, __t, __urng, _M_param); }
2536 template<
typename _ForwardIterator,
2537 typename _UniformRandomNumberGenerator>
2539 __generate(_ForwardIterator __f, _ForwardIterator __t,
2540 _UniformRandomNumberGenerator& __urng,
2541 const param_type& __p)
2542 { this->__generate_impl(__f, __t, __urng, __p); }
2544 template<
typename _UniformRandomNumberGenerator>
2547 _UniformRandomNumberGenerator& __urng,
2548 const param_type& __p)
2549 { this->__generate_impl(__f, __t, __urng, __p); }
2559 {
return (__d1._M_param == __d2._M_param
2560 && __d1._M_nd == __d2._M_nd); }
2572 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2574 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2586 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2592 template<
typename _ForwardIterator,
2593 typename _UniformRandomNumberGenerator>
2595 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2596 _UniformRandomNumberGenerator& __urng,
2597 const param_type& __p);
2599 param_type _M_param;
2607 template<
typename _RealType>
2611 {
return !(__d1 == __d2); }
2620 template<
typename _RealType =
double>
2624 "result_type must be a floating point type");
2648 {
return __p1._M_n == __p2._M_n; }
2652 {
return !(__p1 == __p2); }
2662 : _M_param(__n), _M_gd(__n / 2)
2666 chi_squared_distribution(
const param_type& __p)
2667 : _M_param(__p), _M_gd(__p.n() / 2)
2682 {
return _M_param.n(); }
2689 {
return _M_param; }
2721 template<
typename _UniformRandomNumberGenerator>
2724 {
return 2 * _M_gd(__urng); }
2726 template<
typename _UniformRandomNumberGenerator>
2728 operator()(_UniformRandomNumberGenerator& __urng,
2729 const param_type& __p)
2733 return 2 * _M_gd(__urng, param_type(__p.n() / 2));
2736 template<
typename _ForwardIterator,
2737 typename _UniformRandomNumberGenerator>
2739 __generate(_ForwardIterator __f, _ForwardIterator __t,
2740 _UniformRandomNumberGenerator& __urng)
2741 { this->__generate_impl(__f, __t, __urng); }
2743 template<
typename _ForwardIterator,
2744 typename _UniformRandomNumberGenerator>
2746 __generate(_ForwardIterator __f, _ForwardIterator __t,
2747 _UniformRandomNumberGenerator& __urng,
2748 const param_type& __p)
2751 this->__generate_impl(__f, __t, __urng, __p2); }
2753 template<
typename _UniformRandomNumberGenerator>
2756 _UniformRandomNumberGenerator& __urng)
2757 { this->__generate_impl(__f, __t, __urng); }
2759 template<
typename _UniformRandomNumberGenerator>
2762 _UniformRandomNumberGenerator& __urng,
2763 const param_type& __p)
2766 this->__generate_impl(__f, __t, __urng, __p2); }
2776 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
2788 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2790 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2803 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2809 template<
typename _ForwardIterator,
2810 typename _UniformRandomNumberGenerator>
2812 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2813 _UniformRandomNumberGenerator& __urng);
2815 template<
typename _ForwardIterator,
2816 typename _UniformRandomNumberGenerator>
2818 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2819 _UniformRandomNumberGenerator& __urng,
2823 param_type _M_param;
2831 template<
typename _RealType>
2835 {
return !(__d1 == __d2); }
2844 template<
typename _RealType =
double>
2848 "result_type must be a floating point type");
2862 param_type(_RealType __a, _RealType __b = _RealType(1))
2863 : _M_a(__a), _M_b(__b)
2876 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
2880 {
return !(__p1 == __p2); }
2891 : _M_param(__a, __b)
2895 cauchy_distribution(
const param_type& __p)
2911 {
return _M_param.a(); }
2915 {
return _M_param.b(); }
2922 {
return _M_param; }
2930 { _M_param = __param; }
2949 template<
typename _UniformRandomNumberGenerator>
2952 {
return this->
operator()(__urng, _M_param); }
2954 template<
typename _UniformRandomNumberGenerator>
2956 operator()(_UniformRandomNumberGenerator& __urng,
2957 const param_type& __p);
2959 template<
typename _ForwardIterator,
2960 typename _UniformRandomNumberGenerator>
2962 __generate(_ForwardIterator __f, _ForwardIterator __t,
2963 _UniformRandomNumberGenerator& __urng)
2964 { this->__generate(__f, __t, __urng, _M_param); }
2966 template<
typename _ForwardIterator,
2967 typename _UniformRandomNumberGenerator>
2969 __generate(_ForwardIterator __f, _ForwardIterator __t,
2970 _UniformRandomNumberGenerator& __urng,
2971 const param_type& __p)
2972 { this->__generate_impl(__f, __t, __urng, __p); }
2974 template<
typename _UniformRandomNumberGenerator>
2977 _UniformRandomNumberGenerator& __urng,
2978 const param_type& __p)
2979 { this->__generate_impl(__f, __t, __urng, __p); }
2988 {
return __d1._M_param == __d2._M_param; }
2991 template<
typename _ForwardIterator,
2992 typename _UniformRandomNumberGenerator>
2994 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2995 _UniformRandomNumberGenerator& __urng,
2996 const param_type& __p);
2998 param_type _M_param;
3005 template<
typename _RealType>
3009 {
return !(__d1 == __d2); }
3021 template<
typename _RealType,
typename _CharT,
typename _Traits>
3023 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3036 template<
typename _RealType,
typename _CharT,
typename _Traits>
3052 template<
typename _RealType =
double>
3056 "result_type must be a floating point type");
3070 param_type(_RealType __m, _RealType __n = _RealType(1))
3071 : _M_m(__m), _M_n(__n)
3084 {
return __p1._M_m == __p2._M_m && __p1._M_n == __p2._M_n; }
3088 {
return !(__p1 == __p2); }
3099 _RealType __n = _RealType(1))
3100 : _M_param(__m, __n), _M_gd_x(__m / 2), _M_gd_y(__n / 2)
3104 fisher_f_distribution(
const param_type& __p)
3105 : _M_param(__p), _M_gd_x(__p.m() / 2), _M_gd_y(__p.n() / 2)
3123 {
return _M_param.m(); }
3127 {
return _M_param.n(); }
3134 {
return _M_param; }
3142 { _M_param = __param; }
3161 template<
typename _UniformRandomNumberGenerator>
3164 {
return (_M_gd_x(__urng) * n()) / (_M_gd_y(__urng) * m()); }
3166 template<
typename _UniformRandomNumberGenerator>
3168 operator()(_UniformRandomNumberGenerator& __urng,
3169 const param_type& __p)
3173 return ((_M_gd_x(__urng, param_type(__p.m() / 2)) * n())
3174 / (_M_gd_y(__urng, param_type(__p.n() / 2)) * m()));
3177 template<
typename _ForwardIterator,
3178 typename _UniformRandomNumberGenerator>
3180 __generate(_ForwardIterator __f, _ForwardIterator __t,
3181 _UniformRandomNumberGenerator& __urng)
3182 { this->__generate_impl(__f, __t, __urng); }
3184 template<
typename _ForwardIterator,
3185 typename _UniformRandomNumberGenerator>
3187 __generate(_ForwardIterator __f, _ForwardIterator __t,
3188 _UniformRandomNumberGenerator& __urng,
3189 const param_type& __p)
3190 { this->__generate_impl(__f, __t, __urng, __p); }
3192 template<
typename _UniformRandomNumberGenerator>
3195 _UniformRandomNumberGenerator& __urng)
3196 { this->__generate_impl(__f, __t, __urng); }
3198 template<
typename _UniformRandomNumberGenerator>
3201 _UniformRandomNumberGenerator& __urng,
3202 const param_type& __p)
3203 { this->__generate_impl(__f, __t, __urng, __p); }
3213 {
return (__d1._M_param == __d2._M_param
3214 && __d1._M_gd_x == __d2._M_gd_x
3215 && __d1._M_gd_y == __d2._M_gd_y); }
3227 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3229 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3242 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3248 template<
typename _ForwardIterator,
3249 typename _UniformRandomNumberGenerator>
3251 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3252 _UniformRandomNumberGenerator& __urng);
3254 template<
typename _ForwardIterator,
3255 typename _UniformRandomNumberGenerator>
3257 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3258 _UniformRandomNumberGenerator& __urng,
3259 const param_type& __p);
3261 param_type _M_param;
3269 template<
typename _RealType>
3273 {
return !(__d1 == __d2); }
3284 template<
typename _RealType =
double>
3288 "result_type must be a floating point type");
3312 {
return __p1._M_n == __p2._M_n; }
3316 {
return !(__p1 == __p2); }
3326 : _M_param(__n), _M_nd(), _M_gd(__n / 2, 2)
3330 student_t_distribution(
const param_type& __p)
3331 : _M_param(__p), _M_nd(), _M_gd(__p.n() / 2, 2)
3349 {
return _M_param.n(); }
3356 {
return _M_param; }
3364 { _M_param = __param; }
3383 template<
typename _UniformRandomNumberGenerator>
3386 {
return _M_nd(__urng) *
std::sqrt(n() / _M_gd(__urng)); }
3388 template<
typename _UniformRandomNumberGenerator>
3390 operator()(_UniformRandomNumberGenerator& __urng,
3391 const param_type& __p)
3396 const result_type __g = _M_gd(__urng, param_type(__p.n() / 2, 2));
3397 return _M_nd(__urng) *
std::sqrt(__p.n() / __g);
3400 template<
typename _ForwardIterator,
3401 typename _UniformRandomNumberGenerator>
3403 __generate(_ForwardIterator __f, _ForwardIterator __t,
3404 _UniformRandomNumberGenerator& __urng)
3405 { this->__generate_impl(__f, __t, __urng); }
3407 template<
typename _ForwardIterator,
3408 typename _UniformRandomNumberGenerator>
3410 __generate(_ForwardIterator __f, _ForwardIterator __t,
3411 _UniformRandomNumberGenerator& __urng,
3412 const param_type& __p)
3413 { this->__generate_impl(__f, __t, __urng, __p); }
3415 template<
typename _UniformRandomNumberGenerator>
3418 _UniformRandomNumberGenerator& __urng)
3419 { this->__generate_impl(__f, __t, __urng); }
3421 template<
typename _UniformRandomNumberGenerator>
3424 _UniformRandomNumberGenerator& __urng,
3425 const param_type& __p)
3426 { this->__generate_impl(__f, __t, __urng, __p); }
3436 {
return (__d1._M_param == __d2._M_param
3437 && __d1._M_nd == __d2._M_nd && __d1._M_gd == __d2._M_gd); }
3449 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3451 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3464 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3470 template<
typename _ForwardIterator,
3471 typename _UniformRandomNumberGenerator>
3473 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3474 _UniformRandomNumberGenerator& __urng);
3475 template<
typename _ForwardIterator,
3476 typename _UniformRandomNumberGenerator>
3478 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3479 _UniformRandomNumberGenerator& __urng,
3480 const param_type& __p);
3482 param_type _M_param;
3491 template<
typename _RealType>
3495 {
return !(__d1 == __d2); }
3529 __glibcxx_assert((_M_p >= 0.0) && (_M_p <= 1.0));
3538 {
return __p1._M_p == __p2._M_p; }
3542 {
return !(__p1 == __p2); }
3583 {
return _M_param.p(); }
3590 {
return _M_param; }
3598 { _M_param = __param; }
3617 template<
typename _UniformRandomNumberGenerator>
3620 {
return this->
operator()(__urng, _M_param); }
3622 template<
typename _UniformRandomNumberGenerator>
3624 operator()(_UniformRandomNumberGenerator& __urng,
3625 const param_type& __p)
3627 __detail::_Adaptor<_UniformRandomNumberGenerator, double>
3629 if ((__aurng() - __aurng.min())
3630 < __p.p() * (__aurng.max() - __aurng.min()))
3635 template<
typename _ForwardIterator,
3636 typename _UniformRandomNumberGenerator>
3638 __generate(_ForwardIterator __f, _ForwardIterator __t,
3639 _UniformRandomNumberGenerator& __urng)
3640 { this->__generate(__f, __t, __urng, _M_param); }
3642 template<
typename _ForwardIterator,
3643 typename _UniformRandomNumberGenerator>
3645 __generate(_ForwardIterator __f, _ForwardIterator __t,
3646 _UniformRandomNumberGenerator& __urng,
const param_type& __p)
3647 { this->__generate_impl(__f, __t, __urng, __p); }
3649 template<
typename _UniformRandomNumberGenerator>
3652 _UniformRandomNumberGenerator& __urng,
3653 const param_type& __p)
3654 { this->__generate_impl(__f, __t, __urng, __p); }
3663 {
return __d1._M_param == __d2._M_param; }
3666 template<
typename _ForwardIterator,
3667 typename _UniformRandomNumberGenerator>
3669 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3670 _UniformRandomNumberGenerator& __urng,
3671 const param_type& __p);
3673 param_type _M_param;
3683 {
return !(__d1 == __d2); }
3695 template<
typename _CharT,
typename _Traits>
3697 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3709 template<
typename _CharT,
typename _Traits>
3728 template<
typename _IntType =
int>
3732 "result_type must be an integral type");
3748 : _M_t(__t), _M_p(__p)
3750 __glibcxx_assert((_M_t >= _IntType(0))
3766 {
return __p1._M_t == __p2._M_t && __p1._M_p == __p2._M_p; }
3770 {
return !(__p1 == __p2); }
3780 #if _GLIBCXX_USE_C99_MATH_TR1 3781 double _M_d1, _M_d2, _M_s1, _M_s2, _M_c,
3782 _M_a1, _M_a123, _M_s, _M_lf, _M_lp1p;
3793 : _M_param(__t, __p), _M_nd()
3797 binomial_distribution(
const param_type& __p)
3798 : _M_param(__p), _M_nd()
3813 {
return _M_param.t(); }
3820 {
return _M_param.p(); }
3827 {
return _M_param; }
3835 { _M_param = __param; }
3849 {
return _M_param.t(); }
3854 template<
typename _UniformRandomNumberGenerator>
3857 {
return this->
operator()(__urng, _M_param); }
3859 template<
typename _UniformRandomNumberGenerator>
3861 operator()(_UniformRandomNumberGenerator& __urng,
3862 const param_type& __p);
3864 template<
typename _ForwardIterator,
3865 typename _UniformRandomNumberGenerator>
3867 __generate(_ForwardIterator __f, _ForwardIterator __t,
3868 _UniformRandomNumberGenerator& __urng)
3869 { this->__generate(__f, __t, __urng, _M_param); }
3871 template<
typename _ForwardIterator,
3872 typename _UniformRandomNumberGenerator>
3874 __generate(_ForwardIterator __f, _ForwardIterator __t,
3875 _UniformRandomNumberGenerator& __urng,
3876 const param_type& __p)
3877 { this->__generate_impl(__f, __t, __urng, __p); }
3879 template<
typename _UniformRandomNumberGenerator>
3882 _UniformRandomNumberGenerator& __urng,
3883 const param_type& __p)
3884 { this->__generate_impl(__f, __t, __urng, __p); }
3894 #ifdef _GLIBCXX_USE_C99_MATH_TR1 3895 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
3897 {
return __d1._M_param == __d2._M_param; }
3910 template<
typename _IntType1,
3911 typename _CharT,
typename _Traits>
3913 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3926 template<
typename _IntType1,
3927 typename _CharT,
typename _Traits>
3933 template<
typename _ForwardIterator,
3934 typename _UniformRandomNumberGenerator>
3936 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3937 _UniformRandomNumberGenerator& __urng,
3938 const param_type& __p);
3940 template<
typename _UniformRandomNumberGenerator>
3942 _M_waiting(_UniformRandomNumberGenerator& __urng,
3943 _IntType __t,
double __q);
3945 param_type _M_param;
3954 template<
typename _IntType>
3958 {
return !(__d1 == __d2); }
3968 template<
typename _IntType =
int>
3972 "result_type must be an integral type");
3990 __glibcxx_assert((_M_p > 0.0) && (_M_p < 1.0));
4000 {
return __p1._M_p == __p2._M_p; }
4004 {
return !(__p1 == __p2); }
4009 { _M_log_1_p =
std::log(1.0 - _M_p); }
4026 geometric_distribution(
const param_type& __p)
4043 {
return _M_param.p(); }
4050 {
return _M_param; }
4058 { _M_param = __param; }
4077 template<
typename _UniformRandomNumberGenerator>
4080 {
return this->
operator()(__urng, _M_param); }
4082 template<
typename _UniformRandomNumberGenerator>
4084 operator()(_UniformRandomNumberGenerator& __urng,
4085 const param_type& __p);
4087 template<
typename _ForwardIterator,
4088 typename _UniformRandomNumberGenerator>
4090 __generate(_ForwardIterator __f, _ForwardIterator __t,
4091 _UniformRandomNumberGenerator& __urng)
4092 { this->__generate(__f, __t, __urng, _M_param); }
4094 template<
typename _ForwardIterator,
4095 typename _UniformRandomNumberGenerator>
4097 __generate(_ForwardIterator __f, _ForwardIterator __t,
4098 _UniformRandomNumberGenerator& __urng,
4099 const param_type& __p)
4100 { this->__generate_impl(__f, __t, __urng, __p); }
4102 template<
typename _UniformRandomNumberGenerator>
4105 _UniformRandomNumberGenerator& __urng,
4106 const param_type& __p)
4107 { this->__generate_impl(__f, __t, __urng, __p); }
4116 {
return __d1._M_param == __d2._M_param; }
4119 template<
typename _ForwardIterator,
4120 typename _UniformRandomNumberGenerator>
4122 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4123 _UniformRandomNumberGenerator& __urng,
4124 const param_type& __p);
4126 param_type _M_param;
4133 template<
typename _IntType>
4137 {
return !(__d1 == __d2); }
4149 template<
typename _IntType,
4150 typename _CharT,
typename _Traits>
4152 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4164 template<
typename _IntType,
4165 typename _CharT,
typename _Traits>
4178 template<
typename _IntType =
int>
4182 "result_type must be an integral type");
4197 : _M_k(__k), _M_p(__p)
4199 __glibcxx_assert((_M_k > 0) && (_M_p > 0.0) && (_M_p <= 1.0));
4212 {
return __p1._M_k == __p2._M_k && __p1._M_p == __p2._M_p; }
4216 {
return !(__p1 == __p2); }
4227 : _M_param(__k, __p), _M_gd(__k, (1.0 - __p) / __p)
4231 negative_binomial_distribution(
const param_type& __p)
4232 : _M_param(__p), _M_gd(__p.
k(), (1.0 - __p.
p()) / __p.
p())
4247 {
return _M_param.k(); }
4254 {
return _M_param.p(); }
4261 {
return _M_param; }
4269 { _M_param = __param; }
4288 template<
typename _UniformRandomNumberGenerator>
4290 operator()(_UniformRandomNumberGenerator& __urng);
4292 template<
typename _UniformRandomNumberGenerator>
4294 operator()(_UniformRandomNumberGenerator& __urng,
4295 const param_type& __p);
4297 template<
typename _ForwardIterator,
4298 typename _UniformRandomNumberGenerator>
4300 __generate(_ForwardIterator __f, _ForwardIterator __t,
4301 _UniformRandomNumberGenerator& __urng)
4302 { this->__generate_impl(__f, __t, __urng); }
4304 template<
typename _ForwardIterator,
4305 typename _UniformRandomNumberGenerator>
4307 __generate(_ForwardIterator __f, _ForwardIterator __t,
4308 _UniformRandomNumberGenerator& __urng,
4309 const param_type& __p)
4310 { this->__generate_impl(__f, __t, __urng, __p); }
4312 template<
typename _UniformRandomNumberGenerator>
4315 _UniformRandomNumberGenerator& __urng)
4316 { this->__generate_impl(__f, __t, __urng); }
4318 template<
typename _UniformRandomNumberGenerator>
4321 _UniformRandomNumberGenerator& __urng,
4322 const param_type& __p)
4323 { this->__generate_impl(__f, __t, __urng, __p); }
4333 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
4346 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4348 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4361 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4367 template<
typename _ForwardIterator,
4368 typename _UniformRandomNumberGenerator>
4370 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4371 _UniformRandomNumberGenerator& __urng);
4372 template<
typename _ForwardIterator,
4373 typename _UniformRandomNumberGenerator>
4375 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4376 _UniformRandomNumberGenerator& __urng,
4377 const param_type& __p);
4379 param_type _M_param;
4387 template<
typename _IntType>
4391 {
return !(__d1 == __d2); }
4409 template<
typename _IntType =
int>
4413 "result_type must be an integral type");
4431 __glibcxx_assert(_M_mean > 0.0);
4441 {
return __p1._M_mean == __p2._M_mean; }
4445 {
return !(__p1 == __p2); }
4455 #if _GLIBCXX_USE_C99_MATH_TR1 4456 double _M_lfm, _M_sm, _M_d, _M_scx, _M_1cx, _M_c2b, _M_cb;
4466 : _M_param(__mean), _M_nd()
4470 poisson_distribution(
const param_type& __p)
4471 : _M_param(__p), _M_nd()
4486 {
return _M_param.mean(); }
4493 {
return _M_param; }
4501 { _M_param = __param; }
4520 template<
typename _UniformRandomNumberGenerator>
4523 {
return this->
operator()(__urng, _M_param); }
4525 template<
typename _UniformRandomNumberGenerator>
4527 operator()(_UniformRandomNumberGenerator& __urng,
4528 const param_type& __p);
4530 template<
typename _ForwardIterator,
4531 typename _UniformRandomNumberGenerator>
4533 __generate(_ForwardIterator __f, _ForwardIterator __t,
4534 _UniformRandomNumberGenerator& __urng)
4535 { this->__generate(__f, __t, __urng, _M_param); }
4537 template<
typename _ForwardIterator,
4538 typename _UniformRandomNumberGenerator>
4540 __generate(_ForwardIterator __f, _ForwardIterator __t,
4541 _UniformRandomNumberGenerator& __urng,
4542 const param_type& __p)
4543 { this->__generate_impl(__f, __t, __urng, __p); }
4545 template<
typename _UniformRandomNumberGenerator>
4548 _UniformRandomNumberGenerator& __urng,
4549 const param_type& __p)
4550 { this->__generate_impl(__f, __t, __urng, __p); }
4560 #ifdef _GLIBCXX_USE_C99_MATH_TR1 4561 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
4563 {
return __d1._M_param == __d2._M_param; }
4576 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4578 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4591 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4597 template<
typename _ForwardIterator,
4598 typename _UniformRandomNumberGenerator>
4600 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4601 _UniformRandomNumberGenerator& __urng,
4602 const param_type& __p);
4604 param_type _M_param;
4613 template<
typename _IntType>
4617 {
return !(__d1 == __d2); }
4635 template<
typename _RealType =
double>
4639 "result_type must be a floating point type");
4654 : _M_lambda(__lambda)
4656 __glibcxx_assert(_M_lambda > _RealType(0));
4661 {
return _M_lambda; }
4665 {
return __p1._M_lambda == __p2._M_lambda; }
4669 {
return !(__p1 == __p2); }
4672 _RealType _M_lambda;
4688 : _M_param(__lambda)
4709 {
return _M_param.lambda(); }
4716 {
return _M_param; }
4724 { _M_param = __param; }
4743 template<
typename _UniformRandomNumberGenerator>
4746 {
return this->
operator()(__urng, _M_param); }
4748 template<
typename _UniformRandomNumberGenerator>
4750 operator()(_UniformRandomNumberGenerator& __urng,
4751 const param_type& __p)
4753 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
4758 template<
typename _ForwardIterator,
4759 typename _UniformRandomNumberGenerator>
4761 __generate(_ForwardIterator __f, _ForwardIterator __t,
4762 _UniformRandomNumberGenerator& __urng)
4763 { this->__generate(__f, __t, __urng, _M_param); }
4765 template<
typename _ForwardIterator,
4766 typename _UniformRandomNumberGenerator>
4768 __generate(_ForwardIterator __f, _ForwardIterator __t,
4769 _UniformRandomNumberGenerator& __urng,
4770 const param_type& __p)
4771 { this->__generate_impl(__f, __t, __urng, __p); }
4773 template<
typename _UniformRandomNumberGenerator>
4776 _UniformRandomNumberGenerator& __urng,
4777 const param_type& __p)
4778 { this->__generate_impl(__f, __t, __urng, __p); }
4787 {
return __d1._M_param == __d2._M_param; }
4790 template<
typename _ForwardIterator,
4791 typename _UniformRandomNumberGenerator>
4793 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4794 _UniformRandomNumberGenerator& __urng,
4795 const param_type& __p);
4797 param_type _M_param;
4804 template<
typename _RealType>
4808 {
return !(__d1 == __d2); }
4820 template<
typename _RealType,
typename _CharT,
typename _Traits>
4822 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4835 template<
typename _RealType,
typename _CharT,
typename _Traits>
4850 template<
typename _RealType =
double>
4854 "result_type must be a floating point type");
4868 param_type(_RealType __a, _RealType __b = _RealType(1.0))
4869 : _M_a(__a), _M_b(__b)
4882 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
4886 {
return !(__p1 == __p2); }
4897 : _M_param(__a, __b)
4901 weibull_distribution(
const param_type& __p)
4917 {
return _M_param.a(); }
4924 {
return _M_param.b(); }
4931 {
return _M_param; }
4939 { _M_param = __param; }
4958 template<
typename _UniformRandomNumberGenerator>
4961 {
return this->
operator()(__urng, _M_param); }
4963 template<
typename _UniformRandomNumberGenerator>
4965 operator()(_UniformRandomNumberGenerator& __urng,
4966 const param_type& __p);
4968 template<
typename _ForwardIterator,
4969 typename _UniformRandomNumberGenerator>
4971 __generate(_ForwardIterator __f, _ForwardIterator __t,
4972 _UniformRandomNumberGenerator& __urng)
4973 { this->__generate(__f, __t, __urng, _M_param); }
4975 template<
typename _ForwardIterator,
4976 typename _UniformRandomNumberGenerator>
4978 __generate(_ForwardIterator __f, _ForwardIterator __t,
4979 _UniformRandomNumberGenerator& __urng,
4980 const param_type& __p)
4981 { this->__generate_impl(__f, __t, __urng, __p); }
4983 template<
typename _UniformRandomNumberGenerator>
4986 _UniformRandomNumberGenerator& __urng,
4987 const param_type& __p)
4988 { this->__generate_impl(__f, __t, __urng, __p); }
4997 {
return __d1._M_param == __d2._M_param; }
5000 template<
typename _ForwardIterator,
5001 typename _UniformRandomNumberGenerator>
5003 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5004 _UniformRandomNumberGenerator& __urng,
5005 const param_type& __p);
5007 param_type _M_param;
5014 template<
typename _RealType>
5018 {
return !(__d1 == __d2); }
5030 template<
typename _RealType,
typename _CharT,
typename _Traits>
5032 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5045 template<
typename _RealType,
typename _CharT,
typename _Traits>
5060 template<
typename _RealType =
double>
5064 "result_type must be a floating point type");
5078 param_type(_RealType __a, _RealType __b = _RealType(1.0))
5079 : _M_a(__a), _M_b(__b)
5092 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
5096 {
return !(__p1 == __p2); }
5107 : _M_param(__a, __b)
5111 extreme_value_distribution(
const param_type& __p)
5127 {
return _M_param.a(); }
5134 {
return _M_param.b(); }
5141 {
return _M_param; }
5149 { _M_param = __param; }
5168 template<
typename _UniformRandomNumberGenerator>
5171 {
return this->
operator()(__urng, _M_param); }
5173 template<
typename _UniformRandomNumberGenerator>
5175 operator()(_UniformRandomNumberGenerator& __urng,
5176 const param_type& __p);
5178 template<
typename _ForwardIterator,
5179 typename _UniformRandomNumberGenerator>
5181 __generate(_ForwardIterator __f, _ForwardIterator __t,
5182 _UniformRandomNumberGenerator& __urng)
5183 { this->__generate(__f, __t, __urng, _M_param); }
5185 template<
typename _ForwardIterator,
5186 typename _UniformRandomNumberGenerator>
5188 __generate(_ForwardIterator __f, _ForwardIterator __t,
5189 _UniformRandomNumberGenerator& __urng,
5190 const param_type& __p)
5191 { this->__generate_impl(__f, __t, __urng, __p); }
5193 template<
typename _UniformRandomNumberGenerator>
5196 _UniformRandomNumberGenerator& __urng,
5197 const param_type& __p)
5198 { this->__generate_impl(__f, __t, __urng, __p); }
5207 {
return __d1._M_param == __d2._M_param; }
5210 template<
typename _ForwardIterator,
5211 typename _UniformRandomNumberGenerator>
5213 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5214 _UniformRandomNumberGenerator& __urng,
5215 const param_type& __p);
5217 param_type _M_param;
5224 template<
typename _RealType>
5228 {
return !(__d1 == __d2); }
5240 template<
typename _RealType,
typename _CharT,
typename _Traits>
5242 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5255 template<
typename _RealType,
typename _CharT,
typename _Traits>
5267 template<
typename _IntType =
int>
5271 "result_type must be an integral type");
5284 : _M_prob(), _M_cp()
5287 template<
typename _InputIterator>
5289 _InputIterator __wend)
5290 : _M_prob(__wbegin, __wend), _M_cp()
5291 { _M_initialize(); }
5294 : _M_prob(__wil.begin(), __wil.end()), _M_cp()
5295 { _M_initialize(); }
5297 template<
typename _Func>
5298 param_type(
size_t __nw,
double __xmin,
double __xmax,
5306 probabilities()
const 5311 {
return __p1._M_prob == __p2._M_prob; }
5315 {
return !(__p1 == __p2); }
5329 template<
typename _InputIterator>
5331 _InputIterator __wend)
5332 : _M_param(__wbegin, __wend)
5335 discrete_distribution(initializer_list<double> __wl)
5339 template<
typename _Func>
5340 discrete_distribution(
size_t __nw,
double __xmin,
double __xmax,
5342 : _M_param(__nw, __xmin, __xmax, __fw)
5346 discrete_distribution(
const param_type& __p)
5363 return _M_param._M_prob.
empty()
5372 {
return _M_param; }
5380 { _M_param = __param; }
5395 return _M_param._M_prob.
empty()
5402 template<
typename _UniformRandomNumberGenerator>
5405 {
return this->
operator()(__urng, _M_param); }
5407 template<
typename _UniformRandomNumberGenerator>
5409 operator()(_UniformRandomNumberGenerator& __urng,
5410 const param_type& __p);
5412 template<
typename _ForwardIterator,
5413 typename _UniformRandomNumberGenerator>
5415 __generate(_ForwardIterator __f, _ForwardIterator __t,
5416 _UniformRandomNumberGenerator& __urng)
5417 { this->__generate(__f, __t, __urng, _M_param); }
5419 template<
typename _ForwardIterator,
5420 typename _UniformRandomNumberGenerator>
5422 __generate(_ForwardIterator __f, _ForwardIterator __t,
5423 _UniformRandomNumberGenerator& __urng,
5424 const param_type& __p)
5425 { this->__generate_impl(__f, __t, __urng, __p); }
5427 template<
typename _UniformRandomNumberGenerator>
5430 _UniformRandomNumberGenerator& __urng,
5431 const param_type& __p)
5432 { this->__generate_impl(__f, __t, __urng, __p); }
5441 {
return __d1._M_param == __d2._M_param; }
5453 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5455 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5469 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5475 template<
typename _ForwardIterator,
5476 typename _UniformRandomNumberGenerator>
5478 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5479 _UniformRandomNumberGenerator& __urng,
5480 const param_type& __p);
5482 param_type _M_param;
5489 template<
typename _IntType>
5493 {
return !(__d1 == __d2); }
5502 template<
typename _RealType =
double>
5506 "result_type must be a floating point type");
5519 : _M_int(), _M_den(), _M_cp()
5522 template<
typename _InputIteratorB,
typename _InputIteratorW>
5524 _InputIteratorB __bend,
5525 _InputIteratorW __wbegin);
5527 template<
typename _Func>
5530 template<
typename _Func>
5531 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5544 __tmp[1] = _RealType(1);
5557 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
5561 {
return !(__p1 == __p2); }
5576 template<
typename _InputIteratorB,
typename _InputIteratorW>
5578 _InputIteratorB __bend,
5579 _InputIteratorW __wbegin)
5580 : _M_param(__bfirst, __bend, __wbegin)
5583 template<
typename _Func>
5584 piecewise_constant_distribution(initializer_list<_RealType> __bl,
5586 : _M_param(__bl, __fw)
5589 template<
typename _Func>
5590 piecewise_constant_distribution(
size_t __nw,
5591 _RealType __xmin, _RealType __xmax,
5593 : _M_param(__nw, __xmin, __xmax, __fw)
5597 piecewise_constant_distribution(
const param_type& __p)
5614 if (_M_param._M_int.
empty())
5617 __tmp[1] = _RealType(1);
5621 return _M_param._M_int;
5630 return _M_param._M_den.
empty()
5639 {
return _M_param; }
5647 { _M_param = __param; }
5655 return _M_param._M_int.
empty()
5665 return _M_param._M_int.
empty()
5672 template<
typename _UniformRandomNumberGenerator>
5675 {
return this->
operator()(__urng, _M_param); }
5677 template<
typename _UniformRandomNumberGenerator>
5679 operator()(_UniformRandomNumberGenerator& __urng,
5680 const param_type& __p);
5682 template<
typename _ForwardIterator,
5683 typename _UniformRandomNumberGenerator>
5685 __generate(_ForwardIterator __f, _ForwardIterator __t,
5686 _UniformRandomNumberGenerator& __urng)
5687 { this->__generate(__f, __t, __urng, _M_param); }
5689 template<
typename _ForwardIterator,
5690 typename _UniformRandomNumberGenerator>
5692 __generate(_ForwardIterator __f, _ForwardIterator __t,
5693 _UniformRandomNumberGenerator& __urng,
5694 const param_type& __p)
5695 { this->__generate_impl(__f, __t, __urng, __p); }
5697 template<
typename _UniformRandomNumberGenerator>
5700 _UniformRandomNumberGenerator& __urng,
5701 const param_type& __p)
5702 { this->__generate_impl(__f, __t, __urng, __p); }
5711 {
return __d1._M_param == __d2._M_param; }
5724 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5726 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5740 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5746 template<
typename _ForwardIterator,
5747 typename _UniformRandomNumberGenerator>
5749 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5750 _UniformRandomNumberGenerator& __urng,
5751 const param_type& __p);
5753 param_type _M_param;
5760 template<
typename _RealType>
5764 {
return !(__d1 == __d2); }
5773 template<
typename _RealType =
double>
5777 "result_type must be a floating point type");
5790 : _M_int(), _M_den(), _M_cp(), _M_m()
5793 template<
typename _InputIteratorB,
typename _InputIteratorW>
5795 _InputIteratorB __bend,
5796 _InputIteratorW __wbegin);
5798 template<
typename _Func>
5801 template<
typename _Func>
5802 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5815 __tmp[1] = _RealType(1);
5828 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
5832 {
return !(__p1 == __p2); }
5848 template<
typename _InputIteratorB,
typename _InputIteratorW>
5850 _InputIteratorB __bend,
5851 _InputIteratorW __wbegin)
5852 : _M_param(__bfirst, __bend, __wbegin)
5855 template<
typename _Func>
5856 piecewise_linear_distribution(initializer_list<_RealType> __bl,
5858 : _M_param(__bl, __fw)
5861 template<
typename _Func>
5862 piecewise_linear_distribution(
size_t __nw,
5863 _RealType __xmin, _RealType __xmax,
5865 : _M_param(__nw, __xmin, __xmax, __fw)
5869 piecewise_linear_distribution(
const param_type& __p)
5886 if (_M_param._M_int.
empty())
5889 __tmp[1] = _RealType(1);
5893 return _M_param._M_int;
5903 return _M_param._M_den.
empty()
5912 {
return _M_param; }
5920 { _M_param = __param; }
5928 return _M_param._M_int.
empty()
5938 return _M_param._M_int.
empty()
5945 template<
typename _UniformRandomNumberGenerator>
5948 {
return this->
operator()(__urng, _M_param); }
5950 template<
typename _UniformRandomNumberGenerator>
5952 operator()(_UniformRandomNumberGenerator& __urng,
5953 const param_type& __p);
5955 template<
typename _ForwardIterator,
5956 typename _UniformRandomNumberGenerator>
5958 __generate(_ForwardIterator __f, _ForwardIterator __t,
5959 _UniformRandomNumberGenerator& __urng)
5960 { this->__generate(__f, __t, __urng, _M_param); }
5962 template<
typename _ForwardIterator,
5963 typename _UniformRandomNumberGenerator>
5965 __generate(_ForwardIterator __f, _ForwardIterator __t,
5966 _UniformRandomNumberGenerator& __urng,
5967 const param_type& __p)
5968 { this->__generate_impl(__f, __t, __urng, __p); }
5970 template<
typename _UniformRandomNumberGenerator>
5973 _UniformRandomNumberGenerator& __urng,
5974 const param_type& __p)
5975 { this->__generate_impl(__f, __t, __urng, __p); }
5984 {
return __d1._M_param == __d2._M_param; }
5997 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5999 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
6013 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6019 template<
typename _ForwardIterator,
6020 typename _UniformRandomNumberGenerator>
6022 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6023 _UniformRandomNumberGenerator& __urng,
6024 const param_type& __p);
6026 param_type _M_param;
6033 template<
typename _RealType>
6037 {
return !(__d1 == __d2); }
6065 template<
typename _IntType>
6068 template<
typename _InputIterator>
6069 seed_seq(_InputIterator __begin, _InputIterator __end);
6072 template<
typename _RandomAccessIterator>
6074 generate(_RandomAccessIterator __begin, _RandomAccessIterator __end);
6077 size_t size() const noexcept
6078 {
return _M_v.
size(); }
6080 template<
typename _OutputIterator>
6082 param(_OutputIterator __dest)
const 6083 { std::copy(_M_v.
begin(), _M_v.
end(), __dest); }
6097 _GLIBCXX_END_NAMESPACE_VERSION
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...
shuffle_order_engine(result_type __s)
Seed constructs a shuffle_order_engine engine.
_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...
param_type param() const
Returns the parameter set of the distribution.
constexpr int __lg(int __n)
This is a helper function for the sort routines and for random.tcc.
friend bool operator==(const geometric_distribution &__d1, const geometric_distribution &__d2)
Return true if two geometric distributions have the same parameters.
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.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
static constexpr result_type max()
Gets the maximum value in the generated random number range.
A normal continuous distribution for random numbers.
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 ...
param_type param() const
Returns the parameter set of the distribution.
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 operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
iterator begin() noexcept
result_type max() const
Returns the least upper bound value of the distribution.
friend bool operator==(const binomial_distribution &__d1, const binomial_distribution &__d2)
Return true if two binomial distributions have the same parameters and the sequences that would be ge...
subtract_with_carry_engine(_Sseq &__q)
Constructs a subtract_with_carry_engine random number engine seeded from the seed sequence __q...
friend bool operator==(const negative_binomial_distribution &__d1, const negative_binomial_distribution &__d2)
Return true if two negative binomial distributions have the same parameters and the sequences that wo...
param_type param() const
Returns the parameter set of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
double p() const
Return the parameter of the distribution.
A discrete Poisson random number distribution.
discard_block_engine(_RandomNumberEngine &&__rng)
Move constructs a discard_block_engine engine.
mersenne_twister_engine< uint_fast32_t, 32, 624, 397, 31, 0x9908b0dfUL, 11, 0xffffffffUL, 7, 0x9d2c5680UL, 15, 0xefc60000UL, 18, 1812433253UL > mt19937
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::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::piecewise_linear_distribution< _RealType1 > &__x)
Extracts a piecewise_linear_distribution random number distribution __x from the input stream __is...
Produces random numbers by combining random numbers from some base engine to produce random numbers w...
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...
_RandomNumberEngine::result_type result_type
complex< _Tp > log(const complex< _Tp > &)
Return complex natural logarithm of z.
param_type param() const
Returns the parameter set of the distribution.
shuffle_order_engine(_RandomNumberEngine &&__rng)
Move constructs a shuffle_order_engine engine.
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...
static constexpr result_type max()
result_type min() const
Returns the greatest lower bound value of the distribution.
A discrete binomial random number distribution.
The Marsaglia-Zaman generator.
void reset()
Resets the distribution state.
void seed(result_type __s)
Reseeds the independent_bits_engine object with the default seed for the underlying base class genera...
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.
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine object.
void reset()
Resets the distribution state.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
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 min() const
Returns the greatest lower bound value of the distribution.
A discrete_distribution random number distribution.
Template class basic_ostream.
A lognormal_distribution random number distribution.
void reset()
Resets the distribution state.
result_type max() const
Returns the least upper bound value of the distribution.
param_type param() const
Returns the parameter set of the distribution.
An exponential continuous distribution for random numbers.
_RealType lambda() const
Returns the inverse scale parameter of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void seed(result_type __sd=default_seed)
Seeds the initial state of the random number generator.
result_type max() const
Returns the least upper bound value of the distribution.
std::vector< _RealType > intervals() const
Return the intervals of the distribution.
void reset()
Resets the distribution state.
independent_bits_engine(result_type __s)
Seed constructs a independent_bits_engine engine.
result_type max() const
Returns the least upper bound value of the distribution.
independent_bits_engine(_RandomNumberEngine &&__rng)
Move constructs a independent_bits_engine engine.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
uniform_real_distribution(_RealType __a, _RealType __b=_RealType(1))
Constructs a uniform_real_distribution object.
friend bool operator==(const poisson_distribution &__d1, const poisson_distribution &__d2)
Return true if two Poisson distributions have the same parameters and the sequences that would be gen...
param_type param() const
Returns the parameter set of the distribution.
_RealType mean() const
Returns the mean of the distribution.
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.
A fisher_f_distribution random number distribution.
static constexpr result_type max()
Gets the inclusive maximum value of the range of random integers returned by this generator...
param_type param() const
Returns the parameter set of the distribution.
void reset()
Resets the distribution state.
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...
friend bool operator==(const uniform_real_distribution &__d1, const uniform_real_distribution &__d2)
Return true if two uniform real distributions have the same parameters.
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...
independent_bits_engine(_Sseq &__q)
Generator construct a independent_bits_engine engine.
A piecewise_constant_distribution random number distribution.
std::vector< _RealType > intervals() const
Returns a vector of the intervals.
_IntType k() const
Return the parameter of the distribution.
result_type operator()()
Gets the next random number in the sequence.
A gamma 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.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
Template class basic_istream.
A weibull_distribution random number distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
uint_least32_t result_type
static constexpr result_type multiplier
void discard(unsigned long long __z)
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::chi_squared_distribution< _RealType1 > &__x)
Extracts a chi_squared_distribution random number distribution __x from the input stream __is...
void param(const param_type &__param)
Sets the parameter set of the distribution.
_RealType b() const
Return the parameter of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void reset()
Resets the distribution state.
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...
discard_block_engine(result_type __s)
Seed constructs a discard_block_engine engine.
friend bool operator==(const weibull_distribution &__d1, const weibull_distribution &__d2)
Return true if two Weibull distributions have the same parameters.
result_type operator()()
Gets the next value in the generated random number sequence.
param_type param() const
Returns the parameter set of the distribution.
linear_congruential_engine(_Sseq &__q)
Constructs a linear_congruential_engine random number generator engine seeded from the seed sequence ...
void param(const param_type &__param)
Sets the parameter set of the distribution.
param_type param() const
Returns the parameter set of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
shuffle_order_engine()
Constructs a default shuffle_order_engine engine.
reference back() noexcept
std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, bitset< _Nb > &__x)
Global I/O operators for bitsets.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
A piecewise_linear_distribution random number distribution.
static constexpr result_type min()
Gets the inclusive minimum value of the range of random integers returned by this generator...
double p() const
Returns the distribution parameter p.
void reset()
Resets the distribution state.
void reset()
Resets the distribution state.
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...
Define a member typedef type only if a boolean constant is true.
gamma_distribution()
Constructs a gamma distribution with parameters 1 and 1.
result_type min() const
Returns the greatest lower bound value of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
A chi_squared_distribution random number distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::shuffle_order_engine< _RandomNumberEngine1, __k1 > &__x)
Extracts the current state of a % subtract_with_carry_engine random number generator engine __x from ...
bernoulli_distribution(double __p)
Constructs a Bernoulli distribution with likelihood p.
void param(const param_type &__param)
Sets the parameter set of the distribution.
double p() const
Returns the p parameter of the distribution.
reference front() noexcept
result_type min() const
Returns the greatest lower bound value of the distribution.
static constexpr result_type min()
Gets the minimum value in the generated random number range.
subtract_with_carry_engine(result_type __sd)
Constructs an explicitly seeded subtract_with_carry_engine random number generator.
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::linear_congruential_engine< _UIntType1, __a1, __c1, __m1 > &__lcr)
Sets the state of the engine by reading its textual representation from __is.
result_type min() const
Returns the greatest lower bound value of the distribution.
double p() const
Returns the distribution p parameter.
param_type param() const
Returns the parameter set of the distribution.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
double mean() const
Returns the distribution parameter mean.
Properties of fundamental types.
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...
linear_congruential_engine()
Constructs a linear_congruential_engine random number generator engine with seed 1.
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...
bool empty() const noexcept
void reset()
Resets the distribution state.
friend bool operator==(const piecewise_constant_distribution &__d1, const piecewise_constant_distribution &__d2)
Return true if two piecewise constant distributions have the same parameters.
static constexpr _Tp min() noexcept
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.
void seed(result_type __s=default_seed)
Reseeds the linear_congruential_engine random number generator engine sequence to the seed __s...
One of the math functors.
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...
result_type max() const
Returns the least upper bound value of the distribution.
static constexpr result_type max()
Gets the largest possible value in the output range.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
_RealType beta() const
Returns the 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.
gamma_distribution(_RealType __alpha_val, _RealType __beta_val=_RealType(1))
Constructs a gamma distribution with parameters and .
void param(const param_type &__param)
Sets the parameter set of the distribution.
friend bool operator==(const fisher_f_distribution &__d1, const fisher_f_distribution &__d2)
Return true if two Fisher f distributions have the same parameters and the sequences that would be ge...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void param(const param_type &__param)
Sets the parameter set of the distribution.
linear_congruential_engine(result_type __s)
Constructs a linear_congruential_engine random number generator engine with seed __s. The default seed value is 1.
void seed(result_type __s)
Reseeds the shuffle_order_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.
_RandomNumberEngine::result_type result_type
void reset()
Resets the distribution state.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
bool operator!=(const std::piecewise_linear_distribution< _RealType > &__d1, const std::piecewise_linear_distribution< _RealType > &__d2)
Return true if two piecewise linear distributions have different parameters.
discard_block_engine(const _RandomNumberEngine &__rng)
Copy constructs a discard_block_engine engine.
friend bool operator==(const cauchy_distribution &__d1, const cauchy_distribution &__d2)
Return true if two Cauchy 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.
_IntType t() const
Returns the distribution t parameter.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type max() const
Returns the least upper bound value of the distribution.
mersenne_twister_engine< uint_fast64_t, 64, 312, 156, 31, 0xb5026f5aa96619e9ULL, 29, 0x5555555555555555ULL, 17, 0x71d67fffeda60000ULL, 37, 0xfff7eee000000000ULL, 43, 6364136223846793005ULL > mt19937_64
bernoulli_distribution()
Constructs a Bernoulli distribution with likelihood 0.5.
void param(const param_type &__param)
Sets the parameter set of the distribution.
void reset()
Resets the distribution state.
_RealType generate_canonical(_UniformRandomNumberGenerator &__g)
A function template for converting the output of a (integral) uniform random number generator to a fl...
param_type param() const
Returns the parameter set of the distribution.
std::vector< double > probabilities() const
Returns the probabilities of the distribution.
exponential_distribution()
Constructs an exponential distribution with inverse scale parameter 1.0.
result_type min() const
Returns the greatest lower bound value of the distribution.
static constexpr result_type min()
Gets the smallest possible value in the output range.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
_RealType a() const
Return the parameter of the distribution.
_If_seed_seq< _Sseq > seed(_Sseq &__q)
Reseeds the shuffle_order_engine object with the given seed sequence.
exponential_distribution(_RealType __lambda)
Constructs an exponential distribution with inverse scale parameter .
shuffle_order_engine(_Sseq &__q)
Generator construct a shuffle_order_engine engine.
void param(const param_type &__param)
Sets the parameter set of the distribution.
A discrete geometric random number distribution.
param_type param() const
Returns the parameter set of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
void reset()
Resets the distribution state.
result_type min() const
Returns the inclusive lower bound of the distribution range.
static constexpr result_type max()
Gets the maximum value in the generated random number range.
size_type size() const noexcept
friend bool operator==(const shuffle_order_engine &__lhs, const shuffle_order_engine &__rhs)
static constexpr result_type min()
result_type operator()()
Gets the next value in the generated random number sequence.
void reset()
Resets the distribution state.
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.
ISO C++ entities toplevel namespace is std.
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type max() const
Returns the inclusive upper bound of the distribution range.
mersenne_twister_engine(_Sseq &__q)
Constructs a mersenne_twister_engine random number generator engine seeded from the seed sequence __q...
constexpr const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
void reset()
Resets the distribution state.
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...
constexpr bool equal(_IIter1 __first1, _IIter1 __last1, _IIter2 __first2, _IIter2 __last2, _BinaryPredicate __binary_pred)
Tests a range for element-wise equality.
_If_seed_seq< _Sseq > seed(_Sseq &__q)
Reseeds the independent_bits_engine object with the given seed sequence.
std::vector< double > densities() const
Returns a vector of the probability densities.
uniform_real_distribution()
Constructs a uniform_real_distribution object.
void param(const param_type &__param)
Sets the parameter set of the distribution.
Uniform continuous distribution for random numbers.
discard_block_engine()
Constructs a default discard_block_engine engine.
linear_congruential_engine< uint_fast32_t, 48271UL, 0UL, 2147483647UL > minstd_rand
result_type min() const
Returns the greatest lower bound value of the distribution.
_RealType b() const
Return the parameter of the distribution.
linear_congruential_engine< uint_fast32_t, 16807UL, 0UL, 2147483647UL > minstd_rand0
param_type param() const
Returns the parameter set of the distribution.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
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::independent_bits_engine< _RandomNumberEngine, __w, _UIntType > &__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.
void seed()
Reseeds the independent_bits_engine object with the default seed for the underlying base class genera...
normal_distribution(result_type __mean, result_type __stddev=result_type(1))
param_type param() const
Returns the parameter set of the distribution.
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...
__gnu_cxx::__promote_2< _Tpa, _Tpb >::__type beta(_Tpa __a, _Tpb __b)
shuffle_order_engine(const _RandomNumberEngine &__rng)
Copy constructs a shuffle_order_engine engine.
param_type param() const
Returns 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.
complex< _Tp > sqrt(const complex< _Tp > &)
Return complex square root of z.
void param(const param_type &__param)
Sets the parameter set of the distribution.
complex< _Tp > exp(const complex< _Tp > &)
Return complex base e exponential of z.
result_type operator()()
Gets the next random number in the sequence.
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.
A extreme_value_distribution random number distribution.
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 ...
void reset()
Resets the distribution state.
static constexpr _Tp max() noexcept
A student_t_distribution random number distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
friend bool operator==(const bernoulli_distribution &__d1, const bernoulli_distribution &__d2)
Return true if two Bernoulli distributions have the same parameters.
void param(const param_type &__param)
Sets 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.
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.
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 chi_squared_distribution &__d1, const chi_squared_distribution &__d2)
Return true if two Chi-squared distributions have the same parameters and the sequences that would be...
friend bool operator==(const discard_block_engine &__lhs, const discard_block_engine &__rhs)
Compares two discard_block_engine random number generator objects of the same type for equality...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
static constexpr _Tp lowest() noexcept
result_type max() const
Returns the least upper bound value of the distribution.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine 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...
param_type param() const
Returns the parameter set of the distribution.
_RealType stddev() const
Returns the standard deviation of the distribution.
independent_bits_engine()
Constructs a default independent_bits_engine engine.
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 negative_binomial_distribution random number distribution.
_RealType alpha() const
Returns the of the distribution.
static constexpr result_type max()
Gets the largest possible value in the output range.
result_type max() const
Returns the least upper bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void seed()
Reseeds the shuffle_order_engine object with the default seed for the underlying base class generator...
void discard(unsigned long long __z)
Discard a sequence of random numbers.
friend bool operator==(const independent_bits_engine &__lhs, const independent_bits_engine &__rhs)
Compares two independent_bits_engine random number generator objects of the same type for equality...
result_type min() const
Returns the greatest lower bound value of the distribution.
A cauchy_distribution random number distribution.
friend bool operator==(const extreme_value_distribution &__d1, const extreme_value_distribution &__d2)
Return true if two extreme value distributions have the same parameters.
constexpr const _Tp & max(const _Tp &, const _Tp &)
This does what you think it does.
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.
static constexpr result_type min()
Gets the minimum value in the generated random number range.
void seed()
Reseeds the discard_block_engine object with the default seed for the underlying base class generator...
const _RandomNumberEngine & base() const noexcept
std::vector< double > densities() const
Return a vector of the probability densities of the distribution.
A Bernoulli random number distribution.
A model of a linear congruential random number generator.
Uniform discrete distribution for random numbers. A discrete random distribution on the range with e...
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...
The seed_seq class generates sequences of seeds for random number generators.
static constexpr result_type increment
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.