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>
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>
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>
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");
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>
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>
1311 __w, _UIntType>& __x)
1323 template<
typename _RandomNumberEngine,
size_t __k>
1326 static_assert(1u <= __k,
"template argument substituting "
1327 "__k out of bound");
1333 template<
typename _Sseq>
1334 using _If_seed_seq =
typename enable_if<__detail::__is_seed_seq<
1337 static constexpr
size_t table_size = __k;
1346 { _M_initialize(); }
1357 { _M_initialize(); }
1368 { _M_initialize(); }
1379 { _M_initialize(); }
1386 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1390 { _M_initialize(); }
1419 template<
typename _Sseq>
1430 const _RandomNumberEngine&
1454 for (; __z != 0ULL; --__z)
1478 {
return (__lhs._M_b == __rhs._M_b
1479 && std::equal(__lhs._M_v, __lhs._M_v + __k, __rhs._M_v)
1480 && __lhs._M_y == __rhs._M_y); }
1493 template<
typename _RandomNumberEngine1,
size_t __k1,
1494 typename _CharT,
typename _Traits>
1511 template<
typename _RandomNumberEngine1,
size_t __k1,
1512 typename _CharT,
typename _Traits>
1518 void _M_initialize()
1520 for (
size_t __i = 0; __i < __k; ++__i)
1525 _RandomNumberEngine _M_b;
1541 template<
typename _RandomNumberEngine,
size_t __k>
1547 {
return !(__lhs == __rhs); }
1553 typedef linear_congruential_engine<uint_fast32_t, 16807UL, 0UL, 2147483647UL>
1584 0xb5026f5aa96619e9ULL, 29,
1585 0x5555555555555555ULL, 17,
1586 0x71d67fffeda60000ULL, 37,
1587 0xfff7eee000000000ULL, 43,
1621 #if defined _GLIBCXX_USE_DEV_RANDOM
1635 entropy() const noexcept
1637 #ifdef _GLIBCXX_USE_DEV_RANDOM
1638 return this->_M_getentropy();
1646 {
return this->_M_getval(); }
1649 random_device(
const random_device&) =
delete;
1650 void operator=(
const random_device&) =
delete;
1660 double _M_getentropy() const noexcept;
1662 void _M_init(const
char*,
size_t);
1696 template<
typename _IntType>
1700 {
return !(__d1 == __d2); }
1712 template<
typename _IntType,
typename _CharT,
typename _Traits>
1726 template<
typename _IntType,
typename _CharT,
typename _Traits>
1739 template<
typename _RealType =
double>
1743 "result_type must be a floating point type");
1757 param_type(_RealType __a, _RealType __b = _RealType(1))
1758 : _M_a(__a), _M_b(__b)
1760 __glibcxx_assert(_M_a <= _M_b);
1773 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
1777 {
return !(__p1 == __p2); }
1800 : _M_param(__a, __b)
1818 {
return _M_param.a(); }
1822 {
return _M_param.b(); }
1829 {
return _M_param; }
1837 { _M_param = __param; }
1844 {
return this->a(); }
1851 {
return this->b(); }
1856 template<
typename _UniformRandomNumberGenerator>
1859 {
return this->
operator()(__urng, _M_param); }
1861 template<
typename _UniformRandomNumberGenerator>
1863 operator()(_UniformRandomNumberGenerator& __urng,
1864 const param_type& __p)
1866 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
1868 return (__aurng() * (__p.b() - __p.a())) + __p.a();
1871 template<
typename _ForwardIterator,
1872 typename _UniformRandomNumberGenerator>
1874 __generate(_ForwardIterator __f, _ForwardIterator __t,
1875 _UniformRandomNumberGenerator& __urng)
1876 { this->__generate(__f, __t, __urng, _M_param); }
1878 template<
typename _ForwardIterator,
1879 typename _UniformRandomNumberGenerator>
1881 __generate(_ForwardIterator __f, _ForwardIterator __t,
1882 _UniformRandomNumberGenerator& __urng,
1883 const param_type& __p)
1884 { this->__generate_impl(__f, __t, __urng, __p); }
1886 template<
typename _UniformRandomNumberGenerator>
1889 _UniformRandomNumberGenerator& __urng,
1890 const param_type& __p)
1891 { this->__generate_impl(__f, __t, __urng, __p); }
1900 {
return __d1._M_param == __d2._M_param; }
1903 template<
typename _ForwardIterator,
1904 typename _UniformRandomNumberGenerator>
1906 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
1907 _UniformRandomNumberGenerator& __urng,
1908 const param_type& __p);
1910 param_type _M_param;
1917 template<
typename _IntType>
1921 {
return !(__d1 == __d2); }
1933 template<
typename _RealType,
typename _CharT,
typename _Traits>
1947 template<
typename _RealType,
typename _CharT,
typename _Traits>
1969 template<
typename _RealType =
double>
1973 "result_type must be a floating point type");
1987 param_type(_RealType __mean, _RealType __stddev = _RealType(1))
1988 : _M_mean(__mean), _M_stddev(__stddev)
1990 __glibcxx_assert(_M_stddev > _RealType(0));
1999 {
return _M_stddev; }
2003 {
return (__p1._M_mean == __p2._M_mean
2004 && __p1._M_stddev == __p2._M_stddev); }
2008 {
return !(__p1 == __p2); }
2012 _RealType _M_stddev;
2025 : _M_param(__mean, __stddev)
2038 { _M_saved_available =
false; }
2045 {
return _M_param.mean(); }
2052 {
return _M_param.stddev(); }
2059 {
return _M_param; }
2067 { _M_param = __param; }
2086 template<
typename _UniformRandomNumberGenerator>
2089 {
return this->
operator()(__urng, _M_param); }
2091 template<
typename _UniformRandomNumberGenerator>
2093 operator()(_UniformRandomNumberGenerator& __urng,
2094 const param_type& __p);
2096 template<
typename _ForwardIterator,
2097 typename _UniformRandomNumberGenerator>
2099 __generate(_ForwardIterator __f, _ForwardIterator __t,
2100 _UniformRandomNumberGenerator& __urng)
2101 { this->__generate(__f, __t, __urng, _M_param); }
2103 template<
typename _ForwardIterator,
2104 typename _UniformRandomNumberGenerator>
2106 __generate(_ForwardIterator __f, _ForwardIterator __t,
2107 _UniformRandomNumberGenerator& __urng,
2108 const param_type& __p)
2109 { this->__generate_impl(__f, __t, __urng, __p); }
2111 template<
typename _UniformRandomNumberGenerator>
2114 _UniformRandomNumberGenerator& __urng,
2115 const param_type& __p)
2116 { this->__generate_impl(__f, __t, __urng, __p); }
2123 template<
typename _RealType1>
2138 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2153 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2159 template<
typename _ForwardIterator,
2160 typename _UniformRandomNumberGenerator>
2162 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2163 _UniformRandomNumberGenerator& __urng,
2168 bool _M_saved_available =
false;
2174 template<
typename _RealType>
2178 {
return !(__d1 == __d2); }
2190 template<
typename _RealType =
double>
2194 "result_type must be a floating point type");
2208 param_type(_RealType __m, _RealType __s = _RealType(1))
2209 : _M_m(__m), _M_s(__s)
2222 {
return __p1._M_m == __p2._M_m && __p1._M_s == __p2._M_s; }
2226 {
return !(__p1 == __p2); }
2237 : _M_param(__m, __s), _M_nd()
2241 lognormal_distribution(
const param_type& __p)
2242 : _M_param(__p), _M_nd()
2257 {
return _M_param.m(); }
2261 {
return _M_param.s(); }
2268 {
return _M_param; }
2276 { _M_param = __param; }
2295 template<
typename _UniformRandomNumberGenerator>
2298 {
return this->
operator()(__urng, _M_param); }
2300 template<
typename _UniformRandomNumberGenerator>
2302 operator()(_UniformRandomNumberGenerator& __urng,
2303 const param_type& __p)
2304 {
return std::exp(__p.s() * _M_nd(__urng) + __p.m()); }
2306 template<
typename _ForwardIterator,
2307 typename _UniformRandomNumberGenerator>
2309 __generate(_ForwardIterator __f, _ForwardIterator __t,
2310 _UniformRandomNumberGenerator& __urng)
2311 { this->__generate(__f, __t, __urng, _M_param); }
2313 template<
typename _ForwardIterator,
2314 typename _UniformRandomNumberGenerator>
2316 __generate(_ForwardIterator __f, _ForwardIterator __t,
2317 _UniformRandomNumberGenerator& __urng,
2318 const param_type& __p)
2319 { this->__generate_impl(__f, __t, __urng, __p); }
2321 template<
typename _UniformRandomNumberGenerator>
2324 _UniformRandomNumberGenerator& __urng,
2325 const param_type& __p)
2326 { this->__generate_impl(__f, __t, __urng, __p); }
2336 {
return (__d1._M_param == __d2._M_param
2337 && __d1._M_nd == __d2._M_nd); }
2349 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2364 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2370 template<
typename _ForwardIterator,
2371 typename _UniformRandomNumberGenerator>
2373 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2374 _UniformRandomNumberGenerator& __urng,
2385 template<
typename _RealType>
2389 {
return !(__d1 == __d2); }
2401 template<
typename _RealType =
double>
2405 "result_type must be a floating point type");
2420 param_type(_RealType __alpha_val, _RealType __beta_val = _RealType(1))
2421 : _M_alpha(__alpha_val), _M_beta(__beta_val)
2423 __glibcxx_assert(_M_alpha > _RealType(0));
2429 {
return _M_alpha; }
2437 {
return (__p1._M_alpha == __p2._M_alpha
2438 && __p1._M_beta == __p2._M_beta); }
2442 {
return !(__p1 == __p2); }
2451 _RealType _M_malpha, _M_a2;
2466 _RealType __beta_val = _RealType(1))
2467 : _M_param(__alpha_val, __beta_val), _M_nd()
2472 : _M_param(__p), _M_nd()
2487 {
return _M_param.alpha(); }
2494 {
return _M_param.beta(); }
2501 {
return _M_param; }
2509 { _M_param = __param; }
2528 template<
typename _UniformRandomNumberGenerator>
2531 {
return this->
operator()(__urng, _M_param); }
2533 template<
typename _UniformRandomNumberGenerator>
2535 operator()(_UniformRandomNumberGenerator& __urng,
2536 const param_type& __p);
2538 template<
typename _ForwardIterator,
2539 typename _UniformRandomNumberGenerator>
2541 __generate(_ForwardIterator __f, _ForwardIterator __t,
2542 _UniformRandomNumberGenerator& __urng)
2543 { this->__generate(__f, __t, __urng, _M_param); }
2545 template<
typename _ForwardIterator,
2546 typename _UniformRandomNumberGenerator>
2548 __generate(_ForwardIterator __f, _ForwardIterator __t,
2549 _UniformRandomNumberGenerator& __urng,
2550 const param_type& __p)
2551 { this->__generate_impl(__f, __t, __urng, __p); }
2553 template<
typename _UniformRandomNumberGenerator>
2556 _UniformRandomNumberGenerator& __urng,
2557 const param_type& __p)
2558 { this->__generate_impl(__f, __t, __urng, __p); }
2568 {
return (__d1._M_param == __d2._M_param
2569 && __d1._M_nd == __d2._M_nd); }
2581 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2595 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2601 template<
typename _ForwardIterator,
2602 typename _UniformRandomNumberGenerator>
2604 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2605 _UniformRandomNumberGenerator& __urng,
2616 template<
typename _RealType>
2620 {
return !(__d1 == __d2); }
2629 template<
typename _RealType =
double>
2633 "result_type must be a floating point type");
2657 {
return __p1._M_n == __p2._M_n; }
2661 {
return !(__p1 == __p2); }
2671 : _M_param(__n), _M_gd(__n / 2)
2675 chi_squared_distribution(
const param_type& __p)
2676 : _M_param(__p), _M_gd(__p.n() / 2)
2691 {
return _M_param.n(); }
2698 {
return _M_param; }
2730 template<
typename _UniformRandomNumberGenerator>
2733 {
return 2 * _M_gd(__urng); }
2735 template<
typename _UniformRandomNumberGenerator>
2737 operator()(_UniformRandomNumberGenerator& __urng,
2738 const param_type& __p)
2742 return 2 * _M_gd(__urng, param_type(__p.n() / 2));
2745 template<
typename _ForwardIterator,
2746 typename _UniformRandomNumberGenerator>
2748 __generate(_ForwardIterator __f, _ForwardIterator __t,
2749 _UniformRandomNumberGenerator& __urng)
2750 { this->__generate_impl(__f, __t, __urng); }
2752 template<
typename _ForwardIterator,
2753 typename _UniformRandomNumberGenerator>
2755 __generate(_ForwardIterator __f, _ForwardIterator __t,
2756 _UniformRandomNumberGenerator& __urng,
2757 const param_type& __p)
2760 this->__generate_impl(__f, __t, __urng, __p2); }
2762 template<
typename _UniformRandomNumberGenerator>
2765 _UniformRandomNumberGenerator& __urng)
2766 { this->__generate_impl(__f, __t, __urng); }
2768 template<
typename _UniformRandomNumberGenerator>
2771 _UniformRandomNumberGenerator& __urng,
2772 const param_type& __p)
2775 this->__generate_impl(__f, __t, __urng, __p2); }
2785 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
2797 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2812 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2818 template<
typename _ForwardIterator,
2819 typename _UniformRandomNumberGenerator>
2821 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2822 _UniformRandomNumberGenerator& __urng);
2824 template<
typename _ForwardIterator,
2825 typename _UniformRandomNumberGenerator>
2827 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2828 _UniformRandomNumberGenerator& __urng,
2840 template<
typename _RealType>
2844 {
return !(__d1 == __d2); }
2853 template<
typename _RealType =
double>
2857 "result_type must be a floating point type");
2871 param_type(_RealType __a, _RealType __b = _RealType(1))
2872 : _M_a(__a), _M_b(__b)
2885 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
2889 {
return !(__p1 == __p2); }
2900 : _M_param(__a, __b)
2904 cauchy_distribution(
const param_type& __p)
2920 {
return _M_param.a(); }
2924 {
return _M_param.b(); }
2931 {
return _M_param; }
2939 { _M_param = __param; }
2958 template<
typename _UniformRandomNumberGenerator>
2961 {
return this->
operator()(__urng, _M_param); }
2963 template<
typename _UniformRandomNumberGenerator>
2965 operator()(_UniformRandomNumberGenerator& __urng,
2966 const param_type& __p);
2968 template<
typename _ForwardIterator,
2969 typename _UniformRandomNumberGenerator>
2971 __generate(_ForwardIterator __f, _ForwardIterator __t,
2972 _UniformRandomNumberGenerator& __urng)
2973 { this->__generate(__f, __t, __urng, _M_param); }
2975 template<
typename _ForwardIterator,
2976 typename _UniformRandomNumberGenerator>
2978 __generate(_ForwardIterator __f, _ForwardIterator __t,
2979 _UniformRandomNumberGenerator& __urng,
2980 const param_type& __p)
2981 { this->__generate_impl(__f, __t, __urng, __p); }
2983 template<
typename _UniformRandomNumberGenerator>
2986 _UniformRandomNumberGenerator& __urng,
2987 const param_type& __p)
2988 { this->__generate_impl(__f, __t, __urng, __p); }
2997 {
return __d1._M_param == __d2._M_param; }
3000 template<
typename _ForwardIterator,
3001 typename _UniformRandomNumberGenerator>
3003 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3004 _UniformRandomNumberGenerator& __urng,
3005 const param_type& __p);
3007 param_type _M_param;
3014 template<
typename _RealType>
3018 {
return !(__d1 == __d2); }
3030 template<
typename _RealType,
typename _CharT,
typename _Traits>
3045 template<
typename _RealType,
typename _CharT,
typename _Traits>
3061 template<
typename _RealType =
double>
3065 "result_type must be a floating point type");
3079 param_type(_RealType __m, _RealType __n = _RealType(1))
3080 : _M_m(__m), _M_n(__n)
3093 {
return __p1._M_m == __p2._M_m && __p1._M_n == __p2._M_n; }
3097 {
return !(__p1 == __p2); }
3108 _RealType __n = _RealType(1))
3109 : _M_param(__m, __n), _M_gd_x(__m / 2), _M_gd_y(__n / 2)
3113 fisher_f_distribution(
const param_type& __p)
3114 : _M_param(__p), _M_gd_x(__p.m() / 2), _M_gd_y(__p.n() / 2)
3132 {
return _M_param.m(); }
3136 {
return _M_param.n(); }
3143 {
return _M_param; }
3151 { _M_param = __param; }
3170 template<
typename _UniformRandomNumberGenerator>
3173 {
return (_M_gd_x(__urng) * n()) / (_M_gd_y(__urng) * m()); }
3175 template<
typename _UniformRandomNumberGenerator>
3177 operator()(_UniformRandomNumberGenerator& __urng,
3178 const param_type& __p)
3182 return ((_M_gd_x(__urng, param_type(__p.m() / 2)) * n())
3183 / (_M_gd_y(__urng, param_type(__p.n() / 2)) * m()));
3186 template<
typename _ForwardIterator,
3187 typename _UniformRandomNumberGenerator>
3189 __generate(_ForwardIterator __f, _ForwardIterator __t,
3190 _UniformRandomNumberGenerator& __urng)
3191 { this->__generate_impl(__f, __t, __urng); }
3193 template<
typename _ForwardIterator,
3194 typename _UniformRandomNumberGenerator>
3196 __generate(_ForwardIterator __f, _ForwardIterator __t,
3197 _UniformRandomNumberGenerator& __urng,
3198 const param_type& __p)
3199 { this->__generate_impl(__f, __t, __urng, __p); }
3201 template<
typename _UniformRandomNumberGenerator>
3204 _UniformRandomNumberGenerator& __urng)
3205 { this->__generate_impl(__f, __t, __urng); }
3207 template<
typename _UniformRandomNumberGenerator>
3210 _UniformRandomNumberGenerator& __urng,
3211 const param_type& __p)
3212 { this->__generate_impl(__f, __t, __urng, __p); }
3222 {
return (__d1._M_param == __d2._M_param
3223 && __d1._M_gd_x == __d2._M_gd_x
3224 && __d1._M_gd_y == __d2._M_gd_y); }
3236 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3251 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3257 template<
typename _ForwardIterator,
3258 typename _UniformRandomNumberGenerator>
3260 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3261 _UniformRandomNumberGenerator& __urng);
3263 template<
typename _ForwardIterator,
3264 typename _UniformRandomNumberGenerator>
3266 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3267 _UniformRandomNumberGenerator& __urng,
3278 template<
typename _RealType>
3282 {
return !(__d1 == __d2); }
3293 template<
typename _RealType =
double>
3297 "result_type must be a floating point type");
3321 {
return __p1._M_n == __p2._M_n; }
3325 {
return !(__p1 == __p2); }
3335 : _M_param(__n), _M_nd(), _M_gd(__n / 2, 2)
3339 student_t_distribution(
const param_type& __p)
3340 : _M_param(__p), _M_nd(), _M_gd(__p.n() / 2, 2)
3358 {
return _M_param.n(); }
3365 {
return _M_param; }
3373 { _M_param = __param; }
3392 template<
typename _UniformRandomNumberGenerator>
3395 {
return _M_nd(__urng) *
std::sqrt(n() / _M_gd(__urng)); }
3397 template<
typename _UniformRandomNumberGenerator>
3399 operator()(_UniformRandomNumberGenerator& __urng,
3400 const param_type& __p)
3405 const result_type __g = _M_gd(__urng, param_type(__p.n() / 2, 2));
3406 return _M_nd(__urng) *
std::sqrt(__p.n() / __g);
3409 template<
typename _ForwardIterator,
3410 typename _UniformRandomNumberGenerator>
3412 __generate(_ForwardIterator __f, _ForwardIterator __t,
3413 _UniformRandomNumberGenerator& __urng)
3414 { this->__generate_impl(__f, __t, __urng); }
3416 template<
typename _ForwardIterator,
3417 typename _UniformRandomNumberGenerator>
3419 __generate(_ForwardIterator __f, _ForwardIterator __t,
3420 _UniformRandomNumberGenerator& __urng,
3421 const param_type& __p)
3422 { this->__generate_impl(__f, __t, __urng, __p); }
3424 template<
typename _UniformRandomNumberGenerator>
3427 _UniformRandomNumberGenerator& __urng)
3428 { this->__generate_impl(__f, __t, __urng); }
3430 template<
typename _UniformRandomNumberGenerator>
3433 _UniformRandomNumberGenerator& __urng,
3434 const param_type& __p)
3435 { this->__generate_impl(__f, __t, __urng, __p); }
3445 {
return (__d1._M_param == __d2._M_param
3446 && __d1._M_nd == __d2._M_nd && __d1._M_gd == __d2._M_gd); }
3458 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3473 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3479 template<
typename _ForwardIterator,
3480 typename _UniformRandomNumberGenerator>
3482 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3483 _UniformRandomNumberGenerator& __urng);
3484 template<
typename _ForwardIterator,
3485 typename _UniformRandomNumberGenerator>
3487 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3488 _UniformRandomNumberGenerator& __urng,
3500 template<
typename _RealType>
3504 {
return !(__d1 == __d2); }
3538 __glibcxx_assert((_M_p >= 0.0) && (_M_p <= 1.0));
3547 {
return __p1._M_p == __p2._M_p; }
3551 {
return !(__p1 == __p2); }
3592 {
return _M_param.p(); }
3599 {
return _M_param; }
3607 { _M_param = __param; }
3626 template<
typename _UniformRandomNumberGenerator>
3629 {
return this->
operator()(__urng, _M_param); }
3631 template<
typename _UniformRandomNumberGenerator>
3633 operator()(_UniformRandomNumberGenerator& __urng,
3634 const param_type& __p)
3636 __detail::_Adaptor<_UniformRandomNumberGenerator, double>
3638 if ((__aurng() - __aurng.min())
3639 < __p.p() * (__aurng.max() - __aurng.min()))
3644 template<
typename _ForwardIterator,
3645 typename _UniformRandomNumberGenerator>
3647 __generate(_ForwardIterator __f, _ForwardIterator __t,
3648 _UniformRandomNumberGenerator& __urng)
3649 { this->__generate(__f, __t, __urng, _M_param); }
3651 template<
typename _ForwardIterator,
3652 typename _UniformRandomNumberGenerator>
3654 __generate(_ForwardIterator __f, _ForwardIterator __t,
3655 _UniformRandomNumberGenerator& __urng,
const param_type& __p)
3656 { this->__generate_impl(__f, __t, __urng, __p); }
3658 template<
typename _UniformRandomNumberGenerator>
3661 _UniformRandomNumberGenerator& __urng,
3662 const param_type& __p)
3663 { this->__generate_impl(__f, __t, __urng, __p); }
3672 {
return __d1._M_param == __d2._M_param; }
3675 template<
typename _ForwardIterator,
3676 typename _UniformRandomNumberGenerator>
3678 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3679 _UniformRandomNumberGenerator& __urng,
3680 const param_type& __p);
3682 param_type _M_param;
3692 {
return !(__d1 == __d2); }
3704 template<
typename _CharT,
typename _Traits>
3718 template<
typename _CharT,
typename _Traits>
3737 template<
typename _IntType =
int>
3741 "result_type must be an integral type");
3757 : _M_t(__t), _M_p(__p)
3759 __glibcxx_assert((_M_t >= _IntType(0))
3775 {
return __p1._M_t == __p2._M_t && __p1._M_p == __p2._M_p; }
3779 {
return !(__p1 == __p2); }
3789 #if _GLIBCXX_USE_C99_MATH_TR1
3790 double _M_d1, _M_d2, _M_s1, _M_s2, _M_c,
3791 _M_a1, _M_a123, _M_s, _M_lf, _M_lp1p;
3802 : _M_param(__t, __p), _M_nd()
3806 binomial_distribution(
const param_type& __p)
3807 : _M_param(__p), _M_nd()
3822 {
return _M_param.t(); }
3829 {
return _M_param.p(); }
3836 {
return _M_param; }
3844 { _M_param = __param; }
3858 {
return _M_param.t(); }
3863 template<
typename _UniformRandomNumberGenerator>
3866 {
return this->
operator()(__urng, _M_param); }
3868 template<
typename _UniformRandomNumberGenerator>
3870 operator()(_UniformRandomNumberGenerator& __urng,
3871 const param_type& __p);
3873 template<
typename _ForwardIterator,
3874 typename _UniformRandomNumberGenerator>
3876 __generate(_ForwardIterator __f, _ForwardIterator __t,
3877 _UniformRandomNumberGenerator& __urng)
3878 { this->__generate(__f, __t, __urng, _M_param); }
3880 template<
typename _ForwardIterator,
3881 typename _UniformRandomNumberGenerator>
3883 __generate(_ForwardIterator __f, _ForwardIterator __t,
3884 _UniformRandomNumberGenerator& __urng,
3885 const param_type& __p)
3886 { this->__generate_impl(__f, __t, __urng, __p); }
3888 template<
typename _UniformRandomNumberGenerator>
3891 _UniformRandomNumberGenerator& __urng,
3892 const param_type& __p)
3893 { this->__generate_impl(__f, __t, __urng, __p); }
3903 #ifdef _GLIBCXX_USE_C99_MATH_TR1
3904 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
3906 {
return __d1._M_param == __d2._M_param; }
3919 template<
typename _IntType1,
3920 typename _CharT,
typename _Traits>
3935 template<
typename _IntType1,
3936 typename _CharT,
typename _Traits>
3942 template<
typename _ForwardIterator,
3943 typename _UniformRandomNumberGenerator>
3945 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3946 _UniformRandomNumberGenerator& __urng,
3949 template<
typename _UniformRandomNumberGenerator>
3951 _M_waiting(_UniformRandomNumberGenerator& __urng,
3952 _IntType __t,
double __q);
3963 template<
typename _IntType>
3967 {
return !(__d1 == __d2); }
3977 template<
typename _IntType =
int>
3981 "result_type must be an integral type");
3999 __glibcxx_assert((_M_p > 0.0) && (_M_p < 1.0));
4009 {
return __p1._M_p == __p2._M_p; }
4013 {
return !(__p1 == __p2); }
4018 { _M_log_1_p =
std::log(1.0 - _M_p); }
4035 geometric_distribution(
const param_type& __p)
4052 {
return _M_param.p(); }
4059 {
return _M_param; }
4067 { _M_param = __param; }
4086 template<
typename _UniformRandomNumberGenerator>
4089 {
return this->
operator()(__urng, _M_param); }
4091 template<
typename _UniformRandomNumberGenerator>
4093 operator()(_UniformRandomNumberGenerator& __urng,
4094 const param_type& __p);
4096 template<
typename _ForwardIterator,
4097 typename _UniformRandomNumberGenerator>
4099 __generate(_ForwardIterator __f, _ForwardIterator __t,
4100 _UniformRandomNumberGenerator& __urng)
4101 { this->__generate(__f, __t, __urng, _M_param); }
4103 template<
typename _ForwardIterator,
4104 typename _UniformRandomNumberGenerator>
4106 __generate(_ForwardIterator __f, _ForwardIterator __t,
4107 _UniformRandomNumberGenerator& __urng,
4108 const param_type& __p)
4109 { this->__generate_impl(__f, __t, __urng, __p); }
4111 template<
typename _UniformRandomNumberGenerator>
4114 _UniformRandomNumberGenerator& __urng,
4115 const param_type& __p)
4116 { this->__generate_impl(__f, __t, __urng, __p); }
4125 {
return __d1._M_param == __d2._M_param; }
4128 template<
typename _ForwardIterator,
4129 typename _UniformRandomNumberGenerator>
4131 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4132 _UniformRandomNumberGenerator& __urng,
4133 const param_type& __p);
4135 param_type _M_param;
4142 template<
typename _IntType>
4146 {
return !(__d1 == __d2); }
4158 template<
typename _IntType,
4159 typename _CharT,
typename _Traits>
4173 template<
typename _IntType,
4174 typename _CharT,
typename _Traits>
4187 template<
typename _IntType =
int>
4191 "result_type must be an integral type");
4206 : _M_k(__k), _M_p(__p)
4208 __glibcxx_assert((_M_k > 0) && (_M_p > 0.0) && (_M_p <= 1.0));
4221 {
return __p1._M_k == __p2._M_k && __p1._M_p == __p2._M_p; }
4225 {
return !(__p1 == __p2); }
4236 : _M_param(__k, __p), _M_gd(__k, (1.0 - __p) / __p)
4240 negative_binomial_distribution(
const param_type& __p)
4241 : _M_param(__p), _M_gd(__p.
k(), (1.0 - __p.
p()) / __p.
p())
4256 {
return _M_param.k(); }
4263 {
return _M_param.p(); }
4270 {
return _M_param; }
4278 { _M_param = __param; }
4297 template<
typename _UniformRandomNumberGenerator>
4299 operator()(_UniformRandomNumberGenerator& __urng);
4301 template<
typename _UniformRandomNumberGenerator>
4303 operator()(_UniformRandomNumberGenerator& __urng,
4304 const param_type& __p);
4306 template<
typename _ForwardIterator,
4307 typename _UniformRandomNumberGenerator>
4309 __generate(_ForwardIterator __f, _ForwardIterator __t,
4310 _UniformRandomNumberGenerator& __urng)
4311 { this->__generate_impl(__f, __t, __urng); }
4313 template<
typename _ForwardIterator,
4314 typename _UniformRandomNumberGenerator>
4316 __generate(_ForwardIterator __f, _ForwardIterator __t,
4317 _UniformRandomNumberGenerator& __urng,
4318 const param_type& __p)
4319 { this->__generate_impl(__f, __t, __urng, __p); }
4321 template<
typename _UniformRandomNumberGenerator>
4324 _UniformRandomNumberGenerator& __urng)
4325 { this->__generate_impl(__f, __t, __urng); }
4327 template<
typename _UniformRandomNumberGenerator>
4330 _UniformRandomNumberGenerator& __urng,
4331 const param_type& __p)
4332 { this->__generate_impl(__f, __t, __urng, __p); }
4342 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
4355 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4370 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4376 template<
typename _ForwardIterator,
4377 typename _UniformRandomNumberGenerator>
4379 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4380 _UniformRandomNumberGenerator& __urng);
4381 template<
typename _ForwardIterator,
4382 typename _UniformRandomNumberGenerator>
4384 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4385 _UniformRandomNumberGenerator& __urng,
4396 template<
typename _IntType>
4400 {
return !(__d1 == __d2); }
4418 template<
typename _IntType =
int>
4422 "result_type must be an integral type");
4440 __glibcxx_assert(_M_mean > 0.0);
4450 {
return __p1._M_mean == __p2._M_mean; }
4454 {
return !(__p1 == __p2); }
4464 #if _GLIBCXX_USE_C99_MATH_TR1
4465 double _M_lfm, _M_sm, _M_d, _M_scx, _M_1cx, _M_c2b, _M_cb;
4475 : _M_param(__mean), _M_nd()
4479 poisson_distribution(
const param_type& __p)
4480 : _M_param(__p), _M_nd()
4495 {
return _M_param.mean(); }
4502 {
return _M_param; }
4510 { _M_param = __param; }
4529 template<
typename _UniformRandomNumberGenerator>
4532 {
return this->
operator()(__urng, _M_param); }
4534 template<
typename _UniformRandomNumberGenerator>
4536 operator()(_UniformRandomNumberGenerator& __urng,
4537 const param_type& __p);
4539 template<
typename _ForwardIterator,
4540 typename _UniformRandomNumberGenerator>
4542 __generate(_ForwardIterator __f, _ForwardIterator __t,
4543 _UniformRandomNumberGenerator& __urng)
4544 { this->__generate(__f, __t, __urng, _M_param); }
4546 template<
typename _ForwardIterator,
4547 typename _UniformRandomNumberGenerator>
4549 __generate(_ForwardIterator __f, _ForwardIterator __t,
4550 _UniformRandomNumberGenerator& __urng,
4551 const param_type& __p)
4552 { this->__generate_impl(__f, __t, __urng, __p); }
4554 template<
typename _UniformRandomNumberGenerator>
4557 _UniformRandomNumberGenerator& __urng,
4558 const param_type& __p)
4559 { this->__generate_impl(__f, __t, __urng, __p); }
4569 #ifdef _GLIBCXX_USE_C99_MATH_TR1
4570 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
4572 {
return __d1._M_param == __d2._M_param; }
4585 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4600 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4606 template<
typename _ForwardIterator,
4607 typename _UniformRandomNumberGenerator>
4609 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4610 _UniformRandomNumberGenerator& __urng,
4622 template<
typename _IntType>
4626 {
return !(__d1 == __d2); }
4644 template<
typename _RealType =
double>
4648 "result_type must be a floating point type");
4663 : _M_lambda(__lambda)
4665 __glibcxx_assert(_M_lambda > _RealType(0));
4670 {
return _M_lambda; }
4674 {
return __p1._M_lambda == __p2._M_lambda; }
4678 {
return !(__p1 == __p2); }
4681 _RealType _M_lambda;
4697 : _M_param(__lambda)
4718 {
return _M_param.lambda(); }
4725 {
return _M_param; }
4733 { _M_param = __param; }
4752 template<
typename _UniformRandomNumberGenerator>
4755 {
return this->
operator()(__urng, _M_param); }
4757 template<
typename _UniformRandomNumberGenerator>
4759 operator()(_UniformRandomNumberGenerator& __urng,
4760 const param_type& __p)
4762 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
4767 template<
typename _ForwardIterator,
4768 typename _UniformRandomNumberGenerator>
4770 __generate(_ForwardIterator __f, _ForwardIterator __t,
4771 _UniformRandomNumberGenerator& __urng)
4772 { this->__generate(__f, __t, __urng, _M_param); }
4774 template<
typename _ForwardIterator,
4775 typename _UniformRandomNumberGenerator>
4777 __generate(_ForwardIterator __f, _ForwardIterator __t,
4778 _UniformRandomNumberGenerator& __urng,
4779 const param_type& __p)
4780 { this->__generate_impl(__f, __t, __urng, __p); }
4782 template<
typename _UniformRandomNumberGenerator>
4785 _UniformRandomNumberGenerator& __urng,
4786 const param_type& __p)
4787 { this->__generate_impl(__f, __t, __urng, __p); }
4796 {
return __d1._M_param == __d2._M_param; }
4799 template<
typename _ForwardIterator,
4800 typename _UniformRandomNumberGenerator>
4802 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4803 _UniformRandomNumberGenerator& __urng,
4804 const param_type& __p);
4806 param_type _M_param;
4813 template<
typename _RealType>
4817 {
return !(__d1 == __d2); }
4829 template<
typename _RealType,
typename _CharT,
typename _Traits>
4844 template<
typename _RealType,
typename _CharT,
typename _Traits>
4859 template<
typename _RealType =
double>
4863 "result_type must be a floating point type");
4877 param_type(_RealType __a, _RealType __b = _RealType(1.0))
4878 : _M_a(__a), _M_b(__b)
4891 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
4895 {
return !(__p1 == __p2); }
4906 : _M_param(__a, __b)
4910 weibull_distribution(
const param_type& __p)
4926 {
return _M_param.a(); }
4933 {
return _M_param.b(); }
4940 {
return _M_param; }
4948 { _M_param = __param; }
4967 template<
typename _UniformRandomNumberGenerator>
4970 {
return this->
operator()(__urng, _M_param); }
4972 template<
typename _UniformRandomNumberGenerator>
4974 operator()(_UniformRandomNumberGenerator& __urng,
4975 const param_type& __p);
4977 template<
typename _ForwardIterator,
4978 typename _UniformRandomNumberGenerator>
4980 __generate(_ForwardIterator __f, _ForwardIterator __t,
4981 _UniformRandomNumberGenerator& __urng)
4982 { this->__generate(__f, __t, __urng, _M_param); }
4984 template<
typename _ForwardIterator,
4985 typename _UniformRandomNumberGenerator>
4987 __generate(_ForwardIterator __f, _ForwardIterator __t,
4988 _UniformRandomNumberGenerator& __urng,
4989 const param_type& __p)
4990 { this->__generate_impl(__f, __t, __urng, __p); }
4992 template<
typename _UniformRandomNumberGenerator>
4995 _UniformRandomNumberGenerator& __urng,
4996 const param_type& __p)
4997 { this->__generate_impl(__f, __t, __urng, __p); }
5006 {
return __d1._M_param == __d2._M_param; }
5009 template<
typename _ForwardIterator,
5010 typename _UniformRandomNumberGenerator>
5012 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5013 _UniformRandomNumberGenerator& __urng,
5014 const param_type& __p);
5016 param_type _M_param;
5023 template<
typename _RealType>
5027 {
return !(__d1 == __d2); }
5039 template<
typename _RealType,
typename _CharT,
typename _Traits>
5054 template<
typename _RealType,
typename _CharT,
typename _Traits>
5069 template<
typename _RealType =
double>
5073 "result_type must be a floating point type");
5087 param_type(_RealType __a, _RealType __b = _RealType(1.0))
5088 : _M_a(__a), _M_b(__b)
5101 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
5105 {
return !(__p1 == __p2); }
5116 : _M_param(__a, __b)
5120 extreme_value_distribution(
const param_type& __p)
5136 {
return _M_param.a(); }
5143 {
return _M_param.b(); }
5150 {
return _M_param; }
5158 { _M_param = __param; }
5177 template<
typename _UniformRandomNumberGenerator>
5180 {
return this->
operator()(__urng, _M_param); }
5182 template<
typename _UniformRandomNumberGenerator>
5184 operator()(_UniformRandomNumberGenerator& __urng,
5185 const param_type& __p);
5187 template<
typename _ForwardIterator,
5188 typename _UniformRandomNumberGenerator>
5190 __generate(_ForwardIterator __f, _ForwardIterator __t,
5191 _UniformRandomNumberGenerator& __urng)
5192 { this->__generate(__f, __t, __urng, _M_param); }
5194 template<
typename _ForwardIterator,
5195 typename _UniformRandomNumberGenerator>
5197 __generate(_ForwardIterator __f, _ForwardIterator __t,
5198 _UniformRandomNumberGenerator& __urng,
5199 const param_type& __p)
5200 { this->__generate_impl(__f, __t, __urng, __p); }
5202 template<
typename _UniformRandomNumberGenerator>
5205 _UniformRandomNumberGenerator& __urng,
5206 const param_type& __p)
5207 { this->__generate_impl(__f, __t, __urng, __p); }
5216 {
return __d1._M_param == __d2._M_param; }
5219 template<
typename _ForwardIterator,
5220 typename _UniformRandomNumberGenerator>
5222 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5223 _UniformRandomNumberGenerator& __urng,
5224 const param_type& __p);
5226 param_type _M_param;
5233 template<
typename _RealType>
5237 {
return !(__d1 == __d2); }
5249 template<
typename _RealType,
typename _CharT,
typename _Traits>
5264 template<
typename _RealType,
typename _CharT,
typename _Traits>
5276 template<
typename _IntType =
int>
5280 "result_type must be an integral type");
5293 : _M_prob(), _M_cp()
5296 template<
typename _InputIterator>
5298 _InputIterator __wend)
5299 : _M_prob(__wbegin, __wend), _M_cp()
5300 { _M_initialize(); }
5303 : _M_prob(__wil.begin(), __wil.end()), _M_cp()
5304 { _M_initialize(); }
5306 template<
typename _Func>
5307 param_type(
size_t __nw,
double __xmin,
double __xmax,
5315 probabilities()
const
5320 {
return __p1._M_prob == __p2._M_prob; }
5324 {
return !(__p1 == __p2); }
5338 template<
typename _InputIterator>
5340 _InputIterator __wend)
5341 : _M_param(__wbegin, __wend)
5344 discrete_distribution(initializer_list<double> __wl)
5348 template<
typename _Func>
5349 discrete_distribution(
size_t __nw,
double __xmin,
double __xmax,
5351 : _M_param(__nw, __xmin, __xmax, __fw)
5355 discrete_distribution(
const param_type& __p)
5372 return _M_param._M_prob.
empty()
5381 {
return _M_param; }
5389 { _M_param = __param; }
5404 return _M_param._M_prob.
empty()
5411 template<
typename _UniformRandomNumberGenerator>
5414 {
return this->
operator()(__urng, _M_param); }
5416 template<
typename _UniformRandomNumberGenerator>
5418 operator()(_UniformRandomNumberGenerator& __urng,
5419 const param_type& __p);
5421 template<
typename _ForwardIterator,
5422 typename _UniformRandomNumberGenerator>
5424 __generate(_ForwardIterator __f, _ForwardIterator __t,
5425 _UniformRandomNumberGenerator& __urng)
5426 { this->__generate(__f, __t, __urng, _M_param); }
5428 template<
typename _ForwardIterator,
5429 typename _UniformRandomNumberGenerator>
5431 __generate(_ForwardIterator __f, _ForwardIterator __t,
5432 _UniformRandomNumberGenerator& __urng,
5433 const param_type& __p)
5434 { this->__generate_impl(__f, __t, __urng, __p); }
5436 template<
typename _UniformRandomNumberGenerator>
5439 _UniformRandomNumberGenerator& __urng,
5440 const param_type& __p)
5441 { this->__generate_impl(__f, __t, __urng, __p); }
5450 {
return __d1._M_param == __d2._M_param; }
5462 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5478 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5484 template<
typename _ForwardIterator,
5485 typename _UniformRandomNumberGenerator>
5487 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5488 _UniformRandomNumberGenerator& __urng,
5498 template<
typename _IntType>
5502 {
return !(__d1 == __d2); }
5511 template<
typename _RealType =
double>
5515 "result_type must be a floating point type");
5528 : _M_int(), _M_den(), _M_cp()
5531 template<
typename _InputIteratorB,
typename _InputIteratorW>
5533 _InputIteratorB __bend,
5534 _InputIteratorW __wbegin);
5536 template<
typename _Func>
5539 template<
typename _Func>
5540 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5553 __tmp[1] = _RealType(1);
5566 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
5570 {
return !(__p1 == __p2); }
5585 template<
typename _InputIteratorB,
typename _InputIteratorW>
5587 _InputIteratorB __bend,
5588 _InputIteratorW __wbegin)
5589 : _M_param(__bfirst, __bend, __wbegin)
5592 template<
typename _Func>
5593 piecewise_constant_distribution(initializer_list<_RealType> __bl,
5595 : _M_param(__bl, __fw)
5598 template<
typename _Func>
5599 piecewise_constant_distribution(
size_t __nw,
5600 _RealType __xmin, _RealType __xmax,
5602 : _M_param(__nw, __xmin, __xmax, __fw)
5606 piecewise_constant_distribution(
const param_type& __p)
5623 if (_M_param._M_int.
empty())
5626 __tmp[1] = _RealType(1);
5630 return _M_param._M_int;
5639 return _M_param._M_den.
empty()
5648 {
return _M_param; }
5656 { _M_param = __param; }
5664 return _M_param._M_int.
empty()
5674 return _M_param._M_int.
empty()
5681 template<
typename _UniformRandomNumberGenerator>
5684 {
return this->
operator()(__urng, _M_param); }
5686 template<
typename _UniformRandomNumberGenerator>
5688 operator()(_UniformRandomNumberGenerator& __urng,
5689 const param_type& __p);
5691 template<
typename _ForwardIterator,
5692 typename _UniformRandomNumberGenerator>
5694 __generate(_ForwardIterator __f, _ForwardIterator __t,
5695 _UniformRandomNumberGenerator& __urng)
5696 { this->__generate(__f, __t, __urng, _M_param); }
5698 template<
typename _ForwardIterator,
5699 typename _UniformRandomNumberGenerator>
5701 __generate(_ForwardIterator __f, _ForwardIterator __t,
5702 _UniformRandomNumberGenerator& __urng,
5703 const param_type& __p)
5704 { this->__generate_impl(__f, __t, __urng, __p); }
5706 template<
typename _UniformRandomNumberGenerator>
5709 _UniformRandomNumberGenerator& __urng,
5710 const param_type& __p)
5711 { this->__generate_impl(__f, __t, __urng, __p); }
5720 {
return __d1._M_param == __d2._M_param; }
5733 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5749 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5755 template<
typename _ForwardIterator,
5756 typename _UniformRandomNumberGenerator>
5758 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5759 _UniformRandomNumberGenerator& __urng,
5769 template<
typename _RealType>
5773 {
return !(__d1 == __d2); }
5782 template<
typename _RealType =
double>
5786 "result_type must be a floating point type");
5799 : _M_int(), _M_den(), _M_cp(), _M_m()
5802 template<
typename _InputIteratorB,
typename _InputIteratorW>
5804 _InputIteratorB __bend,
5805 _InputIteratorW __wbegin);
5807 template<
typename _Func>
5810 template<
typename _Func>
5811 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5824 __tmp[1] = _RealType(1);
5837 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
5841 {
return !(__p1 == __p2); }
5857 template<
typename _InputIteratorB,
typename _InputIteratorW>
5859 _InputIteratorB __bend,
5860 _InputIteratorW __wbegin)
5861 : _M_param(__bfirst, __bend, __wbegin)
5864 template<
typename _Func>
5865 piecewise_linear_distribution(initializer_list<_RealType> __bl,
5867 : _M_param(__bl, __fw)
5870 template<
typename _Func>
5871 piecewise_linear_distribution(
size_t __nw,
5872 _RealType __xmin, _RealType __xmax,
5874 : _M_param(__nw, __xmin, __xmax, __fw)
5878 piecewise_linear_distribution(
const param_type& __p)
5895 if (_M_param._M_int.
empty())
5898 __tmp[1] = _RealType(1);
5902 return _M_param._M_int;
5912 return _M_param._M_den.
empty()
5921 {
return _M_param; }
5929 { _M_param = __param; }
5937 return _M_param._M_int.
empty()
5947 return _M_param._M_int.
empty()
5954 template<
typename _UniformRandomNumberGenerator>
5957 {
return this->
operator()(__urng, _M_param); }
5959 template<
typename _UniformRandomNumberGenerator>
5961 operator()(_UniformRandomNumberGenerator& __urng,
5962 const param_type& __p);
5964 template<
typename _ForwardIterator,
5965 typename _UniformRandomNumberGenerator>
5967 __generate(_ForwardIterator __f, _ForwardIterator __t,
5968 _UniformRandomNumberGenerator& __urng)
5969 { this->__generate(__f, __t, __urng, _M_param); }
5971 template<
typename _ForwardIterator,
5972 typename _UniformRandomNumberGenerator>
5974 __generate(_ForwardIterator __f, _ForwardIterator __t,
5975 _UniformRandomNumberGenerator& __urng,
5976 const param_type& __p)
5977 { this->__generate_impl(__f, __t, __urng, __p); }
5979 template<
typename _UniformRandomNumberGenerator>
5982 _UniformRandomNumberGenerator& __urng,
5983 const param_type& __p)
5984 { this->__generate_impl(__f, __t, __urng, __p); }
5993 {
return __d1._M_param == __d2._M_param; }
6006 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6022 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6028 template<
typename _ForwardIterator,
6029 typename _UniformRandomNumberGenerator>
6031 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6032 _UniformRandomNumberGenerator& __urng,
6042 template<
typename _RealType>
6046 {
return !(__d1 == __d2); }
6074 template<
typename _IntType,
typename = _Require<is_
integral<_IntType>>>
6077 template<
typename _InputIterator>
6078 seed_seq(_InputIterator __begin, _InputIterator __end);
6081 template<
typename _RandomAccessIterator>
6083 generate(_RandomAccessIterator __begin, _RandomAccessIterator __end);
6086 size_t size() const noexcept
6087 {
return _M_v.
size(); }
6089 template<
typename _OutputIterator>
6091 param(_OutputIterator __dest)
const
6092 { std::copy(_M_v.
begin(), _M_v.
end(), __dest); }
6106 _GLIBCXX_END_NAMESPACE_VERSION
complex< _Tp > log(const complex< _Tp > &)
Return complex natural logarithm of z.
complex< _Tp > exp(const complex< _Tp > &)
Return complex base e exponential of z.
complex< _Tp > sqrt(const complex< _Tp > &)
Return complex square root of z.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
constexpr const _Tp & max(const _Tp &, const _Tp &)
This does what you think it does.
constexpr const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
_RealType generate_canonical(_UniformRandomNumberGenerator &__g)
A function template for converting the output of a (integral) uniform random number generator to a fl...
__gnu_cxx::__promote_2< _Tpa, _Tpb >::__type beta(_Tpa __a, _Tpb __b)
linear_congruential_engine< uint_fast32_t, 48271UL, 0UL, 2147483647UL > minstd_rand
linear_congruential_engine< uint_fast32_t, 16807UL, 0UL, 2147483647UL > minstd_rand0
mersenne_twister_engine< uint_fast32_t, 32, 624, 397, 31, 0x9908b0dfUL, 11, 0xffffffffUL, 7, 0x9d2c5680UL, 15, 0xefc60000UL, 18, 1812433253UL > mt19937
mersenne_twister_engine< uint_fast64_t, 64, 312, 156, 31, 0xb5026f5aa96619e9ULL, 29, 0x5555555555555555ULL, 17, 0x71d67fffeda60000ULL, 37, 0xfff7eee000000000ULL, 43, 6364136223846793005ULL > mt19937_64
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.
ISO C++ entities toplevel namespace is std.
std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, bitset< _Nb > &__x)
Global I/O operators for bitsets.
std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const bitset< _Nb > &__x)
Global I/O operators for bitsets.
constexpr int __lg(int __n)
This is a helper function for the sort routines and for random.tcc.
Template class basic_istream.
Template class basic_ostream.
Properties of fundamental types.
static constexpr _Tp max() noexcept
static constexpr _Tp lowest() noexcept
static constexpr _Tp min() noexcept
Define a member typedef type only if a boolean constant is true.
A model of a linear congruential random number generator.
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(result_type __s)
Constructs a linear_congruential_engine random number generator engine with seed __s....
linear_congruential_engine(_Sseq &__q)
Constructs a linear_congruential_engine random number generator engine seeded from the seed sequence ...
static constexpr result_type min()
Gets the smallest possible value in the output range.
static constexpr result_type multiplier
void discard(unsigned long long __z)
Discard a sequence of random numbers.
linear_congruential_engine()
Constructs a linear_congruential_engine random number generator engine with seed 1.
void seed(result_type __s=default_seed)
Reseeds the linear_congruential_engine random number generator engine sequence to the seed __s.
_If_seed_seq< _Sseq > seed(_Sseq &__q)
Reseeds the linear_congruential_engine random number generator engine sequence using values from the ...
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.
static constexpr result_type increment
result_type operator()()
Gets the next random number in the sequence.
static constexpr result_type max()
Gets the largest possible value in the output range.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::linear_congruential_engine< _UIntType1, __a1, __c1, __m1 > &__lcr)
Writes the textual representation of the state x(i) of x to __os.
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 discard(unsigned long long __z)
Discard a sequence of random numbers.
mersenne_twister_engine(_Sseq &__q)
Constructs a mersenne_twister_engine random number generator engine seeded from the seed sequence __q...
static constexpr result_type max()
Gets the largest possible value in the output range.
friend bool operator==(const mersenne_twister_engine &__lhs, const mersenne_twister_engine &__rhs)
Compares two % mersenne_twister_engine random number generator objects of the same type for equality.
static constexpr result_type min()
Gets the smallest possible value in the output range.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::mersenne_twister_engine< _UIntType1, __w1, __n1, __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1, __l1, __f1 > &__x)
Inserts the current state of a % mersenne_twister_engine random number generator engine __x into the ...
The Marsaglia-Zaman generator.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::subtract_with_carry_engine< _UIntType1, __w1, __s1, __r1 > &__x)
Extracts the current state of a % subtract_with_carry_engine random number generator engine __x from ...
void seed(result_type __sd=default_seed)
Seeds the initial state of the random number generator.
subtract_with_carry_engine(result_type __sd)
Constructs an explicitly seeded subtract_with_carry_engine random number generator.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
result_type operator()()
Gets the next random number in the sequence.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::subtract_with_carry_engine< _UIntType1, __w1, __s1, __r1 > &__x)
Inserts the current state of a % subtract_with_carry_engine random number generator engine __x into t...
static constexpr result_type min()
Gets the inclusive minimum value of the range of random integers returned by this generator.
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...
_If_seed_seq< _Sseq > seed(_Sseq &__q)
Seeds the initial state of the % subtract_with_carry_engine random number generator.
subtract_with_carry_engine(_Sseq &__q)
Constructs a subtract_with_carry_engine random number engine seeded from the seed sequence __q.
static constexpr result_type max()
Gets the inclusive maximum value of the range of random integers returned by this generator.
_If_seed_seq< _Sseq > seed(_Sseq &__q)
Reseeds the discard_block_engine object with the given seed sequence.
void seed(result_type __s)
Reseeds the discard_block_engine object with the default seed for the underlying base class generator...
static constexpr result_type min()
Gets the minimum value in the generated random number range.
void seed()
Reseeds the discard_block_engine object with the default seed for the underlying base class generator...
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine object.
discard_block_engine(const _RandomNumberEngine &__rng)
Copy constructs a discard_block_engine engine.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::discard_block_engine< _RandomNumberEngine1, __p1, __r1 > &__x)
Extracts the current state of a % subtract_with_carry_engine random number generator engine __x from ...
discard_block_engine(_RandomNumberEngine &&__rng)
Move constructs a discard_block_engine engine.
static constexpr result_type max()
Gets the maximum value in the generated random number range.
discard_block_engine()
Constructs a default discard_block_engine engine.
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.
discard_block_engine(_Sseq &__q)
Generator construct a discard_block_engine engine.
result_type operator()()
Gets the next value in the generated random number sequence.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::discard_block_engine< _RandomNumberEngine1, __p1, __r1 > &__x)
Inserts the current state of a discard_block_engine random number generator engine __x into the outpu...
discard_block_engine(result_type __s)
Seed constructs a discard_block_engine engine.
_RandomNumberEngine::result_type result_type
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 ...
independent_bits_engine(_Sseq &__q)
Generator construct a independent_bits_engine engine.
independent_bits_engine(const _RandomNumberEngine &__rng)
Copy constructs a independent_bits_engine engine.
_If_seed_seq< _Sseq > seed(_Sseq &__q)
Reseeds the independent_bits_engine object with the given seed sequence.
static constexpr result_type min()
Gets the minimum value in the generated random number range.
result_type operator()()
Gets the next value in the generated random number sequence.
void seed()
Reseeds the independent_bits_engine object with the default seed for the underlying base class genera...
void discard(unsigned long long __z)
Discard a sequence of random numbers.
void seed(result_type __s)
Reseeds the independent_bits_engine object with the default seed for the underlying base class genera...
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine object.
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.
static constexpr result_type max()
Gets the maximum value in the generated random number range.
independent_bits_engine()
Constructs a default independent_bits_engine engine.
independent_bits_engine(result_type __s)
Seed constructs a independent_bits_engine engine.
independent_bits_engine(_RandomNumberEngine &&__rng)
Move constructs a independent_bits_engine engine.
Produces random numbers by combining random numbers from some base engine to produce random numbers w...
static constexpr result_type min()
shuffle_order_engine()
Constructs a default shuffle_order_engine engine.
static constexpr result_type max()
shuffle_order_engine(const _RandomNumberEngine &__rng)
Copy constructs a shuffle_order_engine engine.
shuffle_order_engine(_Sseq &__q)
Generator construct a shuffle_order_engine engine.
_If_seed_seq< _Sseq > seed(_Sseq &__q)
Reseeds the shuffle_order_engine object with the given seed sequence.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::shuffle_order_engine< _RandomNumberEngine1, __k1 > &__x)
Inserts the current state of a shuffle_order_engine random number generator engine __x into the outpu...
shuffle_order_engine(_RandomNumberEngine &&__rng)
Move constructs a shuffle_order_engine engine.
void seed()
Reseeds the shuffle_order_engine object with the default seed for the underlying base class generator...
shuffle_order_engine(result_type __s)
Seed constructs a shuffle_order_engine engine.
_RandomNumberEngine::result_type result_type
const _RandomNumberEngine & base() const noexcept
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 ...
friend bool operator==(const shuffle_order_engine &__lhs, const shuffle_order_engine &__rhs)
void discard(unsigned long long __z)
void seed(result_type __s)
Reseeds the shuffle_order_engine object with the default seed for the underlying base class generator...
Uniform continuous distribution for random numbers.
param_type param() const
Returns the parameter set of the distribution.
void reset()
Resets the distribution state.
uniform_real_distribution(_RealType __a, _RealType __b=_RealType(1))
Constructs a uniform_real_distribution object.
result_type min() const
Returns the inclusive lower bound of the distribution range.
friend bool operator==(const uniform_real_distribution &__d1, const uniform_real_distribution &__d2)
Return true if two uniform real distributions have the same parameters.
result_type max() const
Returns the inclusive upper bound of the distribution range.
uniform_real_distribution()
Constructs a uniform_real_distribution object.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void param(const param_type &__param)
Sets the parameter set of the distribution.
A normal continuous distribution for random numbers.
_RealType stddev() const
Returns the standard deviation of the distribution.
param_type param() const
Returns the parameter set of the distribution.
void reset()
Resets the distribution state.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
_RealType mean() const
Returns the mean of the distribution.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::normal_distribution< _RealType1 > &__x)
Inserts a normal_distribution random number distribution __x into the output stream __os.
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.
normal_distribution(result_type __mean, result_type __stddev=result_type(1))
result_type max() const
Returns the least upper bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
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...
A lognormal_distribution random number distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::lognormal_distribution< _RealType1 > &__x)
Extracts a lognormal_distribution random number distribution __x from the input stream __is.
friend bool operator==(const lognormal_distribution &__d1, const lognormal_distribution &__d2)
Return true if two lognormal distributions have the same parameters and the sequences that would be g...
param_type param() const
Returns the parameter set of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::lognormal_distribution< _RealType1 > &__x)
Inserts a lognormal_distribution random number distribution __x into the output stream __os.
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.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
A gamma continuous distribution for random numbers.
gamma_distribution(_RealType __alpha_val, _RealType __beta_val=_RealType(1))
Constructs a gamma distribution with parameters and .
void reset()
Resets the distribution state.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::gamma_distribution< _RealType1 > &__x)
Inserts a gamma_distribution random number distribution __x into the output stream __os.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type min() const
Returns the greatest lower bound value of the distribution.
_RealType alpha() const
Returns the of the distribution.
gamma_distribution()
Constructs a gamma distribution with parameters 1 and 1.
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::gamma_distribution< _RealType1 > &__x)
Extracts a gamma_distribution random number distribution __x from the input stream __is.
void param(const param_type &__param)
Sets the parameter set of the distribution.
_RealType beta() const
Returns the 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.
A chi_squared_distribution random number distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
param_type param() const
Returns the parameter set of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::chi_squared_distribution< _RealType1 > &__x)
Extracts a chi_squared_distribution random number distribution __x from the input stream __is.
friend bool operator==(const chi_squared_distribution &__d1, const chi_squared_distribution &__d2)
Return true if two Chi-squared distributions have the same parameters and the sequences that would be...
result_type min() const
Returns the greatest lower bound value of the distribution.
void reset()
Resets the distribution state.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::chi_squared_distribution< _RealType1 > &__x)
Inserts a chi_squared_distribution random number distribution __x into the output stream __os.
A cauchy_distribution random number distribution.
result_type min() const
Returns the greatest lower bound value 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 reset()
Resets the distribution state.
param_type param() const
Returns 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.
void param(const param_type &__param)
Sets the parameter set of the distribution.
A fisher_f_distribution random number distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
void reset()
Resets the distribution state.
param_type param() const
Returns the parameter set of the distribution.
friend bool operator==(const fisher_f_distribution &__d1, const fisher_f_distribution &__d2)
Return true if two Fisher f distributions have the same parameters and the sequences that would be ge...
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::fisher_f_distribution< _RealType1 > &__x)
Extracts a fisher_f_distribution random number distribution __x from the input stream __is.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::fisher_f_distribution< _RealType1 > &__x)
Inserts a fisher_f_distribution random number distribution __x into the output stream __os.
A student_t_distribution random number distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::student_t_distribution< _RealType1 > &__x)
Extracts a student_t_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 min() const
Returns the greatest lower bound value of the distribution.
void reset()
Resets the distribution state.
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...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::student_t_distribution< _RealType1 > &__x)
Inserts a student_t_distribution random number distribution __x into the output stream __os.
param_type param() const
Returns the parameter set of the distribution.
A Bernoulli random number distribution.
void reset()
Resets the distribution state.
result_type max() const
Returns the least upper bound value of the distribution.
friend bool operator==(const bernoulli_distribution &__d1, const bernoulli_distribution &__d2)
Return true if two Bernoulli distributions have the same parameters.
param_type param() const
Returns the parameter set of the distribution.
bernoulli_distribution()
Constructs a Bernoulli distribution with likelihood 0.5.
bernoulli_distribution(double __p)
Constructs a Bernoulli distribution with likelihood p.
result_type min() const
Returns the greatest lower bound value of the distribution.
double p() const
Returns the p parameter of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
A discrete binomial random number distribution.
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.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::binomial_distribution< _IntType1 > &__x)
Inserts a binomial_distribution random number distribution __x into the output stream __os.
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 param(const param_type &__param)
Sets the parameter set of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
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...
param_type param() const
Returns the parameter set of the distribution.
_IntType t() const
Returns the distribution t parameter.
void reset()
Resets the distribution state.
double p() const
Returns the distribution p parameter.
A discrete geometric random number distribution.
double p() const
Returns the distribution parameter p.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type max() const
Returns the least upper bound value of the distribution.
friend bool operator==(const geometric_distribution &__d1, const geometric_distribution &__d2)
Return true if two geometric distributions have the same parameters.
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 reset()
Resets the distribution state.
result_type min() const
Returns the greatest lower bound value of the distribution.
A negative_binomial_distribution random number distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::negative_binomial_distribution< _IntType1 > &__x)
Inserts a negative_binomial_distribution random number distribution __x into the output stream __os.
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.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
double p() const
Return the parameter 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...
param_type param() const
Returns the parameter set of the distribution.
_IntType k() const
Return the parameter of the distribution.
void reset()
Resets the distribution state.
A discrete Poisson random number distribution.
void reset()
Resets the distribution state.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
double mean() const
Returns the distribution parameter mean.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::poisson_distribution< _IntType1 > &__x)
Inserts a poisson_distribution random number distribution __x into the output stream __os.
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 max() const
Returns the least upper bound value 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.
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.
An exponential continuous distribution for random numbers.
_RealType lambda() const
Returns the inverse scale parameter of the distribution.
exponential_distribution()
Constructs an exponential distribution with inverse scale parameter 1.0.
exponential_distribution(_RealType __lambda)
Constructs an exponential distribution with inverse scale parameter .
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void reset()
Resets the distribution state.
result_type min() const
Returns the greatest lower bound value 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.
void param(const param_type &__param)
Sets the parameter set of the distribution.
friend bool operator==(const exponential_distribution &__d1, const exponential_distribution &__d2)
Return true if two exponential distributions have the same parameters.
A weibull_distribution random number 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.
void reset()
Resets the distribution state.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend bool operator==(const weibull_distribution &__d1, const weibull_distribution &__d2)
Return true if two Weibull distributions have the same parameters.
void param(const param_type &__param)
Sets the parameter set of the distribution.
_RealType b() const
Return the parameter of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
_RealType a() const
Return the parameter of the distribution.
A extreme_value_distribution random number distribution.
void reset()
Resets the distribution state.
_RealType b() const
Return the parameter of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
_RealType a() const
Return the parameter of the distribution.
friend bool operator==(const extreme_value_distribution &__d1, const extreme_value_distribution &__d2)
Return true if two extreme value distributions have the same parameters.
param_type param() const
Returns the parameter set of the distribution.
A discrete_distribution random number distribution.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::discrete_distribution< _IntType1 > &__x)
Inserts a discrete_distribution random number distribution __x into the output stream __os.
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.
void reset()
Resets the distribution state.
param_type param() const
Returns the parameter set of the distribution.
friend bool operator==(const discrete_distribution &__d1, const discrete_distribution &__d2)
Return true if two discrete distributions have the same parameters.
std::vector< double > probabilities() const
Returns the probabilities of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::discrete_distribution< _IntType1 > &__x)
Extracts a discrete_distribution random number distribution __x from the input stream __is.
void param(const param_type &__param)
Sets the parameter set of the distribution.
A piecewise_constant_distribution random number distribution.
std::vector< double > densities() const
Returns a vector of the probability densities.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::piecewise_constant_distribution< _RealType1 > &__x)
Inserts a piecewise_constant_distribution random number distribution __x into the output stream __os.
result_type max() const
Returns the least upper bound value of the distribution.
void reset()
Resets the distribution state.
param_type param() const
Returns the parameter set of the distribution.
friend bool operator==(const piecewise_constant_distribution &__d1, const piecewise_constant_distribution &__d2)
Return true if two piecewise constant distributions have the same parameters.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::piecewise_constant_distribution< _RealType1 > &__x)
Extracts a piecewise_constant_distribution random number distribution __x from the input stream __is.
std::vector< _RealType > intervals() const
Returns a vector of the intervals.
A piecewise_linear_distribution random number distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type max() const
Returns the least upper bound value of the distribution.
param_type param() const
Returns the parameter set of the distribution.
friend bool operator==(const piecewise_linear_distribution &__d1, const piecewise_linear_distribution &__d2)
Return true if two piecewise linear distributions have the same parameters.
std::vector< _RealType > intervals() const
Return the intervals of the distribution.
friend std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const std::piecewise_linear_distribution< _RealType1 > &__x)
Inserts a piecewise_linear_distribution random number distribution __x into the output stream __os.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
std::vector< double > densities() const
Return a vector of the probability densities of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::piecewise_linear_distribution< _RealType1 > &__x)
Extracts a piecewise_linear_distribution random number distribution __x from the input stream __is.
The seed_seq class generates sequences of seeds for random number generators.
uint_least32_t result_type
One of the math functors.
bool empty() const noexcept
reference front() noexcept
iterator begin() noexcept
reference back() noexcept
size_type size() const noexcept
Uniform discrete distribution for random numbers. A discrete random distribution on the range with e...