37 namespace std _GLIBCXX_VISIBILITY(default)
39 _GLIBCXX_BEGIN_NAMESPACE_VERSION
56 template<
typename _RealType,
size_t __bits,
57 typename _UniformRandomNumberGenerator>
61 _GLIBCXX_END_NAMESPACE_VERSION
68 _GLIBCXX_BEGIN_NAMESPACE_VERSION
70 template<
typename _UIntType,
size_t __w,
71 bool = __w < static_cast<size_t>
74 {
static const _UIntType __value = 0; };
76 template<
typename _UIntType,
size_t __w>
77 struct _Shift<_UIntType, __w, true>
78 {
static const _UIntType __value = _UIntType(1) << __w; };
81 int __which = ((__s <= __CHAR_BIT__ *
sizeof (int))
82 + (__s <= __CHAR_BIT__ *
sizeof (long))
83 + (__s <= __CHAR_BIT__ *
sizeof (
long long))
86 struct _Select_uint_least_t
88 static_assert(__which < 0,
89 "sorry, would be too much trouble for a slow result");
93 struct _Select_uint_least_t<__s, 4>
94 {
typedef unsigned int type; };
97 struct _Select_uint_least_t<__s, 3>
98 {
typedef unsigned long type; };
101 struct _Select_uint_least_t<__s, 2>
102 {
typedef unsigned long long type; };
104 #ifdef _GLIBCXX_USE_INT128 106 struct _Select_uint_least_t<__s, 1>
107 {
typedef unsigned __int128 type; };
111 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
112 bool __big_enough = (!(__m & (__m - 1))
113 || (_Tp(-1) - __c) / __a >= __m - 1),
114 bool __schrage_ok = __m % __a < __m / __a>
117 typedef typename _Select_uint_least_t<
std::__lg(__a)
121 {
return static_cast<_Tp
>((_Tp2(__a) * __x + __c) % __m); }
125 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c>
126 struct _Mod<_Tp, __m, __a, __c, false, true>
135 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
bool __s>
136 struct _Mod<_Tp, __m, __a, __c, true, __s>
141 _Tp __res = __a * __x + __c;
148 template<
typename _Tp, _Tp __m, _Tp __a = 1, _Tp __c = 0>
151 {
return _Mod<_Tp, __m, __a, __c>::__calc(__x); }
157 template<
typename _Engine,
typename _DInputType>
161 "template argument not a floating point type");
164 _Adaptor(_Engine& __g)
169 {
return _DInputType(0); }
173 {
return _DInputType(1); }
192 _GLIBCXX_END_NAMESPACE_VERSION
195 _GLIBCXX_BEGIN_NAMESPACE_VERSION
235 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
238 static_assert(std::is_unsigned<_UIntType>::value,
"template argument " 239 "substituting _UIntType not an unsigned integral type");
240 static_assert(__m == 0u || (__a < __m && __c < __m),
241 "template argument substituting __m out of bounds");
248 static constexpr result_type multiplier = __a;
250 static constexpr result_type increment = __c;
253 static constexpr result_type default_seed = 1u;
272 template<
typename _Sseq,
typename =
typename 273 std::enable_if<!std::is_same<_Sseq, linear_congruential_engine>::value>
286 seed(result_type __s = default_seed);
295 template<
typename _Sseq>
296 typename std::enable_if<std::is_class<_Sseq>::value>::type
305 static constexpr result_type
307 {
return __c == 0u ? 1u : 0u; }
312 static constexpr result_type
322 for (; __z != 0ULL; --__z)
332 _M_x = __detail::__mod<_UIntType, __m, __a, __c>(_M_x);
350 {
return __lhs._M_x == __rhs._M_x; }
360 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
361 _UIntType1 __m1,
typename _CharT,
typename _Traits>
363 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
365 __a1, __c1, __m1>& __lcr);
380 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
381 _UIntType1 __m1,
typename _CharT,
typename _Traits>
402 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
408 {
return !(__lhs == __rhs); }
439 template<
typename _UIntType,
size_t __w,
440 size_t __n,
size_t __m,
size_t __r,
441 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
442 _UIntType __b,
size_t __t,
443 _UIntType __c,
size_t __l, _UIntType __f>
446 static_assert(std::is_unsigned<_UIntType>::value,
"template argument " 447 "substituting _UIntType not an unsigned integral type");
448 static_assert(1u <= __m && __m <= __n,
449 "template argument substituting __m out of bounds");
450 static_assert(__r <= __w,
"template argument substituting " 452 static_assert(__u <= __w,
"template argument substituting " 454 static_assert(__s <= __w,
"template argument substituting " 456 static_assert(__t <= __w,
"template argument substituting " 458 static_assert(__l <= __w,
"template argument substituting " 461 "template argument substituting __w out of bound");
462 static_assert(__a <= (__detail::_Shift<_UIntType, __w>::__value - 1),
463 "template argument substituting __a out of bound");
464 static_assert(__b <= (__detail::_Shift<_UIntType, __w>::__value - 1),
465 "template argument substituting __b out of bound");
466 static_assert(__c <= (__detail::_Shift<_UIntType, __w>::__value - 1),
467 "template argument substituting __c out of bound");
468 static_assert(__d <= (__detail::_Shift<_UIntType, __w>::__value - 1),
469 "template argument substituting __d out of bound");
470 static_assert(__f <= (__detail::_Shift<_UIntType, __w>::__value - 1),
471 "template argument substituting __f out of bound");
478 static constexpr
size_t word_size = __w;
479 static constexpr
size_t state_size = __n;
480 static constexpr
size_t shift_size = __m;
481 static constexpr
size_t mask_bits = __r;
482 static constexpr result_type xor_mask = __a;
483 static constexpr
size_t tempering_u = __u;
484 static constexpr result_type tempering_d = __d;
485 static constexpr
size_t tempering_s = __s;
486 static constexpr result_type tempering_b = __b;
487 static constexpr
size_t tempering_t = __t;
488 static constexpr result_type tempering_c = __c;
489 static constexpr
size_t tempering_l = __l;
490 static constexpr result_type initialization_multiplier = __f;
491 static constexpr result_type default_seed = 5489u;
504 template<
typename _Sseq,
typename =
typename 505 std::enable_if<!std::is_same<_Sseq, mersenne_twister_engine>::value>
512 seed(result_type __sd = default_seed);
514 template<
typename _Sseq>
515 typename std::enable_if<std::is_class<_Sseq>::value>::type
521 static constexpr result_type
528 static constexpr result_type
530 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
536 discard(
unsigned long long __z);
556 {
return (
std::equal(__lhs._M_x, __lhs._M_x + state_size, __rhs._M_x)
557 && __lhs._M_p == __rhs._M_p); }
571 template<
typename _UIntType1,
572 size_t __w1,
size_t __n1,
573 size_t __m1,
size_t __r1,
574 _UIntType1 __a1,
size_t __u1,
575 _UIntType1 __d1,
size_t __s1,
576 _UIntType1 __b1,
size_t __t1,
577 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
578 typename _CharT,
typename _Traits>
580 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
582 __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
597 template<
typename _UIntType1,
598 size_t __w1,
size_t __n1,
599 size_t __m1,
size_t __r1,
600 _UIntType1 __a1,
size_t __u1,
601 _UIntType1 __d1,
size_t __s1,
602 _UIntType1 __b1,
size_t __t1,
603 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
604 typename _CharT,
typename _Traits>
608 __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
614 _UIntType _M_x[state_size];
630 template<
typename _UIntType,
size_t __w,
631 size_t __n,
size_t __m,
size_t __r,
632 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
633 _UIntType __b,
size_t __t,
634 _UIntType __c,
size_t __l, _UIntType __f>
637 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __lhs,
639 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __rhs)
640 {
return !(__lhs == __rhs); }
658 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
661 static_assert(std::is_unsigned<_UIntType>::value,
"template argument " 662 "substituting _UIntType not an unsigned integral type");
663 static_assert(0u < __s && __s < __r,
664 "template argument substituting __s out of bounds");
666 "template argument substituting __w out of bounds");
673 static constexpr
size_t word_size = __w;
674 static constexpr
size_t short_lag = __s;
675 static constexpr
size_t long_lag = __r;
676 static constexpr result_type default_seed = 19780503u;
692 template<
typename _Sseq,
typename =
typename 693 std::enable_if<!std::is_same<_Sseq, subtract_with_carry_engine>::value>
712 seed(result_type __sd = default_seed);
718 template<
typename _Sseq>
719 typename std::enable_if<std::is_class<_Sseq>::value>::type
726 static constexpr result_type
734 static constexpr result_type
736 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
744 for (; __z != 0ULL; --__z)
769 {
return (
std::equal(__lhs._M_x, __lhs._M_x + long_lag, __rhs._M_x)
770 && __lhs._M_carry == __rhs._M_carry
771 && __lhs._M_p == __rhs._M_p); }
785 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
786 typename _CharT,
typename _Traits>
788 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
804 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
805 typename _CharT,
typename _Traits>
813 _UIntType _M_x[long_lag];
830 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
836 {
return !(__lhs == __rhs); }
845 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
848 static_assert(1 <= __r && __r <= __p,
849 "template argument substituting __r out of bounds");
853 typedef typename _RandomNumberEngine::result_type
result_type;
856 static constexpr
size_t block_size = __p;
857 static constexpr
size_t used_block = __r;
865 : _M_b(), _M_n(0) { }
875 : _M_b(__rng), _M_n(0) { }
885 : _M_b(
std::move(__rng)), _M_n(0) { }
895 : _M_b(__s), _M_n(0) { }
902 template<
typename _Sseq,
typename =
typename 903 std::enable_if<!std::is_same<_Sseq, discard_block_engine>::value
904 && !std::is_same<_Sseq, _RandomNumberEngine>::value>
938 template<
typename _Sseq>
950 const _RandomNumberEngine&
957 static constexpr result_type
964 static constexpr result_type
974 for (; __z != 0ULL; --__z)
998 {
return __lhs._M_b == __rhs._M_b && __lhs._M_n == __rhs._M_n; }
1011 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1012 typename _CharT,
typename _Traits>
1014 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1029 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1030 typename _CharT,
typename _Traits>
1037 _RandomNumberEngine _M_b;
1052 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
1058 {
return !(__lhs == __rhs); }
1065 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1068 static_assert(std::is_unsigned<_UIntType>::value,
"template argument " 1069 "substituting _UIntType not an unsigned integral type");
1071 "template argument substituting __w out of bounds");
1103 : _M_b(
std::move(__rng)) { }
1120 template<
typename _Sseq,
typename =
typename 1121 std::enable_if<!std::is_same<_Sseq, independent_bits_engine>::value
1122 && !std::is_same<_Sseq, _RandomNumberEngine>::value>
1150 template<
typename _Sseq>
1159 const _RandomNumberEngine&
1166 static constexpr result_type
1173 static constexpr result_type
1175 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1183 for (; __z != 0ULL; --__z)
1208 {
return __lhs._M_b == __rhs._M_b; }
1222 template<
typename _CharT,
typename _Traits>
1226 __w, _UIntType>& __x)
1233 _RandomNumberEngine _M_b;
1248 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1254 {
return !(__lhs == __rhs); }
1266 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType,
1267 typename _CharT,
typename _Traits>
1269 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1271 __w, _UIntType>& __x)
1283 template<
typename _RandomNumberEngine,
size_t __k>
1286 static_assert(1u <= __k,
"template argument substituting " 1287 "__k out of bound");
1291 typedef typename _RandomNumberEngine::result_type
result_type;
1293 static constexpr
size_t table_size = __k;
1302 { _M_initialize(); }
1313 { _M_initialize(); }
1323 : _M_b(
std::move(__rng))
1324 { _M_initialize(); }
1335 { _M_initialize(); }
1342 template<
typename _Sseq,
typename =
typename 1343 std::enable_if<!std::is_same<_Sseq, shuffle_order_engine>::value
1344 && !std::is_same<_Sseq, _RandomNumberEngine>::value>
1349 { _M_initialize(); }
1378 template<
typename _Sseq>
1389 const _RandomNumberEngine&
1396 static constexpr result_type
1403 static constexpr result_type
1413 for (; __z != 0ULL; --__z)
1437 {
return (__lhs._M_b == __rhs._M_b
1438 &&
std::equal(__lhs._M_v, __lhs._M_v + __k, __rhs._M_v)
1439 && __lhs._M_y == __rhs._M_y); }
1452 template<
typename _RandomNumberEngine1,
size_t __k1,
1453 typename _CharT,
typename _Traits>
1455 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1470 template<
typename _RandomNumberEngine1,
size_t __k1,
1471 typename _CharT,
typename _Traits>
1477 void _M_initialize()
1479 for (
size_t __i = 0; __i < __k; ++__i)
1484 _RandomNumberEngine _M_b;
1485 result_type _M_v[__k];
1500 template<
typename _RandomNumberEngine,
size_t __k>
1506 {
return !(__lhs == __rhs); }
1543 0xb5026f5aa96619e9ULL, 29,
1544 0x5555555555555555ULL, 17,
1545 0x71d67fffeda60000ULL, 37,
1546 0xfff7eee000000000ULL, 43,
1575 #ifdef _GLIBCXX_USE_RANDOM_TR1 1590 { _M_init_pretr1(__token); }
1596 static constexpr result_type
1600 static constexpr result_type
1605 entropy()
const noexcept
1611 #ifdef _GLIBCXX_USE_RANDOM_TR1 1612 return this->_M_getval();
1614 return this->_M_getval_pretr1();
1628 result_type _M_getval();
1629 result_type _M_getval_pretr1();
1658 template<
typename _IntType>
1662 {
return !(__d1 == __d2); }
1674 template<
typename _IntType,
typename _CharT,
typename _Traits>
1676 operator<<(std::basic_ostream<_CharT, _Traits>&,
1688 template<
typename _IntType,
typename _CharT,
typename _Traits>
1701 template<
typename _RealType =
double>
1705 "template argument not a floating point type");
1717 _RealType __b = _RealType(1))
1718 : _M_a(__a), _M_b(__b)
1720 __glibcxx_assert(_M_a <= _M_b);
1733 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
1749 _RealType __b = _RealType(1))
1750 : _M_param(__a, __b)
1768 {
return _M_param.a(); }
1772 {
return _M_param.b(); }
1779 {
return _M_param; }
1787 { _M_param = __param; }
1794 {
return this->a(); }
1801 {
return this->b(); }
1806 template<
typename _UniformRandomNumberGenerator>
1809 {
return this->operator()(__urng, _M_param); }
1811 template<
typename _UniformRandomNumberGenerator>
1813 operator()(_UniformRandomNumberGenerator& __urng,
1816 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
1818 return (__aurng() * (__p.b() - __p.a())) + __p.a();
1821 template<
typename _ForwardIterator,
1822 typename _UniformRandomNumberGenerator>
1824 __generate(_ForwardIterator __f, _ForwardIterator __t,
1825 _UniformRandomNumberGenerator& __urng)
1826 { this->__generate(__f, __t, __urng, _M_param); }
1828 template<
typename _ForwardIterator,
1829 typename _UniformRandomNumberGenerator>
1831 __generate(_ForwardIterator __f, _ForwardIterator __t,
1832 _UniformRandomNumberGenerator& __urng,
1834 { this->__generate_impl(__f, __t, __urng, __p); }
1836 template<
typename _UniformRandomNumberGenerator>
1838 __generate(result_type* __f, result_type* __t,
1839 _UniformRandomNumberGenerator& __urng,
1841 { this->__generate_impl(__f, __t, __urng, __p); }
1850 {
return __d1._M_param == __d2._M_param; }
1853 template<
typename _ForwardIterator,
1854 typename _UniformRandomNumberGenerator>
1856 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
1857 _UniformRandomNumberGenerator& __urng,
1867 template<
typename _IntType>
1871 {
return !(__d1 == __d2); }
1883 template<
typename _RealType,
typename _CharT,
typename _Traits>
1885 operator<<(std::basic_ostream<_CharT, _Traits>&,
1897 template<
typename _RealType,
typename _CharT,
typename _Traits>
1919 template<
typename _RealType =
double>
1923 "template argument not a floating point type");
1935 _RealType __stddev = _RealType(1))
1936 : _M_mean(__mean), _M_stddev(__stddev)
1938 __glibcxx_assert(_M_stddev > _RealType(0));
1947 {
return _M_stddev; }
1951 {
return (__p1._M_mean == __p2._M_mean
1952 && __p1._M_stddev == __p2._M_stddev); }
1956 _RealType _M_stddev;
1966 result_type __stddev = result_type(1))
1967 : _M_param(__mean, __stddev), _M_saved_available(false)
1972 : _M_param(__p), _M_saved_available(
false)
1980 { _M_saved_available =
false; }
1987 {
return _M_param.mean(); }
1994 {
return _M_param.stddev(); }
2001 {
return _M_param; }
2009 { _M_param = __param; }
2028 template<
typename _UniformRandomNumberGenerator>
2031 {
return this->operator()(__urng, _M_param); }
2033 template<
typename _UniformRandomNumberGenerator>
2035 operator()(_UniformRandomNumberGenerator& __urng,
2036 const param_type& __p);
2038 template<
typename _ForwardIterator,
2039 typename _UniformRandomNumberGenerator>
2041 __generate(_ForwardIterator __f, _ForwardIterator __t,
2042 _UniformRandomNumberGenerator& __urng)
2043 { this->__generate(__f, __t, __urng, _M_param); }
2045 template<
typename _ForwardIterator,
2046 typename _UniformRandomNumberGenerator>
2048 __generate(_ForwardIterator __f, _ForwardIterator __t,
2049 _UniformRandomNumberGenerator& __urng,
2050 const param_type& __p)
2051 { this->__generate_impl(__f, __t, __urng, __p); }
2053 template<
typename _UniformRandomNumberGenerator>
2055 __generate(result_type* __f, result_type* __t,
2056 _UniformRandomNumberGenerator& __urng,
2057 const param_type& __p)
2058 { this->__generate_impl(__f, __t, __urng, __p); }
2065 template<
typename _RealType1>
2080 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2082 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2095 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2101 template<
typename _ForwardIterator,
2102 typename _UniformRandomNumberGenerator>
2104 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2105 _UniformRandomNumberGenerator& __urng,
2106 const param_type& __p);
2108 param_type _M_param;
2109 result_type _M_saved;
2110 bool _M_saved_available;
2116 template<
typename _RealType>
2120 {
return !(__d1 == __d2); }
2132 template<
typename _RealType =
double>
2136 "template argument not a floating point type");
2148 _RealType __s = _RealType(1))
2149 : _M_m(__m), _M_s(__s)
2162 {
return __p1._M_m == __p2._M_m && __p1._M_s == __p2._M_s; }
2171 _RealType __s = _RealType(1))
2172 : _M_param(__m, __s), _M_nd()
2177 : _M_param(__p), _M_nd()
2192 {
return _M_param.m(); }
2196 {
return _M_param.s(); }
2203 {
return _M_param; }
2211 { _M_param = __param; }
2218 {
return result_type(0); }
2230 template<
typename _UniformRandomNumberGenerator>
2233 {
return this->operator()(__urng, _M_param); }
2235 template<
typename _UniformRandomNumberGenerator>
2237 operator()(_UniformRandomNumberGenerator& __urng,
2239 {
return std::exp(__p.s() * _M_nd(__urng) + __p.m()); }
2241 template<
typename _ForwardIterator,
2242 typename _UniformRandomNumberGenerator>
2244 __generate(_ForwardIterator __f, _ForwardIterator __t,
2245 _UniformRandomNumberGenerator& __urng)
2246 { this->__generate(__f, __t, __urng, _M_param); }
2248 template<
typename _ForwardIterator,
2249 typename _UniformRandomNumberGenerator>
2251 __generate(_ForwardIterator __f, _ForwardIterator __t,
2252 _UniformRandomNumberGenerator& __urng,
2254 { this->__generate_impl(__f, __t, __urng, __p); }
2256 template<
typename _UniformRandomNumberGenerator>
2258 __generate(result_type* __f, result_type* __t,
2259 _UniformRandomNumberGenerator& __urng,
2261 { this->__generate_impl(__f, __t, __urng, __p); }
2271 {
return (__d1._M_param == __d2._M_param
2272 && __d1._M_nd == __d2._M_nd); }
2284 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2286 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2299 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2305 template<
typename _ForwardIterator,
2306 typename _UniformRandomNumberGenerator>
2308 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2309 _UniformRandomNumberGenerator& __urng,
2320 template<
typename _RealType>
2324 {
return !(__d1 == __d2); }
2336 template<
typename _RealType =
double>
2340 "template argument not a floating point type");
2352 param_type(_RealType __alpha_val = _RealType(1),
2353 _RealType __beta_val = _RealType(1))
2354 : _M_alpha(__alpha_val), _M_beta(__beta_val)
2356 __glibcxx_assert(_M_alpha > _RealType(0));
2362 {
return _M_alpha; }
2369 operator==(
const param_type& __p1,
const param_type& __p2)
2370 {
return (__p1._M_alpha == __p2._M_alpha
2371 && __p1._M_beta == __p2._M_beta); }
2380 _RealType _M_malpha, _M_a2;
2390 _RealType __beta_val = _RealType(1))
2391 : _M_param(__alpha_val, __beta_val), _M_nd()
2396 : _M_param(__p), _M_nd()
2411 {
return _M_param.alpha(); }
2418 {
return _M_param.beta(); }
2425 {
return _M_param; }
2433 { _M_param = __param; }
2440 {
return result_type(0); }
2452 template<
typename _UniformRandomNumberGenerator>
2455 {
return this->operator()(__urng, _M_param); }
2457 template<
typename _UniformRandomNumberGenerator>
2459 operator()(_UniformRandomNumberGenerator& __urng,
2460 const param_type& __p);
2462 template<
typename _ForwardIterator,
2463 typename _UniformRandomNumberGenerator>
2465 __generate(_ForwardIterator __f, _ForwardIterator __t,
2466 _UniformRandomNumberGenerator& __urng)
2467 { this->__generate(__f, __t, __urng, _M_param); }
2469 template<
typename _ForwardIterator,
2470 typename _UniformRandomNumberGenerator>
2472 __generate(_ForwardIterator __f, _ForwardIterator __t,
2473 _UniformRandomNumberGenerator& __urng,
2474 const param_type& __p)
2475 { this->__generate_impl(__f, __t, __urng, __p); }
2477 template<
typename _UniformRandomNumberGenerator>
2479 __generate(result_type* __f, result_type* __t,
2480 _UniformRandomNumberGenerator& __urng,
2481 const param_type& __p)
2482 { this->__generate_impl(__f, __t, __urng, __p); }
2492 {
return (__d1._M_param == __d2._M_param
2493 && __d1._M_nd == __d2._M_nd); }
2505 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2507 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2519 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2525 template<
typename _ForwardIterator,
2526 typename _UniformRandomNumberGenerator>
2528 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2529 _UniformRandomNumberGenerator& __urng,
2530 const param_type& __p);
2532 param_type _M_param;
2540 template<
typename _RealType>
2544 {
return !(__d1 == __d2); }
2553 template<
typename _RealType =
double>
2557 "template argument not a floating point type");
2578 {
return __p1._M_n == __p2._M_n; }
2586 : _M_param(__n), _M_gd(__n / 2)
2591 : _M_param(__p), _M_gd(__p.n() / 2)
2606 {
return _M_param.n(); }
2613 {
return _M_param; }
2625 _M_gd.param(param_type{__param.n() / 2});
2633 {
return result_type(0); }
2645 template<
typename _UniformRandomNumberGenerator>
2648 {
return 2 * _M_gd(__urng); }
2650 template<
typename _UniformRandomNumberGenerator>
2652 operator()(_UniformRandomNumberGenerator& __urng,
2657 return 2 * _M_gd(__urng, param_type(__p.n() / 2));
2660 template<
typename _ForwardIterator,
2661 typename _UniformRandomNumberGenerator>
2663 __generate(_ForwardIterator __f, _ForwardIterator __t,
2664 _UniformRandomNumberGenerator& __urng)
2665 { this->__generate_impl(__f, __t, __urng); }
2667 template<
typename _ForwardIterator,
2668 typename _UniformRandomNumberGenerator>
2670 __generate(_ForwardIterator __f, _ForwardIterator __t,
2671 _UniformRandomNumberGenerator& __urng,
2675 this->__generate_impl(__f, __t, __urng, __p2); }
2677 template<
typename _UniformRandomNumberGenerator>
2679 __generate(result_type* __f, result_type* __t,
2680 _UniformRandomNumberGenerator& __urng)
2681 { this->__generate_impl(__f, __t, __urng); }
2683 template<
typename _UniformRandomNumberGenerator>
2685 __generate(result_type* __f, result_type* __t,
2686 _UniformRandomNumberGenerator& __urng,
2690 this->__generate_impl(__f, __t, __urng, __p2); }
2700 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
2712 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2714 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2727 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2733 template<
typename _ForwardIterator,
2734 typename _UniformRandomNumberGenerator>
2736 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2737 _UniformRandomNumberGenerator& __urng);
2739 template<
typename _ForwardIterator,
2740 typename _UniformRandomNumberGenerator>
2742 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2743 _UniformRandomNumberGenerator& __urng,
2755 template<
typename _RealType>
2759 {
return !(__d1 == __d2); }
2768 template<
typename _RealType =
double>
2772 "template argument not a floating point type");
2784 _RealType __b = _RealType(1))
2785 : _M_a(__a), _M_b(__b)
2798 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
2807 _RealType __b = _RealType(1))
2808 : _M_param(__a, __b)
2828 {
return _M_param.a(); }
2832 {
return _M_param.b(); }
2839 {
return _M_param; }
2847 { _M_param = __param; }
2866 template<
typename _UniformRandomNumberGenerator>
2869 {
return this->operator()(__urng, _M_param); }
2871 template<
typename _UniformRandomNumberGenerator>
2873 operator()(_UniformRandomNumberGenerator& __urng,
2876 template<
typename _ForwardIterator,
2877 typename _UniformRandomNumberGenerator>
2879 __generate(_ForwardIterator __f, _ForwardIterator __t,
2880 _UniformRandomNumberGenerator& __urng)
2881 { this->__generate(__f, __t, __urng, _M_param); }
2883 template<
typename _ForwardIterator,
2884 typename _UniformRandomNumberGenerator>
2886 __generate(_ForwardIterator __f, _ForwardIterator __t,
2887 _UniformRandomNumberGenerator& __urng,
2889 { this->__generate_impl(__f, __t, __urng, __p); }
2891 template<
typename _UniformRandomNumberGenerator>
2893 __generate(result_type* __f, result_type* __t,
2894 _UniformRandomNumberGenerator& __urng,
2896 { this->__generate_impl(__f, __t, __urng, __p); }
2905 {
return __d1._M_param == __d2._M_param; }
2908 template<
typename _ForwardIterator,
2909 typename _UniformRandomNumberGenerator>
2911 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2912 _UniformRandomNumberGenerator& __urng,
2922 template<
typename _RealType>
2926 {
return !(__d1 == __d2); }
2938 template<
typename _RealType,
typename _CharT,
typename _Traits>
2940 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2953 template<
typename _RealType,
typename _CharT,
typename _Traits>
2969 template<
typename _RealType =
double>
2973 "template argument not a floating point type");
2985 _RealType __n = _RealType(1))
2986 : _M_m(__m), _M_n(__n)
2999 {
return __p1._M_m == __p2._M_m && __p1._M_n == __p2._M_n; }
3008 _RealType __n = _RealType(1))
3009 : _M_param(__m, __n), _M_gd_x(__m / 2), _M_gd_y(__n / 2)
3014 : _M_param(__p), _M_gd_x(__p.m() / 2), _M_gd_y(__p.n() / 2)
3032 {
return _M_param.m(); }
3036 {
return _M_param.n(); }
3043 {
return _M_param; }
3051 { _M_param = __param; }
3058 {
return result_type(0); }
3070 template<
typename _UniformRandomNumberGenerator>
3073 {
return (_M_gd_x(__urng) * n()) / (_M_gd_y(__urng) * m()); }
3075 template<
typename _UniformRandomNumberGenerator>
3077 operator()(_UniformRandomNumberGenerator& __urng,
3082 return ((_M_gd_x(__urng, param_type(__p.m() / 2)) * n())
3083 / (_M_gd_y(__urng, param_type(__p.n() / 2)) * m()));
3086 template<
typename _ForwardIterator,
3087 typename _UniformRandomNumberGenerator>
3089 __generate(_ForwardIterator __f, _ForwardIterator __t,
3090 _UniformRandomNumberGenerator& __urng)
3091 { this->__generate_impl(__f, __t, __urng); }
3093 template<
typename _ForwardIterator,
3094 typename _UniformRandomNumberGenerator>
3096 __generate(_ForwardIterator __f, _ForwardIterator __t,
3097 _UniformRandomNumberGenerator& __urng,
3099 { this->__generate_impl(__f, __t, __urng, __p); }
3101 template<
typename _UniformRandomNumberGenerator>
3103 __generate(result_type* __f, result_type* __t,
3104 _UniformRandomNumberGenerator& __urng)
3105 { this->__generate_impl(__f, __t, __urng); }
3107 template<
typename _UniformRandomNumberGenerator>
3109 __generate(result_type* __f, result_type* __t,
3110 _UniformRandomNumberGenerator& __urng,
3112 { this->__generate_impl(__f, __t, __urng, __p); }
3122 {
return (__d1._M_param == __d2._M_param
3123 && __d1._M_gd_x == __d2._M_gd_x
3124 && __d1._M_gd_y == __d2._M_gd_y); }
3136 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3138 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3151 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3157 template<
typename _ForwardIterator,
3158 typename _UniformRandomNumberGenerator>
3160 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3161 _UniformRandomNumberGenerator& __urng);
3163 template<
typename _ForwardIterator,
3164 typename _UniformRandomNumberGenerator>
3166 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3167 _UniformRandomNumberGenerator& __urng,
3178 template<
typename _RealType>
3182 {
return !(__d1 == __d2); }
3193 template<
typename _RealType =
double>
3197 "template argument not a floating point type");
3218 {
return __p1._M_n == __p2._M_n; }
3226 : _M_param(__n), _M_nd(), _M_gd(__n / 2, 2)
3231 : _M_param(__p), _M_nd(), _M_gd(__p.n() / 2, 2)
3249 {
return _M_param.n(); }
3256 {
return _M_param; }
3264 { _M_param = __param; }
3283 template<
typename _UniformRandomNumberGenerator>
3286 {
return _M_nd(__urng) *
std::sqrt(n() / _M_gd(__urng)); }
3288 template<
typename _UniformRandomNumberGenerator>
3290 operator()(_UniformRandomNumberGenerator& __urng,
3296 const result_type __g = _M_gd(__urng, param_type(__p.n() / 2, 2));
3297 return _M_nd(__urng) *
std::sqrt(__p.n() / __g);
3300 template<
typename _ForwardIterator,
3301 typename _UniformRandomNumberGenerator>
3303 __generate(_ForwardIterator __f, _ForwardIterator __t,
3304 _UniformRandomNumberGenerator& __urng)
3305 { this->__generate_impl(__f, __t, __urng); }
3307 template<
typename _ForwardIterator,
3308 typename _UniformRandomNumberGenerator>
3310 __generate(_ForwardIterator __f, _ForwardIterator __t,
3311 _UniformRandomNumberGenerator& __urng,
3313 { this->__generate_impl(__f, __t, __urng, __p); }
3315 template<
typename _UniformRandomNumberGenerator>
3317 __generate(result_type* __f, result_type* __t,
3318 _UniformRandomNumberGenerator& __urng)
3319 { this->__generate_impl(__f, __t, __urng); }
3321 template<
typename _UniformRandomNumberGenerator>
3323 __generate(result_type* __f, result_type* __t,
3324 _UniformRandomNumberGenerator& __urng,
3326 { this->__generate_impl(__f, __t, __urng, __p); }
3336 {
return (__d1._M_param == __d2._M_param
3337 && __d1._M_nd == __d2._M_nd && __d1._M_gd == __d2._M_gd); }
3349 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3351 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3364 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3370 template<
typename _ForwardIterator,
3371 typename _UniformRandomNumberGenerator>
3373 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3374 _UniformRandomNumberGenerator& __urng);
3375 template<
typename _ForwardIterator,
3376 typename _UniformRandomNumberGenerator>
3378 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3379 _UniformRandomNumberGenerator& __urng,
3391 template<
typename _RealType>
3395 {
return !(__d1 == __d2); }
3426 __glibcxx_assert((_M_p >= 0.0) && (_M_p <= 1.0));
3435 {
return __p1._M_p == __p2._M_p; }
3471 {
return _M_param.p(); }
3478 {
return _M_param; }
3486 { _M_param = __param; }
3505 template<
typename _UniformRandomNumberGenerator>
3508 {
return this->operator()(__urng, _M_param); }
3510 template<
typename _UniformRandomNumberGenerator>
3512 operator()(_UniformRandomNumberGenerator& __urng,
3515 __detail::_Adaptor<_UniformRandomNumberGenerator, double>
3517 if ((__aurng() - __aurng.min())
3518 < __p.p() * (__aurng.max() - __aurng.min()))
3523 template<
typename _ForwardIterator,
3524 typename _UniformRandomNumberGenerator>
3526 __generate(_ForwardIterator __f, _ForwardIterator __t,
3527 _UniformRandomNumberGenerator& __urng)
3528 { this->__generate(__f, __t, __urng, _M_param); }
3530 template<
typename _ForwardIterator,
3531 typename _UniformRandomNumberGenerator>
3533 __generate(_ForwardIterator __f, _ForwardIterator __t,
3534 _UniformRandomNumberGenerator& __urng,
const param_type& __p)
3535 { this->__generate_impl(__f, __t, __urng, __p); }
3537 template<
typename _UniformRandomNumberGenerator>
3539 __generate(result_type* __f, result_type* __t,
3540 _UniformRandomNumberGenerator& __urng,
3542 { this->__generate_impl(__f, __t, __urng, __p); }
3551 {
return __d1._M_param == __d2._M_param; }
3554 template<
typename _ForwardIterator,
3555 typename _UniformRandomNumberGenerator>
3557 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3558 _UniformRandomNumberGenerator& __urng,
3571 {
return !(__d1 == __d2); }
3583 template<
typename _CharT,
typename _Traits>
3585 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3597 template<
typename _CharT,
typename _Traits>
3616 template<
typename _IntType =
int>
3620 "template argument not an integral type");
3632 param_type(_IntType __t = _IntType(1),
double __p = 0.5)
3633 : _M_t(__t), _M_p(__p)
3635 __glibcxx_assert((_M_t >= _IntType(0))
3650 operator==(
const param_type& __p1,
const param_type& __p2)
3651 {
return __p1._M_t == __p2._M_t && __p1._M_p == __p2._M_p; }
3661 #if _GLIBCXX_USE_C99_MATH_TR1 3662 double _M_d1, _M_d2, _M_s1, _M_s2, _M_c,
3663 _M_a1, _M_a123, _M_s, _M_lf, _M_lp1p;
3672 : _M_param(__t, __p), _M_nd()
3677 : _M_param(__p), _M_nd()
3692 {
return _M_param.t(); }
3699 {
return _M_param.p(); }
3706 {
return _M_param; }
3714 { _M_param = __param; }
3728 {
return _M_param.t(); }
3733 template<
typename _UniformRandomNumberGenerator>
3736 {
return this->operator()(__urng, _M_param); }
3738 template<
typename _UniformRandomNumberGenerator>
3740 operator()(_UniformRandomNumberGenerator& __urng,
3743 template<
typename _ForwardIterator,
3744 typename _UniformRandomNumberGenerator>
3746 __generate(_ForwardIterator __f, _ForwardIterator __t,
3747 _UniformRandomNumberGenerator& __urng)
3748 { this->__generate(__f, __t, __urng, _M_param); }
3750 template<
typename _ForwardIterator,
3751 typename _UniformRandomNumberGenerator>
3753 __generate(_ForwardIterator __f, _ForwardIterator __t,
3754 _UniformRandomNumberGenerator& __urng,
3756 { this->__generate_impl(__f, __t, __urng, __p); }
3758 template<
typename _UniformRandomNumberGenerator>
3761 _UniformRandomNumberGenerator& __urng,
3763 { this->__generate_impl(__f, __t, __urng, __p); }
3773 #ifdef _GLIBCXX_USE_C99_MATH_TR1 3774 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
3776 {
return __d1._M_param == __d2._M_param; }
3789 template<
typename _IntType1,
3790 typename _CharT,
typename _Traits>
3792 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3805 template<
typename _IntType1,
3806 typename _CharT,
typename _Traits>
3812 template<
typename _ForwardIterator,
3813 typename _UniformRandomNumberGenerator>
3815 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3816 _UniformRandomNumberGenerator& __urng,
3819 template<
typename _UniformRandomNumberGenerator>
3821 _M_waiting(_UniformRandomNumberGenerator& __urng,
3822 _IntType __t,
double __q);
3833 template<
typename _IntType>
3837 {
return !(__d1 == __d2); }
3847 template<
typename _IntType =
int>
3851 "template argument not an integral type");
3866 __glibcxx_assert((_M_p > 0.0) && (_M_p < 1.0));
3875 operator==(
const param_type& __p1,
const param_type& __p2)
3876 {
return __p1._M_p == __p2._M_p; }
3881 { _M_log_1_p =
std::log(1.0 - _M_p); }
3912 {
return _M_param.p(); }
3919 {
return _M_param; }
3927 { _M_param = __param; }
3946 template<
typename _UniformRandomNumberGenerator>
3949 {
return this->operator()(__urng, _M_param); }
3951 template<
typename _UniformRandomNumberGenerator>
3953 operator()(_UniformRandomNumberGenerator& __urng,
3956 template<
typename _ForwardIterator,
3957 typename _UniformRandomNumberGenerator>
3959 __generate(_ForwardIterator __f, _ForwardIterator __t,
3960 _UniformRandomNumberGenerator& __urng)
3961 { this->__generate(__f, __t, __urng, _M_param); }
3963 template<
typename _ForwardIterator,
3964 typename _UniformRandomNumberGenerator>
3966 __generate(_ForwardIterator __f, _ForwardIterator __t,
3967 _UniformRandomNumberGenerator& __urng,
3969 { this->__generate_impl(__f, __t, __urng, __p); }
3971 template<
typename _UniformRandomNumberGenerator>
3974 _UniformRandomNumberGenerator& __urng,
3976 { this->__generate_impl(__f, __t, __urng, __p); }
3985 {
return __d1._M_param == __d2._M_param; }
3988 template<
typename _ForwardIterator,
3989 typename _UniformRandomNumberGenerator>
3991 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3992 _UniformRandomNumberGenerator& __urng,
4002 template<
typename _IntType>
4006 {
return !(__d1 == __d2); }
4018 template<
typename _IntType,
4019 typename _CharT,
typename _Traits>
4021 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4033 template<
typename _IntType,
4034 typename _CharT,
typename _Traits>
4047 template<
typename _IntType =
int>
4051 "template argument not an integral type");
4062 param_type(_IntType __k = 1,
double __p = 0.5)
4063 : _M_k(__k), _M_p(__p)
4065 __glibcxx_assert((_M_k > 0) && (_M_p > 0.0) && (_M_p <= 1.0));
4078 {
return __p1._M_k == __p2._M_k && __p1._M_p == __p2._M_p; }
4087 : _M_param(__k, __p), _M_gd(__k, (1.0 - __p) / __p)
4092 : _M_param(__p), _M_gd(__p.k(), (1.0 - __p.p()) / __p.p())
4107 {
return _M_param.k(); }
4114 {
return _M_param.p(); }
4121 {
return _M_param; }
4129 { _M_param = __param; }
4148 template<
typename _UniformRandomNumberGenerator>
4150 operator()(_UniformRandomNumberGenerator& __urng);
4152 template<
typename _UniformRandomNumberGenerator>
4154 operator()(_UniformRandomNumberGenerator& __urng,
4157 template<
typename _ForwardIterator,
4158 typename _UniformRandomNumberGenerator>
4160 __generate(_ForwardIterator __f, _ForwardIterator __t,
4161 _UniformRandomNumberGenerator& __urng)
4162 { this->__generate_impl(__f, __t, __urng); }
4164 template<
typename _ForwardIterator,
4165 typename _UniformRandomNumberGenerator>
4167 __generate(_ForwardIterator __f, _ForwardIterator __t,
4168 _UniformRandomNumberGenerator& __urng,
4170 { this->__generate_impl(__f, __t, __urng, __p); }
4172 template<
typename _UniformRandomNumberGenerator>
4175 _UniformRandomNumberGenerator& __urng)
4176 { this->__generate_impl(__f, __t, __urng); }
4178 template<
typename _UniformRandomNumberGenerator>
4181 _UniformRandomNumberGenerator& __urng,
4183 { this->__generate_impl(__f, __t, __urng, __p); }
4193 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
4206 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4208 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4221 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4227 template<
typename _ForwardIterator,
4228 typename _UniformRandomNumberGenerator>
4230 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4231 _UniformRandomNumberGenerator& __urng);
4232 template<
typename _ForwardIterator,
4233 typename _UniformRandomNumberGenerator>
4235 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4236 _UniformRandomNumberGenerator& __urng,
4247 template<
typename _IntType>
4251 {
return !(__d1 == __d2); }
4269 template<
typename _IntType =
int>
4273 "template argument not an integral type");
4288 __glibcxx_assert(_M_mean > 0.0);
4297 operator==(
const param_type& __p1,
const param_type& __p2)
4298 {
return __p1._M_mean == __p2._M_mean; }
4308 #if _GLIBCXX_USE_C99_MATH_TR1 4309 double _M_lfm, _M_sm, _M_d, _M_scx, _M_1cx, _M_c2b, _M_cb;
4316 : _M_param(__mean), _M_nd()
4321 : _M_param(__p), _M_nd()
4336 {
return _M_param.mean(); }
4343 {
return _M_param; }
4351 { _M_param = __param; }
4370 template<
typename _UniformRandomNumberGenerator>
4373 {
return this->operator()(__urng, _M_param); }
4375 template<
typename _UniformRandomNumberGenerator>
4377 operator()(_UniformRandomNumberGenerator& __urng,
4380 template<
typename _ForwardIterator,
4381 typename _UniformRandomNumberGenerator>
4383 __generate(_ForwardIterator __f, _ForwardIterator __t,
4384 _UniformRandomNumberGenerator& __urng)
4385 { this->__generate(__f, __t, __urng, _M_param); }
4387 template<
typename _ForwardIterator,
4388 typename _UniformRandomNumberGenerator>
4390 __generate(_ForwardIterator __f, _ForwardIterator __t,
4391 _UniformRandomNumberGenerator& __urng,
4393 { this->__generate_impl(__f, __t, __urng, __p); }
4395 template<
typename _UniformRandomNumberGenerator>
4398 _UniformRandomNumberGenerator& __urng,
4400 { this->__generate_impl(__f, __t, __urng, __p); }
4410 #ifdef _GLIBCXX_USE_C99_MATH_TR1 4411 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
4413 {
return __d1._M_param == __d2._M_param; }
4426 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4428 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4441 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4447 template<
typename _ForwardIterator,
4448 typename _UniformRandomNumberGenerator>
4450 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4451 _UniformRandomNumberGenerator& __urng,
4463 template<
typename _IntType>
4467 {
return !(__d1 == __d2); }
4485 template<
typename _RealType =
double>
4489 "template argument not a floating point type");
4500 param_type(_RealType __lambda = _RealType(1))
4501 : _M_lambda(__lambda)
4503 __glibcxx_assert(_M_lambda > _RealType(0));
4508 {
return _M_lambda; }
4512 {
return __p1._M_lambda == __p2._M_lambda; }
4515 _RealType _M_lambda;
4525 : _M_param(__lambda)
4546 {
return _M_param.lambda(); }
4553 {
return _M_param; }
4561 { _M_param = __param; }
4580 template<
typename _UniformRandomNumberGenerator>
4583 {
return this->operator()(__urng, _M_param); }
4585 template<
typename _UniformRandomNumberGenerator>
4587 operator()(_UniformRandomNumberGenerator& __urng,
4590 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
4595 template<
typename _ForwardIterator,
4596 typename _UniformRandomNumberGenerator>
4598 __generate(_ForwardIterator __f, _ForwardIterator __t,
4599 _UniformRandomNumberGenerator& __urng)
4600 { this->__generate(__f, __t, __urng, _M_param); }
4602 template<
typename _ForwardIterator,
4603 typename _UniformRandomNumberGenerator>
4605 __generate(_ForwardIterator __f, _ForwardIterator __t,
4606 _UniformRandomNumberGenerator& __urng,
4608 { this->__generate_impl(__f, __t, __urng, __p); }
4610 template<
typename _UniformRandomNumberGenerator>
4613 _UniformRandomNumberGenerator& __urng,
4615 { this->__generate_impl(__f, __t, __urng, __p); }
4624 {
return __d1._M_param == __d2._M_param; }
4627 template<
typename _ForwardIterator,
4628 typename _UniformRandomNumberGenerator>
4630 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4631 _UniformRandomNumberGenerator& __urng,
4641 template<
typename _RealType>
4645 {
return !(__d1 == __d2); }
4657 template<
typename _RealType,
typename _CharT,
typename _Traits>
4659 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4672 template<
typename _RealType,
typename _CharT,
typename _Traits>
4687 template<
typename _RealType =
double>
4691 "template argument not a floating point type");
4703 _RealType __b = _RealType(1))
4704 : _M_a(__a), _M_b(__b)
4717 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
4726 _RealType __b = _RealType(1))
4727 : _M_param(__a, __b)
4747 {
return _M_param.a(); }
4754 {
return _M_param.b(); }
4761 {
return _M_param; }
4769 { _M_param = __param; }
4788 template<
typename _UniformRandomNumberGenerator>
4791 {
return this->operator()(__urng, _M_param); }
4793 template<
typename _UniformRandomNumberGenerator>
4795 operator()(_UniformRandomNumberGenerator& __urng,
4798 template<
typename _ForwardIterator,
4799 typename _UniformRandomNumberGenerator>
4801 __generate(_ForwardIterator __f, _ForwardIterator __t,
4802 _UniformRandomNumberGenerator& __urng)
4803 { this->__generate(__f, __t, __urng, _M_param); }
4805 template<
typename _ForwardIterator,
4806 typename _UniformRandomNumberGenerator>
4808 __generate(_ForwardIterator __f, _ForwardIterator __t,
4809 _UniformRandomNumberGenerator& __urng,
4811 { this->__generate_impl(__f, __t, __urng, __p); }
4813 template<
typename _UniformRandomNumberGenerator>
4816 _UniformRandomNumberGenerator& __urng,
4818 { this->__generate_impl(__f, __t, __urng, __p); }
4827 {
return __d1._M_param == __d2._M_param; }
4830 template<
typename _ForwardIterator,
4831 typename _UniformRandomNumberGenerator>
4833 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4834 _UniformRandomNumberGenerator& __urng,
4844 template<
typename _RealType>
4848 {
return !(__d1 == __d2); }
4860 template<
typename _RealType,
typename _CharT,
typename _Traits>
4862 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4875 template<
typename _RealType,
typename _CharT,
typename _Traits>
4890 template<
typename _RealType =
double>
4894 "template argument not a floating point type");
4906 _RealType __b = _RealType(1))
4907 : _M_a(__a), _M_b(__b)
4920 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
4929 _RealType __b = _RealType(1))
4930 : _M_param(__a, __b)
4950 {
return _M_param.a(); }
4957 {
return _M_param.b(); }
4964 {
return _M_param; }
4972 { _M_param = __param; }
4991 template<
typename _UniformRandomNumberGenerator>
4994 {
return this->operator()(__urng, _M_param); }
4996 template<
typename _UniformRandomNumberGenerator>
4998 operator()(_UniformRandomNumberGenerator& __urng,
5001 template<
typename _ForwardIterator,
5002 typename _UniformRandomNumberGenerator>
5004 __generate(_ForwardIterator __f, _ForwardIterator __t,
5005 _UniformRandomNumberGenerator& __urng)
5006 { this->__generate(__f, __t, __urng, _M_param); }
5008 template<
typename _ForwardIterator,
5009 typename _UniformRandomNumberGenerator>
5011 __generate(_ForwardIterator __f, _ForwardIterator __t,
5012 _UniformRandomNumberGenerator& __urng,
5014 { this->__generate_impl(__f, __t, __urng, __p); }
5016 template<
typename _UniformRandomNumberGenerator>
5019 _UniformRandomNumberGenerator& __urng,
5021 { this->__generate_impl(__f, __t, __urng, __p); }
5030 {
return __d1._M_param == __d2._M_param; }
5033 template<
typename _ForwardIterator,
5034 typename _UniformRandomNumberGenerator>
5036 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5037 _UniformRandomNumberGenerator& __urng,
5047 template<
typename _RealType>
5051 {
return !(__d1 == __d2); }
5063 template<
typename _RealType,
typename _CharT,
typename _Traits>
5065 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5078 template<
typename _RealType,
typename _CharT,
typename _Traits>
5090 template<
typename _IntType =
int>
5094 "template argument not an integral type");
5106 : _M_prob(), _M_cp()
5109 template<
typename _InputIterator>
5110 param_type(_InputIterator __wbegin,
5111 _InputIterator __wend)
5112 : _M_prob(__wbegin, __wend), _M_cp()
5113 { _M_initialize(); }
5116 : _M_prob(__wil.begin(), __wil.end()), _M_cp()
5117 { _M_initialize(); }
5119 template<
typename _Func>
5120 param_type(
size_t __nw,
double __xmin,
double __xmax,
5124 param_type(
const param_type&) =
default;
5125 param_type& operator=(
const param_type&) =
default;
5128 probabilities()
const 5132 operator==(
const param_type& __p1,
const param_type& __p2)
5133 {
return __p1._M_prob == __p2._M_prob; }
5147 template<
typename _InputIterator>
5149 _InputIterator __wend)
5150 : _M_param(__wbegin, __wend)
5157 template<
typename _Func>
5160 : _M_param(__nw, __xmin, __xmax, __fw)
5181 return _M_param._M_prob.empty()
5190 {
return _M_param; }
5198 { _M_param = __param; }
5213 return _M_param._M_prob.empty()
5220 template<
typename _UniformRandomNumberGenerator>
5223 {
return this->operator()(__urng, _M_param); }
5225 template<
typename _UniformRandomNumberGenerator>
5227 operator()(_UniformRandomNumberGenerator& __urng,
5230 template<
typename _ForwardIterator,
5231 typename _UniformRandomNumberGenerator>
5233 __generate(_ForwardIterator __f, _ForwardIterator __t,
5234 _UniformRandomNumberGenerator& __urng)
5235 { this->__generate(__f, __t, __urng, _M_param); }
5237 template<
typename _ForwardIterator,
5238 typename _UniformRandomNumberGenerator>
5240 __generate(_ForwardIterator __f, _ForwardIterator __t,
5241 _UniformRandomNumberGenerator& __urng,
5243 { this->__generate_impl(__f, __t, __urng, __p); }
5245 template<
typename _UniformRandomNumberGenerator>
5248 _UniformRandomNumberGenerator& __urng,
5250 { this->__generate_impl(__f, __t, __urng, __p); }
5259 {
return __d1._M_param == __d2._M_param; }
5271 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5273 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5287 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5293 template<
typename _ForwardIterator,
5294 typename _UniformRandomNumberGenerator>
5296 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5297 _UniformRandomNumberGenerator& __urng,
5307 template<
typename _IntType>
5311 {
return !(__d1 == __d2); }
5320 template<
typename _RealType =
double>
5324 "template argument not a floating point type");
5336 : _M_int(), _M_den(), _M_cp()
5339 template<
typename _InputIteratorB,
typename _InputIteratorW>
5340 param_type(_InputIteratorB __bfirst,
5341 _InputIteratorB __bend,
5342 _InputIteratorW __wbegin);
5344 template<
typename _Func>
5347 template<
typename _Func>
5348 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5352 param_type(
const param_type&) =
default;
5353 param_type& operator=(
const param_type&) =
default;
5361 __tmp[1] = _RealType(1);
5373 operator==(
const param_type& __p1,
const param_type& __p2)
5374 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
5390 template<
typename _InputIteratorB,
typename _InputIteratorW>
5392 _InputIteratorB __bend,
5393 _InputIteratorW __wbegin)
5394 : _M_param(__bfirst, __bend, __wbegin)
5397 template<
typename _Func>
5400 : _M_param(__bl, __fw)
5403 template<
typename _Func>
5405 _RealType __xmin, _RealType __xmax,
5407 : _M_param(__nw, __xmin, __xmax, __fw)
5428 if (_M_param._M_int.empty())
5431 __tmp[1] = _RealType(1);
5435 return _M_param._M_int;
5444 return _M_param._M_den.empty()
5453 {
return _M_param; }
5461 { _M_param = __param; }
5469 return _M_param._M_int.empty()
5479 return _M_param._M_int.empty()
5486 template<
typename _UniformRandomNumberGenerator>
5489 {
return this->operator()(__urng, _M_param); }
5491 template<
typename _UniformRandomNumberGenerator>
5493 operator()(_UniformRandomNumberGenerator& __urng,
5496 template<
typename _ForwardIterator,
5497 typename _UniformRandomNumberGenerator>
5499 __generate(_ForwardIterator __f, _ForwardIterator __t,
5500 _UniformRandomNumberGenerator& __urng)
5501 { this->__generate(__f, __t, __urng, _M_param); }
5503 template<
typename _ForwardIterator,
5504 typename _UniformRandomNumberGenerator>
5506 __generate(_ForwardIterator __f, _ForwardIterator __t,
5507 _UniformRandomNumberGenerator& __urng,
5509 { this->__generate_impl(__f, __t, __urng, __p); }
5511 template<
typename _UniformRandomNumberGenerator>
5514 _UniformRandomNumberGenerator& __urng,
5516 { this->__generate_impl(__f, __t, __urng, __p); }
5525 {
return __d1._M_param == __d2._M_param; }
5538 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5540 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5554 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5560 template<
typename _ForwardIterator,
5561 typename _UniformRandomNumberGenerator>
5563 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5564 _UniformRandomNumberGenerator& __urng,
5574 template<
typename _RealType>
5578 {
return !(__d1 == __d2); }
5587 template<
typename _RealType =
double>
5591 "template argument not a floating point type");
5603 : _M_int(), _M_den(), _M_cp(), _M_m()
5606 template<
typename _InputIteratorB,
typename _InputIteratorW>
5607 param_type(_InputIteratorB __bfirst,
5608 _InputIteratorB __bend,
5609 _InputIteratorW __wbegin);
5611 template<
typename _Func>
5614 template<
typename _Func>
5615 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5619 param_type(
const param_type&) =
default;
5620 param_type& operator=(
const param_type&) =
default;
5628 __tmp[1] = _RealType(1);
5640 operator==(
const param_type& __p1,
const param_type& __p2)
5641 {
return (__p1._M_int == __p2._M_int
5642 && __p1._M_den == __p2._M_den); }
5659 template<
typename _InputIteratorB,
typename _InputIteratorW>
5661 _InputIteratorB __bend,
5662 _InputIteratorW __wbegin)
5663 : _M_param(__bfirst, __bend, __wbegin)
5666 template<
typename _Func>
5669 : _M_param(__bl, __fw)
5672 template<
typename _Func>
5674 _RealType __xmin, _RealType __xmax,
5676 : _M_param(__nw, __xmin, __xmax, __fw)
5697 if (_M_param._M_int.
empty())
5700 __tmp[1] = _RealType(1);
5704 return _M_param._M_int;
5714 return _M_param._M_den.
empty()
5723 {
return _M_param; }
5731 { _M_param = __param; }
5739 return _M_param._M_int.
empty()
5749 return _M_param._M_int.
empty()
5756 template<
typename _UniformRandomNumberGenerator>
5759 {
return this->operator()(__urng, _M_param); }
5761 template<
typename _UniformRandomNumberGenerator>
5763 operator()(_UniformRandomNumberGenerator& __urng,
5766 template<
typename _ForwardIterator,
5767 typename _UniformRandomNumberGenerator>
5769 __generate(_ForwardIterator __f, _ForwardIterator __t,
5770 _UniformRandomNumberGenerator& __urng)
5771 { this->__generate(__f, __t, __urng, _M_param); }
5773 template<
typename _ForwardIterator,
5774 typename _UniformRandomNumberGenerator>
5776 __generate(_ForwardIterator __f, _ForwardIterator __t,
5777 _UniformRandomNumberGenerator& __urng,
5779 { this->__generate_impl(__f, __t, __urng, __p); }
5781 template<
typename _UniformRandomNumberGenerator>
5784 _UniformRandomNumberGenerator& __urng,
5786 { this->__generate_impl(__f, __t, __urng, __p); }
5795 {
return __d1._M_param == __d2._M_param; }
5808 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5810 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5824 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5830 template<
typename _ForwardIterator,
5831 typename _UniformRandomNumberGenerator>
5833 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5834 _UniformRandomNumberGenerator& __urng,
5844 template<
typename _RealType>
5848 {
return !(__d1 == __d2); }
5876 template<
typename _IntType>
5879 template<
typename _InputIterator>
5880 seed_seq(_InputIterator __begin, _InputIterator __end);
5883 template<
typename _RandomAccessIterator>
5885 generate(_RandomAccessIterator __begin, _RandomAccessIterator __end);
5888 size_t size()
const noexcept
5889 {
return _M_v.size(); }
5891 template<
typename OutputIterator>
5893 param(OutputIterator __dest)
const 5894 { std::copy(_M_v.begin(), _M_v.end(), __dest); }
5908 _GLIBCXX_END_NAMESPACE_VERSION
void seed(result_type __s)
Reseeds the independent_bits_engine object with the default seed for the underlying base class genera...
void seed(result_type __s)
Reseeds the shuffle_order_engine object with the default seed for the underlying base class 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.
The Marsaglia-Zaman generator.
result_type max() const
Returns the inclusive upper bound of the distribution range.
void reset()
Resets the distribution state.
A Bernoulli random number distribution.
independent_bits_engine(result_type __s)
Seed constructs a independent_bits_engine engine.
param_type param() const
Returns the parameter set of the distribution.
_GLIBCXX14_CONSTEXPR const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
param_type param() const
Returns the parameter set of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
friend bool operator==(const geometric_distribution &__d1, const geometric_distribution &__d2)
Return true if two geometric distributions have the same parameters.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
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 weibull_distribution &__d1, const weibull_distribution &__d2)
Return true if two Weibull distributions have the same parameters.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
static constexpr result_type max()
Template class basic_ostream.
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 max() const
Returns the least upper bound value of the distribution.
reference front() noexcept
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 result_type max()
Gets the inclusive maximum value of the range of random integers returned by this generator...
A discrete Poisson random number distribution.
friend bool operator==(const student_t_distribution &__d1, const student_t_distribution &__d2)
Return true if two Student t distributions have the same parameters and the sequences that would be g...
friend bool operator==(const linear_congruential_engine &__lhs, const linear_congruential_engine &__rhs)
Compares two linear congruential random number generator objects of the same type for equality...
result_type max() const
Returns the least upper bound value of the distribution.
void seed()
Reseeds the independent_bits_engine object with the default seed for the underlying base class genera...
param_type param() const
Returns the parameter set of the distribution.
Uniform discrete distribution for random numbers. A discrete random distribution on the range with e...
_RealType stddev() const
Returns the standard deviation of the distribution.
discard_block_engine()
Constructs a default discard_block_engine engine.
_RealType b() const
Return the parameter of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type max() const
Returns the least upper bound value of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
_RealType a() const
Return the parameter of the distribution.
normal_distribution(result_type __mean=result_type(0), result_type __stddev=result_type(1))
_RealType lambda() const
Returns the inverse scale parameter of the distribution.
param_type param() const
Returns the parameter set of the distribution.
mersenne_twister_engine(_Sseq &__q)
Constructs a mersenne_twister_engine random number generator engine seeded from the seed sequence __q...
discard_block_engine(const _RandomNumberEngine &__rng)
Copy constructs a discard_block_engine engine.
result_type min() const
Returns the greatest lower bound value of the distribution.
param_type param() const
Returns the parameter set of the distribution.
static constexpr result_type min()
Gets the smallest possible value in the output range.
_RealType b() const
Return the parameter of the distribution.
bernoulli_distribution(double __p=0.5)
Constructs a Bernoulli distribution with likelihood p.
param_type param() const
Returns the parameter set of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
static constexpr _Tp lowest() noexcept
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...
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.
Properties of fundamental types.
void seed()
Reseeds the shuffle_order_engine object with the default seed for the underlying base class generator...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
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.
double p() const
Returns the distribution p parameter.
param_type param() const
Returns the parameter set of the distribution.
void reset()
Resets the distribution state.
__gnu_cxx::__promote_2< _Tpa, _Tpb >::__type beta(_Tpa __a, _Tpb __b)
bool empty() const noexcept
A weibull_distribution random number distribution.
friend bool operator==(const shuffle_order_engine &__lhs, const shuffle_order_engine &__rhs)
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...
static constexpr result_type min()
Gets the minimum value in the generated random number range.
result_type max() const
Returns the least upper bound value of the distribution.
void reset()
Resets the distribution state.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void seed(_Sseq &__q)
Reseeds the independent_bits_engine object with the given seed sequence.
Uniform continuous distribution for random numbers.
result_type max() const
Returns the least upper bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void reset()
Resets the distribution state.
static constexpr _Tp max() noexcept
result_type max() const
Returns the least upper bound value of the distribution.
void reset()
Resets the distribution state.
constexpr int __lg(int __n)
This is a helper function for the sort routines and for random.tcc.
_RealType generate_canonical(_UniformRandomNumberGenerator &__g)
A function template for converting the output of a (integral) uniform random number generator to a fl...
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.
mersenne_twister_engine< uint_fast32_t, 32, 624, 397, 31, 0x9908b0dfUL, 11, 0xffffffffUL, 7, 0x9d2c5680UL, 15, 0xefc60000UL, 18, 1812433253UL > mt19937
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.
std::vector< double > densities() const
Return a vector of the probability densities of the distribution.
independent_bits_engine(const _RandomNumberEngine &__rng)
Copy constructs a independent_bits_engine engine.
bool equal(_IIter1 __first1, _IIter1 __last1, _IIter2 __first2, _IIter2 __last2, _BinaryPredicate __binary_pred)
Tests a range for element-wise equality.
void param(const param_type &__param)
Sets 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.
A chi_squared_distribution random number distribution.
std::vector< double > densities() const
Returns a vector of the probability densities.
friend bool operator==(const extreme_value_distribution &__d1, const extreme_value_distribution &__d2)
Return true if two extreme value distributions have the same parameters.
void seed(_Sseq &__q)
Reseeds the shuffle_order_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...
double p() const
Returns the p parameter of the distribution.
param_type param() const
Returns the parameter set of the distribution.
A extreme_value_distribution random number distribution.
param_type param() const
Returns the parameter set of the distribution.
shuffle_order_engine(const _RandomNumberEngine &__rng)
Copy constructs a shuffle_order_engine engine.
complex< _Tp > log(const complex< _Tp > &)
Return complex natural logarithm of z.
param_type param() const
Returns the parameter set of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
std::vector< double > probabilities() const
Returns the probabilities of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void discard(unsigned long long __z)
void reset()
Resets the distribution state.
linear_congruential_engine(result_type __s=default_seed)
Constructs a linear_congruential_engine random number generator engine with seed __s. The default seed value is 1.
param_type param() const
Returns the parameter set of the distribution.
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine object.
result_type min() const
Returns the greatest lower bound value of the distribution.
static constexpr result_type min()
Gets the inclusive minimum value of the range of random integers returned by this generator...
param_type param() const
Returns the parameter set of the distribution.
static constexpr result_type min()
Gets the smallest possible value in the output range.
static constexpr result_type max()
Gets the maximum value in the generated random number range.
_RealType mean() const
Returns the mean of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
const _RandomNumberEngine & base() const noexcept
The seed_seq class generates sequences of seeds for random number generators.
result_type min() const
Returns the greatest lower bound value of the distribution.
void reset()
Resets the distribution state.
result_type max() const
Returns the least upper bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine object.
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 exponential_distribution &__d1, const exponential_distribution &__d2)
Return true if two exponential distributions have the same parameters.
A cauchy_distribution random number distribution.
double p() const
Returns the distribution parameter p.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
complex< _Tp > sqrt(const complex< _Tp > &)
Return complex square root of z.
double mean() const
Returns the distribution parameter mean.
shuffle_order_engine(_Sseq &__q)
Generator construct a shuffle_order_engine engine.
_GLIBCXX14_CONSTEXPR const _Tp & max(const _Tp &, const _Tp &)
This does what you think it does.
void reset()
Resets the distribution state.
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 mersenne_twister_engine &__lhs, const mersenne_twister_engine &__rhs)
Compares two % mersenne_twister_engine random number generator objects of the same type for equality...
uint_least32_t result_type
discard_block_engine(_Sseq &__q)
Generator construct a discard_block_engine engine.
param_type param() const
Returns the parameter set of the distribution.
param_type param() const
Returns the parameter set of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
A discrete binomial random number distribution.
A normal continuous distribution for random numbers.
friend bool operator==(const discrete_distribution &__d1, const discrete_distribution &__d2)
Return true if two discrete distributions have the same parameters.
result_type min() const
Returns the greatest lower bound value of the distribution.
complex< _Tp > exp(const complex< _Tp > &)
Return complex base e exponential of z.
result_type max() const
Returns the least upper bound value of the distribution.
subtract_with_carry_engine(result_type __sd=default_seed)
Constructs an explicitly seeded % subtract_with_carry_engine random number generator.
One of the math functors.
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...
void discard(unsigned long long __z)
Discard a sequence of random numbers.
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.
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 operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void param(const param_type &__param)
Sets the parameter set of the distribution.
linear_congruential_engine< uint_fast32_t, 48271UL, 0UL, 2147483647UL > minstd_rand
Template class basic_istream.
_RandomNumberEngine::result_type result_type
std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, const _Quoted_string< basic_string< _CharT, _Traits, _Alloc > &, _CharT > &__str)
Extractor for delimited strings. The left and right delimiters can be different.
void param(const param_type &__param)
Sets the parameter set of the distribution.
A discrete_distribution random number distribution.
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 gamma_distribution &__d1, const gamma_distribution &__d2)
Return true if two gamma distributions have the same parameters and the sequences that would be gener...
A discrete geometric random number distribution.
friend bool operator==(const lognormal_distribution &__d1, const lognormal_distribution &__d2)
Return true if two lognormal distributions have the same parameters and the sequences that would be g...
result_type operator()()
Gets the next random number in the sequence.
A lognormal_distribution random number distribution.
void reset()
Resets the distribution state.
ISO C++ entities toplevel namespace is std.
result_type min() const
Returns the greatest lower bound value of the distribution.
An exponential continuous distribution for random numbers.
void param(const param_type &__param)
Sets the parameter set of the distribution.
void reset()
Resets the distribution state.
uniform_real_distribution(_RealType __a=_RealType(0), _RealType __b=_RealType(1))
Constructs a uniform_real_distribution object.
static constexpr result_type min()
_RealType alpha() const
Returns the of the distribution.
double p() const
Return the parameter of the distribution.
reference back() noexcept
static constexpr result_type max()
Gets the largest possible value in the output range.
void param(const param_type &__param)
Sets the parameter set of the distribution.
_RealType beta() const
Returns the of the distribution.
A fisher_f_distribution random number distribution.
exponential_distribution(const result_type &__lambda=result_type(1))
Constructs an exponential distribution with inverse scale parameter .
param_type param() const
Returns the parameter set 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.
A piecewise_constant_distribution random number distribution.
_RealType a() const
Return the parameter of the distribution.
static constexpr _Tp min() noexcept
_RandomNumberEngine::result_type result_type
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
param_type param() const
Returns the parameter set of the distribution.
independent_bits_engine()
Constructs a default independent_bits_engine engine.
independent_bits_engine(_Sseq &__q)
Generator construct a independent_bits_engine engine.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
A gamma continuous distribution for random numbers.
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.
mersenne_twister_engine< uint_fast64_t, 64, 312, 156, 31, 0xb5026f5aa96619e9ULL, 29, 0x5555555555555555ULL, 17, 0x71d67fffeda60000ULL, 37, 0xfff7eee000000000ULL, 43, 6364136223846793005ULL > mt19937_64
friend bool operator==(const fisher_f_distribution &__d1, const fisher_f_distribution &__d2)
Return true if two Fisher f distributions have the same parameters and the sequences that would be ge...
friend bool operator==(const 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 max() const
Returns the least upper bound value of the distribution.
std::vector< _RealType > intervals() const
Returns a vector of the intervals.
shuffle_order_engine(_RandomNumberEngine &&__rng)
Move constructs a shuffle_order_engine engine.
result_type min() const
Returns the greatest lower bound value of the distribution.
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.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void reset()
Resets the distribution state.
friend bool operator==(const binomial_distribution &__d1, const binomial_distribution &__d2)
Return true if two binomial distributions have the same parameters and the sequences that would be ge...
_IntType k() const
Return the parameter of the distribution.
void reset()
Resets the distribution state.
gamma_distribution(_RealType __alpha_val=_RealType(1), _RealType __beta_val=_RealType(1))
Constructs a gamma distribution with parameters and .
void reset()
Resets the distribution state.
independent_bits_engine(_RandomNumberEngine &&__rng)
Move constructs a independent_bits_engine engine.
discard_block_engine(_RandomNumberEngine &&__rng)
Move constructs a discard_block_engine engine.
A model of a linear congruential random number generator.
static constexpr result_type max()
Gets the maximum value in the generated random number range.
A student_t_distribution random number distribution.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
void reset()
Resets the distribution state.
void param(const param_type &__param)
Sets the parameter set of the distribution.
void reset()
Resets the distribution state.
result_type min() const
Returns the greatest lower bound value of the distribution.
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 reset()
Resets the distribution state.
A piecewise_linear_distribution random number distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
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...
shuffle_order_engine()
Constructs a default shuffle_order_engine engine.
result_type max() const
Returns the least upper bound value of the distribution.
result_type min() const
Returns the inclusive lower bound of the distribution range.
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
param_type param() const
Returns the parameter set of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend bool operator==(const bernoulli_distribution &__d1, const bernoulli_distribution &__d2)
Return true if two Bernoulli distributions have the same parameters.
linear_congruential_engine< uint_fast32_t, 16807UL, 0UL, 2147483647UL > minstd_rand0
void seed(_Sseq &__q)
Reseeds the discard_block_engine object with the given seed sequence.
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.
param_type param() const
Returns the parameter set of the distribution.
void seed()
Reseeds the discard_block_engine object with the default seed for the underlying base class generator...
A negative_binomial_distribution random number distribution.
Produces random numbers by combining random numbers from some base engine to produce random numbers w...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.