37 namespace std _GLIBCXX_VISIBILITY(default)
39 _GLIBCXX_BEGIN_NAMESPACE_VERSION
58 template<
typename _RealType,
size_t __bits,
59 typename _UniformRandomNumberGenerator>
67 template<
typename _UIntType,
size_t __w,
68 bool = __w < static_cast<size_t>
71 {
static constexpr _UIntType __value = 0; };
73 template<
typename _UIntType,
size_t __w>
74 struct _Shift<_UIntType, __w, true>
75 {
static constexpr _UIntType __value = _UIntType(1) << __w; };
78 int __which = ((__s <= __CHAR_BIT__ *
sizeof (int))
79 + (__s <= __CHAR_BIT__ *
sizeof (long))
80 + (__s <= __CHAR_BIT__ *
sizeof (
long long))
83 struct _Select_uint_least_t
85 static_assert(__which < 0,
86 "sorry, would be too much trouble for a slow result");
90 struct _Select_uint_least_t<__s, 4>
91 {
using type =
unsigned int; };
94 struct _Select_uint_least_t<__s, 3>
95 {
using type =
unsigned long; };
98 struct _Select_uint_least_t<__s, 2>
99 {
using type =
unsigned long long; };
101 #if __SIZEOF_INT128__ > __SIZEOF_LONG_LONG__
103 struct _Select_uint_least_t<__s, 1>
104 { __extension__
using type =
unsigned __int128; };
108 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
109 bool __big_enough = (!(__m & (__m - 1))
110 || (_Tp(-1) - __c) / __a >= __m - 1),
111 bool __schrage_ok = __m % __a < __m / __a>
118 =
typename _Select_uint_least_t<
std::__lg(__a)
120 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>
152 if _GLIBCXX17_CONSTEXPR (__a == 0)
157 constexpr _Tp __a1 = __a ? __a : 1;
158 return _Mod<_Tp, __m, __a1, __c>::__calc(__x);
166 template<
typename _Engine,
typename _DInputType>
170 "template argument must be a floating point type");
173 _Adaptor(_Engine& __g)
178 {
return _DInputType(0); }
182 {
return _DInputType(1); }
201 template<
typename _Sseq>
202 using __seed_seq_generate_t = decltype(
203 std::declval<_Sseq&>().generate(std::declval<uint_least32_t*>(),
204 std::declval<uint_least32_t*>()));
208 template<
typename _Sseq,
typename _Engine,
typename _Res,
209 typename _GenerateCheck = __seed_seq_generate_t<_Sseq>>
210 using __is_seed_seq = __and_<
211 __not_<is_same<__remove_cvref_t<_Sseq>, _Engine>>,
212 is_unsigned<typename _Sseq::result_type>,
213 __not_<is_convertible<_Sseq, _Res>>
257 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
261 "result_type must be an unsigned integral type");
262 static_assert(__m == 0u || (__a < __m && __c < __m),
263 "template argument substituting __m out of bounds");
265 template<
typename _Sseq>
266 using _If_seed_seq =
typename enable_if<__detail::__is_seed_seq<
305 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
326 template<
typename _Sseq>
338 {
return __c == 0u ? 1u : 0u; }
353 for (; __z != 0ULL; --__z)
363 _M_x = __detail::__mod<_UIntType, __m, __a, __c>(_M_x);
381 {
return __lhs._M_x == __rhs._M_x; }
391 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
392 _UIntType1 __m1,
typename _CharT,
typename _Traits>
396 __a1, __c1, __m1>& __lcr);
411 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
412 _UIntType1 __m1,
typename _CharT,
typename _Traits>
433 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
439 {
return !(__lhs == __rhs); }
470 template<
typename _UIntType,
size_t __w,
471 size_t __n,
size_t __m,
size_t __r,
472 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
473 _UIntType __b,
size_t __t,
474 _UIntType __c,
size_t __l, _UIntType __f>
478 "result_type must be an unsigned integral type");
479 static_assert(1u <= __m && __m <= __n,
480 "template argument substituting __m out of bounds");
481 static_assert(__r <= __w,
"template argument substituting "
483 static_assert(__u <= __w,
"template argument substituting "
485 static_assert(__s <= __w,
"template argument substituting "
487 static_assert(__t <= __w,
"template argument substituting "
489 static_assert(__l <= __w,
"template argument substituting "
492 "template argument substituting __w out of bound");
493 static_assert(__a <= (__detail::_Shift<_UIntType, __w>::__value - 1),
494 "template argument substituting __a out of bound");
495 static_assert(__b <= (__detail::_Shift<_UIntType, __w>::__value - 1),
496 "template argument substituting __b out of bound");
497 static_assert(__c <= (__detail::_Shift<_UIntType, __w>::__value - 1),
498 "template argument substituting __c out of bound");
499 static_assert(__d <= (__detail::_Shift<_UIntType, __w>::__value - 1),
500 "template argument substituting __d out of bound");
501 static_assert(__f <= (__detail::_Shift<_UIntType, __w>::__value - 1),
502 "template argument substituting __f out of bound");
504 template<
typename _Sseq>
505 using _If_seed_seq =
typename enable_if<__detail::__is_seed_seq<
513 static constexpr
size_t word_size = __w;
514 static constexpr
size_t state_size = __n;
515 static constexpr
size_t shift_size = __m;
516 static constexpr
size_t mask_bits = __r;
518 static constexpr
size_t tempering_u = __u;
520 static constexpr
size_t tempering_s = __s;
522 static constexpr
size_t tempering_t = __t;
524 static constexpr
size_t tempering_l = __l;
525 static constexpr
result_type initialization_multiplier = __f;
542 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
550 template<
typename _Sseq>
566 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
572 discard(
unsigned long long __z);
592 {
return (std::equal(__lhs._M_x, __lhs._M_x + state_size, __rhs._M_x)
593 && __lhs._M_p == __rhs._M_p); }
607 template<
typename _UIntType1,
608 size_t __w1,
size_t __n1,
609 size_t __m1,
size_t __r1,
610 _UIntType1 __a1,
size_t __u1,
611 _UIntType1 __d1,
size_t __s1,
612 _UIntType1 __b1,
size_t __t1,
613 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
614 typename _CharT,
typename _Traits>
618 __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
633 template<
typename _UIntType1,
634 size_t __w1,
size_t __n1,
635 size_t __m1,
size_t __r1,
636 _UIntType1 __a1,
size_t __u1,
637 _UIntType1 __d1,
size_t __s1,
638 _UIntType1 __b1,
size_t __t1,
639 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
640 typename _CharT,
typename _Traits>
644 __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
650 _UIntType _M_x[state_size];
666 template<
typename _UIntType,
size_t __w,
667 size_t __n,
size_t __m,
size_t __r,
668 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
669 _UIntType __b,
size_t __t,
670 _UIntType __c,
size_t __l, _UIntType __f>
673 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __lhs,
675 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __rhs)
676 {
return !(__lhs == __rhs); }
694 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
698 "result_type must be an unsigned integral type");
699 static_assert(0u < __s && __s < __r,
702 "template argument substituting __w out of bounds");
704 template<
typename _Sseq>
705 using _If_seed_seq =
typename enable_if<__detail::__is_seed_seq<
713 static constexpr
size_t word_size = __w;
714 static constexpr
size_t short_lag = __s;
715 static constexpr
size_t long_lag = __r;
716 static constexpr
result_type default_seed = 19780503u;
735 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
759 template<
typename _Sseq>
777 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
785 for (; __z != 0ULL; --__z)
810 {
return (std::equal(__lhs._M_x, __lhs._M_x + long_lag, __rhs._M_x)
811 && __lhs._M_carry == __rhs._M_carry
812 && __lhs._M_p == __rhs._M_p); }
826 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
827 typename _CharT,
typename _Traits>
845 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
846 typename _CharT,
typename _Traits>
854 _UIntType _M_x[long_lag];
871 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
877 {
return !(__lhs == __rhs); }
886 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
889 static_assert(1 <= __r && __r <= __p,
890 "template argument substituting __r out of bounds");
896 template<
typename _Sseq>
897 using _If_seed_seq =
typename enable_if<__detail::__is_seed_seq<
901 static constexpr
size_t block_size = __p;
902 static constexpr
size_t used_block = __r;
910 : _M_b(), _M_n(0) { }
920 : _M_b(__rng), _M_n(0) { }
930 : _M_b(
std::
move(__rng)), _M_n(0) { }
940 : _M_b(__s), _M_n(0) { }
947 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
980 template<
typename _Sseq>
992 const _RandomNumberEngine&
1001 {
return _RandomNumberEngine::min(); }
1008 {
return _RandomNumberEngine::max(); }
1016 for (; __z != 0ULL; --__z)
1040 {
return __lhs._M_b == __rhs._M_b && __lhs._M_n == __rhs._M_n; }
1053 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1054 typename _CharT,
typename _Traits>
1071 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1072 typename _CharT,
typename _Traits>
1079 _RandomNumberEngine _M_b;
1094 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
1100 {
return !(__lhs == __rhs); }
1107 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1111 "result_type must be an unsigned integral type");
1113 "template argument substituting __w out of bounds");
1115 template<
typename _Sseq>
1116 using _If_seed_seq =
typename enable_if<__detail::__is_seed_seq<
1166 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1193 template<
typename _Sseq>
1202 const _RandomNumberEngine&
1218 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1226 for (; __z != 0ULL; --__z)
1251 {
return __lhs._M_b == __rhs._M_b; }
1265 template<
typename _CharT,
typename _Traits>
1269 __w, _UIntType>& __x)
1276 _RandomNumberEngine _M_b;
1291 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1297 {
return !(__lhs == __rhs); }
1309 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType,
1310 typename _CharT,
typename _Traits>
1314 __w, _UIntType>& __x)
1328 template<
typename _RandomNumberEngine,
size_t __k>
1331 static_assert(1u <= __k,
"template argument substituting "
1332 "__k out of bound");
1338 template<
typename _Sseq>
1339 using _If_seed_seq =
typename enable_if<__detail::__is_seed_seq<
1342 static constexpr
size_t table_size = __k;
1351 { _M_initialize(); }
1362 { _M_initialize(); }
1373 { _M_initialize(); }
1384 { _M_initialize(); }
1391 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1395 { _M_initialize(); }
1424 template<
typename _Sseq>
1435 const _RandomNumberEngine&
1444 {
return _RandomNumberEngine::min(); }
1451 {
return _RandomNumberEngine::max(); }
1459 for (; __z != 0ULL; --__z)
1483 {
return (__lhs._M_b == __rhs._M_b
1484 && std::equal(__lhs._M_v, __lhs._M_v + __k, __rhs._M_v)
1485 && __lhs._M_y == __rhs._M_y); }
1498 template<
typename _RandomNumberEngine1,
size_t __k1,
1499 typename _CharT,
typename _Traits>
1516 template<
typename _RandomNumberEngine1,
size_t __k1,
1517 typename _CharT,
typename _Traits>
1523 void _M_initialize()
1525 for (
size_t __i = 0; __i < __k; ++__i)
1530 _RandomNumberEngine _M_b;
1546 template<
typename _RandomNumberEngine,
size_t __k>
1552 {
return !(__lhs == __rhs); }
1558 typedef linear_congruential_engine<uint_fast32_t, 16807UL, 0UL, 2147483647UL>
1589 0xb5026f5aa96619e9ULL, 29,
1590 0x5555555555555555ULL, 17,
1591 0x71d67fffeda60000ULL, 37,
1592 0xfff7eee000000000ULL, 43,
1626 #if defined _GLIBCXX_USE_DEV_RANDOM
1640 entropy() const noexcept
1642 #ifdef _GLIBCXX_USE_DEV_RANDOM
1643 return this->_M_getentropy();
1651 {
return this->_M_getval(); }
1654 random_device(
const random_device&) =
delete;
1655 void operator=(
const random_device&) =
delete;
1665 double _M_getentropy() const noexcept;
1667 void _M_init(const
char*,
size_t);
1701 template<
typename _IntType>
1705 {
return !(__d1 == __d2); }
1717 template<
typename _IntType,
typename _CharT,
typename _Traits>
1731 template<
typename _IntType,
typename _CharT,
typename _Traits>
1744 template<
typename _RealType =
double>
1748 "result_type must be a floating point type");
1762 param_type(_RealType __a, _RealType __b = _RealType(1))
1763 : _M_a(__a), _M_b(__b)
1765 __glibcxx_assert(_M_a <= _M_b);
1778 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
1782 {
return !(__p1 == __p2); }
1805 : _M_param(__a, __b)
1823 {
return _M_param.a(); }
1827 {
return _M_param.b(); }
1834 {
return _M_param; }
1842 { _M_param = __param; }
1849 {
return this->a(); }
1856 {
return this->b(); }
1861 template<
typename _UniformRandomNumberGenerator>
1864 {
return this->
operator()(__urng, _M_param); }
1866 template<
typename _UniformRandomNumberGenerator>
1868 operator()(_UniformRandomNumberGenerator& __urng,
1869 const param_type& __p)
1871 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
1873 return (__aurng() * (__p.b() - __p.a())) + __p.a();
1876 template<
typename _ForwardIterator,
1877 typename _UniformRandomNumberGenerator>
1879 __generate(_ForwardIterator __f, _ForwardIterator __t,
1880 _UniformRandomNumberGenerator& __urng)
1881 { this->__generate(__f, __t, __urng, _M_param); }
1883 template<
typename _ForwardIterator,
1884 typename _UniformRandomNumberGenerator>
1886 __generate(_ForwardIterator __f, _ForwardIterator __t,
1887 _UniformRandomNumberGenerator& __urng,
1888 const param_type& __p)
1889 { this->__generate_impl(__f, __t, __urng, __p); }
1891 template<
typename _UniformRandomNumberGenerator>
1894 _UniformRandomNumberGenerator& __urng,
1895 const param_type& __p)
1896 { this->__generate_impl(__f, __t, __urng, __p); }
1905 {
return __d1._M_param == __d2._M_param; }
1908 template<
typename _ForwardIterator,
1909 typename _UniformRandomNumberGenerator>
1911 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
1912 _UniformRandomNumberGenerator& __urng,
1913 const param_type& __p);
1915 param_type _M_param;
1922 template<
typename _IntType>
1926 {
return !(__d1 == __d2); }
1938 template<
typename _RealType,
typename _CharT,
typename _Traits>
1952 template<
typename _RealType,
typename _CharT,
typename _Traits>
1974 template<
typename _RealType =
double>
1978 "result_type must be a floating point type");
1992 param_type(_RealType __mean, _RealType __stddev = _RealType(1))
1993 : _M_mean(__mean), _M_stddev(__stddev)
1995 __glibcxx_assert(_M_stddev > _RealType(0));
2004 {
return _M_stddev; }
2008 {
return (__p1._M_mean == __p2._M_mean
2009 && __p1._M_stddev == __p2._M_stddev); }
2013 {
return !(__p1 == __p2); }
2017 _RealType _M_stddev;
2030 : _M_param(__mean, __stddev)
2043 { _M_saved_available =
false; }
2050 {
return _M_param.mean(); }
2057 {
return _M_param.stddev(); }
2064 {
return _M_param; }
2072 { _M_param = __param; }
2091 template<
typename _UniformRandomNumberGenerator>
2094 {
return this->
operator()(__urng, _M_param); }
2096 template<
typename _UniformRandomNumberGenerator>
2098 operator()(_UniformRandomNumberGenerator& __urng,
2099 const param_type& __p);
2101 template<
typename _ForwardIterator,
2102 typename _UniformRandomNumberGenerator>
2104 __generate(_ForwardIterator __f, _ForwardIterator __t,
2105 _UniformRandomNumberGenerator& __urng)
2106 { this->__generate(__f, __t, __urng, _M_param); }
2108 template<
typename _ForwardIterator,
2109 typename _UniformRandomNumberGenerator>
2111 __generate(_ForwardIterator __f, _ForwardIterator __t,
2112 _UniformRandomNumberGenerator& __urng,
2113 const param_type& __p)
2114 { this->__generate_impl(__f, __t, __urng, __p); }
2116 template<
typename _UniformRandomNumberGenerator>
2119 _UniformRandomNumberGenerator& __urng,
2120 const param_type& __p)
2121 { this->__generate_impl(__f, __t, __urng, __p); }
2128 template<
typename _RealType1>
2143 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2158 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2164 template<
typename _ForwardIterator,
2165 typename _UniformRandomNumberGenerator>
2167 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2168 _UniformRandomNumberGenerator& __urng,
2173 bool _M_saved_available =
false;
2179 template<
typename _RealType>
2183 {
return !(__d1 == __d2); }
2195 template<
typename _RealType =
double>
2199 "result_type must be a floating point type");
2213 param_type(_RealType __m, _RealType __s = _RealType(1))
2214 : _M_m(__m), _M_s(__s)
2227 {
return __p1._M_m == __p2._M_m && __p1._M_s == __p2._M_s; }
2231 {
return !(__p1 == __p2); }
2242 : _M_param(__m, __s), _M_nd()
2246 lognormal_distribution(
const param_type& __p)
2247 : _M_param(__p), _M_nd()
2262 {
return _M_param.m(); }
2266 {
return _M_param.s(); }
2273 {
return _M_param; }
2281 { _M_param = __param; }
2300 template<
typename _UniformRandomNumberGenerator>
2303 {
return this->
operator()(__urng, _M_param); }
2305 template<
typename _UniformRandomNumberGenerator>
2307 operator()(_UniformRandomNumberGenerator& __urng,
2308 const param_type& __p)
2309 {
return std::exp(__p.s() * _M_nd(__urng) + __p.m()); }
2311 template<
typename _ForwardIterator,
2312 typename _UniformRandomNumberGenerator>
2314 __generate(_ForwardIterator __f, _ForwardIterator __t,
2315 _UniformRandomNumberGenerator& __urng)
2316 { this->__generate(__f, __t, __urng, _M_param); }
2318 template<
typename _ForwardIterator,
2319 typename _UniformRandomNumberGenerator>
2321 __generate(_ForwardIterator __f, _ForwardIterator __t,
2322 _UniformRandomNumberGenerator& __urng,
2323 const param_type& __p)
2324 { this->__generate_impl(__f, __t, __urng, __p); }
2326 template<
typename _UniformRandomNumberGenerator>
2329 _UniformRandomNumberGenerator& __urng,
2330 const param_type& __p)
2331 { this->__generate_impl(__f, __t, __urng, __p); }
2341 {
return (__d1._M_param == __d2._M_param
2342 && __d1._M_nd == __d2._M_nd); }
2354 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2369 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2375 template<
typename _ForwardIterator,
2376 typename _UniformRandomNumberGenerator>
2378 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2379 _UniformRandomNumberGenerator& __urng,
2390 template<
typename _RealType>
2394 {
return !(__d1 == __d2); }
2406 template<
typename _RealType =
double>
2410 "result_type must be a floating point type");
2425 param_type(_RealType __alpha_val, _RealType __beta_val = _RealType(1))
2426 : _M_alpha(__alpha_val), _M_beta(__beta_val)
2428 __glibcxx_assert(_M_alpha > _RealType(0));
2434 {
return _M_alpha; }
2442 {
return (__p1._M_alpha == __p2._M_alpha
2443 && __p1._M_beta == __p2._M_beta); }
2447 {
return !(__p1 == __p2); }
2456 _RealType _M_malpha, _M_a2;
2471 _RealType __beta_val = _RealType(1))
2472 : _M_param(__alpha_val, __beta_val), _M_nd()
2477 : _M_param(__p), _M_nd()
2492 {
return _M_param.alpha(); }
2499 {
return _M_param.beta(); }
2506 {
return _M_param; }
2514 { _M_param = __param; }
2533 template<
typename _UniformRandomNumberGenerator>
2536 {
return this->
operator()(__urng, _M_param); }
2538 template<
typename _UniformRandomNumberGenerator>
2540 operator()(_UniformRandomNumberGenerator& __urng,
2541 const param_type& __p);
2543 template<
typename _ForwardIterator,
2544 typename _UniformRandomNumberGenerator>
2546 __generate(_ForwardIterator __f, _ForwardIterator __t,
2547 _UniformRandomNumberGenerator& __urng)
2548 { this->__generate(__f, __t, __urng, _M_param); }
2550 template<
typename _ForwardIterator,
2551 typename _UniformRandomNumberGenerator>
2553 __generate(_ForwardIterator __f, _ForwardIterator __t,
2554 _UniformRandomNumberGenerator& __urng,
2555 const param_type& __p)
2556 { this->__generate_impl(__f, __t, __urng, __p); }
2558 template<
typename _UniformRandomNumberGenerator>
2561 _UniformRandomNumberGenerator& __urng,
2562 const param_type& __p)
2563 { this->__generate_impl(__f, __t, __urng, __p); }
2573 {
return (__d1._M_param == __d2._M_param
2574 && __d1._M_nd == __d2._M_nd); }
2586 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2600 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2606 template<
typename _ForwardIterator,
2607 typename _UniformRandomNumberGenerator>
2609 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2610 _UniformRandomNumberGenerator& __urng,
2621 template<
typename _RealType>
2625 {
return !(__d1 == __d2); }
2634 template<
typename _RealType =
double>
2638 "result_type must be a floating point type");
2662 {
return __p1._M_n == __p2._M_n; }
2666 {
return !(__p1 == __p2); }
2676 : _M_param(__n), _M_gd(__n / 2)
2680 chi_squared_distribution(
const param_type& __p)
2681 : _M_param(__p), _M_gd(__p.n() / 2)
2696 {
return _M_param.n(); }
2703 {
return _M_param; }
2735 template<
typename _UniformRandomNumberGenerator>
2738 {
return 2 * _M_gd(__urng); }
2740 template<
typename _UniformRandomNumberGenerator>
2742 operator()(_UniformRandomNumberGenerator& __urng,
2743 const param_type& __p)
2747 return 2 * _M_gd(__urng, param_type(__p.n() / 2));
2750 template<
typename _ForwardIterator,
2751 typename _UniformRandomNumberGenerator>
2753 __generate(_ForwardIterator __f, _ForwardIterator __t,
2754 _UniformRandomNumberGenerator& __urng)
2755 { this->__generate_impl(__f, __t, __urng); }
2757 template<
typename _ForwardIterator,
2758 typename _UniformRandomNumberGenerator>
2760 __generate(_ForwardIterator __f, _ForwardIterator __t,
2761 _UniformRandomNumberGenerator& __urng,
2762 const param_type& __p)
2765 this->__generate_impl(__f, __t, __urng, __p2); }
2767 template<
typename _UniformRandomNumberGenerator>
2770 _UniformRandomNumberGenerator& __urng)
2771 { this->__generate_impl(__f, __t, __urng); }
2773 template<
typename _UniformRandomNumberGenerator>
2776 _UniformRandomNumberGenerator& __urng,
2777 const param_type& __p)
2780 this->__generate_impl(__f, __t, __urng, __p2); }
2790 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
2802 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2817 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2823 template<
typename _ForwardIterator,
2824 typename _UniformRandomNumberGenerator>
2826 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2827 _UniformRandomNumberGenerator& __urng);
2829 template<
typename _ForwardIterator,
2830 typename _UniformRandomNumberGenerator>
2832 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2833 _UniformRandomNumberGenerator& __urng,
2845 template<
typename _RealType>
2849 {
return !(__d1 == __d2); }
2858 template<
typename _RealType =
double>
2862 "result_type must be a floating point type");
2876 param_type(_RealType __a, _RealType __b = _RealType(1))
2877 : _M_a(__a), _M_b(__b)
2890 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
2894 {
return !(__p1 == __p2); }
2905 : _M_param(__a, __b)
2909 cauchy_distribution(
const param_type& __p)
2925 {
return _M_param.a(); }
2929 {
return _M_param.b(); }
2936 {
return _M_param; }
2944 { _M_param = __param; }
2963 template<
typename _UniformRandomNumberGenerator>
2966 {
return this->
operator()(__urng, _M_param); }
2968 template<
typename _UniformRandomNumberGenerator>
2970 operator()(_UniformRandomNumberGenerator& __urng,
2971 const param_type& __p);
2973 template<
typename _ForwardIterator,
2974 typename _UniformRandomNumberGenerator>
2976 __generate(_ForwardIterator __f, _ForwardIterator __t,
2977 _UniformRandomNumberGenerator& __urng)
2978 { this->__generate(__f, __t, __urng, _M_param); }
2980 template<
typename _ForwardIterator,
2981 typename _UniformRandomNumberGenerator>
2983 __generate(_ForwardIterator __f, _ForwardIterator __t,
2984 _UniformRandomNumberGenerator& __urng,
2985 const param_type& __p)
2986 { this->__generate_impl(__f, __t, __urng, __p); }
2988 template<
typename _UniformRandomNumberGenerator>
2991 _UniformRandomNumberGenerator& __urng,
2992 const param_type& __p)
2993 { this->__generate_impl(__f, __t, __urng, __p); }
3002 {
return __d1._M_param == __d2._M_param; }
3005 template<
typename _ForwardIterator,
3006 typename _UniformRandomNumberGenerator>
3008 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3009 _UniformRandomNumberGenerator& __urng,
3010 const param_type& __p);
3012 param_type _M_param;
3019 template<
typename _RealType>
3023 {
return !(__d1 == __d2); }
3035 template<
typename _RealType,
typename _CharT,
typename _Traits>
3050 template<
typename _RealType,
typename _CharT,
typename _Traits>
3066 template<
typename _RealType =
double>
3070 "result_type must be a floating point type");
3084 param_type(_RealType __m, _RealType __n = _RealType(1))
3085 : _M_m(__m), _M_n(__n)
3098 {
return __p1._M_m == __p2._M_m && __p1._M_n == __p2._M_n; }
3102 {
return !(__p1 == __p2); }
3113 _RealType __n = _RealType(1))
3114 : _M_param(__m, __n), _M_gd_x(__m / 2), _M_gd_y(__n / 2)
3118 fisher_f_distribution(
const param_type& __p)
3119 : _M_param(__p), _M_gd_x(__p.m() / 2), _M_gd_y(__p.n() / 2)
3137 {
return _M_param.m(); }
3141 {
return _M_param.n(); }
3148 {
return _M_param; }
3156 { _M_param = __param; }
3175 template<
typename _UniformRandomNumberGenerator>
3178 {
return (_M_gd_x(__urng) * n()) / (_M_gd_y(__urng) * m()); }
3180 template<
typename _UniformRandomNumberGenerator>
3182 operator()(_UniformRandomNumberGenerator& __urng,
3183 const param_type& __p)
3187 return ((_M_gd_x(__urng, param_type(__p.m() / 2)) * n())
3188 / (_M_gd_y(__urng, param_type(__p.n() / 2)) * m()));
3191 template<
typename _ForwardIterator,
3192 typename _UniformRandomNumberGenerator>
3194 __generate(_ForwardIterator __f, _ForwardIterator __t,
3195 _UniformRandomNumberGenerator& __urng)
3196 { this->__generate_impl(__f, __t, __urng); }
3198 template<
typename _ForwardIterator,
3199 typename _UniformRandomNumberGenerator>
3201 __generate(_ForwardIterator __f, _ForwardIterator __t,
3202 _UniformRandomNumberGenerator& __urng,
3203 const param_type& __p)
3204 { this->__generate_impl(__f, __t, __urng, __p); }
3206 template<
typename _UniformRandomNumberGenerator>
3209 _UniformRandomNumberGenerator& __urng)
3210 { this->__generate_impl(__f, __t, __urng); }
3212 template<
typename _UniformRandomNumberGenerator>
3215 _UniformRandomNumberGenerator& __urng,
3216 const param_type& __p)
3217 { this->__generate_impl(__f, __t, __urng, __p); }
3227 {
return (__d1._M_param == __d2._M_param
3228 && __d1._M_gd_x == __d2._M_gd_x
3229 && __d1._M_gd_y == __d2._M_gd_y); }
3241 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3256 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3262 template<
typename _ForwardIterator,
3263 typename _UniformRandomNumberGenerator>
3265 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3266 _UniformRandomNumberGenerator& __urng);
3268 template<
typename _ForwardIterator,
3269 typename _UniformRandomNumberGenerator>
3271 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3272 _UniformRandomNumberGenerator& __urng,
3283 template<
typename _RealType>
3287 {
return !(__d1 == __d2); }
3298 template<
typename _RealType =
double>
3302 "result_type must be a floating point type");
3326 {
return __p1._M_n == __p2._M_n; }
3330 {
return !(__p1 == __p2); }
3340 : _M_param(__n), _M_nd(), _M_gd(__n / 2, 2)
3344 student_t_distribution(
const param_type& __p)
3345 : _M_param(__p), _M_nd(), _M_gd(__p.n() / 2, 2)
3363 {
return _M_param.n(); }
3370 {
return _M_param; }
3378 { _M_param = __param; }
3397 template<
typename _UniformRandomNumberGenerator>
3400 {
return _M_nd(__urng) *
std::sqrt(n() / _M_gd(__urng)); }
3402 template<
typename _UniformRandomNumberGenerator>
3404 operator()(_UniformRandomNumberGenerator& __urng,
3405 const param_type& __p)
3410 const result_type __g = _M_gd(__urng, param_type(__p.n() / 2, 2));
3411 return _M_nd(__urng) *
std::sqrt(__p.n() / __g);
3414 template<
typename _ForwardIterator,
3415 typename _UniformRandomNumberGenerator>
3417 __generate(_ForwardIterator __f, _ForwardIterator __t,
3418 _UniformRandomNumberGenerator& __urng)
3419 { this->__generate_impl(__f, __t, __urng); }
3421 template<
typename _ForwardIterator,
3422 typename _UniformRandomNumberGenerator>
3424 __generate(_ForwardIterator __f, _ForwardIterator __t,
3425 _UniformRandomNumberGenerator& __urng,
3426 const param_type& __p)
3427 { this->__generate_impl(__f, __t, __urng, __p); }
3429 template<
typename _UniformRandomNumberGenerator>
3432 _UniformRandomNumberGenerator& __urng)
3433 { this->__generate_impl(__f, __t, __urng); }
3435 template<
typename _UniformRandomNumberGenerator>
3438 _UniformRandomNumberGenerator& __urng,
3439 const param_type& __p)
3440 { this->__generate_impl(__f, __t, __urng, __p); }
3450 {
return (__d1._M_param == __d2._M_param
3451 && __d1._M_nd == __d2._M_nd && __d1._M_gd == __d2._M_gd); }
3463 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3478 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3484 template<
typename _ForwardIterator,
3485 typename _UniformRandomNumberGenerator>
3487 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3488 _UniformRandomNumberGenerator& __urng);
3489 template<
typename _ForwardIterator,
3490 typename _UniformRandomNumberGenerator>
3492 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3493 _UniformRandomNumberGenerator& __urng,
3505 template<
typename _RealType>
3509 {
return !(__d1 == __d2); }
3543 __glibcxx_assert((_M_p >= 0.0) && (_M_p <= 1.0));
3552 {
return __p1._M_p == __p2._M_p; }
3556 {
return !(__p1 == __p2); }
3597 {
return _M_param.p(); }
3604 {
return _M_param; }
3612 { _M_param = __param; }
3631 template<
typename _UniformRandomNumberGenerator>
3634 {
return this->
operator()(__urng, _M_param); }
3636 template<
typename _UniformRandomNumberGenerator>
3638 operator()(_UniformRandomNumberGenerator& __urng,
3639 const param_type& __p)
3641 __detail::_Adaptor<_UniformRandomNumberGenerator, double>
3643 if ((__aurng() - __aurng.min())
3644 < __p.p() * (__aurng.max() - __aurng.min()))
3649 template<
typename _ForwardIterator,
3650 typename _UniformRandomNumberGenerator>
3652 __generate(_ForwardIterator __f, _ForwardIterator __t,
3653 _UniformRandomNumberGenerator& __urng)
3654 { this->__generate(__f, __t, __urng, _M_param); }
3656 template<
typename _ForwardIterator,
3657 typename _UniformRandomNumberGenerator>
3659 __generate(_ForwardIterator __f, _ForwardIterator __t,
3660 _UniformRandomNumberGenerator& __urng,
const param_type& __p)
3661 { this->__generate_impl(__f, __t, __urng, __p); }
3663 template<
typename _UniformRandomNumberGenerator>
3666 _UniformRandomNumberGenerator& __urng,
3667 const param_type& __p)
3668 { this->__generate_impl(__f, __t, __urng, __p); }
3677 {
return __d1._M_param == __d2._M_param; }
3680 template<
typename _ForwardIterator,
3681 typename _UniformRandomNumberGenerator>
3683 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3684 _UniformRandomNumberGenerator& __urng,
3685 const param_type& __p);
3687 param_type _M_param;
3697 {
return !(__d1 == __d2); }
3709 template<
typename _CharT,
typename _Traits>
3723 template<
typename _CharT,
typename _Traits>
3742 template<
typename _IntType =
int>
3746 "result_type must be an integral type");
3762 : _M_t(__t), _M_p(__p)
3764 __glibcxx_assert((_M_t >= _IntType(0))
3780 {
return __p1._M_t == __p2._M_t && __p1._M_p == __p2._M_p; }
3784 {
return !(__p1 == __p2); }
3794 #if _GLIBCXX_USE_C99_MATH_TR1
3795 double _M_d1, _M_d2, _M_s1, _M_s2, _M_c,
3796 _M_a1, _M_a123, _M_s, _M_lf, _M_lp1p;
3807 : _M_param(__t, __p), _M_nd()
3811 binomial_distribution(
const param_type& __p)
3812 : _M_param(__p), _M_nd()
3827 {
return _M_param.t(); }
3834 {
return _M_param.p(); }
3841 {
return _M_param; }
3849 { _M_param = __param; }
3863 {
return _M_param.t(); }
3868 template<
typename _UniformRandomNumberGenerator>
3871 {
return this->
operator()(__urng, _M_param); }
3873 template<
typename _UniformRandomNumberGenerator>
3875 operator()(_UniformRandomNumberGenerator& __urng,
3876 const param_type& __p);
3878 template<
typename _ForwardIterator,
3879 typename _UniformRandomNumberGenerator>
3881 __generate(_ForwardIterator __f, _ForwardIterator __t,
3882 _UniformRandomNumberGenerator& __urng)
3883 { this->__generate(__f, __t, __urng, _M_param); }
3885 template<
typename _ForwardIterator,
3886 typename _UniformRandomNumberGenerator>
3888 __generate(_ForwardIterator __f, _ForwardIterator __t,
3889 _UniformRandomNumberGenerator& __urng,
3890 const param_type& __p)
3891 { this->__generate_impl(__f, __t, __urng, __p); }
3893 template<
typename _UniformRandomNumberGenerator>
3896 _UniformRandomNumberGenerator& __urng,
3897 const param_type& __p)
3898 { this->__generate_impl(__f, __t, __urng, __p); }
3908 #ifdef _GLIBCXX_USE_C99_MATH_TR1
3909 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
3911 {
return __d1._M_param == __d2._M_param; }
3924 template<
typename _IntType1,
3925 typename _CharT,
typename _Traits>
3940 template<
typename _IntType1,
3941 typename _CharT,
typename _Traits>
3947 template<
typename _ForwardIterator,
3948 typename _UniformRandomNumberGenerator>
3950 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3951 _UniformRandomNumberGenerator& __urng,
3954 template<
typename _UniformRandomNumberGenerator>
3956 _M_waiting(_UniformRandomNumberGenerator& __urng,
3957 _IntType __t,
double __q);
3968 template<
typename _IntType>
3972 {
return !(__d1 == __d2); }
3982 template<
typename _IntType =
int>
3986 "result_type must be an integral type");
4004 __glibcxx_assert((_M_p > 0.0) && (_M_p < 1.0));
4014 {
return __p1._M_p == __p2._M_p; }
4018 {
return !(__p1 == __p2); }
4023 { _M_log_1_p =
std::log(1.0 - _M_p); }
4040 geometric_distribution(
const param_type& __p)
4057 {
return _M_param.p(); }
4064 {
return _M_param; }
4072 { _M_param = __param; }
4091 template<
typename _UniformRandomNumberGenerator>
4094 {
return this->
operator()(__urng, _M_param); }
4096 template<
typename _UniformRandomNumberGenerator>
4098 operator()(_UniformRandomNumberGenerator& __urng,
4099 const param_type& __p);
4101 template<
typename _ForwardIterator,
4102 typename _UniformRandomNumberGenerator>
4104 __generate(_ForwardIterator __f, _ForwardIterator __t,
4105 _UniformRandomNumberGenerator& __urng)
4106 { this->__generate(__f, __t, __urng, _M_param); }
4108 template<
typename _ForwardIterator,
4109 typename _UniformRandomNumberGenerator>
4111 __generate(_ForwardIterator __f, _ForwardIterator __t,
4112 _UniformRandomNumberGenerator& __urng,
4113 const param_type& __p)
4114 { this->__generate_impl(__f, __t, __urng, __p); }
4116 template<
typename _UniformRandomNumberGenerator>
4119 _UniformRandomNumberGenerator& __urng,
4120 const param_type& __p)
4121 { this->__generate_impl(__f, __t, __urng, __p); }
4130 {
return __d1._M_param == __d2._M_param; }
4133 template<
typename _ForwardIterator,
4134 typename _UniformRandomNumberGenerator>
4136 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4137 _UniformRandomNumberGenerator& __urng,
4138 const param_type& __p);
4140 param_type _M_param;
4147 template<
typename _IntType>
4151 {
return !(__d1 == __d2); }
4163 template<
typename _IntType,
4164 typename _CharT,
typename _Traits>
4178 template<
typename _IntType,
4179 typename _CharT,
typename _Traits>
4192 template<
typename _IntType =
int>
4196 "result_type must be an integral type");
4211 : _M_k(__k), _M_p(__p)
4213 __glibcxx_assert((_M_k > 0) && (_M_p > 0.0) && (_M_p <= 1.0));
4226 {
return __p1._M_k == __p2._M_k && __p1._M_p == __p2._M_p; }
4230 {
return !(__p1 == __p2); }
4241 : _M_param(__k, __p), _M_gd(__k, (1.0 - __p) / __p)
4245 negative_binomial_distribution(
const param_type& __p)
4246 : _M_param(__p), _M_gd(__p.
k(), (1.0 - __p.
p()) / __p.
p())
4261 {
return _M_param.k(); }
4268 {
return _M_param.p(); }
4275 {
return _M_param; }
4283 { _M_param = __param; }
4302 template<
typename _UniformRandomNumberGenerator>
4304 operator()(_UniformRandomNumberGenerator& __urng);
4306 template<
typename _UniformRandomNumberGenerator>
4308 operator()(_UniformRandomNumberGenerator& __urng,
4309 const param_type& __p);
4311 template<
typename _ForwardIterator,
4312 typename _UniformRandomNumberGenerator>
4314 __generate(_ForwardIterator __f, _ForwardIterator __t,
4315 _UniformRandomNumberGenerator& __urng)
4316 { this->__generate_impl(__f, __t, __urng); }
4318 template<
typename _ForwardIterator,
4319 typename _UniformRandomNumberGenerator>
4321 __generate(_ForwardIterator __f, _ForwardIterator __t,
4322 _UniformRandomNumberGenerator& __urng,
4323 const param_type& __p)
4324 { this->__generate_impl(__f, __t, __urng, __p); }
4326 template<
typename _UniformRandomNumberGenerator>
4329 _UniformRandomNumberGenerator& __urng)
4330 { this->__generate_impl(__f, __t, __urng); }
4332 template<
typename _UniformRandomNumberGenerator>
4335 _UniformRandomNumberGenerator& __urng,
4336 const param_type& __p)
4337 { this->__generate_impl(__f, __t, __urng, __p); }
4347 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
4360 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4375 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4381 template<
typename _ForwardIterator,
4382 typename _UniformRandomNumberGenerator>
4384 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4385 _UniformRandomNumberGenerator& __urng);
4386 template<
typename _ForwardIterator,
4387 typename _UniformRandomNumberGenerator>
4389 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4390 _UniformRandomNumberGenerator& __urng,
4401 template<
typename _IntType>
4405 {
return !(__d1 == __d2); }
4423 template<
typename _IntType =
int>
4427 "result_type must be an integral type");
4445 __glibcxx_assert(_M_mean > 0.0);
4455 {
return __p1._M_mean == __p2._M_mean; }
4459 {
return !(__p1 == __p2); }
4469 #if _GLIBCXX_USE_C99_MATH_TR1
4470 double _M_lfm, _M_sm, _M_d, _M_scx, _M_1cx, _M_c2b, _M_cb;
4480 : _M_param(__mean), _M_nd()
4484 poisson_distribution(
const param_type& __p)
4485 : _M_param(__p), _M_nd()
4500 {
return _M_param.mean(); }
4507 {
return _M_param; }
4515 { _M_param = __param; }
4534 template<
typename _UniformRandomNumberGenerator>
4537 {
return this->
operator()(__urng, _M_param); }
4539 template<
typename _UniformRandomNumberGenerator>
4541 operator()(_UniformRandomNumberGenerator& __urng,
4542 const param_type& __p);
4544 template<
typename _ForwardIterator,
4545 typename _UniformRandomNumberGenerator>
4547 __generate(_ForwardIterator __f, _ForwardIterator __t,
4548 _UniformRandomNumberGenerator& __urng)
4549 { this->__generate(__f, __t, __urng, _M_param); }
4551 template<
typename _ForwardIterator,
4552 typename _UniformRandomNumberGenerator>
4554 __generate(_ForwardIterator __f, _ForwardIterator __t,
4555 _UniformRandomNumberGenerator& __urng,
4556 const param_type& __p)
4557 { this->__generate_impl(__f, __t, __urng, __p); }
4559 template<
typename _UniformRandomNumberGenerator>
4562 _UniformRandomNumberGenerator& __urng,
4563 const param_type& __p)
4564 { this->__generate_impl(__f, __t, __urng, __p); }
4574 #ifdef _GLIBCXX_USE_C99_MATH_TR1
4575 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
4577 {
return __d1._M_param == __d2._M_param; }
4590 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4605 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4611 template<
typename _ForwardIterator,
4612 typename _UniformRandomNumberGenerator>
4614 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4615 _UniformRandomNumberGenerator& __urng,
4627 template<
typename _IntType>
4631 {
return !(__d1 == __d2); }
4649 template<
typename _RealType =
double>
4653 "result_type must be a floating point type");
4668 : _M_lambda(__lambda)
4670 __glibcxx_assert(_M_lambda > _RealType(0));
4675 {
return _M_lambda; }
4679 {
return __p1._M_lambda == __p2._M_lambda; }
4683 {
return !(__p1 == __p2); }
4686 _RealType _M_lambda;
4702 : _M_param(__lambda)
4723 {
return _M_param.lambda(); }
4730 {
return _M_param; }
4738 { _M_param = __param; }
4757 template<
typename _UniformRandomNumberGenerator>
4760 {
return this->
operator()(__urng, _M_param); }
4762 template<
typename _UniformRandomNumberGenerator>
4764 operator()(_UniformRandomNumberGenerator& __urng,
4765 const param_type& __p)
4767 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
4772 template<
typename _ForwardIterator,
4773 typename _UniformRandomNumberGenerator>
4775 __generate(_ForwardIterator __f, _ForwardIterator __t,
4776 _UniformRandomNumberGenerator& __urng)
4777 { this->__generate(__f, __t, __urng, _M_param); }
4779 template<
typename _ForwardIterator,
4780 typename _UniformRandomNumberGenerator>
4782 __generate(_ForwardIterator __f, _ForwardIterator __t,
4783 _UniformRandomNumberGenerator& __urng,
4784 const param_type& __p)
4785 { this->__generate_impl(__f, __t, __urng, __p); }
4787 template<
typename _UniformRandomNumberGenerator>
4790 _UniformRandomNumberGenerator& __urng,
4791 const param_type& __p)
4792 { this->__generate_impl(__f, __t, __urng, __p); }
4801 {
return __d1._M_param == __d2._M_param; }
4804 template<
typename _ForwardIterator,
4805 typename _UniformRandomNumberGenerator>
4807 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4808 _UniformRandomNumberGenerator& __urng,
4809 const param_type& __p);
4811 param_type _M_param;
4818 template<
typename _RealType>
4822 {
return !(__d1 == __d2); }
4834 template<
typename _RealType,
typename _CharT,
typename _Traits>
4849 template<
typename _RealType,
typename _CharT,
typename _Traits>
4864 template<
typename _RealType =
double>
4868 "result_type must be a floating point type");
4882 param_type(_RealType __a, _RealType __b = _RealType(1.0))
4883 : _M_a(__a), _M_b(__b)
4896 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
4900 {
return !(__p1 == __p2); }
4911 : _M_param(__a, __b)
4915 weibull_distribution(
const param_type& __p)
4931 {
return _M_param.a(); }
4938 {
return _M_param.b(); }
4945 {
return _M_param; }
4953 { _M_param = __param; }
4972 template<
typename _UniformRandomNumberGenerator>
4975 {
return this->
operator()(__urng, _M_param); }
4977 template<
typename _UniformRandomNumberGenerator>
4979 operator()(_UniformRandomNumberGenerator& __urng,
4980 const param_type& __p);
4982 template<
typename _ForwardIterator,
4983 typename _UniformRandomNumberGenerator>
4985 __generate(_ForwardIterator __f, _ForwardIterator __t,
4986 _UniformRandomNumberGenerator& __urng)
4987 { this->__generate(__f, __t, __urng, _M_param); }
4989 template<
typename _ForwardIterator,
4990 typename _UniformRandomNumberGenerator>
4992 __generate(_ForwardIterator __f, _ForwardIterator __t,
4993 _UniformRandomNumberGenerator& __urng,
4994 const param_type& __p)
4995 { this->__generate_impl(__f, __t, __urng, __p); }
4997 template<
typename _UniformRandomNumberGenerator>
5000 _UniformRandomNumberGenerator& __urng,
5001 const param_type& __p)
5002 { this->__generate_impl(__f, __t, __urng, __p); }
5011 {
return __d1._M_param == __d2._M_param; }
5014 template<
typename _ForwardIterator,
5015 typename _UniformRandomNumberGenerator>
5017 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5018 _UniformRandomNumberGenerator& __urng,
5019 const param_type& __p);
5021 param_type _M_param;
5028 template<
typename _RealType>
5032 {
return !(__d1 == __d2); }
5044 template<
typename _RealType,
typename _CharT,
typename _Traits>
5059 template<
typename _RealType,
typename _CharT,
typename _Traits>
5074 template<
typename _RealType =
double>
5078 "result_type must be a floating point type");
5092 param_type(_RealType __a, _RealType __b = _RealType(1.0))
5093 : _M_a(__a), _M_b(__b)
5106 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
5110 {
return !(__p1 == __p2); }
5121 : _M_param(__a, __b)
5125 extreme_value_distribution(
const param_type& __p)
5141 {
return _M_param.a(); }
5148 {
return _M_param.b(); }
5155 {
return _M_param; }
5163 { _M_param = __param; }
5182 template<
typename _UniformRandomNumberGenerator>
5185 {
return this->
operator()(__urng, _M_param); }
5187 template<
typename _UniformRandomNumberGenerator>
5189 operator()(_UniformRandomNumberGenerator& __urng,
5190 const param_type& __p);
5192 template<
typename _ForwardIterator,
5193 typename _UniformRandomNumberGenerator>
5195 __generate(_ForwardIterator __f, _ForwardIterator __t,
5196 _UniformRandomNumberGenerator& __urng)
5197 { this->__generate(__f, __t, __urng, _M_param); }
5199 template<
typename _ForwardIterator,
5200 typename _UniformRandomNumberGenerator>
5202 __generate(_ForwardIterator __f, _ForwardIterator __t,
5203 _UniformRandomNumberGenerator& __urng,
5204 const param_type& __p)
5205 { this->__generate_impl(__f, __t, __urng, __p); }
5207 template<
typename _UniformRandomNumberGenerator>
5210 _UniformRandomNumberGenerator& __urng,
5211 const param_type& __p)
5212 { this->__generate_impl(__f, __t, __urng, __p); }
5221 {
return __d1._M_param == __d2._M_param; }
5224 template<
typename _ForwardIterator,
5225 typename _UniformRandomNumberGenerator>
5227 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5228 _UniformRandomNumberGenerator& __urng,
5229 const param_type& __p);
5231 param_type _M_param;
5238 template<
typename _RealType>
5242 {
return !(__d1 == __d2); }
5254 template<
typename _RealType,
typename _CharT,
typename _Traits>
5269 template<
typename _RealType,
typename _CharT,
typename _Traits>
5281 template<
typename _IntType =
int>
5285 "result_type must be an integral type");
5298 : _M_prob(), _M_cp()
5301 template<
typename _InputIterator>
5303 _InputIterator __wend)
5304 : _M_prob(__wbegin, __wend), _M_cp()
5305 { _M_initialize(); }
5308 : _M_prob(__wil.begin(), __wil.end()), _M_cp()
5309 { _M_initialize(); }
5311 template<
typename _Func>
5312 param_type(
size_t __nw,
double __xmin,
double __xmax,
5320 probabilities()
const
5325 {
return __p1._M_prob == __p2._M_prob; }
5329 {
return !(__p1 == __p2); }
5343 template<
typename _InputIterator>
5345 _InputIterator __wend)
5346 : _M_param(__wbegin, __wend)
5349 discrete_distribution(initializer_list<double> __wl)
5353 template<
typename _Func>
5354 discrete_distribution(
size_t __nw,
double __xmin,
double __xmax,
5356 : _M_param(__nw, __xmin, __xmax, __fw)
5360 discrete_distribution(
const param_type& __p)
5377 return _M_param._M_prob.
empty()
5386 {
return _M_param; }
5394 { _M_param = __param; }
5409 return _M_param._M_prob.
empty()
5416 template<
typename _UniformRandomNumberGenerator>
5419 {
return this->
operator()(__urng, _M_param); }
5421 template<
typename _UniformRandomNumberGenerator>
5423 operator()(_UniformRandomNumberGenerator& __urng,
5424 const param_type& __p);
5426 template<
typename _ForwardIterator,
5427 typename _UniformRandomNumberGenerator>
5429 __generate(_ForwardIterator __f, _ForwardIterator __t,
5430 _UniformRandomNumberGenerator& __urng)
5431 { this->__generate(__f, __t, __urng, _M_param); }
5433 template<
typename _ForwardIterator,
5434 typename _UniformRandomNumberGenerator>
5436 __generate(_ForwardIterator __f, _ForwardIterator __t,
5437 _UniformRandomNumberGenerator& __urng,
5438 const param_type& __p)
5439 { this->__generate_impl(__f, __t, __urng, __p); }
5441 template<
typename _UniformRandomNumberGenerator>
5444 _UniformRandomNumberGenerator& __urng,
5445 const param_type& __p)
5446 { this->__generate_impl(__f, __t, __urng, __p); }
5455 {
return __d1._M_param == __d2._M_param; }
5467 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5483 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5489 template<
typename _ForwardIterator,
5490 typename _UniformRandomNumberGenerator>
5492 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5493 _UniformRandomNumberGenerator& __urng,
5503 template<
typename _IntType>
5507 {
return !(__d1 == __d2); }
5516 template<
typename _RealType =
double>
5520 "result_type must be a floating point type");
5533 : _M_int(), _M_den(), _M_cp()
5536 template<
typename _InputIteratorB,
typename _InputIteratorW>
5538 _InputIteratorB __bend,
5539 _InputIteratorW __wbegin);
5541 template<
typename _Func>
5544 template<
typename _Func>
5545 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5558 __tmp[1] = _RealType(1);
5571 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
5575 {
return !(__p1 == __p2); }
5590 template<
typename _InputIteratorB,
typename _InputIteratorW>
5592 _InputIteratorB __bend,
5593 _InputIteratorW __wbegin)
5594 : _M_param(__bfirst, __bend, __wbegin)
5597 template<
typename _Func>
5598 piecewise_constant_distribution(initializer_list<_RealType> __bl,
5600 : _M_param(__bl, __fw)
5603 template<
typename _Func>
5604 piecewise_constant_distribution(
size_t __nw,
5605 _RealType __xmin, _RealType __xmax,
5607 : _M_param(__nw, __xmin, __xmax, __fw)
5611 piecewise_constant_distribution(
const param_type& __p)
5628 if (_M_param._M_int.
empty())
5631 __tmp[1] = _RealType(1);
5635 return _M_param._M_int;
5644 return _M_param._M_den.
empty()
5653 {
return _M_param; }
5661 { _M_param = __param; }
5669 return _M_param._M_int.
empty()
5679 return _M_param._M_int.
empty()
5686 template<
typename _UniformRandomNumberGenerator>
5689 {
return this->
operator()(__urng, _M_param); }
5691 template<
typename _UniformRandomNumberGenerator>
5693 operator()(_UniformRandomNumberGenerator& __urng,
5694 const param_type& __p);
5696 template<
typename _ForwardIterator,
5697 typename _UniformRandomNumberGenerator>
5699 __generate(_ForwardIterator __f, _ForwardIterator __t,
5700 _UniformRandomNumberGenerator& __urng)
5701 { this->__generate(__f, __t, __urng, _M_param); }
5703 template<
typename _ForwardIterator,
5704 typename _UniformRandomNumberGenerator>
5706 __generate(_ForwardIterator __f, _ForwardIterator __t,
5707 _UniformRandomNumberGenerator& __urng,
5708 const param_type& __p)
5709 { this->__generate_impl(__f, __t, __urng, __p); }
5711 template<
typename _UniformRandomNumberGenerator>
5714 _UniformRandomNumberGenerator& __urng,
5715 const param_type& __p)
5716 { this->__generate_impl(__f, __t, __urng, __p); }
5725 {
return __d1._M_param == __d2._M_param; }
5738 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5754 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5760 template<
typename _ForwardIterator,
5761 typename _UniformRandomNumberGenerator>
5763 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5764 _UniformRandomNumberGenerator& __urng,
5774 template<
typename _RealType>
5778 {
return !(__d1 == __d2); }
5787 template<
typename _RealType =
double>
5791 "result_type must be a floating point type");
5804 : _M_int(), _M_den(), _M_cp(), _M_m()
5807 template<
typename _InputIteratorB,
typename _InputIteratorW>
5809 _InputIteratorB __bend,
5810 _InputIteratorW __wbegin);
5812 template<
typename _Func>
5815 template<
typename _Func>
5816 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5829 __tmp[1] = _RealType(1);
5842 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
5846 {
return !(__p1 == __p2); }
5862 template<
typename _InputIteratorB,
typename _InputIteratorW>
5864 _InputIteratorB __bend,
5865 _InputIteratorW __wbegin)
5866 : _M_param(__bfirst, __bend, __wbegin)
5869 template<
typename _Func>
5870 piecewise_linear_distribution(initializer_list<_RealType> __bl,
5872 : _M_param(__bl, __fw)
5875 template<
typename _Func>
5876 piecewise_linear_distribution(
size_t __nw,
5877 _RealType __xmin, _RealType __xmax,
5879 : _M_param(__nw, __xmin, __xmax, __fw)
5883 piecewise_linear_distribution(
const param_type& __p)
5900 if (_M_param._M_int.
empty())
5903 __tmp[1] = _RealType(1);
5907 return _M_param._M_int;
5917 return _M_param._M_den.
empty()
5926 {
return _M_param; }
5934 { _M_param = __param; }
5942 return _M_param._M_int.
empty()
5952 return _M_param._M_int.
empty()
5959 template<
typename _UniformRandomNumberGenerator>
5962 {
return this->
operator()(__urng, _M_param); }
5964 template<
typename _UniformRandomNumberGenerator>
5966 operator()(_UniformRandomNumberGenerator& __urng,
5967 const param_type& __p);
5969 template<
typename _ForwardIterator,
5970 typename _UniformRandomNumberGenerator>
5972 __generate(_ForwardIterator __f, _ForwardIterator __t,
5973 _UniformRandomNumberGenerator& __urng)
5974 { this->__generate(__f, __t, __urng, _M_param); }
5976 template<
typename _ForwardIterator,
5977 typename _UniformRandomNumberGenerator>
5979 __generate(_ForwardIterator __f, _ForwardIterator __t,
5980 _UniformRandomNumberGenerator& __urng,
5981 const param_type& __p)
5982 { this->__generate_impl(__f, __t, __urng, __p); }
5984 template<
typename _UniformRandomNumberGenerator>
5987 _UniformRandomNumberGenerator& __urng,
5988 const param_type& __p)
5989 { this->__generate_impl(__f, __t, __urng, __p); }
5998 {
return __d1._M_param == __d2._M_param; }
6011 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6027 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6033 template<
typename _ForwardIterator,
6034 typename _UniformRandomNumberGenerator>
6036 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6037 _UniformRandomNumberGenerator& __urng,
6047 template<
typename _RealType>
6051 {
return !(__d1 == __d2); }
6079 template<
typename _IntType,
typename = _Require<is_
integral<_IntType>>>
6082 template<
typename _InputIterator>
6083 seed_seq(_InputIterator __begin, _InputIterator __end);
6086 template<
typename _RandomAccessIterator>
6088 generate(_RandomAccessIterator __begin, _RandomAccessIterator __end);
6091 size_t size() const noexcept
6092 {
return _M_v.
size(); }
6094 template<
typename _OutputIterator>
6096 param(_OutputIterator __dest)
const
6097 { std::copy(_M_v.
begin(), _M_v.
end(), __dest); }
6111 _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.
static constexpr result_type increment
_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.
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 reordering random numbers from some base engine.
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.
constexpr iterator end() noexcept
constexpr iterator begin() noexcept
constexpr reference front() noexcept
constexpr bool empty() const noexcept
constexpr size_type size() const noexcept
constexpr reference back() noexcept
Uniform discrete distribution for random numbers. A discrete random distribution on the range with e...