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>
150 if _GLIBCXX17_CONSTEXPR (__a == 0)
155 constexpr _Tp __a1 = __a ? __a : 1;
156 return _Mod<_Tp, __m, __a1, __c>::__calc(__x);
164 template<
typename _Engine,
typename _DInputType>
168 "template argument must be a floating point type");
171 _Adaptor(_Engine& __g)
176 {
return _DInputType(0); }
180 {
return _DInputType(1); }
199 template<
typename _Sseq>
200 using __seed_seq_generate_t = decltype(
201 std::declval<_Sseq&>().generate(std::declval<uint_least32_t*>(),
202 std::declval<uint_least32_t*>()));
206 template<
typename _Sseq,
typename _Engine,
typename _Res,
207 typename _GenerateCheck = __seed_seq_generate_t<_Sseq>>
208 using __is_seed_seq = __and_<
209 __not_<is_same<__remove_cvref_t<_Sseq>, _Engine>>,
210 is_unsigned<typename _Sseq::result_type>,
211 __not_<is_convertible<_Sseq, _Res>>
254 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
257 static_assert(std::is_unsigned<_UIntType>::value,
258 "result_type must be an unsigned integral type");
259 static_assert(__m == 0u || (__a < __m && __c < __m),
260 "template argument substituting __m out of bounds");
262 template<
typename _Sseq>
263 using _If_seed_seq =
typename enable_if<__detail::__is_seed_seq<
302 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
323 template<
typename _Sseq>
335 {
return __c == 0u ? 1u : 0u; }
350 for (; __z != 0ULL; --__z)
360 _M_x = __detail::__mod<_UIntType, __m, __a, __c>(_M_x);
378 {
return __lhs._M_x == __rhs._M_x; }
388 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
389 _UIntType1 __m1,
typename _CharT,
typename _Traits>
391 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
393 __a1, __c1, __m1>& __lcr);
408 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
409 _UIntType1 __m1,
typename _CharT,
typename _Traits>
430 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
436 {
return !(__lhs == __rhs); }
467 template<
typename _UIntType,
size_t __w,
468 size_t __n,
size_t __m,
size_t __r,
469 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
470 _UIntType __b,
size_t __t,
471 _UIntType __c,
size_t __l, _UIntType __f>
474 static_assert(std::is_unsigned<_UIntType>::value,
475 "result_type must be an unsigned integral type");
476 static_assert(1u <= __m && __m <= __n,
477 "template argument substituting __m out of bounds");
478 static_assert(__r <= __w,
"template argument substituting " 480 static_assert(__u <= __w,
"template argument substituting " 482 static_assert(__s <= __w,
"template argument substituting " 484 static_assert(__t <= __w,
"template argument substituting " 486 static_assert(__l <= __w,
"template argument substituting " 489 "template argument substituting __w out of bound");
490 static_assert(__a <= (__detail::_Shift<_UIntType, __w>::__value - 1),
491 "template argument substituting __a out of bound");
492 static_assert(__b <= (__detail::_Shift<_UIntType, __w>::__value - 1),
493 "template argument substituting __b out of bound");
494 static_assert(__c <= (__detail::_Shift<_UIntType, __w>::__value - 1),
495 "template argument substituting __c out of bound");
496 static_assert(__d <= (__detail::_Shift<_UIntType, __w>::__value - 1),
497 "template argument substituting __d out of bound");
498 static_assert(__f <= (__detail::_Shift<_UIntType, __w>::__value - 1),
499 "template argument substituting __f out of bound");
501 template<
typename _Sseq>
502 using _If_seed_seq =
typename enable_if<__detail::__is_seed_seq<
510 static constexpr
size_t word_size = __w;
511 static constexpr
size_t state_size = __n;
512 static constexpr
size_t shift_size = __m;
513 static constexpr
size_t mask_bits = __r;
515 static constexpr
size_t tempering_u = __u;
517 static constexpr
size_t tempering_s = __s;
519 static constexpr
size_t tempering_t = __t;
521 static constexpr
size_t tempering_l = __l;
522 static constexpr
result_type initialization_multiplier = __f;
539 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
547 template<
typename _Sseq>
563 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
569 discard(
unsigned long long __z);
589 {
return (
std::equal(__lhs._M_x, __lhs._M_x + state_size, __rhs._M_x)
590 && __lhs._M_p == __rhs._M_p); }
604 template<
typename _UIntType1,
605 size_t __w1,
size_t __n1,
606 size_t __m1,
size_t __r1,
607 _UIntType1 __a1,
size_t __u1,
608 _UIntType1 __d1,
size_t __s1,
609 _UIntType1 __b1,
size_t __t1,
610 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
611 typename _CharT,
typename _Traits>
613 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
615 __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
630 template<
typename _UIntType1,
631 size_t __w1,
size_t __n1,
632 size_t __m1,
size_t __r1,
633 _UIntType1 __a1,
size_t __u1,
634 _UIntType1 __d1,
size_t __s1,
635 _UIntType1 __b1,
size_t __t1,
636 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
637 typename _CharT,
typename _Traits>
641 __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
647 _UIntType _M_x[state_size];
663 template<
typename _UIntType,
size_t __w,
664 size_t __n,
size_t __m,
size_t __r,
665 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
666 _UIntType __b,
size_t __t,
667 _UIntType __c,
size_t __l, _UIntType __f>
670 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __lhs,
672 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __rhs)
673 {
return !(__lhs == __rhs); }
691 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
694 static_assert(std::is_unsigned<_UIntType>::value,
695 "result_type must be an unsigned integral type");
696 static_assert(0u < __s && __s < __r,
699 "template argument substituting __w out of bounds");
701 template<
typename _Sseq>
702 using _If_seed_seq =
typename enable_if<__detail::__is_seed_seq<
710 static constexpr
size_t word_size = __w;
711 static constexpr
size_t short_lag = __s;
712 static constexpr
size_t long_lag = __r;
713 static constexpr
result_type default_seed = 19780503u;
732 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
756 template<
typename _Sseq>
774 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
782 for (; __z != 0ULL; --__z)
807 {
return (
std::equal(__lhs._M_x, __lhs._M_x + long_lag, __rhs._M_x)
808 && __lhs._M_carry == __rhs._M_carry
809 && __lhs._M_p == __rhs._M_p); }
823 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
824 typename _CharT,
typename _Traits>
826 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
842 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
843 typename _CharT,
typename _Traits>
851 _UIntType _M_x[long_lag];
868 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
874 {
return !(__lhs == __rhs); }
883 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
886 static_assert(1 <= __r && __r <= __p,
887 "template argument substituting __r out of bounds");
891 typedef typename _RandomNumberEngine::result_type
result_type;
893 template<
typename _Sseq>
894 using _If_seed_seq =
typename enable_if<__detail::__is_seed_seq<
898 static constexpr
size_t block_size = __p;
899 static constexpr
size_t used_block = __r;
907 : _M_b(), _M_n(0) { }
917 : _M_b(__rng), _M_n(0) { }
927 : _M_b(
std::
move(__rng)), _M_n(0) { }
937 : _M_b(__s), _M_n(0) { }
944 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
977 template<
typename _Sseq>
989 const _RandomNumberEngine&
1013 for (; __z != 0ULL; --__z)
1037 {
return __lhs._M_b == __rhs._M_b && __lhs._M_n == __rhs._M_n; }
1050 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1051 typename _CharT,
typename _Traits>
1053 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1068 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1069 typename _CharT,
typename _Traits>
1076 _RandomNumberEngine _M_b;
1091 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
1097 {
return !(__lhs == __rhs); }
1104 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1107 static_assert(std::is_unsigned<_UIntType>::value,
1108 "result_type must be an unsigned integral type");
1110 "template argument substituting __w out of bounds");
1112 template<
typename _Sseq>
1113 using _If_seed_seq =
typename enable_if<__detail::__is_seed_seq<
1163 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1190 template<
typename _Sseq>
1199 const _RandomNumberEngine&
1215 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1223 for (; __z != 0ULL; --__z)
1248 {
return __lhs._M_b == __rhs._M_b; }
1262 template<
typename _CharT,
typename _Traits>
1266 __w, _UIntType>& __x)
1273 _RandomNumberEngine _M_b;
1288 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1294 {
return !(__lhs == __rhs); }
1306 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType,
1307 typename _CharT,
typename _Traits>
1309 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1311 __w, _UIntType>& __x)
1325 template<
typename _RandomNumberEngine,
size_t __k>
1328 static_assert(1u <= __k,
"template argument substituting " 1329 "__k out of bound");
1333 typedef typename _RandomNumberEngine::result_type
result_type;
1335 template<
typename _Sseq>
1336 using _If_seed_seq =
typename enable_if<__detail::__is_seed_seq<
1339 static constexpr
size_t table_size = __k;
1348 { _M_initialize(); }
1359 { _M_initialize(); }
1370 { _M_initialize(); }
1381 { _M_initialize(); }
1388 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1392 { _M_initialize(); }
1421 template<
typename _Sseq>
1432 const _RandomNumberEngine&
1456 for (; __z != 0ULL; --__z)
1480 {
return (__lhs._M_b == __rhs._M_b
1481 &&
std::equal(__lhs._M_v, __lhs._M_v + __k, __rhs._M_v)
1482 && __lhs._M_y == __rhs._M_y); }
1495 template<
typename _RandomNumberEngine1,
size_t __k1,
1496 typename _CharT,
typename _Traits>
1498 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1513 template<
typename _RandomNumberEngine1,
size_t __k1,
1514 typename _CharT,
typename _Traits>
1520 void _M_initialize()
1522 for (
size_t __i = 0; __i < __k; ++__i)
1527 _RandomNumberEngine _M_b;
1543 template<
typename _RandomNumberEngine,
size_t __k>
1549 {
return !(__lhs == __rhs); }
1555 typedef linear_congruential_engine<uint_fast32_t, 16807UL, 0UL, 2147483647UL>
1586 0xb5026f5aa96619e9ULL, 29,
1587 0x5555555555555555ULL, 17,
1588 0x71d67fffeda60000ULL, 37,
1589 0xfff7eee000000000ULL, 43,
1623 #if defined _GLIBCXX_USE_DEV_RANDOM 1637 entropy() const noexcept
1639 #ifdef _GLIBCXX_USE_DEV_RANDOM 1640 return this->_M_getentropy();
1648 {
return this->_M_getval(); }
1651 random_device(
const random_device&) =
delete;
1652 void operator=(
const random_device&) =
delete;
1662 double _M_getentropy() const noexcept;
1664 void _M_init(const
char*,
size_t);
1698 template<
typename _IntType>
1702 {
return !(__d1 == __d2); }
1714 template<
typename _IntType,
typename _CharT,
typename _Traits>
1716 operator<<(std::basic_ostream<_CharT, _Traits>&,
1728 template<
typename _IntType,
typename _CharT,
typename _Traits>
1741 template<
typename _RealType =
double>
1745 "result_type must be a floating point type");
1759 param_type(_RealType __a, _RealType __b = _RealType(1))
1760 : _M_a(__a), _M_b(__b)
1762 __glibcxx_assert(_M_a <= _M_b);
1775 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
1779 {
return !(__p1 == __p2); }
1802 : _M_param(__a, __b)
1820 {
return _M_param.a(); }
1824 {
return _M_param.b(); }
1831 {
return _M_param; }
1839 { _M_param = __param; }
1846 {
return this->a(); }
1853 {
return this->b(); }
1858 template<
typename _UniformRandomNumberGenerator>
1861 {
return this->
operator()(__urng, _M_param); }
1863 template<
typename _UniformRandomNumberGenerator>
1865 operator()(_UniformRandomNumberGenerator& __urng,
1866 const param_type& __p)
1868 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
1870 return (__aurng() * (__p.b() - __p.a())) + __p.a();
1873 template<
typename _ForwardIterator,
1874 typename _UniformRandomNumberGenerator>
1876 __generate(_ForwardIterator __f, _ForwardIterator __t,
1877 _UniformRandomNumberGenerator& __urng)
1878 { this->__generate(__f, __t, __urng, _M_param); }
1880 template<
typename _ForwardIterator,
1881 typename _UniformRandomNumberGenerator>
1883 __generate(_ForwardIterator __f, _ForwardIterator __t,
1884 _UniformRandomNumberGenerator& __urng,
1885 const param_type& __p)
1886 { this->__generate_impl(__f, __t, __urng, __p); }
1888 template<
typename _UniformRandomNumberGenerator>
1891 _UniformRandomNumberGenerator& __urng,
1892 const param_type& __p)
1893 { this->__generate_impl(__f, __t, __urng, __p); }
1902 {
return __d1._M_param == __d2._M_param; }
1905 template<
typename _ForwardIterator,
1906 typename _UniformRandomNumberGenerator>
1908 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
1909 _UniformRandomNumberGenerator& __urng,
1910 const param_type& __p);
1912 param_type _M_param;
1919 template<
typename _IntType>
1923 {
return !(__d1 == __d2); }
1935 template<
typename _RealType,
typename _CharT,
typename _Traits>
1937 operator<<(std::basic_ostream<_CharT, _Traits>&,
1949 template<
typename _RealType,
typename _CharT,
typename _Traits>
1971 template<
typename _RealType =
double>
1975 "result_type must be a floating point type");
1989 param_type(_RealType __mean, _RealType __stddev = _RealType(1))
1990 : _M_mean(__mean), _M_stddev(__stddev)
1992 __glibcxx_assert(_M_stddev > _RealType(0));
2001 {
return _M_stddev; }
2005 {
return (__p1._M_mean == __p2._M_mean
2006 && __p1._M_stddev == __p2._M_stddev); }
2010 {
return !(__p1 == __p2); }
2014 _RealType _M_stddev;
2027 : _M_param(__mean, __stddev)
2040 { _M_saved_available =
false; }
2047 {
return _M_param.mean(); }
2054 {
return _M_param.stddev(); }
2061 {
return _M_param; }
2069 { _M_param = __param; }
2088 template<
typename _UniformRandomNumberGenerator>
2091 {
return this->
operator()(__urng, _M_param); }
2093 template<
typename _UniformRandomNumberGenerator>
2095 operator()(_UniformRandomNumberGenerator& __urng,
2096 const param_type& __p);
2098 template<
typename _ForwardIterator,
2099 typename _UniformRandomNumberGenerator>
2101 __generate(_ForwardIterator __f, _ForwardIterator __t,
2102 _UniformRandomNumberGenerator& __urng)
2103 { this->__generate(__f, __t, __urng, _M_param); }
2105 template<
typename _ForwardIterator,
2106 typename _UniformRandomNumberGenerator>
2108 __generate(_ForwardIterator __f, _ForwardIterator __t,
2109 _UniformRandomNumberGenerator& __urng,
2110 const param_type& __p)
2111 { this->__generate_impl(__f, __t, __urng, __p); }
2113 template<
typename _UniformRandomNumberGenerator>
2116 _UniformRandomNumberGenerator& __urng,
2117 const param_type& __p)
2118 { this->__generate_impl(__f, __t, __urng, __p); }
2125 template<
typename _RealType1>
2140 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2142 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2155 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2161 template<
typename _ForwardIterator,
2162 typename _UniformRandomNumberGenerator>
2164 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2165 _UniformRandomNumberGenerator& __urng,
2166 const param_type& __p);
2168 param_type _M_param;
2170 bool _M_saved_available =
false;
2176 template<
typename _RealType>
2180 {
return !(__d1 == __d2); }
2192 template<
typename _RealType =
double>
2196 "result_type must be a floating point type");
2210 param_type(_RealType __m, _RealType __s = _RealType(1))
2211 : _M_m(__m), _M_s(__s)
2224 {
return __p1._M_m == __p2._M_m && __p1._M_s == __p2._M_s; }
2228 {
return !(__p1 == __p2); }
2239 : _M_param(__m, __s), _M_nd()
2243 lognormal_distribution(
const param_type& __p)
2244 : _M_param(__p), _M_nd()
2259 {
return _M_param.m(); }
2263 {
return _M_param.s(); }
2270 {
return _M_param; }
2278 { _M_param = __param; }
2297 template<
typename _UniformRandomNumberGenerator>
2300 {
return this->
operator()(__urng, _M_param); }
2302 template<
typename _UniformRandomNumberGenerator>
2304 operator()(_UniformRandomNumberGenerator& __urng,
2305 const param_type& __p)
2306 {
return std::exp(__p.s() * _M_nd(__urng) + __p.m()); }
2308 template<
typename _ForwardIterator,
2309 typename _UniformRandomNumberGenerator>
2311 __generate(_ForwardIterator __f, _ForwardIterator __t,
2312 _UniformRandomNumberGenerator& __urng)
2313 { this->__generate(__f, __t, __urng, _M_param); }
2315 template<
typename _ForwardIterator,
2316 typename _UniformRandomNumberGenerator>
2318 __generate(_ForwardIterator __f, _ForwardIterator __t,
2319 _UniformRandomNumberGenerator& __urng,
2320 const param_type& __p)
2321 { this->__generate_impl(__f, __t, __urng, __p); }
2323 template<
typename _UniformRandomNumberGenerator>
2326 _UniformRandomNumberGenerator& __urng,
2327 const param_type& __p)
2328 { this->__generate_impl(__f, __t, __urng, __p); }
2338 {
return (__d1._M_param == __d2._M_param
2339 && __d1._M_nd == __d2._M_nd); }
2351 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2353 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2366 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2372 template<
typename _ForwardIterator,
2373 typename _UniformRandomNumberGenerator>
2375 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2376 _UniformRandomNumberGenerator& __urng,
2377 const param_type& __p);
2379 param_type _M_param;
2387 template<
typename _RealType>
2391 {
return !(__d1 == __d2); }
2403 template<
typename _RealType =
double>
2407 "result_type must be a floating point type");
2422 param_type(_RealType __alpha_val, _RealType __beta_val = _RealType(1))
2423 : _M_alpha(__alpha_val), _M_beta(__beta_val)
2425 __glibcxx_assert(_M_alpha > _RealType(0));
2431 {
return _M_alpha; }
2439 {
return (__p1._M_alpha == __p2._M_alpha
2440 && __p1._M_beta == __p2._M_beta); }
2444 {
return !(__p1 == __p2); }
2453 _RealType _M_malpha, _M_a2;
2468 _RealType __beta_val = _RealType(1))
2469 : _M_param(__alpha_val, __beta_val), _M_nd()
2474 : _M_param(__p), _M_nd()
2489 {
return _M_param.alpha(); }
2496 {
return _M_param.beta(); }
2503 {
return _M_param; }
2511 { _M_param = __param; }
2530 template<
typename _UniformRandomNumberGenerator>
2533 {
return this->
operator()(__urng, _M_param); }
2535 template<
typename _UniformRandomNumberGenerator>
2537 operator()(_UniformRandomNumberGenerator& __urng,
2538 const param_type& __p);
2540 template<
typename _ForwardIterator,
2541 typename _UniformRandomNumberGenerator>
2543 __generate(_ForwardIterator __f, _ForwardIterator __t,
2544 _UniformRandomNumberGenerator& __urng)
2545 { this->__generate(__f, __t, __urng, _M_param); }
2547 template<
typename _ForwardIterator,
2548 typename _UniformRandomNumberGenerator>
2550 __generate(_ForwardIterator __f, _ForwardIterator __t,
2551 _UniformRandomNumberGenerator& __urng,
2552 const param_type& __p)
2553 { this->__generate_impl(__f, __t, __urng, __p); }
2555 template<
typename _UniformRandomNumberGenerator>
2558 _UniformRandomNumberGenerator& __urng,
2559 const param_type& __p)
2560 { this->__generate_impl(__f, __t, __urng, __p); }
2570 {
return (__d1._M_param == __d2._M_param
2571 && __d1._M_nd == __d2._M_nd); }
2583 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2585 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2597 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2603 template<
typename _ForwardIterator,
2604 typename _UniformRandomNumberGenerator>
2606 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2607 _UniformRandomNumberGenerator& __urng,
2608 const param_type& __p);
2610 param_type _M_param;
2618 template<
typename _RealType>
2622 {
return !(__d1 == __d2); }
2631 template<
typename _RealType =
double>
2635 "result_type must be a floating point type");
2659 {
return __p1._M_n == __p2._M_n; }
2663 {
return !(__p1 == __p2); }
2673 : _M_param(__n), _M_gd(__n / 2)
2677 chi_squared_distribution(
const param_type& __p)
2678 : _M_param(__p), _M_gd(__p.n() / 2)
2693 {
return _M_param.n(); }
2700 {
return _M_param; }
2732 template<
typename _UniformRandomNumberGenerator>
2735 {
return 2 * _M_gd(__urng); }
2737 template<
typename _UniformRandomNumberGenerator>
2739 operator()(_UniformRandomNumberGenerator& __urng,
2740 const param_type& __p)
2744 return 2 * _M_gd(__urng, param_type(__p.n() / 2));
2747 template<
typename _ForwardIterator,
2748 typename _UniformRandomNumberGenerator>
2750 __generate(_ForwardIterator __f, _ForwardIterator __t,
2751 _UniformRandomNumberGenerator& __urng)
2752 { this->__generate_impl(__f, __t, __urng); }
2754 template<
typename _ForwardIterator,
2755 typename _UniformRandomNumberGenerator>
2757 __generate(_ForwardIterator __f, _ForwardIterator __t,
2758 _UniformRandomNumberGenerator& __urng,
2759 const param_type& __p)
2762 this->__generate_impl(__f, __t, __urng, __p2); }
2764 template<
typename _UniformRandomNumberGenerator>
2767 _UniformRandomNumberGenerator& __urng)
2768 { this->__generate_impl(__f, __t, __urng); }
2770 template<
typename _UniformRandomNumberGenerator>
2773 _UniformRandomNumberGenerator& __urng,
2774 const param_type& __p)
2777 this->__generate_impl(__f, __t, __urng, __p2); }
2787 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
2799 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2801 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2814 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2820 template<
typename _ForwardIterator,
2821 typename _UniformRandomNumberGenerator>
2823 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2824 _UniformRandomNumberGenerator& __urng);
2826 template<
typename _ForwardIterator,
2827 typename _UniformRandomNumberGenerator>
2829 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2830 _UniformRandomNumberGenerator& __urng,
2834 param_type _M_param;
2842 template<
typename _RealType>
2846 {
return !(__d1 == __d2); }
2855 template<
typename _RealType =
double>
2859 "result_type must be a floating point type");
2873 param_type(_RealType __a, _RealType __b = _RealType(1))
2874 : _M_a(__a), _M_b(__b)
2887 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
2891 {
return !(__p1 == __p2); }
2902 : _M_param(__a, __b)
2906 cauchy_distribution(
const param_type& __p)
2922 {
return _M_param.a(); }
2926 {
return _M_param.b(); }
2933 {
return _M_param; }
2941 { _M_param = __param; }
2960 template<
typename _UniformRandomNumberGenerator>
2963 {
return this->
operator()(__urng, _M_param); }
2965 template<
typename _UniformRandomNumberGenerator>
2967 operator()(_UniformRandomNumberGenerator& __urng,
2968 const param_type& __p);
2970 template<
typename _ForwardIterator,
2971 typename _UniformRandomNumberGenerator>
2973 __generate(_ForwardIterator __f, _ForwardIterator __t,
2974 _UniformRandomNumberGenerator& __urng)
2975 { this->__generate(__f, __t, __urng, _M_param); }
2977 template<
typename _ForwardIterator,
2978 typename _UniformRandomNumberGenerator>
2980 __generate(_ForwardIterator __f, _ForwardIterator __t,
2981 _UniformRandomNumberGenerator& __urng,
2982 const param_type& __p)
2983 { this->__generate_impl(__f, __t, __urng, __p); }
2985 template<
typename _UniformRandomNumberGenerator>
2988 _UniformRandomNumberGenerator& __urng,
2989 const param_type& __p)
2990 { this->__generate_impl(__f, __t, __urng, __p); }
2999 {
return __d1._M_param == __d2._M_param; }
3002 template<
typename _ForwardIterator,
3003 typename _UniformRandomNumberGenerator>
3005 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3006 _UniformRandomNumberGenerator& __urng,
3007 const param_type& __p);
3009 param_type _M_param;
3016 template<
typename _RealType>
3020 {
return !(__d1 == __d2); }
3032 template<
typename _RealType,
typename _CharT,
typename _Traits>
3034 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3047 template<
typename _RealType,
typename _CharT,
typename _Traits>
3063 template<
typename _RealType =
double>
3067 "result_type must be a floating point type");
3081 param_type(_RealType __m, _RealType __n = _RealType(1))
3082 : _M_m(__m), _M_n(__n)
3095 {
return __p1._M_m == __p2._M_m && __p1._M_n == __p2._M_n; }
3099 {
return !(__p1 == __p2); }
3110 _RealType __n = _RealType(1))
3111 : _M_param(__m, __n), _M_gd_x(__m / 2), _M_gd_y(__n / 2)
3115 fisher_f_distribution(
const param_type& __p)
3116 : _M_param(__p), _M_gd_x(__p.m() / 2), _M_gd_y(__p.n() / 2)
3134 {
return _M_param.m(); }
3138 {
return _M_param.n(); }
3145 {
return _M_param; }
3153 { _M_param = __param; }
3172 template<
typename _UniformRandomNumberGenerator>
3175 {
return (_M_gd_x(__urng) * n()) / (_M_gd_y(__urng) * m()); }
3177 template<
typename _UniformRandomNumberGenerator>
3179 operator()(_UniformRandomNumberGenerator& __urng,
3180 const param_type& __p)
3184 return ((_M_gd_x(__urng, param_type(__p.m() / 2)) * n())
3185 / (_M_gd_y(__urng, param_type(__p.n() / 2)) * m()));
3188 template<
typename _ForwardIterator,
3189 typename _UniformRandomNumberGenerator>
3191 __generate(_ForwardIterator __f, _ForwardIterator __t,
3192 _UniformRandomNumberGenerator& __urng)
3193 { this->__generate_impl(__f, __t, __urng); }
3195 template<
typename _ForwardIterator,
3196 typename _UniformRandomNumberGenerator>
3198 __generate(_ForwardIterator __f, _ForwardIterator __t,
3199 _UniformRandomNumberGenerator& __urng,
3200 const param_type& __p)
3201 { this->__generate_impl(__f, __t, __urng, __p); }
3203 template<
typename _UniformRandomNumberGenerator>
3206 _UniformRandomNumberGenerator& __urng)
3207 { this->__generate_impl(__f, __t, __urng); }
3209 template<
typename _UniformRandomNumberGenerator>
3212 _UniformRandomNumberGenerator& __urng,
3213 const param_type& __p)
3214 { this->__generate_impl(__f, __t, __urng, __p); }
3224 {
return (__d1._M_param == __d2._M_param
3225 && __d1._M_gd_x == __d2._M_gd_x
3226 && __d1._M_gd_y == __d2._M_gd_y); }
3238 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3240 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3253 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3259 template<
typename _ForwardIterator,
3260 typename _UniformRandomNumberGenerator>
3262 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3263 _UniformRandomNumberGenerator& __urng);
3265 template<
typename _ForwardIterator,
3266 typename _UniformRandomNumberGenerator>
3268 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3269 _UniformRandomNumberGenerator& __urng,
3270 const param_type& __p);
3272 param_type _M_param;
3280 template<
typename _RealType>
3284 {
return !(__d1 == __d2); }
3295 template<
typename _RealType =
double>
3299 "result_type must be a floating point type");
3323 {
return __p1._M_n == __p2._M_n; }
3327 {
return !(__p1 == __p2); }
3337 : _M_param(__n), _M_nd(), _M_gd(__n / 2, 2)
3341 student_t_distribution(
const param_type& __p)
3342 : _M_param(__p), _M_nd(), _M_gd(__p.n() / 2, 2)
3360 {
return _M_param.n(); }
3367 {
return _M_param; }
3375 { _M_param = __param; }
3394 template<
typename _UniformRandomNumberGenerator>
3397 {
return _M_nd(__urng) *
std::sqrt(n() / _M_gd(__urng)); }
3399 template<
typename _UniformRandomNumberGenerator>
3401 operator()(_UniformRandomNumberGenerator& __urng,
3402 const param_type& __p)
3407 const result_type __g = _M_gd(__urng, param_type(__p.n() / 2, 2));
3408 return _M_nd(__urng) *
std::sqrt(__p.n() / __g);
3411 template<
typename _ForwardIterator,
3412 typename _UniformRandomNumberGenerator>
3414 __generate(_ForwardIterator __f, _ForwardIterator __t,
3415 _UniformRandomNumberGenerator& __urng)
3416 { this->__generate_impl(__f, __t, __urng); }
3418 template<
typename _ForwardIterator,
3419 typename _UniformRandomNumberGenerator>
3421 __generate(_ForwardIterator __f, _ForwardIterator __t,
3422 _UniformRandomNumberGenerator& __urng,
3423 const param_type& __p)
3424 { this->__generate_impl(__f, __t, __urng, __p); }
3426 template<
typename _UniformRandomNumberGenerator>
3429 _UniformRandomNumberGenerator& __urng)
3430 { this->__generate_impl(__f, __t, __urng); }
3432 template<
typename _UniformRandomNumberGenerator>
3435 _UniformRandomNumberGenerator& __urng,
3436 const param_type& __p)
3437 { this->__generate_impl(__f, __t, __urng, __p); }
3447 {
return (__d1._M_param == __d2._M_param
3448 && __d1._M_nd == __d2._M_nd && __d1._M_gd == __d2._M_gd); }
3460 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3462 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3475 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3481 template<
typename _ForwardIterator,
3482 typename _UniformRandomNumberGenerator>
3484 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3485 _UniformRandomNumberGenerator& __urng);
3486 template<
typename _ForwardIterator,
3487 typename _UniformRandomNumberGenerator>
3489 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3490 _UniformRandomNumberGenerator& __urng,
3491 const param_type& __p);
3493 param_type _M_param;
3502 template<
typename _RealType>
3506 {
return !(__d1 == __d2); }
3540 __glibcxx_assert((_M_p >= 0.0) && (_M_p <= 1.0));
3549 {
return __p1._M_p == __p2._M_p; }
3553 {
return !(__p1 == __p2); }
3594 {
return _M_param.p(); }
3601 {
return _M_param; }
3609 { _M_param = __param; }
3628 template<
typename _UniformRandomNumberGenerator>
3631 {
return this->
operator()(__urng, _M_param); }
3633 template<
typename _UniformRandomNumberGenerator>
3635 operator()(_UniformRandomNumberGenerator& __urng,
3636 const param_type& __p)
3638 __detail::_Adaptor<_UniformRandomNumberGenerator, double>
3640 if ((__aurng() - __aurng.min())
3641 < __p.p() * (__aurng.max() - __aurng.min()))
3646 template<
typename _ForwardIterator,
3647 typename _UniformRandomNumberGenerator>
3649 __generate(_ForwardIterator __f, _ForwardIterator __t,
3650 _UniformRandomNumberGenerator& __urng)
3651 { this->__generate(__f, __t, __urng, _M_param); }
3653 template<
typename _ForwardIterator,
3654 typename _UniformRandomNumberGenerator>
3656 __generate(_ForwardIterator __f, _ForwardIterator __t,
3657 _UniformRandomNumberGenerator& __urng,
const param_type& __p)
3658 { this->__generate_impl(__f, __t, __urng, __p); }
3660 template<
typename _UniformRandomNumberGenerator>
3663 _UniformRandomNumberGenerator& __urng,
3664 const param_type& __p)
3665 { this->__generate_impl(__f, __t, __urng, __p); }
3674 {
return __d1._M_param == __d2._M_param; }
3677 template<
typename _ForwardIterator,
3678 typename _UniformRandomNumberGenerator>
3680 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3681 _UniformRandomNumberGenerator& __urng,
3682 const param_type& __p);
3684 param_type _M_param;
3694 {
return !(__d1 == __d2); }
3706 template<
typename _CharT,
typename _Traits>
3708 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3720 template<
typename _CharT,
typename _Traits>
3739 template<
typename _IntType =
int>
3743 "result_type must be an integral type");
3759 : _M_t(__t), _M_p(__p)
3761 __glibcxx_assert((_M_t >= _IntType(0))
3777 {
return __p1._M_t == __p2._M_t && __p1._M_p == __p2._M_p; }
3781 {
return !(__p1 == __p2); }
3791 #if _GLIBCXX_USE_C99_MATH_TR1 3792 double _M_d1, _M_d2, _M_s1, _M_s2, _M_c,
3793 _M_a1, _M_a123, _M_s, _M_lf, _M_lp1p;
3804 : _M_param(__t, __p), _M_nd()
3808 binomial_distribution(
const param_type& __p)
3809 : _M_param(__p), _M_nd()
3824 {
return _M_param.t(); }
3831 {
return _M_param.p(); }
3838 {
return _M_param; }
3846 { _M_param = __param; }
3860 {
return _M_param.t(); }
3865 template<
typename _UniformRandomNumberGenerator>
3868 {
return this->
operator()(__urng, _M_param); }
3870 template<
typename _UniformRandomNumberGenerator>
3872 operator()(_UniformRandomNumberGenerator& __urng,
3873 const param_type& __p);
3875 template<
typename _ForwardIterator,
3876 typename _UniformRandomNumberGenerator>
3878 __generate(_ForwardIterator __f, _ForwardIterator __t,
3879 _UniformRandomNumberGenerator& __urng)
3880 { this->__generate(__f, __t, __urng, _M_param); }
3882 template<
typename _ForwardIterator,
3883 typename _UniformRandomNumberGenerator>
3885 __generate(_ForwardIterator __f, _ForwardIterator __t,
3886 _UniformRandomNumberGenerator& __urng,
3887 const param_type& __p)
3888 { this->__generate_impl(__f, __t, __urng, __p); }
3890 template<
typename _UniformRandomNumberGenerator>
3893 _UniformRandomNumberGenerator& __urng,
3894 const param_type& __p)
3895 { this->__generate_impl(__f, __t, __urng, __p); }
3905 #ifdef _GLIBCXX_USE_C99_MATH_TR1 3906 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
3908 {
return __d1._M_param == __d2._M_param; }
3921 template<
typename _IntType1,
3922 typename _CharT,
typename _Traits>
3924 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3937 template<
typename _IntType1,
3938 typename _CharT,
typename _Traits>
3944 template<
typename _ForwardIterator,
3945 typename _UniformRandomNumberGenerator>
3947 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3948 _UniformRandomNumberGenerator& __urng,
3949 const param_type& __p);
3951 template<
typename _UniformRandomNumberGenerator>
3953 _M_waiting(_UniformRandomNumberGenerator& __urng,
3954 _IntType __t,
double __q);
3956 param_type _M_param;
3965 template<
typename _IntType>
3969 {
return !(__d1 == __d2); }
3979 template<
typename _IntType =
int>
3983 "result_type must be an integral type");
4001 __glibcxx_assert((_M_p > 0.0) && (_M_p < 1.0));
4011 {
return __p1._M_p == __p2._M_p; }
4015 {
return !(__p1 == __p2); }
4020 { _M_log_1_p =
std::log(1.0 - _M_p); }
4037 geometric_distribution(
const param_type& __p)
4054 {
return _M_param.p(); }
4061 {
return _M_param; }
4069 { _M_param = __param; }
4088 template<
typename _UniformRandomNumberGenerator>
4091 {
return this->
operator()(__urng, _M_param); }
4093 template<
typename _UniformRandomNumberGenerator>
4095 operator()(_UniformRandomNumberGenerator& __urng,
4096 const param_type& __p);
4098 template<
typename _ForwardIterator,
4099 typename _UniformRandomNumberGenerator>
4101 __generate(_ForwardIterator __f, _ForwardIterator __t,
4102 _UniformRandomNumberGenerator& __urng)
4103 { this->__generate(__f, __t, __urng, _M_param); }
4105 template<
typename _ForwardIterator,
4106 typename _UniformRandomNumberGenerator>
4108 __generate(_ForwardIterator __f, _ForwardIterator __t,
4109 _UniformRandomNumberGenerator& __urng,
4110 const param_type& __p)
4111 { this->__generate_impl(__f, __t, __urng, __p); }
4113 template<
typename _UniformRandomNumberGenerator>
4116 _UniformRandomNumberGenerator& __urng,
4117 const param_type& __p)
4118 { this->__generate_impl(__f, __t, __urng, __p); }
4127 {
return __d1._M_param == __d2._M_param; }
4130 template<
typename _ForwardIterator,
4131 typename _UniformRandomNumberGenerator>
4133 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4134 _UniformRandomNumberGenerator& __urng,
4135 const param_type& __p);
4137 param_type _M_param;
4144 template<
typename _IntType>
4148 {
return !(__d1 == __d2); }
4160 template<
typename _IntType,
4161 typename _CharT,
typename _Traits>
4163 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4175 template<
typename _IntType,
4176 typename _CharT,
typename _Traits>
4189 template<
typename _IntType =
int>
4193 "result_type must be an integral type");
4208 : _M_k(__k), _M_p(__p)
4210 __glibcxx_assert((_M_k > 0) && (_M_p > 0.0) && (_M_p <= 1.0));
4223 {
return __p1._M_k == __p2._M_k && __p1._M_p == __p2._M_p; }
4227 {
return !(__p1 == __p2); }
4238 : _M_param(__k, __p), _M_gd(__k, (1.0 - __p) / __p)
4242 negative_binomial_distribution(
const param_type& __p)
4243 : _M_param(__p), _M_gd(__p.
k(), (1.0 - __p.
p()) / __p.
p())
4258 {
return _M_param.k(); }
4265 {
return _M_param.p(); }
4272 {
return _M_param; }
4280 { _M_param = __param; }
4299 template<
typename _UniformRandomNumberGenerator>
4301 operator()(_UniformRandomNumberGenerator& __urng);
4303 template<
typename _UniformRandomNumberGenerator>
4305 operator()(_UniformRandomNumberGenerator& __urng,
4306 const param_type& __p);
4308 template<
typename _ForwardIterator,
4309 typename _UniformRandomNumberGenerator>
4311 __generate(_ForwardIterator __f, _ForwardIterator __t,
4312 _UniformRandomNumberGenerator& __urng)
4313 { this->__generate_impl(__f, __t, __urng); }
4315 template<
typename _ForwardIterator,
4316 typename _UniformRandomNumberGenerator>
4318 __generate(_ForwardIterator __f, _ForwardIterator __t,
4319 _UniformRandomNumberGenerator& __urng,
4320 const param_type& __p)
4321 { this->__generate_impl(__f, __t, __urng, __p); }
4323 template<
typename _UniformRandomNumberGenerator>
4326 _UniformRandomNumberGenerator& __urng)
4327 { this->__generate_impl(__f, __t, __urng); }
4329 template<
typename _UniformRandomNumberGenerator>
4332 _UniformRandomNumberGenerator& __urng,
4333 const param_type& __p)
4334 { this->__generate_impl(__f, __t, __urng, __p); }
4344 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
4357 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4359 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4372 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4378 template<
typename _ForwardIterator,
4379 typename _UniformRandomNumberGenerator>
4381 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4382 _UniformRandomNumberGenerator& __urng);
4383 template<
typename _ForwardIterator,
4384 typename _UniformRandomNumberGenerator>
4386 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4387 _UniformRandomNumberGenerator& __urng,
4388 const param_type& __p);
4390 param_type _M_param;
4398 template<
typename _IntType>
4402 {
return !(__d1 == __d2); }
4420 template<
typename _IntType =
int>
4424 "result_type must be an integral type");
4442 __glibcxx_assert(_M_mean > 0.0);
4452 {
return __p1._M_mean == __p2._M_mean; }
4456 {
return !(__p1 == __p2); }
4466 #if _GLIBCXX_USE_C99_MATH_TR1 4467 double _M_lfm, _M_sm, _M_d, _M_scx, _M_1cx, _M_c2b, _M_cb;
4477 : _M_param(__mean), _M_nd()
4481 poisson_distribution(
const param_type& __p)
4482 : _M_param(__p), _M_nd()
4497 {
return _M_param.mean(); }
4504 {
return _M_param; }
4512 { _M_param = __param; }
4531 template<
typename _UniformRandomNumberGenerator>
4534 {
return this->
operator()(__urng, _M_param); }
4536 template<
typename _UniformRandomNumberGenerator>
4538 operator()(_UniformRandomNumberGenerator& __urng,
4539 const param_type& __p);
4541 template<
typename _ForwardIterator,
4542 typename _UniformRandomNumberGenerator>
4544 __generate(_ForwardIterator __f, _ForwardIterator __t,
4545 _UniformRandomNumberGenerator& __urng)
4546 { this->__generate(__f, __t, __urng, _M_param); }
4548 template<
typename _ForwardIterator,
4549 typename _UniformRandomNumberGenerator>
4551 __generate(_ForwardIterator __f, _ForwardIterator __t,
4552 _UniformRandomNumberGenerator& __urng,
4553 const param_type& __p)
4554 { this->__generate_impl(__f, __t, __urng, __p); }
4556 template<
typename _UniformRandomNumberGenerator>
4559 _UniformRandomNumberGenerator& __urng,
4560 const param_type& __p)
4561 { this->__generate_impl(__f, __t, __urng, __p); }
4571 #ifdef _GLIBCXX_USE_C99_MATH_TR1 4572 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
4574 {
return __d1._M_param == __d2._M_param; }
4587 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4589 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4602 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4608 template<
typename _ForwardIterator,
4609 typename _UniformRandomNumberGenerator>
4611 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4612 _UniformRandomNumberGenerator& __urng,
4613 const param_type& __p);
4615 param_type _M_param;
4624 template<
typename _IntType>
4628 {
return !(__d1 == __d2); }
4646 template<
typename _RealType =
double>
4650 "result_type must be a floating point type");
4665 : _M_lambda(__lambda)
4667 __glibcxx_assert(_M_lambda > _RealType(0));
4672 {
return _M_lambda; }
4676 {
return __p1._M_lambda == __p2._M_lambda; }
4680 {
return !(__p1 == __p2); }
4683 _RealType _M_lambda;
4699 : _M_param(__lambda)
4720 {
return _M_param.lambda(); }
4727 {
return _M_param; }
4735 { _M_param = __param; }
4754 template<
typename _UniformRandomNumberGenerator>
4757 {
return this->
operator()(__urng, _M_param); }
4759 template<
typename _UniformRandomNumberGenerator>
4761 operator()(_UniformRandomNumberGenerator& __urng,
4762 const param_type& __p)
4764 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
4769 template<
typename _ForwardIterator,
4770 typename _UniformRandomNumberGenerator>
4772 __generate(_ForwardIterator __f, _ForwardIterator __t,
4773 _UniformRandomNumberGenerator& __urng)
4774 { this->__generate(__f, __t, __urng, _M_param); }
4776 template<
typename _ForwardIterator,
4777 typename _UniformRandomNumberGenerator>
4779 __generate(_ForwardIterator __f, _ForwardIterator __t,
4780 _UniformRandomNumberGenerator& __urng,
4781 const param_type& __p)
4782 { this->__generate_impl(__f, __t, __urng, __p); }
4784 template<
typename _UniformRandomNumberGenerator>
4787 _UniformRandomNumberGenerator& __urng,
4788 const param_type& __p)
4789 { this->__generate_impl(__f, __t, __urng, __p); }
4798 {
return __d1._M_param == __d2._M_param; }
4801 template<
typename _ForwardIterator,
4802 typename _UniformRandomNumberGenerator>
4804 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4805 _UniformRandomNumberGenerator& __urng,
4806 const param_type& __p);
4808 param_type _M_param;
4815 template<
typename _RealType>
4819 {
return !(__d1 == __d2); }
4831 template<
typename _RealType,
typename _CharT,
typename _Traits>
4833 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4846 template<
typename _RealType,
typename _CharT,
typename _Traits>
4861 template<
typename _RealType =
double>
4865 "result_type must be a floating point type");
4879 param_type(_RealType __a, _RealType __b = _RealType(1.0))
4880 : _M_a(__a), _M_b(__b)
4893 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
4897 {
return !(__p1 == __p2); }
4908 : _M_param(__a, __b)
4912 weibull_distribution(
const param_type& __p)
4928 {
return _M_param.a(); }
4935 {
return _M_param.b(); }
4942 {
return _M_param; }
4950 { _M_param = __param; }
4969 template<
typename _UniformRandomNumberGenerator>
4972 {
return this->
operator()(__urng, _M_param); }
4974 template<
typename _UniformRandomNumberGenerator>
4976 operator()(_UniformRandomNumberGenerator& __urng,
4977 const param_type& __p);
4979 template<
typename _ForwardIterator,
4980 typename _UniformRandomNumberGenerator>
4982 __generate(_ForwardIterator __f, _ForwardIterator __t,
4983 _UniformRandomNumberGenerator& __urng)
4984 { this->__generate(__f, __t, __urng, _M_param); }
4986 template<
typename _ForwardIterator,
4987 typename _UniformRandomNumberGenerator>
4989 __generate(_ForwardIterator __f, _ForwardIterator __t,
4990 _UniformRandomNumberGenerator& __urng,
4991 const param_type& __p)
4992 { this->__generate_impl(__f, __t, __urng, __p); }
4994 template<
typename _UniformRandomNumberGenerator>
4997 _UniformRandomNumberGenerator& __urng,
4998 const param_type& __p)
4999 { this->__generate_impl(__f, __t, __urng, __p); }
5008 {
return __d1._M_param == __d2._M_param; }
5011 template<
typename _ForwardIterator,
5012 typename _UniformRandomNumberGenerator>
5014 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5015 _UniformRandomNumberGenerator& __urng,
5016 const param_type& __p);
5018 param_type _M_param;
5025 template<
typename _RealType>
5029 {
return !(__d1 == __d2); }
5041 template<
typename _RealType,
typename _CharT,
typename _Traits>
5043 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5056 template<
typename _RealType,
typename _CharT,
typename _Traits>
5071 template<
typename _RealType =
double>
5075 "result_type must be a floating point type");
5089 param_type(_RealType __a, _RealType __b = _RealType(1.0))
5090 : _M_a(__a), _M_b(__b)
5103 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
5107 {
return !(__p1 == __p2); }
5118 : _M_param(__a, __b)
5122 extreme_value_distribution(
const param_type& __p)
5138 {
return _M_param.a(); }
5145 {
return _M_param.b(); }
5152 {
return _M_param; }
5160 { _M_param = __param; }
5179 template<
typename _UniformRandomNumberGenerator>
5182 {
return this->
operator()(__urng, _M_param); }
5184 template<
typename _UniformRandomNumberGenerator>
5186 operator()(_UniformRandomNumberGenerator& __urng,
5187 const param_type& __p);
5189 template<
typename _ForwardIterator,
5190 typename _UniformRandomNumberGenerator>
5192 __generate(_ForwardIterator __f, _ForwardIterator __t,
5193 _UniformRandomNumberGenerator& __urng)
5194 { this->__generate(__f, __t, __urng, _M_param); }
5196 template<
typename _ForwardIterator,
5197 typename _UniformRandomNumberGenerator>
5199 __generate(_ForwardIterator __f, _ForwardIterator __t,
5200 _UniformRandomNumberGenerator& __urng,
5201 const param_type& __p)
5202 { this->__generate_impl(__f, __t, __urng, __p); }
5204 template<
typename _UniformRandomNumberGenerator>
5207 _UniformRandomNumberGenerator& __urng,
5208 const param_type& __p)
5209 { this->__generate_impl(__f, __t, __urng, __p); }
5218 {
return __d1._M_param == __d2._M_param; }
5221 template<
typename _ForwardIterator,
5222 typename _UniformRandomNumberGenerator>
5224 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5225 _UniformRandomNumberGenerator& __urng,
5226 const param_type& __p);
5228 param_type _M_param;
5235 template<
typename _RealType>
5239 {
return !(__d1 == __d2); }
5251 template<
typename _RealType,
typename _CharT,
typename _Traits>
5253 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5266 template<
typename _RealType,
typename _CharT,
typename _Traits>
5278 template<
typename _IntType =
int>
5282 "result_type must be an integral type");
5295 : _M_prob(), _M_cp()
5298 template<
typename _InputIterator>
5300 _InputIterator __wend)
5301 : _M_prob(__wbegin, __wend), _M_cp()
5302 { _M_initialize(); }
5305 : _M_prob(__wil.begin(), __wil.end()), _M_cp()
5306 { _M_initialize(); }
5308 template<
typename _Func>
5309 param_type(
size_t __nw,
double __xmin,
double __xmax,
5317 probabilities()
const 5322 {
return __p1._M_prob == __p2._M_prob; }
5326 {
return !(__p1 == __p2); }
5340 template<
typename _InputIterator>
5342 _InputIterator __wend)
5343 : _M_param(__wbegin, __wend)
5346 discrete_distribution(initializer_list<double> __wl)
5350 template<
typename _Func>
5351 discrete_distribution(
size_t __nw,
double __xmin,
double __xmax,
5353 : _M_param(__nw, __xmin, __xmax, __fw)
5357 discrete_distribution(
const param_type& __p)
5374 return _M_param._M_prob.
empty()
5383 {
return _M_param; }
5391 { _M_param = __param; }
5406 return _M_param._M_prob.
empty()
5413 template<
typename _UniformRandomNumberGenerator>
5416 {
return this->
operator()(__urng, _M_param); }
5418 template<
typename _UniformRandomNumberGenerator>
5420 operator()(_UniformRandomNumberGenerator& __urng,
5421 const param_type& __p);
5423 template<
typename _ForwardIterator,
5424 typename _UniformRandomNumberGenerator>
5426 __generate(_ForwardIterator __f, _ForwardIterator __t,
5427 _UniformRandomNumberGenerator& __urng)
5428 { this->__generate(__f, __t, __urng, _M_param); }
5430 template<
typename _ForwardIterator,
5431 typename _UniformRandomNumberGenerator>
5433 __generate(_ForwardIterator __f, _ForwardIterator __t,
5434 _UniformRandomNumberGenerator& __urng,
5435 const param_type& __p)
5436 { this->__generate_impl(__f, __t, __urng, __p); }
5438 template<
typename _UniformRandomNumberGenerator>
5441 _UniformRandomNumberGenerator& __urng,
5442 const param_type& __p)
5443 { this->__generate_impl(__f, __t, __urng, __p); }
5452 {
return __d1._M_param == __d2._M_param; }
5464 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5466 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5480 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5486 template<
typename _ForwardIterator,
5487 typename _UniformRandomNumberGenerator>
5489 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5490 _UniformRandomNumberGenerator& __urng,
5491 const param_type& __p);
5493 param_type _M_param;
5500 template<
typename _IntType>
5504 {
return !(__d1 == __d2); }
5513 template<
typename _RealType =
double>
5517 "result_type must be a floating point type");
5530 : _M_int(), _M_den(), _M_cp()
5533 template<
typename _InputIteratorB,
typename _InputIteratorW>
5535 _InputIteratorB __bend,
5536 _InputIteratorW __wbegin);
5538 template<
typename _Func>
5541 template<
typename _Func>
5542 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5555 __tmp[1] = _RealType(1);
5568 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
5572 {
return !(__p1 == __p2); }
5587 template<
typename _InputIteratorB,
typename _InputIteratorW>
5589 _InputIteratorB __bend,
5590 _InputIteratorW __wbegin)
5591 : _M_param(__bfirst, __bend, __wbegin)
5594 template<
typename _Func>
5595 piecewise_constant_distribution(initializer_list<_RealType> __bl,
5597 : _M_param(__bl, __fw)
5600 template<
typename _Func>
5601 piecewise_constant_distribution(
size_t __nw,
5602 _RealType __xmin, _RealType __xmax,
5604 : _M_param(__nw, __xmin, __xmax, __fw)
5608 piecewise_constant_distribution(
const param_type& __p)
5625 if (_M_param._M_int.
empty())
5628 __tmp[1] = _RealType(1);
5632 return _M_param._M_int;
5641 return _M_param._M_den.
empty()
5650 {
return _M_param; }
5658 { _M_param = __param; }
5666 return _M_param._M_int.
empty()
5676 return _M_param._M_int.
empty()
5683 template<
typename _UniformRandomNumberGenerator>
5686 {
return this->
operator()(__urng, _M_param); }
5688 template<
typename _UniformRandomNumberGenerator>
5690 operator()(_UniformRandomNumberGenerator& __urng,
5691 const param_type& __p);
5693 template<
typename _ForwardIterator,
5694 typename _UniformRandomNumberGenerator>
5696 __generate(_ForwardIterator __f, _ForwardIterator __t,
5697 _UniformRandomNumberGenerator& __urng)
5698 { this->__generate(__f, __t, __urng, _M_param); }
5700 template<
typename _ForwardIterator,
5701 typename _UniformRandomNumberGenerator>
5703 __generate(_ForwardIterator __f, _ForwardIterator __t,
5704 _UniformRandomNumberGenerator& __urng,
5705 const param_type& __p)
5706 { this->__generate_impl(__f, __t, __urng, __p); }
5708 template<
typename _UniformRandomNumberGenerator>
5711 _UniformRandomNumberGenerator& __urng,
5712 const param_type& __p)
5713 { this->__generate_impl(__f, __t, __urng, __p); }
5722 {
return __d1._M_param == __d2._M_param; }
5735 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5737 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5751 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5757 template<
typename _ForwardIterator,
5758 typename _UniformRandomNumberGenerator>
5760 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5761 _UniformRandomNumberGenerator& __urng,
5762 const param_type& __p);
5764 param_type _M_param;
5771 template<
typename _RealType>
5775 {
return !(__d1 == __d2); }
5784 template<
typename _RealType =
double>
5788 "result_type must be a floating point type");
5801 : _M_int(), _M_den(), _M_cp(), _M_m()
5804 template<
typename _InputIteratorB,
typename _InputIteratorW>
5806 _InputIteratorB __bend,
5807 _InputIteratorW __wbegin);
5809 template<
typename _Func>
5812 template<
typename _Func>
5813 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5826 __tmp[1] = _RealType(1);
5839 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
5843 {
return !(__p1 == __p2); }
5859 template<
typename _InputIteratorB,
typename _InputIteratorW>
5861 _InputIteratorB __bend,
5862 _InputIteratorW __wbegin)
5863 : _M_param(__bfirst, __bend, __wbegin)
5866 template<
typename _Func>
5867 piecewise_linear_distribution(initializer_list<_RealType> __bl,
5869 : _M_param(__bl, __fw)
5872 template<
typename _Func>
5873 piecewise_linear_distribution(
size_t __nw,
5874 _RealType __xmin, _RealType __xmax,
5876 : _M_param(__nw, __xmin, __xmax, __fw)
5880 piecewise_linear_distribution(
const param_type& __p)
5897 if (_M_param._M_int.
empty())
5900 __tmp[1] = _RealType(1);
5904 return _M_param._M_int;
5914 return _M_param._M_den.
empty()
5923 {
return _M_param; }
5931 { _M_param = __param; }
5939 return _M_param._M_int.
empty()
5949 return _M_param._M_int.
empty()
5956 template<
typename _UniformRandomNumberGenerator>
5959 {
return this->
operator()(__urng, _M_param); }
5961 template<
typename _UniformRandomNumberGenerator>
5963 operator()(_UniformRandomNumberGenerator& __urng,
5964 const param_type& __p);
5966 template<
typename _ForwardIterator,
5967 typename _UniformRandomNumberGenerator>
5969 __generate(_ForwardIterator __f, _ForwardIterator __t,
5970 _UniformRandomNumberGenerator& __urng)
5971 { this->__generate(__f, __t, __urng, _M_param); }
5973 template<
typename _ForwardIterator,
5974 typename _UniformRandomNumberGenerator>
5976 __generate(_ForwardIterator __f, _ForwardIterator __t,
5977 _UniformRandomNumberGenerator& __urng,
5978 const param_type& __p)
5979 { this->__generate_impl(__f, __t, __urng, __p); }
5981 template<
typename _UniformRandomNumberGenerator>
5984 _UniformRandomNumberGenerator& __urng,
5985 const param_type& __p)
5986 { this->__generate_impl(__f, __t, __urng, __p); }
5995 {
return __d1._M_param == __d2._M_param; }
6008 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6010 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
6024 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6030 template<
typename _ForwardIterator,
6031 typename _UniformRandomNumberGenerator>
6033 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6034 _UniformRandomNumberGenerator& __urng,
6035 const param_type& __p);
6037 param_type _M_param;
6044 template<
typename _RealType>
6048 {
return !(__d1 == __d2); }
6076 template<
typename _IntType>
6079 template<
typename _InputIterator>
6080 seed_seq(_InputIterator __begin, _InputIterator __end);
6083 template<
typename _RandomAccessIterator>
6085 generate(_RandomAccessIterator __begin, _RandomAccessIterator __end);
6088 size_t size() const noexcept
6089 {
return _M_v.
size(); }
6091 template<
typename _OutputIterator>
6093 param(_OutputIterator __dest)
const 6094 { std::copy(_M_v.
begin(), _M_v.
end(), __dest); }
6108 _GLIBCXX_END_NAMESPACE_VERSION
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 reset()
Resets the distribution state.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
iterator begin() noexcept
static constexpr result_type min()
Gets the inclusive minimum value of the range of random integers returned by this generator...
Uniform discrete distribution for random numbers. A discrete random distribution on the range with e...
void seed()
Reseeds the discard_block_engine object with the default seed for the underlying base class generator...
A cauchy_distribution random number distribution.
static constexpr result_type max()
Gets the largest possible value in the output range.
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.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type max() const
Returns the least upper bound value 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.
param_type param() const
Returns the parameter set of the distribution.
A discrete_distribution random number distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
_IntType t() const
Returns the distribution t parameter.
independent_bits_engine()
Constructs a default independent_bits_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.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
A lognormal_distribution random number distribution.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
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 reset()
Resets the distribution state.
void param(const param_type &__param)
Sets the parameter set of the distribution.
bool operator!=(const std::piecewise_linear_distribution< _RealType > &__d1, const std::piecewise_linear_distribution< _RealType > &__d2)
Return true if two piecewise linear distributions have different parameters.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
An exponential continuous distribution for random numbers.
void reset()
Resets the distribution state.
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...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void param(const param_type &__param)
Sets the parameter set of the distribution.
subtract_with_carry_engine(_Sseq &__q)
Constructs a subtract_with_carry_engine random number engine seeded from the seed sequence __q...
gamma_distribution()
Constructs a gamma distribution with parameters 1 and 1.
independent_bits_engine(const _RandomNumberEngine &__rng)
Copy constructs a independent_bits_engine engine.
param_type param() const
Returns the parameter set of the distribution.
void discard(unsigned long long __z)
A fisher_f_distribution random number distribution.
param_type param() const
Returns the parameter set of the distribution.
friend bool operator==(const cauchy_distribution &__d1, const cauchy_distribution &__d2)
Return true if two Cauchy distributions have the same parameters.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
static constexpr result_type min()
Gets the smallest possible value in the output range.
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...
static constexpr result_type min()
Gets the smallest possible value in the output range.
result_type min() const
Returns the greatest lower bound value of the distribution.
friend bool operator==(const subtract_with_carry_engine &__lhs, const subtract_with_carry_engine &__rhs)
Compares two % subtract_with_carry_engine random number generator objects of the same type for equali...
A piecewise_constant_distribution random number distribution.
param_type param() const
Returns the parameter set of the distribution.
A gamma continuous distribution for random numbers.
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...
void seed(result_type __sd=default_seed)
Seeds the initial state of the random number generator.
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine object.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
Define a member typedef type only if a boolean constant is true.
void reset()
Resets the distribution state.
friend bool operator==(const shuffle_order_engine &__lhs, const shuffle_order_engine &__rhs)
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType > &__x)
Extracts the current state of a % subtract_with_carry_engine random number generator engine __x from ...
friend 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.
double p() const
Returns the p parameter of the distribution.
shuffle_order_engine(_Sseq &__q)
Generator construct a shuffle_order_engine engine.
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type operator()()
Gets the next random number in the sequence.
void reset()
Resets the distribution state.
void reset()
Resets the distribution state.
friend bool operator==(const exponential_distribution &__d1, const exponential_distribution &__d2)
Return true if two exponential distributions have the same parameters.
result_type max() const
Returns the inclusive upper bound of the distribution range.
param_type param() const
Returns the parameter set of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type max() const
Returns the least upper bound value of the distribution.
Template class basic_ostream.
result_type min() const
Returns the greatest lower bound value of the distribution.
param_type param() const
Returns the parameter set of the distribution.
A student_t_distribution random number distribution.
void reset()
Resets the distribution state.
param_type param() const
Returns the parameter set of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
_If_seed_seq< _Sseq > seed(_Sseq &__q)
Reseeds the shuffle_order_engine object with the given seed sequence.
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...
A piecewise_linear_distribution random number distribution.
exponential_distribution(_RealType __lambda)
Constructs an exponential distribution with inverse scale parameter .
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.
mersenne_twister_engine< uint_fast64_t, 64, 312, 156, 31, 0xb5026f5aa96619e9ULL, 29, 0x5555555555555555ULL, 17, 0x71d67fffeda60000ULL, 37, 0xfff7eee000000000ULL, 43, 6364136223846793005ULL > mt19937_64
void reset()
Resets the distribution state.
shuffle_order_engine(_RandomNumberEngine &&__rng)
Move constructs a shuffle_order_engine engine.
std::vector< double > densities() const
Return a vector of the probability densities of the distribution.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
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...
friend bool operator==(const uniform_real_distribution &__d1, const uniform_real_distribution &__d2)
Return true if two uniform real distributions have the same parameters.
param_type param() const
Returns the parameter set of the distribution.
std::vector< _RealType > intervals() const
Returns a vector of the intervals.
independent_bits_engine(result_type __s)
Seed constructs a independent_bits_engine engine.
void seed()
Reseeds the shuffle_order_engine object with the default seed for the underlying base class generator...
_RealType b() const
Return the parameter of the distribution.
size_type size() const noexcept
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...
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::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 min() const
Returns the greatest lower bound value of the distribution.
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.
bool empty() const noexcept
__gnu_cxx::__promote_2< _Tpa, _Tpb >::__type beta(_Tpa __a, _Tpb __b)
static constexpr result_type min()
Gets the minimum value in the generated random number range.
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.
double p() const
Returns the distribution parameter p.
independent_bits_engine(_RandomNumberEngine &&__rng)
Move constructs a independent_bits_engine engine.
param_type param() const
Returns the parameter set of the distribution.
linear_congruential_engine< uint_fast32_t, 48271UL, 0UL, 2147483647UL > minstd_rand
normal_distribution(result_type __mean, result_type __stddev=result_type(1))
result_type max() const
Returns the least upper bound value of the distribution.
discard_block_engine(_RandomNumberEngine &&__rng)
Move constructs a discard_block_engine engine.
friend bool operator==(const piecewise_linear_distribution &__d1, const piecewise_linear_distribution &__d2)
Return true if two piecewise linear distributions have the same parameters.
result_type min() const
Returns the greatest lower bound value of the distribution.
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::lognormal_distribution< _RealType1 > &__x)
Extracts a lognormal_distribution random number distribution __x from the input stream __is...
result_type max() const
Returns the least upper bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
shuffle_order_engine()
Constructs a default shuffle_order_engine engine.
param_type param() const
Returns the parameter set of the distribution.
The Marsaglia-Zaman generator.
void seed(result_type __s)
Reseeds the independent_bits_engine object with the default seed for the underlying base class genera...
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::normal_distribution< _RealType1 > &__x)
Extracts a normal_distribution random number distribution __x from the input stream __is...
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::subtract_with_carry_engine< _UIntType1, __w1, __s1, __r1 > &__x)
Extracts the current state of a % subtract_with_carry_engine random number generator engine __x from ...
A discrete binomial random number distribution.
double p() const
Return the parameter of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
param_type param() const
Returns the parameter set of the distribution.
shuffle_order_engine(result_type __s)
Seed constructs a shuffle_order_engine engine.
void param(const param_type &__param)
Sets the parameter set of the distribution.
friend bool operator==(const chi_squared_distribution &__d1, const chi_squared_distribution &__d2)
Return true if two Chi-squared distributions have the same parameters and the sequences that would be...
double mean() const
Returns the distribution parameter mean.
friend bool operator==(const extreme_value_distribution &__d1, const extreme_value_distribution &__d2)
Return true if two extreme value distributions have the same parameters.
result_type max() const
Returns the least upper bound value of the distribution.
_RealType stddev() const
Returns the standard deviation of the distribution.
discard_block_engine(const _RandomNumberEngine &__rng)
Copy constructs a discard_block_engine engine.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::linear_congruential_engine< _UIntType1, __a1, __c1, __m1 > &__lcr)
Sets the state of the engine by reading its textual representation from __is.
linear_congruential_engine(_Sseq &__q)
Constructs a linear_congruential_engine random number generator engine seeded from the seed sequence ...
uniform_real_distribution(_RealType __a, _RealType __b=_RealType(1))
Constructs a uniform_real_distribution object.
void seed()
Reseeds the independent_bits_engine object with the default seed for the underlying base class genera...
Template class basic_istream.
reference front() noexcept
_RealType alpha() const
Returns the of the distribution.
result_type min() const
Returns the greatest lower bound value 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.
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...
void reset()
Resets the distribution state.
linear_congruential_engine()
Constructs a linear_congruential_engine random number generator engine with seed 1.
param_type param() const
Returns the parameter set of the distribution.
result_type operator()()
Gets the next value in the generated random number sequence.
subtract_with_carry_engine(result_type __sd)
Constructs an explicitly seeded subtract_with_carry_engine random number generator.
result_type max() const
Returns the least upper bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void param(const param_type &__param)
Sets the parameter set of the distribution.
void reset()
Resets the distribution state.
_RandomNumberEngine::result_type result_type
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...
static constexpr result_type max()
Gets the largest possible value in the output range.
_If_seed_seq< _Sseq > seed(_Sseq &__q)
Reseeds the discard_block_engine object with the given seed sequence.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
bernoulli_distribution(double __p)
Constructs a Bernoulli distribution with likelihood p.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
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.
param_type param() const
Returns the parameter set of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
std::vector< _RealType > intervals() const
Return the intervals of the distribution.
param_type param() const
Returns the parameter set of the distribution.
void reset()
Resets the distribution state.
exponential_distribution()
Constructs an exponential distribution with inverse scale parameter 1.0.
result_type operator()()
Gets the next random number in the sequence.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::piecewise_constant_distribution< _RealType1 > &__x)
Extracts a piecewise_constant_distribution random number distribution __x from the input stream __is...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
static constexpr result_type min()
result_type max() const
Returns the least upper bound value of the distribution.
A weibull_distribution random number distribution.
uint_least32_t result_type
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
static constexpr result_type multiplier
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...
complex< _Tp > exp(const complex< _Tp > &)
Return complex base e exponential of z.
constexpr const _Tp & max(const _Tp &, const _Tp &)
This does what you think it does.
complex< _Tp > sqrt(const complex< _Tp > &)
Return complex square root of z.
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::gamma_distribution< _RealType1 > &__x)
Extracts a gamma_distribution random number distribution __x from the input stream __is...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type min() const
Returns the greatest lower bound value of the distribution.
discard_block_engine()
Constructs a default discard_block_engine engine.
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...
void reset()
Resets the distribution state.
mersenne_twister_engine< uint_fast32_t, 32, 624, 397, 31, 0x9908b0dfUL, 11, 0xffffffffUL, 7, 0x9d2c5680UL, 15, 0xefc60000UL, 18, 1812433253UL > mt19937
result_type min() const
Returns the greatest lower bound value of the distribution.
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.
A discrete geometric random number distribution.
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine object.
discard_block_engine(result_type __s)
Seed constructs a discard_block_engine engine.
result_type min() const
Returns the greatest lower bound value of the distribution.
void seed(result_type __s)
Reseeds the discard_block_engine object with the default seed for the underlying base class generator...
A chi_squared_distribution random number distribution.
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::piecewise_linear_distribution< _RealType1 > &__x)
Extracts a piecewise_linear_distribution random number distribution __x from the input stream __is...
_RandomNumberEngine::result_type result_type
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
static constexpr result_type increment
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...
result_type max() const
Returns the least upper bound value of the distribution.
std::vector< double > probabilities() const
Returns the probabilities of the distribution.
void reset()
Resets the distribution state.
void param(const param_type &__param)
Sets the parameter set of the distribution.
discard_block_engine(_Sseq &__q)
Generator construct 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.
ISO C++ entities toplevel namespace is std.
result_type max() const
Returns the least upper bound value of the distribution.
independent_bits_engine(_Sseq &__q)
Generator construct a independent_bits_engine engine.
friend bool operator==(const independent_bits_engine &__lhs, const independent_bits_engine &__rhs)
Compares two independent_bits_engine random number generator objects of the same type for equality...
mersenne_twister_engine(_Sseq &__q)
Constructs a mersenne_twister_engine random number generator engine seeded from the seed sequence __q...
friend bool operator==(const bernoulli_distribution &__d1, const bernoulli_distribution &__d2)
Return true if two Bernoulli distributions have the same parameters.
static constexpr result_type max()
Gets the maximum value in the generated random number range.
auto_ptr & operator=(auto_ptr &__a)
auto_ptr assignment operator.
Uniform continuous distribution for random numbers.
param_type param() const
Returns the parameter set of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
static constexpr result_type max()
Gets the inclusive maximum value of the range of random integers returned by this generator...
bernoulli_distribution()
Constructs a Bernoulli distribution with likelihood 0.5.
double p() const
Returns the distribution p parameter.
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...
The seed_seq class generates sequences of seeds for random number generators.
_If_seed_seq< _Sseq > seed(_Sseq &__q)
Reseeds the independent_bits_engine object with the given seed sequence.
void param(const param_type &__param)
Sets the parameter set of the distribution.
A negative_binomial_distribution random number distribution.
static constexpr result_type max()
_RealType beta() const
Returns the of the distribution.
void reset()
Resets the distribution state.
void param(const param_type &__param)
Sets the parameter set of the distribution.
param_type param() const
Returns the parameter set of the distribution.
static constexpr _Tp max() noexcept
std::vector< double > densities() const
Returns a vector of the probability densities.
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...
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...
_RealType generate_canonical(_UniformRandomNumberGenerator &__g)
A function template for converting the output of a (integral) uniform random number generator to a fl...
A model of a linear congruential random number generator.
uniform_real_distribution()
Constructs a uniform_real_distribution object.
_RealType a() const
Return the parameter of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type operator()()
Gets the next value in the generated random number sequence.
A Bernoulli random number distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void param(const param_type &__param)
Sets the parameter set of the distribution.
linear_congruential_engine< uint_fast32_t, 16807UL, 0UL, 2147483647UL > minstd_rand0
friend bool operator==(const discrete_distribution &__d1, const discrete_distribution &__d2)
Return true if two discrete distributions have the same parameters.
param_type param() const
Returns the parameter set of the distribution.
param_type param() const
Returns the parameter set of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
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...
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...
result_type max() const
Returns the least upper bound value of the distribution.
constexpr const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
static constexpr _Tp lowest() noexcept
void reset()
Resets the distribution state.
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...
reference back() noexcept
_RealType mean() const
Returns the mean of the distribution.
void reset()
Resets the distribution state.
A extreme_value_distribution random number distribution.
_RealType a() const
Return the parameter of the distribution.
One of the math functors.
std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, bitset< _Nb > &__x)
Global I/O operators for bitsets.
A normal continuous distribution for random numbers.
_RealType b() const
Return the parameter of the distribution.
_IntType k() const
Return the parameter of the distribution.
Properties of fundamental types.
static constexpr _Tp min() noexcept
result_type min() const
Returns the inclusive lower bound of the distribution range.
const _RandomNumberEngine & base() const noexcept
_RealType lambda() const
Returns the inverse scale parameter of the distribution.
constexpr bool equal(_IIter1 __first1, _IIter1 __last1, _IIter2 __first2, _IIter2 __last2, _BinaryPredicate __binary_pred)
Tests a range for element-wise equality.
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 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...
A discrete Poisson random number distribution.
static constexpr result_type max()
Gets the maximum value in the generated random number range.
void reset()
Resets the distribution state.
Produces random numbers by reordering random numbers from some base engine.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type max() const
Returns the least upper bound value of the distribution.