37namespace std _GLIBCXX_VISIBILITY(default)
39_GLIBCXX_BEGIN_NAMESPACE_VERSION
58 template<
typename _RealType,
size_t __bits,
59 typename _UniformRandomNumberGenerator>
67#pragma GCC diagnostic push
68#pragma GCC diagnostic ignored "-Wc++17-extensions"
70 template<
typename _UIntType,
size_t __w,
71 bool = __w < static_cast<size_t>
74 {
static constexpr _UIntType __value = 0; };
76 template<
typename _UIntType,
size_t __w>
77 struct _Shift<_UIntType, __w, true>
78 {
static constexpr _UIntType __value = _UIntType(1) << __w; };
81 int __which = ((__s <= __CHAR_BIT__ *
sizeof (int))
82 + (__s <= __CHAR_BIT__ *
sizeof (long))
83 + (__s <= __CHAR_BIT__ *
sizeof (
long long))
86 struct _Select_uint_least_t
88 static_assert(__which < 0,
89 "sorry, would be too much trouble for a slow result");
93 struct _Select_uint_least_t<__s, 4>
94 {
using type =
unsigned int; };
97 struct _Select_uint_least_t<__s, 3>
98 {
using type =
unsigned long; };
101 struct _Select_uint_least_t<__s, 2>
102 {
using type =
unsigned long long; };
104#if __SIZEOF_INT128__ > __SIZEOF_LONG_LONG__
106 struct _Select_uint_least_t<__s, 1>
107 { __extension__
using type =
unsigned __int128; };
108#elif __has_builtin(__builtin_add_overflow) \
109 && __has_builtin(__builtin_sub_overflow) \
110 && defined __UINT64_TYPE__
112 struct _Select_uint_least_t<__s, 1>
119 type(uint64_t __a) noexcept : _M_lo(__a), _M_hi(0) { }
123 operator*(type __l, uint64_t __x)
noexcept
129 constexpr uint64_t __mask = 0xffffffff;
130 uint64_t __ll[2] = { __l._M_lo >> 32, __l._M_lo & __mask };
131 uint64_t __xx[2] = { __x >> 32, __x & __mask };
132 uint64_t __l0x0 = __ll[0] * __xx[0];
133 uint64_t __l0x1 = __ll[0] * __xx[1];
134 uint64_t __l1x0 = __ll[1] * __xx[0];
135 uint64_t __l1x1 = __ll[1] * __xx[1];
139 = (__l0x1 & __mask) + (__l1x0 & __mask) + (__l1x1 >> 32);
140 __l._M_hi = __l0x0 + (__l0x1 >> 32) + (__l1x0 >> 32) + (__mid >> 32);
141 __l._M_lo = (__mid << 32) + (__l1x1 & __mask);
146 operator+(type __l, uint64_t __c)
noexcept
148 __l._M_hi += __builtin_add_overflow(__l._M_lo, __c, &__l._M_lo);
153 operator%(type __l, uint64_t __m)
noexcept
155 if (__builtin_expect(__l._M_hi == 0, 0))
161 int __shift = __builtin_clzll(__m) + 64
162 - __builtin_clzll(__l._M_hi);
166 __x._M_hi = __m << (__shift - 64);
171 __x._M_hi = __m >> (64 - __shift);
172 __x._M_lo = __m << __shift;
175 while (__l._M_hi != 0 || __l._M_lo >= __m)
179 __l._M_hi -= __x._M_hi;
180 __l._M_hi -= __builtin_sub_overflow(__l._M_lo, __x._M_lo,
183 __x._M_lo = (__x._M_lo >> 1) | (__x._M_hi << 63);
190 explicit operator uint64_t() const noexcept
193 friend bool operator<(
const type& __l,
const type& __r)
noexcept
195 if (__l._M_hi < __r._M_hi)
197 else if (__l._M_hi == __r._M_hi)
198 return __l._M_lo < __r._M_lo;
203 friend bool operator<=(
const type& __l,
const type& __r)
noexcept
204 {
return !(__r < __l); }
213 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
214 bool __big_enough = (!(__m & (__m - 1))
215 || (_Tp(-1) - __c) / __a >= __m - 1),
216 bool __schrage_ok = __m % __a < __m / __a>
223 =
typename _Select_uint_least_t<
std::__lg(__a)
225 return static_cast<_Tp
>((_Tp2(__a) * __x + __c) % __m);
230 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c>
231 struct _Mod<_Tp, __m, __a, __c, false, true>
240 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
bool __s>
241 struct _Mod<_Tp, __m, __a, __c, true, __s>
246 _Tp __res = __a * __x + __c;
253 template<
typename _Tp, _Tp __m, _Tp __a = 1, _Tp __c = 0>
257 if constexpr (__a == 0)
260 return _Mod<_Tp, __m, __a, __c>::__calc(__x);
267 template<
typename _Engine,
typename _DInputType>
270 static_assert(std::is_floating_point<_DInputType>::value,
271 "template argument must be a floating point type");
274 _Adaptor(_Engine& __g)
279 {
return _DInputType(0); }
283 {
return _DInputType(1); }
307 template<
typename _Sseq>
308 using __seed_seq_generate_t =
decltype(
312 template<
typename _Sseq,
typename _Engine,
typename _Res,
313 typename _GenerateCheck = __seed_seq_generate_t<_Sseq>>
314 using _If_seed_seq_for = _Require<
315 __not_<is_same<__remove_cvref_t<_Sseq>, _Engine>>,
316 is_unsigned<typename _Sseq::result_type>,
317 __not_<is_convertible<_Sseq, _Res>>
320#pragma GCC diagnostic pop
365 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
369 "result_type must be an unsigned integral type");
370 static_assert(__m == 0u || (__a < __m && __c < __m),
371 "template argument substituting __m out of bounds");
373 template<
typename _Sseq>
414 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
435 template<
typename _Sseq>
447 {
return __c == 0u ? 1u : 0u; }
460 discard(
unsigned long long __z)
462 for (; __z != 0ULL; --__z)
472 _M_x = __detail::__mod<_UIntType, __m, __a, __c>(_M_x);
490 {
return __lhs._M_x == __rhs._M_x; }
500 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
501 _UIntType1 __m1,
typename _CharT,
typename _Traits>
505 __a1, __c1, __m1>& __lcr);
520 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
521 _UIntType1 __m1,
typename _CharT,
typename _Traits>
531#if __cpp_impl_three_way_comparison < 201907L
543 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
549 {
return !(__lhs == __rhs); }
583 template<
typename _UIntType,
size_t __w,
584 size_t __n,
size_t __m,
size_t __r,
585 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
586 _UIntType __b,
size_t __t,
587 _UIntType __c,
size_t __l, _UIntType __f>
588 class mersenne_twister_engine
591 "result_type must be an unsigned integral type");
592 static_assert(1u <= __m && __m <= __n,
593 "template argument substituting __m out of bounds");
594 static_assert(__r <= __w,
"template argument substituting "
596 static_assert(__u <= __w,
"template argument substituting "
598 static_assert(__s <= __w,
"template argument substituting "
600 static_assert(__t <= __w,
"template argument substituting "
602 static_assert(__l <= __w,
"template argument substituting "
604 static_assert(__w <= std::numeric_limits<_UIntType>::digits,
605 "template argument substituting __w out of bound");
606 static_assert(__a <= (__detail::_Shift<_UIntType, __w>::__value - 1),
607 "template argument substituting __a out of bound");
608 static_assert(__b <= (__detail::_Shift<_UIntType, __w>::__value - 1),
609 "template argument substituting __b out of bound");
610 static_assert(__c <= (__detail::_Shift<_UIntType, __w>::__value - 1),
611 "template argument substituting __c out of bound");
612 static_assert(__d <= (__detail::_Shift<_UIntType, __w>::__value - 1),
613 "template argument substituting __d out of bound");
614 static_assert(__f <= (__detail::_Shift<_UIntType, __w>::__value - 1),
615 "template argument substituting __f out of bound");
617 template<
typename _Sseq>
619 = __detail::_If_seed_seq_for<_Sseq, mersenne_twister_engine,
627 static constexpr size_t word_size = __w;
628 static constexpr size_t state_size = __n;
629 static constexpr size_t shift_size = __m;
630 static constexpr size_t mask_bits = __r;
632 static constexpr size_t tempering_u = __u;
634 static constexpr size_t tempering_s = __s;
636 static constexpr size_t tempering_t = __t;
638 static constexpr size_t tempering_l = __l;
639 static constexpr result_type initialization_multiplier = __f;
644 mersenne_twister_engine() : mersenne_twister_engine(default_seed) { }
656 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
658 mersenne_twister_engine(_Sseq& __q)
662 seed(result_type __sd = default_seed);
664 template<
typename _Sseq>
680 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
686 discard(
unsigned long long __z);
704 operator==(
const mersenne_twister_engine& __lhs,
705 const mersenne_twister_engine& __rhs)
706 {
return (std::equal(__lhs._M_x, __lhs._M_x + state_size, __rhs._M_x)
707 && __lhs._M_p == __rhs._M_p); }
721 template<
typename _UIntType1,
722 size_t __w1,
size_t __n1,
723 size_t __m1,
size_t __r1,
724 _UIntType1 __a1,
size_t __u1,
725 _UIntType1 __d1,
size_t __s1,
726 _UIntType1 __b1,
size_t __t1,
727 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
728 typename _CharT,
typename _Traits>
732 __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
747 template<
typename _UIntType1,
748 size_t __w1,
size_t __n1,
749 size_t __m1,
size_t __r1,
750 _UIntType1 __a1,
size_t __u1,
751 _UIntType1 __d1,
size_t __s1,
752 _UIntType1 __b1,
size_t __t1,
753 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
754 typename _CharT,
typename _Traits>
758 __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
764 _UIntType _M_x[state_size];
768#if __cpp_impl_three_way_comparison < 201907L
781 template<
typename _UIntType,
size_t __w,
782 size_t __n,
size_t __m,
size_t __r,
783 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
784 _UIntType __b,
size_t __t,
785 _UIntType __c,
size_t __l, _UIntType __f>
788 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __lhs,
790 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __rhs)
791 {
return !(__lhs == __rhs); }
812 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
813 class subtract_with_carry_engine
816 "result_type must be an unsigned integral type");
817 static_assert(0u < __s && __s < __r,
819 static_assert(0u < __w && __w <= std::numeric_limits<_UIntType>::digits,
820 "template argument substituting __w out of bounds");
822 template<
typename _Sseq>
824 = __detail::_If_seed_seq_for<_Sseq, subtract_with_carry_engine,
832 static constexpr size_t word_size = __w;
833 static constexpr size_t short_lag = __s;
834 static constexpr size_t long_lag = __r;
835 static constexpr uint_least32_t default_seed = 19780503u;
837 subtract_with_carry_engine() : subtract_with_carry_engine(0u)
854 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
856 subtract_with_carry_engine(_Sseq& __q)
878 template<
typename _Sseq>
896 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
902 discard(
unsigned long long __z)
904 for (; __z != 0ULL; --__z)
927 operator==(
const subtract_with_carry_engine& __lhs,
928 const subtract_with_carry_engine& __rhs)
929 {
return (std::equal(__lhs._M_x, __lhs._M_x + long_lag, __rhs._M_x)
930 && __lhs._M_carry == __rhs._M_carry
931 && __lhs._M_p == __rhs._M_p); }
945 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
946 typename _CharT,
typename _Traits>
964 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
965 typename _CharT,
typename _Traits>
973 _UIntType _M_x[long_lag];
978#if __cpp_impl_three_way_comparison < 201907L
991 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
997 {
return !(__lhs == __rhs); }
1009 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
1012 static_assert(1 <= __r && __r <= __p,
1013 "template argument substituting __r out of bounds");
1019 template<
typename _Sseq>
1025 static constexpr size_t block_size = __p;
1026 static constexpr size_t used_block = __r;
1034 : _M_b(), _M_n(0) { }
1044 : _M_b(__rng), _M_n(0) { }
1054 : _M_b(
std::
move(__rng)), _M_n(0) { }
1064 : _M_b(__s), _M_n(0) { }
1071 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1074 : _M_b(__q), _M_n(0)
1104 template<
typename _Sseq>
1116 const _RandomNumberEngine&
1117 base() const noexcept
1125 {
return _RandomNumberEngine::min(); }
1132 {
return _RandomNumberEngine::max(); }
1138 discard(
unsigned long long __z)
1140 for (; __z != 0ULL; --__z)
1164 {
return __lhs._M_b == __rhs._M_b && __lhs._M_n == __rhs._M_n; }
1177 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1178 typename _CharT,
typename _Traits>
1195 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
1196 typename _CharT,
typename _Traits>
1203 _RandomNumberEngine _M_b;
1207#if __cpp_impl_three_way_comparison < 201907L
1219 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
1225 {
return !(__lhs == __rhs); }
1235 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1239 "result_type must be an unsigned integral type");
1240 static_assert(0u < __w && __w <= std::numeric_limits<_UIntType>::digits,
1241 "template argument substituting __w out of bounds");
1243 template<
typename _Sseq>
1295 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1322 template<
typename _Sseq>
1331 const _RandomNumberEngine&
1332 base() const noexcept
1347 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1353 discard(
unsigned long long __z)
1355 for (; __z != 0ULL; --__z)
1380 {
return __lhs._M_b == __rhs._M_b; }
1394 template<
typename _CharT,
typename _Traits>
1398 __w, _UIntType>& __x)
1405 _RandomNumberEngine _M_b;
1408#if __cpp_impl_three_way_comparison < 201907L
1421 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1427 {
return !(__lhs == __rhs); }
1440 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType,
1441 typename _CharT,
typename _Traits>
1442 std::basic_ostream<_CharT, _Traits>&
1443 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1444 const std::independent_bits_engine<_RandomNumberEngine,
1445 __w, _UIntType>& __x)
1462 template<
typename _RandomNumberEngine,
size_t __k>
1465 static_assert(1u <= __k,
"template argument substituting "
1466 "__k out of bound");
1472 template<
typename _Sseq>
1477 static constexpr size_t table_size = __k;
1486 { _M_initialize(); }
1497 { _M_initialize(); }
1508 { _M_initialize(); }
1519 { _M_initialize(); }
1526 template<
typename _Sseq,
typename = _If_seed_seq<_Sseq>>
1530 { _M_initialize(); }
1559 template<
typename _Sseq>
1570 const _RandomNumberEngine&
1571 base() const noexcept
1579 {
return _RandomNumberEngine::min(); }
1586 {
return _RandomNumberEngine::max(); }
1592 discard(
unsigned long long __z)
1594 for (; __z != 0ULL; --__z)
1618 {
return (__lhs._M_b == __rhs._M_b
1619 && std::equal(__lhs._M_v, __lhs._M_v + __k, __rhs._M_v)
1620 && __lhs._M_y == __rhs._M_y); }
1633 template<
typename _RandomNumberEngine1,
size_t __k1,
1634 typename _CharT,
typename _Traits>
1651 template<
typename _RandomNumberEngine1,
size_t __k1,
1652 typename _CharT,
typename _Traits>
1658 void _M_initialize()
1660 for (
size_t __i = 0; __i < __k; ++__i)
1665 _RandomNumberEngine _M_b;
1666 result_type _M_v[__k];
1670#if __cpp_impl_three_way_comparison < 201907L
1682 template<
typename _RandomNumberEngine,
size_t __k>
1688 {
return !(__lhs == __rhs); }
1725 0xb5026f5aa96619e9ULL, 29,
1726 0x5555555555555555ULL, 17,
1727 0x71d67fffeda60000ULL, 37,
1728 0xfff7eee000000000ULL, 43,
1760 random_device() { _M_init(
"default"); }
1777 entropy() const noexcept
1778 {
return this->_M_getentropy(); }
1782 {
return this->_M_getval(); }
1785 random_device(
const random_device&) =
delete;
1786 void operator=(
const random_device&) =
delete;
1796 double _M_getentropy() const noexcept;
1798 void _M_init(const
char*,
size_t);
1828#if __cpp_impl_three_way_comparison < 201907L
1833 template<
typename _IntType>
1835 operator!=(
const std::uniform_int_distribution<_IntType>& __d1,
1836 const std::uniform_int_distribution<_IntType>& __d2)
1837 {
return !(__d1 == __d2); }
1850 template<
typename _IntType,
typename _CharT,
typename _Traits>
1851 std::basic_ostream<_CharT, _Traits>&
1852 operator<<(std::basic_ostream<_CharT, _Traits>&,
1853 const std::uniform_int_distribution<_IntType>&);
1864 template<
typename _IntType,
typename _CharT,
typename _Traits>
1865 std::basic_istream<_CharT, _Traits>&
1866 operator>>(std::basic_istream<_CharT, _Traits>&,
1867 std::uniform_int_distribution<_IntType>&);
1880 template<
typename _RealType =
double>
1884 "result_type must be a floating point type");
1895 param_type() : param_type(0) { }
1898 param_type(_RealType __a, _RealType __b = _RealType(1))
1899 : _M_a(__a), _M_b(__b)
1901 __glibcxx_assert(_M_a <= _M_b);
1913 operator==(
const param_type& __p1,
const param_type& __p2)
1914 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
1916#if __cpp_impl_three_way_comparison < 201907L
1918 operator!=(
const param_type& __p1,
const param_type& __p2)
1919 {
return !(__p1 == __p2); }
1943 : _M_param(__a, __b)
1961 {
return _M_param.a(); }
1965 {
return _M_param.b(); }
1972 {
return _M_param; }
1980 { _M_param = __param; }
1987 {
return this->a(); }
1994 {
return this->b(); }
1999 template<
typename _UniformRandomNumberGenerator>
2002 {
return this->
operator()(__urng, _M_param); }
2004 template<
typename _UniformRandomNumberGenerator>
2006 operator()(_UniformRandomNumberGenerator& __urng,
2007 const param_type& __p)
2009 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
2011 return (__aurng() * (__p.b() - __p.a())) + __p.a();
2014 template<
typename _ForwardIterator,
2015 typename _UniformRandomNumberGenerator>
2017 __generate(_ForwardIterator __f, _ForwardIterator __t,
2018 _UniformRandomNumberGenerator& __urng)
2019 { this->__generate(__f, __t, __urng, _M_param); }
2021 template<
typename _ForwardIterator,
2022 typename _UniformRandomNumberGenerator>
2024 __generate(_ForwardIterator __f, _ForwardIterator __t,
2025 _UniformRandomNumberGenerator& __urng,
2027 { this->__generate_impl(__f, __t, __urng, __p); }
2029 template<
typename _UniformRandomNumberGenerator>
2032 _UniformRandomNumberGenerator& __urng,
2034 { this->__generate_impl(__f, __t, __urng, __p); }
2043 {
return __d1._M_param == __d2._M_param; }
2046 template<
typename _ForwardIterator,
2047 typename _UniformRandomNumberGenerator>
2049 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2050 _UniformRandomNumberGenerator& __urng,
2051 const param_type& __p);
2053 param_type _M_param;
2056#if __cpp_impl_three_way_comparison < 201907L
2061 template<
typename _IntType>
2065 {
return !(__d1 == __d2); }
2078 template<
typename _RealType,
typename _CharT,
typename _Traits>
2079 std::basic_ostream<_CharT, _Traits>&
2080 operator<<(std::basic_ostream<_CharT, _Traits>&,
2081 const std::uniform_real_distribution<_RealType>&);
2092 template<
typename _RealType,
typename _CharT,
typename _Traits>
2093 std::basic_istream<_CharT, _Traits>&
2094 operator>>(std::basic_istream<_CharT, _Traits>&,
2095 std::uniform_real_distribution<_RealType>&);
2117 template<
typename _RealType =
double>
2118 class normal_distribution
2121 "result_type must be a floating point type");
2130 typedef normal_distribution<_RealType> distribution_type;
2132 param_type() : param_type(0.0) { }
2135 param_type(_RealType __mean, _RealType __stddev = _RealType(1))
2136 : _M_mean(__mean), _M_stddev(__stddev)
2138 __glibcxx_assert(_M_stddev > _RealType(0));
2147 {
return _M_stddev; }
2150 operator==(
const param_type& __p1,
const param_type& __p2)
2151 {
return (__p1._M_mean == __p2._M_mean
2152 && __p1._M_stddev == __p2._M_stddev); }
2154#if __cpp_impl_three_way_comparison < 201907L
2156 operator!=(
const param_type& __p1,
const param_type& __p2)
2157 {
return !(__p1 == __p2); }
2162 _RealType _M_stddev;
2166 normal_distribution() : normal_distribution(0.0) { }
2175 : _M_param(__mean, __stddev)
2188 { _M_saved_available =
false; }
2195 {
return _M_param.mean(); }
2202 {
return _M_param.stddev(); }
2209 {
return _M_param; }
2217 { _M_param = __param; }
2236 template<
typename _UniformRandomNumberGenerator>
2239 {
return this->
operator()(__urng, _M_param); }
2241 template<
typename _UniformRandomNumberGenerator>
2244 const param_type& __p);
2246 template<
typename _ForwardIterator,
2247 typename _UniformRandomNumberGenerator>
2249 __generate(_ForwardIterator __f, _ForwardIterator __t,
2250 _UniformRandomNumberGenerator& __urng)
2251 { this->__generate(__f, __t, __urng, _M_param); }
2253 template<
typename _ForwardIterator,
2254 typename _UniformRandomNumberGenerator>
2256 __generate(_ForwardIterator __f, _ForwardIterator __t,
2257 _UniformRandomNumberGenerator& __urng,
2258 const param_type& __p)
2259 { this->__generate_impl(__f, __t, __urng, __p); }
2261 template<
typename _UniformRandomNumberGenerator>
2263 __generate(result_type* __f, result_type* __t,
2264 _UniformRandomNumberGenerator& __urng,
2265 const param_type& __p)
2266 { this->__generate_impl(__f, __t, __urng, __p); }
2273 template<
typename _RealType1>
2288 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2303 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2309 template<
typename _ForwardIterator,
2310 typename _UniformRandomNumberGenerator>
2312 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2313 _UniformRandomNumberGenerator& __urng,
2314 const param_type& __p);
2316 param_type _M_param;
2318 bool _M_saved_available =
false;
2321#if __cpp_impl_three_way_comparison < 201907L
2325 template<
typename _RealType>
2329 {
return !(__d1 == __d2); }
2344 template<
typename _RealType =
double>
2345 class lognormal_distribution
2348 "result_type must be a floating point type");
2357 typedef lognormal_distribution<_RealType> distribution_type;
2359 param_type() : param_type(0.0) { }
2362 param_type(_RealType __m, _RealType __s = _RealType(1))
2363 : _M_m(__m), _M_s(__s)
2375 operator==(
const param_type& __p1,
const param_type& __p2)
2376 {
return __p1._M_m == __p2._M_m && __p1._M_s == __p2._M_s; }
2378#if __cpp_impl_three_way_comparison < 201907L
2380 operator!=(
const param_type& __p1,
const param_type& __p2)
2381 {
return !(__p1 == __p2); }
2389 lognormal_distribution() : lognormal_distribution(0.0) { }
2393 : _M_param(__m, __s), _M_nd()
2397 lognormal_distribution(
const param_type& __p)
2398 : _M_param(__p), _M_nd()
2413 {
return _M_param.m(); }
2417 {
return _M_param.s(); }
2424 {
return _M_param; }
2432 { _M_param = __param; }
2451 template<
typename _UniformRandomNumberGenerator>
2454 {
return this->
operator()(__urng, _M_param); }
2456 template<
typename _UniformRandomNumberGenerator>
2458 operator()(_UniformRandomNumberGenerator& __urng,
2459 const param_type& __p)
2460 {
return std::exp(__p.s() * _M_nd(__urng) + __p.m()); }
2462 template<
typename _ForwardIterator,
2463 typename _UniformRandomNumberGenerator>
2465 __generate(_ForwardIterator __f, _ForwardIterator __t,
2466 _UniformRandomNumberGenerator& __urng)
2467 { this->__generate(__f, __t, __urng, _M_param); }
2469 template<
typename _ForwardIterator,
2470 typename _UniformRandomNumberGenerator>
2472 __generate(_ForwardIterator __f, _ForwardIterator __t,
2473 _UniformRandomNumberGenerator& __urng,
2475 { this->__generate_impl(__f, __t, __urng, __p); }
2477 template<
typename _UniformRandomNumberGenerator>
2480 _UniformRandomNumberGenerator& __urng,
2482 { this->__generate_impl(__f, __t, __urng, __p); }
2491 const lognormal_distribution& __d2)
2492 {
return (__d1._M_param == __d2._M_param
2493 && __d1._M_nd == __d2._M_nd); }
2505 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2520 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2526 template<
typename _ForwardIterator,
2527 typename _UniformRandomNumberGenerator>
2529 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2530 _UniformRandomNumberGenerator& __urng,
2531 const param_type& __p);
2533 param_type _M_param;
2538#if __cpp_impl_three_way_comparison < 201907L
2542 template<
typename _RealType>
2546 {
return !(__d1 == __d2); }
2569 template<
typename _RealType =
double>
2573 "result_type must be a floating point type");
2585 param_type() : param_type(1.0) { }
2588 param_type(_RealType __alpha_val, _RealType __beta_val = _RealType(1))
2589 : _M_alpha(__alpha_val), _M_beta(__beta_val)
2591 __glibcxx_assert(_M_alpha > _RealType(0));
2597 {
return _M_alpha; }
2604 operator==(
const param_type& __p1,
const param_type& __p2)
2605 {
return (__p1._M_alpha == __p2._M_alpha
2606 && __p1._M_beta == __p2._M_beta); }
2608#if __cpp_impl_three_way_comparison < 201907L
2610 operator!=(
const param_type& __p1,
const param_type& __p2)
2611 {
return !(__p1 == __p2); }
2621 _RealType _M_malpha, _M_a2;
2636 _RealType __beta_val = _RealType(1))
2637 : _M_param(__alpha_val, __beta_val), _M_nd()
2642 : _M_param(__p), _M_nd()
2657 {
return _M_param.alpha(); }
2664 {
return _M_param.beta(); }
2671 {
return _M_param; }
2679 { _M_param = __param; }
2698 template<
typename _UniformRandomNumberGenerator>
2701 {
return this->
operator()(__urng, _M_param); }
2703 template<
typename _UniformRandomNumberGenerator>
2706 const param_type& __p);
2708 template<
typename _ForwardIterator,
2709 typename _UniformRandomNumberGenerator>
2711 __generate(_ForwardIterator __f, _ForwardIterator __t,
2712 _UniformRandomNumberGenerator& __urng)
2713 { this->__generate(__f, __t, __urng, _M_param); }
2715 template<
typename _ForwardIterator,
2716 typename _UniformRandomNumberGenerator>
2718 __generate(_ForwardIterator __f, _ForwardIterator __t,
2719 _UniformRandomNumberGenerator& __urng,
2720 const param_type& __p)
2721 { this->__generate_impl(__f, __t, __urng, __p); }
2723 template<
typename _UniformRandomNumberGenerator>
2725 __generate(result_type* __f, result_type* __t,
2726 _UniformRandomNumberGenerator& __urng,
2727 const param_type& __p)
2728 { this->__generate_impl(__f, __t, __urng, __p); }
2738 {
return (__d1._M_param == __d2._M_param
2739 && __d1._M_nd == __d2._M_nd); }
2751 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2765 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2771 template<
typename _ForwardIterator,
2772 typename _UniformRandomNumberGenerator>
2774 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
2775 _UniformRandomNumberGenerator& __urng,
2776 const param_type& __p);
2778 param_type _M_param;
2783#if __cpp_impl_three_way_comparison < 201907L
2787 template<
typename _RealType>
2791 {
return !(__d1 == __d2); }
2811 template<
typename _RealType =
double>
2812 class chi_squared_distribution
2815 "result_type must be a floating point type");
2824 typedef chi_squared_distribution<_RealType> distribution_type;
2826 param_type() : param_type(1) { }
2829 param_type(_RealType __n)
2838 operator==(
const param_type& __p1,
const param_type& __p2)
2839 {
return __p1._M_n == __p2._M_n; }
2841#if __cpp_impl_three_way_comparison < 201907L
2843 operator!=(
const param_type& __p1,
const param_type& __p2)
2844 {
return !(__p1 == __p2); }
2851 chi_squared_distribution() : chi_squared_distribution(1) { }
2855 : _M_param(__n), _M_gd(__n / 2)
2859 chi_squared_distribution(
const param_type& __p)
2860 : _M_param(__p), _M_gd(__p.n() / 2)
2875 {
return _M_param.n(); }
2882 {
return _M_param; }
2895 _M_gd.param(param_type(__param.n() / 2));
2915 template<
typename _UniformRandomNumberGenerator>
2918 {
return 2 * _M_gd(__urng); }
2920 template<
typename _UniformRandomNumberGenerator>
2922 operator()(_UniformRandomNumberGenerator& __urng,
2923 const param_type& __p)
2927 return 2 * _M_gd(__urng, param_type(__p.n() / 2));
2930 template<
typename _ForwardIterator,
2931 typename _UniformRandomNumberGenerator>
2933 __generate(_ForwardIterator __f, _ForwardIterator __t,
2934 _UniformRandomNumberGenerator& __urng)
2935 { this->__generate_impl(__f, __t, __urng); }
2937 template<
typename _ForwardIterator,
2938 typename _UniformRandomNumberGenerator>
2940 __generate(_ForwardIterator __f, _ForwardIterator __t,
2941 _UniformRandomNumberGenerator& __urng,
2943 {
typename std::gamma_distribution<result_type>::param_type
2945 this->__generate_impl(__f, __t, __urng, __p2); }
2947 template<
typename _UniformRandomNumberGenerator>
2950 _UniformRandomNumberGenerator& __urng)
2951 { this->__generate_impl(__f, __t, __urng); }
2953 template<
typename _UniformRandomNumberGenerator>
2956 _UniformRandomNumberGenerator& __urng,
2958 {
typename std::gamma_distribution<result_type>::param_type
2960 this->__generate_impl(__f, __t, __urng, __p2); }
2969 const chi_squared_distribution& __d2)
2970 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
2982 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2997 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3003 template<
typename _ForwardIterator,
3004 typename _UniformRandomNumberGenerator>
3006 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3007 _UniformRandomNumberGenerator& __urng);
3009 template<
typename _ForwardIterator,
3010 typename _UniformRandomNumberGenerator>
3012 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3013 _UniformRandomNumberGenerator& __urng,
3017 param_type _M_param;
3022#if __cpp_impl_three_way_comparison < 201907L
3026 template<
typename _RealType>
3030 {
return !(__d1 == __d2); }
3042 template<
typename _RealType =
double>
3043 class cauchy_distribution
3046 "result_type must be a floating point type");
3055 typedef cauchy_distribution<_RealType> distribution_type;
3057 param_type() : param_type(0) { }
3060 param_type(_RealType __a, _RealType __b = _RealType(1))
3061 : _M_a(__a), _M_b(__b)
3073 operator==(
const param_type& __p1,
const param_type& __p2)
3074 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
3076#if __cpp_impl_three_way_comparison < 201907L
3078 operator!=(
const param_type& __p1,
const param_type& __p2)
3079 {
return !(__p1 == __p2); }
3087 cauchy_distribution() : cauchy_distribution(0.0) { }
3091 : _M_param(__a, __b)
3095 cauchy_distribution(
const param_type& __p)
3111 {
return _M_param.a(); }
3115 {
return _M_param.b(); }
3122 {
return _M_param; }
3130 { _M_param = __param; }
3149 template<
typename _UniformRandomNumberGenerator>
3152 {
return this->
operator()(__urng, _M_param); }
3154 template<
typename _UniformRandomNumberGenerator>
3156 operator()(_UniformRandomNumberGenerator& __urng,
3157 const param_type& __p);
3159 template<
typename _ForwardIterator,
3160 typename _UniformRandomNumberGenerator>
3162 __generate(_ForwardIterator __f, _ForwardIterator __t,
3163 _UniformRandomNumberGenerator& __urng)
3164 { this->__generate(__f, __t, __urng, _M_param); }
3166 template<
typename _ForwardIterator,
3167 typename _UniformRandomNumberGenerator>
3169 __generate(_ForwardIterator __f, _ForwardIterator __t,
3170 _UniformRandomNumberGenerator& __urng,
3171 const param_type& __p)
3172 { this->__generate_impl(__f, __t, __urng, __p); }
3174 template<
typename _UniformRandomNumberGenerator>
3177 _UniformRandomNumberGenerator& __urng,
3179 { this->__generate_impl(__f, __t, __urng, __p); }
3187 const cauchy_distribution& __d2)
3188 {
return __d1._M_param == __d2._M_param; }
3191 template<
typename _ForwardIterator,
3192 typename _UniformRandomNumberGenerator>
3194 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3195 _UniformRandomNumberGenerator& __urng,
3196 const param_type& __p);
3198 param_type _M_param;
3201#if __cpp_impl_three_way_comparison < 201907L
3206 template<
typename _RealType>
3210 {
return !(__d1 == __d2); }
3223 template<
typename _RealType,
typename _CharT,
typename _Traits>
3224 std::basic_ostream<_CharT, _Traits>&
3225 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3226 const std::cauchy_distribution<_RealType>& __x);
3238 template<
typename _RealType,
typename _CharT,
typename _Traits>
3239 std::basic_istream<_CharT, _Traits>&
3240 operator>>(std::basic_istream<_CharT, _Traits>& __is,
3241 std::cauchy_distribution<_RealType>& __x);
3257 template<
typename _RealType =
double>
3258 class fisher_f_distribution
3261 "result_type must be a floating point type");
3270 typedef fisher_f_distribution<_RealType> distribution_type;
3272 param_type() : param_type(1) { }
3275 param_type(_RealType __m, _RealType __n = _RealType(1))
3276 : _M_m(__m), _M_n(__n)
3288 operator==(
const param_type& __p1,
const param_type& __p2)
3289 {
return __p1._M_m == __p2._M_m && __p1._M_n == __p2._M_n; }
3291#if __cpp_impl_three_way_comparison < 201907L
3293 operator!=(
const param_type& __p1,
const param_type& __p2)
3294 {
return !(__p1 == __p2); }
3302 fisher_f_distribution() : fisher_f_distribution(1.0) { }
3306 _RealType __n = _RealType(1))
3307 : _M_param(__m, __n), _M_gd_x(__m / 2), _M_gd_y(__n / 2)
3311 fisher_f_distribution(
const param_type& __p)
3312 : _M_param(__p), _M_gd_x(__p.m() / 2), _M_gd_y(__p.n() / 2)
3330 {
return _M_param.m(); }
3334 {
return _M_param.n(); }
3341 {
return _M_param; }
3354 _M_gd_x.param(param_type(__param.m() / 2));
3355 _M_gd_y.param(param_type(__param.n() / 2));
3375 template<
typename _UniformRandomNumberGenerator>
3378 {
return (_M_gd_x(__urng) * n()) / (_M_gd_y(__urng) * m()); }
3380 template<
typename _UniformRandomNumberGenerator>
3382 operator()(_UniformRandomNumberGenerator& __urng,
3383 const param_type& __p)
3387 return ((_M_gd_x(__urng, param_type(__p.m() / 2)) * n())
3388 / (_M_gd_y(__urng, param_type(__p.n() / 2)) * m()));
3391 template<
typename _ForwardIterator,
3392 typename _UniformRandomNumberGenerator>
3394 __generate(_ForwardIterator __f, _ForwardIterator __t,
3395 _UniformRandomNumberGenerator& __urng)
3396 { this->__generate_impl(__f, __t, __urng); }
3398 template<
typename _ForwardIterator,
3399 typename _UniformRandomNumberGenerator>
3401 __generate(_ForwardIterator __f, _ForwardIterator __t,
3402 _UniformRandomNumberGenerator& __urng,
3404 { this->__generate_impl(__f, __t, __urng, __p); }
3406 template<
typename _UniformRandomNumberGenerator>
3409 _UniformRandomNumberGenerator& __urng)
3410 { this->__generate_impl(__f, __t, __urng); }
3412 template<
typename _UniformRandomNumberGenerator>
3415 _UniformRandomNumberGenerator& __urng,
3417 { this->__generate_impl(__f, __t, __urng, __p); }
3426 const fisher_f_distribution& __d2)
3427 {
return (__d1._M_param == __d2._M_param
3428 && __d1._M_gd_x == __d2._M_gd_x
3429 && __d1._M_gd_y == __d2._M_gd_y); }
3441 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3456 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3462 template<
typename _ForwardIterator,
3463 typename _UniformRandomNumberGenerator>
3465 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3466 _UniformRandomNumberGenerator& __urng);
3468 template<
typename _ForwardIterator,
3469 typename _UniformRandomNumberGenerator>
3471 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3472 _UniformRandomNumberGenerator& __urng,
3473 const param_type& __p);
3475 param_type _M_param;
3480#if __cpp_impl_three_way_comparison < 201907L
3484 template<
typename _RealType>
3488 {
return !(__d1 == __d2); }
3503 template<
typename _RealType =
double>
3504 class student_t_distribution
3507 "result_type must be a floating point type");
3516 typedef student_t_distribution<_RealType> distribution_type;
3518 param_type() : param_type(1) { }
3521 param_type(_RealType __n)
3530 operator==(
const param_type& __p1,
const param_type& __p2)
3531 {
return __p1._M_n == __p2._M_n; }
3533#if __cpp_impl_three_way_comparison < 201907L
3535 operator!=(
const param_type& __p1,
const param_type& __p2)
3536 {
return !(__p1 == __p2); }
3543 student_t_distribution() : student_t_distribution(1.0) { }
3547 : _M_param(__n), _M_nd(), _M_gd(__n / 2, 2)
3551 student_t_distribution(
const param_type& __p)
3552 : _M_param(__p), _M_nd(), _M_gd(__p.n() / 2, 2)
3570 {
return _M_param.n(); }
3577 {
return _M_param; }
3590 _M_gd.param(param_type(__param.n() / 2, 2));
3610 template<
typename _UniformRandomNumberGenerator>
3613 {
return _M_nd(__urng) *
std::sqrt(n() / _M_gd(__urng)); }
3615 template<
typename _UniformRandomNumberGenerator>
3617 operator()(_UniformRandomNumberGenerator& __urng,
3618 const param_type& __p)
3623 const result_type __g = _M_gd(__urng, param_type(__p.n() / 2, 2));
3624 return _M_nd(__urng) *
std::sqrt(__p.n() / __g);
3627 template<
typename _ForwardIterator,
3628 typename _UniformRandomNumberGenerator>
3630 __generate(_ForwardIterator __f, _ForwardIterator __t,
3631 _UniformRandomNumberGenerator& __urng)
3632 { this->__generate_impl(__f, __t, __urng); }
3634 template<
typename _ForwardIterator,
3635 typename _UniformRandomNumberGenerator>
3637 __generate(_ForwardIterator __f, _ForwardIterator __t,
3638 _UniformRandomNumberGenerator& __urng,
3640 { this->__generate_impl(__f, __t, __urng, __p); }
3642 template<
typename _UniformRandomNumberGenerator>
3645 _UniformRandomNumberGenerator& __urng)
3646 { this->__generate_impl(__f, __t, __urng); }
3648 template<
typename _UniformRandomNumberGenerator>
3651 _UniformRandomNumberGenerator& __urng,
3653 { this->__generate_impl(__f, __t, __urng, __p); }
3662 const student_t_distribution& __d2)
3663 {
return (__d1._M_param == __d2._M_param
3664 && __d1._M_nd == __d2._M_nd && __d1._M_gd == __d2._M_gd); }
3676 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3691 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3697 template<
typename _ForwardIterator,
3698 typename _UniformRandomNumberGenerator>
3700 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3701 _UniformRandomNumberGenerator& __urng);
3702 template<
typename _ForwardIterator,
3703 typename _UniformRandomNumberGenerator>
3705 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3706 _UniformRandomNumberGenerator& __urng,
3707 const param_type& __p);
3709 param_type _M_param;
3715#if __cpp_impl_three_way_comparison < 201907L
3719 template<
typename _RealType>
3723 {
return !(__d1 == __d2); }
3754 param_type() : param_type(0.5) { }
3757 param_type(
double __p)
3760 __glibcxx_assert((_M_p >= 0.0) && (_M_p <= 1.0));
3768 operator==(
const param_type& __p1,
const param_type& __p2)
3769 {
return __p1._M_p == __p2._M_p; }
3771#if __cpp_impl_three_way_comparison < 201907L
3773 operator!=(
const param_type& __p1,
const param_type& __p2)
3774 {
return !(__p1 == __p2); }
3816 {
return _M_param.p(); }
3823 {
return _M_param; }
3831 { _M_param = __param; }
3850 template<
typename _UniformRandomNumberGenerator>
3853 {
return this->
operator()(__urng, _M_param); }
3855 template<
typename _UniformRandomNumberGenerator>
3857 operator()(_UniformRandomNumberGenerator& __urng,
3858 const param_type& __p)
3860 __detail::_Adaptor<_UniformRandomNumberGenerator, double>
3862 if ((__aurng() - __aurng.min())
3863 < __p.p() * (__aurng.max() - __aurng.min()))
3868 template<
typename _ForwardIterator,
3869 typename _UniformRandomNumberGenerator>
3871 __generate(_ForwardIterator __f, _ForwardIterator __t,
3872 _UniformRandomNumberGenerator& __urng)
3873 { this->__generate(__f, __t, __urng, _M_param); }
3875 template<
typename _ForwardIterator,
3876 typename _UniformRandomNumberGenerator>
3878 __generate(_ForwardIterator __f, _ForwardIterator __t,
3879 _UniformRandomNumberGenerator& __urng,
const param_type& __p)
3880 { this->__generate_impl(__f, __t, __urng, __p); }
3882 template<
typename _UniformRandomNumberGenerator>
3885 _UniformRandomNumberGenerator& __urng,
3887 { this->__generate_impl(__f, __t, __urng, __p); }
3896 {
return __d1._M_param == __d2._M_param; }
3899 template<
typename _ForwardIterator,
3900 typename _UniformRandomNumberGenerator>
3902 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
3903 _UniformRandomNumberGenerator& __urng,
3904 const param_type& __p);
3906 param_type _M_param;
3909#if __cpp_impl_three_way_comparison < 201907L
3917 {
return !(__d1 == __d2); }
3930 template<
typename _CharT,
typename _Traits>
3931 std::basic_ostream<_CharT, _Traits>&
3932 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3933 const std::bernoulli_distribution& __x);
3944 template<
typename _CharT,
typename _Traits>
3945 inline std::basic_istream<_CharT, _Traits>&
3966 template<
typename _IntType =
int>
3967 class binomial_distribution
3970 "result_type must be an integral type");
3979 typedef binomial_distribution<_IntType> distribution_type;
3980 friend class binomial_distribution<_IntType>;
3982 param_type() : param_type(1) { }
3985 param_type(_IntType __t,
double __p = 0.5)
3986 : _M_t(__t), _M_p(__p)
3988 __glibcxx_assert((_M_t >= _IntType(0))
4003 operator==(
const param_type& __p1,
const param_type& __p2)
4004 {
return __p1._M_t == __p2._M_t && __p1._M_p == __p2._M_p; }
4006#if __cpp_impl_three_way_comparison < 201907L
4008 operator!=(
const param_type& __p1,
const param_type& __p2)
4009 {
return !(__p1 == __p2); }
4020#if _GLIBCXX_USE_C99_MATH_FUNCS
4021 double _M_d1, _M_d2, _M_s1, _M_s2, _M_c,
4022 _M_a1, _M_a123, _M_s, _M_lf, _M_lp1p;
4029 binomial_distribution() : binomial_distribution(1) { }
4033 : _M_param(__t, __p), _M_nd()
4037 binomial_distribution(
const param_type& __p)
4038 : _M_param(__p), _M_nd()
4053 {
return _M_param.t(); }
4060 {
return _M_param.p(); }
4067 {
return _M_param; }
4075 { _M_param = __param; }
4089 {
return _M_param.t(); }
4094 template<
typename _UniformRandomNumberGenerator>
4097 {
return this->
operator()(__urng, _M_param); }
4099 template<
typename _UniformRandomNumberGenerator>
4102 const param_type& __p);
4104 template<
typename _ForwardIterator,
4105 typename _UniformRandomNumberGenerator>
4107 __generate(_ForwardIterator __f, _ForwardIterator __t,
4108 _UniformRandomNumberGenerator& __urng)
4109 { this->__generate(__f, __t, __urng, _M_param); }
4111 template<
typename _ForwardIterator,
4112 typename _UniformRandomNumberGenerator>
4114 __generate(_ForwardIterator __f, _ForwardIterator __t,
4115 _UniformRandomNumberGenerator& __urng,
4116 const param_type& __p)
4117 { this->__generate_impl(__f, __t, __urng, __p); }
4119 template<
typename _UniformRandomNumberGenerator>
4121 __generate(result_type* __f, result_type* __t,
4122 _UniformRandomNumberGenerator& __urng,
4123 const param_type& __p)
4124 { this->__generate_impl(__f, __t, __urng, __p); }
4133 const binomial_distribution& __d2)
4134#ifdef _GLIBCXX_USE_C99_MATH_FUNCS
4135 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
4137 {
return __d1._M_param == __d2._M_param; }
4150 template<
typename _IntType1,
4151 typename _CharT,
typename _Traits>
4166 template<
typename _IntType1,
4167 typename _CharT,
typename _Traits>
4173 template<
typename _ForwardIterator,
4174 typename _UniformRandomNumberGenerator>
4176 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4177 _UniformRandomNumberGenerator& __urng,
4178 const param_type& __p);
4180 template<
typename _UniformRandomNumberGenerator>
4182 _M_waiting(_UniformRandomNumberGenerator& __urng,
4183 _IntType __t,
double __q);
4185 param_type _M_param;
4191#if __cpp_impl_three_way_comparison < 201907L
4195 template<
typename _IntType>
4199 {
return !(__d1 == __d2); }
4212 template<
typename _IntType =
int>
4213 class geometric_distribution
4216 "result_type must be an integral type");
4225 typedef geometric_distribution<_IntType> distribution_type;
4226 friend class geometric_distribution<_IntType>;
4228 param_type() : param_type(0.5) { }
4231 param_type(
double __p)
4234 __glibcxx_assert((_M_p > 0.0) && (_M_p < 1.0));
4243 operator==(
const param_type& __p1,
const param_type& __p2)
4244 {
return __p1._M_p == __p2._M_p; }
4246#if __cpp_impl_three_way_comparison < 201907L
4248 operator!=(
const param_type& __p1,
const param_type& __p2)
4249 {
return !(__p1 == __p2); }
4255 { _M_log_1_p =
std::log(1.0 - _M_p); }
4264 geometric_distribution() : geometric_distribution(0.5) { }
4272 geometric_distribution(
const param_type& __p)
4289 {
return _M_param.p(); }
4296 {
return _M_param; }
4304 { _M_param = __param; }
4323 template<
typename _UniformRandomNumberGenerator>
4326 {
return this->
operator()(__urng, _M_param); }
4328 template<
typename _UniformRandomNumberGenerator>
4330 operator()(_UniformRandomNumberGenerator& __urng,
4331 const param_type& __p);
4333 template<
typename _ForwardIterator,
4334 typename _UniformRandomNumberGenerator>
4336 __generate(_ForwardIterator __f, _ForwardIterator __t,
4337 _UniformRandomNumberGenerator& __urng)
4338 { this->__generate(__f, __t, __urng, _M_param); }
4340 template<
typename _ForwardIterator,
4341 typename _UniformRandomNumberGenerator>
4343 __generate(_ForwardIterator __f, _ForwardIterator __t,
4344 _UniformRandomNumberGenerator& __urng,
4345 const param_type& __p)
4346 { this->__generate_impl(__f, __t, __urng, __p); }
4348 template<
typename _UniformRandomNumberGenerator>
4351 _UniformRandomNumberGenerator& __urng,
4353 { this->__generate_impl(__f, __t, __urng, __p); }
4361 const geometric_distribution& __d2)
4362 {
return __d1._M_param == __d2._M_param; }
4365 template<
typename _ForwardIterator,
4366 typename _UniformRandomNumberGenerator>
4368 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4369 _UniformRandomNumberGenerator& __urng,
4370 const param_type& __p);
4372 param_type _M_param;
4375#if __cpp_impl_three_way_comparison < 201907L
4380 template<
typename _IntType>
4384 {
return !(__d1 == __d2); }
4397 template<
typename _IntType,
4398 typename _CharT,
typename _Traits>
4399 std::basic_ostream<_CharT, _Traits>&
4400 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4401 const std::geometric_distribution<_IntType>& __x);
4412 template<
typename _IntType,
4413 typename _CharT,
typename _Traits>
4414 std::basic_istream<_CharT, _Traits>&
4415 operator>>(std::basic_istream<_CharT, _Traits>& __is,
4416 std::geometric_distribution<_IntType>& __x);
4429 template<
typename _IntType =
int>
4430 class negative_binomial_distribution
4433 "result_type must be an integral type");
4442 typedef negative_binomial_distribution<_IntType> distribution_type;
4444 param_type() : param_type(1) { }
4447 param_type(_IntType __k,
double __p = 0.5)
4448 : _M_k(__k), _M_p(__p)
4450 __glibcxx_assert((_M_k > 0) && (_M_p > 0.0) && (_M_p <= 1.0));
4462 operator==(
const param_type& __p1,
const param_type& __p2)
4463 {
return __p1._M_k == __p2._M_k && __p1._M_p == __p2._M_p; }
4465#if __cpp_impl_three_way_comparison < 201907L
4467 operator!=(
const param_type& __p1,
const param_type& __p2)
4468 {
return !(__p1 == __p2); }
4476 negative_binomial_distribution() : negative_binomial_distribution(1) { }
4480 : _M_param(__k, __p), _M_gd(__k, (1.0 - __p) / __p)
4484 negative_binomial_distribution(
const param_type& __p)
4485 : _M_param(__p), _M_gd(__p.
k(), (1.0 - __p.
p()) / __p.
p())
4500 {
return _M_param.k(); }
4507 {
return _M_param.p(); }
4514 {
return _M_param; }
4527 _M_gd.param(param_type(__param.k(), (1.0 - __param.p()) / __param.p()));
4547 template<
typename _UniformRandomNumberGenerator>
4551 template<
typename _UniformRandomNumberGenerator>
4553 operator()(_UniformRandomNumberGenerator& __urng,
4554 const param_type& __p);
4556 template<
typename _ForwardIterator,
4557 typename _UniformRandomNumberGenerator>
4559 __generate(_ForwardIterator __f, _ForwardIterator __t,
4560 _UniformRandomNumberGenerator& __urng)
4561 { this->__generate_impl(__f, __t, __urng); }
4563 template<
typename _ForwardIterator,
4564 typename _UniformRandomNumberGenerator>
4566 __generate(_ForwardIterator __f, _ForwardIterator __t,
4567 _UniformRandomNumberGenerator& __urng,
4568 const param_type& __p)
4569 { this->__generate_impl(__f, __t, __urng, __p); }
4571 template<
typename _UniformRandomNumberGenerator>
4573 __generate(result_type* __f, result_type* __t,
4574 _UniformRandomNumberGenerator& __urng)
4575 { this->__generate_impl(__f, __t, __urng); }
4577 template<
typename _UniformRandomNumberGenerator>
4580 _UniformRandomNumberGenerator& __urng,
4582 { this->__generate_impl(__f, __t, __urng, __p); }
4591 const negative_binomial_distribution& __d2)
4592 {
return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
4605 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4620 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4626 template<
typename _ForwardIterator,
4627 typename _UniformRandomNumberGenerator>
4629 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4630 _UniformRandomNumberGenerator& __urng);
4631 template<
typename _ForwardIterator,
4632 typename _UniformRandomNumberGenerator>
4634 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4635 _UniformRandomNumberGenerator& __urng,
4636 const param_type& __p);
4638 param_type _M_param;
4643#if __cpp_impl_three_way_comparison < 201907L
4647 template<
typename _IntType>
4651 {
return !(__d1 == __d2); }
4672 template<
typename _IntType =
int>
4673 class poisson_distribution
4676 "result_type must be an integral type");
4685 typedef poisson_distribution<_IntType> distribution_type;
4686 friend class poisson_distribution<_IntType>;
4688 param_type() : param_type(1.0) { }
4691 param_type(
double __mean)
4694 __glibcxx_assert(_M_mean > 0.0);
4703 operator==(
const param_type& __p1,
const param_type& __p2)
4704 {
return __p1._M_mean == __p2._M_mean; }
4706#if __cpp_impl_three_way_comparison < 201907L
4708 operator!=(
const param_type& __p1,
const param_type& __p2)
4709 {
return !(__p1 == __p2); }
4720#if _GLIBCXX_USE_C99_MATH_FUNCS
4721 double _M_lfm, _M_sm, _M_d, _M_scx, _M_1cx, _M_c2b, _M_cb;
4727 poisson_distribution() : poisson_distribution(1.0) { }
4731 : _M_param(__mean), _M_nd()
4735 poisson_distribution(
const param_type& __p)
4736 : _M_param(__p), _M_nd()
4751 {
return _M_param.mean(); }
4758 {
return _M_param; }
4766 { _M_param = __param; }
4785 template<
typename _UniformRandomNumberGenerator>
4788 {
return this->
operator()(__urng, _M_param); }
4790 template<
typename _UniformRandomNumberGenerator>
4793 const param_type& __p);
4795 template<
typename _ForwardIterator,
4796 typename _UniformRandomNumberGenerator>
4798 __generate(_ForwardIterator __f, _ForwardIterator __t,
4799 _UniformRandomNumberGenerator& __urng)
4800 { this->__generate(__f, __t, __urng, _M_param); }
4802 template<
typename _ForwardIterator,
4803 typename _UniformRandomNumberGenerator>
4805 __generate(_ForwardIterator __f, _ForwardIterator __t,
4806 _UniformRandomNumberGenerator& __urng,
4807 const param_type& __p)
4808 { this->__generate_impl(__f, __t, __urng, __p); }
4810 template<
typename _UniformRandomNumberGenerator>
4812 __generate(result_type* __f, result_type* __t,
4813 _UniformRandomNumberGenerator& __urng,
4814 const param_type& __p)
4815 { this->__generate_impl(__f, __t, __urng, __p); }
4824 const poisson_distribution& __d2)
4825#ifdef _GLIBCXX_USE_C99_MATH_FUNCS
4826 {
return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
4828 {
return __d1._M_param == __d2._M_param; }
4841 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4856 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4862 template<
typename _ForwardIterator,
4863 typename _UniformRandomNumberGenerator>
4865 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
4866 _UniformRandomNumberGenerator& __urng,
4867 const param_type& __p);
4869 param_type _M_param;
4875#if __cpp_impl_three_way_comparison < 201907L
4879 template<
typename _IntType>
4883 {
return !(__d1 == __d2); }
4904 template<
typename _RealType =
double>
4908 "result_type must be a floating point type");
4919 param_type() : param_type(1.0) { }
4922 param_type(_RealType __lambda)
4923 : _M_lambda(__lambda)
4925 __glibcxx_assert(_M_lambda > _RealType(0));
4930 {
return _M_lambda; }
4933 operator==(
const param_type& __p1,
const param_type& __p2)
4934 {
return __p1._M_lambda == __p2._M_lambda; }
4936#if __cpp_impl_three_way_comparison < 201907L
4938 operator!=(
const param_type& __p1,
const param_type& __p2)
4939 {
return !(__p1 == __p2); }
4943 _RealType _M_lambda;
4959 : _M_param(__lambda)
4980 {
return _M_param.lambda(); }
4987 {
return _M_param; }
4995 { _M_param = __param; }
5014 template<
typename _UniformRandomNumberGenerator>
5017 {
return this->
operator()(__urng, _M_param); }
5019 template<
typename _UniformRandomNumberGenerator>
5021 operator()(_UniformRandomNumberGenerator& __urng,
5022 const param_type& __p)
5024 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
5029 template<
typename _ForwardIterator,
5030 typename _UniformRandomNumberGenerator>
5032 __generate(_ForwardIterator __f, _ForwardIterator __t,
5033 _UniformRandomNumberGenerator& __urng)
5034 { this->__generate(__f, __t, __urng, _M_param); }
5036 template<
typename _ForwardIterator,
5037 typename _UniformRandomNumberGenerator>
5039 __generate(_ForwardIterator __f, _ForwardIterator __t,
5040 _UniformRandomNumberGenerator& __urng,
5042 { this->__generate_impl(__f, __t, __urng, __p); }
5044 template<
typename _UniformRandomNumberGenerator>
5047 _UniformRandomNumberGenerator& __urng,
5049 { this->__generate_impl(__f, __t, __urng, __p); }
5058 {
return __d1._M_param == __d2._M_param; }
5061 template<
typename _ForwardIterator,
5062 typename _UniformRandomNumberGenerator>
5064 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5065 _UniformRandomNumberGenerator& __urng,
5066 const param_type& __p);
5068 param_type _M_param;
5071#if __cpp_impl_three_way_comparison < 201907L
5076 template<
typename _RealType>
5080 {
return !(__d1 == __d2); }
5093 template<
typename _RealType,
typename _CharT,
typename _Traits>
5094 std::basic_ostream<_CharT, _Traits>&
5095 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5096 const std::exponential_distribution<_RealType>& __x);
5108 template<
typename _RealType,
typename _CharT,
typename _Traits>
5109 std::basic_istream<_CharT, _Traits>&
5110 operator>>(std::basic_istream<_CharT, _Traits>& __is,
5111 std::exponential_distribution<_RealType>& __x);
5126 template<
typename _RealType =
double>
5127 class weibull_distribution
5130 "result_type must be a floating point type");
5139 typedef weibull_distribution<_RealType> distribution_type;
5141 param_type() : param_type(1.0) { }
5144 param_type(_RealType __a, _RealType __b = _RealType(1.0))
5145 : _M_a(__a), _M_b(__b)
5157 operator==(
const param_type& __p1,
const param_type& __p2)
5158 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
5160#if __cpp_impl_three_way_comparison < 201907L
5162 operator!=(
const param_type& __p1,
const param_type& __p2)
5163 {
return !(__p1 == __p2); }
5171 weibull_distribution() : weibull_distribution(1.0) { }
5175 : _M_param(__a, __b)
5179 weibull_distribution(
const param_type& __p)
5195 {
return _M_param.a(); }
5202 {
return _M_param.b(); }
5209 {
return _M_param; }
5217 { _M_param = __param; }
5236 template<
typename _UniformRandomNumberGenerator>
5239 {
return this->
operator()(__urng, _M_param); }
5241 template<
typename _UniformRandomNumberGenerator>
5243 operator()(_UniformRandomNumberGenerator& __urng,
5244 const param_type& __p);
5246 template<
typename _ForwardIterator,
5247 typename _UniformRandomNumberGenerator>
5249 __generate(_ForwardIterator __f, _ForwardIterator __t,
5250 _UniformRandomNumberGenerator& __urng)
5251 { this->__generate(__f, __t, __urng, _M_param); }
5253 template<
typename _ForwardIterator,
5254 typename _UniformRandomNumberGenerator>
5256 __generate(_ForwardIterator __f, _ForwardIterator __t,
5257 _UniformRandomNumberGenerator& __urng,
5258 const param_type& __p)
5259 { this->__generate_impl(__f, __t, __urng, __p); }
5261 template<
typename _UniformRandomNumberGenerator>
5264 _UniformRandomNumberGenerator& __urng,
5266 { this->__generate_impl(__f, __t, __urng, __p); }
5274 const weibull_distribution& __d2)
5275 {
return __d1._M_param == __d2._M_param; }
5278 template<
typename _ForwardIterator,
5279 typename _UniformRandomNumberGenerator>
5281 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5282 _UniformRandomNumberGenerator& __urng,
5283 const param_type& __p);
5285 param_type _M_param;
5288#if __cpp_impl_three_way_comparison < 201907L
5293 template<
typename _RealType>
5297 {
return !(__d1 == __d2); }
5310 template<
typename _RealType,
typename _CharT,
typename _Traits>
5311 std::basic_ostream<_CharT, _Traits>&
5312 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5313 const std::weibull_distribution<_RealType>& __x);
5325 template<
typename _RealType,
typename _CharT,
typename _Traits>
5326 std::basic_istream<_CharT, _Traits>&
5327 operator>>(std::basic_istream<_CharT, _Traits>& __is,
5328 std::weibull_distribution<_RealType>& __x);
5343 template<
typename _RealType =
double>
5344 class extreme_value_distribution
5347 "result_type must be a floating point type");
5356 typedef extreme_value_distribution<_RealType> distribution_type;
5358 param_type() : param_type(0.0) { }
5361 param_type(_RealType __a, _RealType __b = _RealType(1.0))
5362 : _M_a(__a), _M_b(__b)
5374 operator==(
const param_type& __p1,
const param_type& __p2)
5375 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
5377#if __cpp_impl_three_way_comparison < 201907L
5379 operator!=(
const param_type& __p1,
const param_type& __p2)
5380 {
return !(__p1 == __p2); }
5388 extreme_value_distribution() : extreme_value_distribution(0.0) { }
5392 : _M_param(__a, __b)
5396 extreme_value_distribution(
const param_type& __p)
5412 {
return _M_param.a(); }
5419 {
return _M_param.b(); }
5426 {
return _M_param; }
5434 { _M_param = __param; }
5453 template<
typename _UniformRandomNumberGenerator>
5456 {
return this->
operator()(__urng, _M_param); }
5458 template<
typename _UniformRandomNumberGenerator>
5460 operator()(_UniformRandomNumberGenerator& __urng,
5461 const param_type& __p);
5463 template<
typename _ForwardIterator,
5464 typename _UniformRandomNumberGenerator>
5466 __generate(_ForwardIterator __f, _ForwardIterator __t,
5467 _UniformRandomNumberGenerator& __urng)
5468 { this->__generate(__f, __t, __urng, _M_param); }
5470 template<
typename _ForwardIterator,
5471 typename _UniformRandomNumberGenerator>
5473 __generate(_ForwardIterator __f, _ForwardIterator __t,
5474 _UniformRandomNumberGenerator& __urng,
5475 const param_type& __p)
5476 { this->__generate_impl(__f, __t, __urng, __p); }
5478 template<
typename _UniformRandomNumberGenerator>
5481 _UniformRandomNumberGenerator& __urng,
5483 { this->__generate_impl(__f, __t, __urng, __p); }
5491 const extreme_value_distribution& __d2)
5492 {
return __d1._M_param == __d2._M_param; }
5495 template<
typename _ForwardIterator,
5496 typename _UniformRandomNumberGenerator>
5498 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5499 _UniformRandomNumberGenerator& __urng,
5500 const param_type& __p);
5502 param_type _M_param;
5505#if __cpp_impl_three_way_comparison < 201907L
5510 template<
typename _RealType>
5514 {
return !(__d1 == __d2); }
5527 template<
typename _RealType,
typename _CharT,
typename _Traits>
5528 std::basic_ostream<_CharT, _Traits>&
5529 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5530 const std::extreme_value_distribution<_RealType>& __x);
5542 template<
typename _RealType,
typename _CharT,
typename _Traits>
5543 std::basic_istream<_CharT, _Traits>&
5544 operator>>(std::basic_istream<_CharT, _Traits>& __is,
5545 std::extreme_value_distribution<_RealType>& __x);
5565 template<
typename _IntType =
int>
5566 class discrete_distribution
5569 "result_type must be an integral type");
5578 typedef discrete_distribution<_IntType> distribution_type;
5579 friend class discrete_distribution<_IntType>;
5582 : _M_prob(), _M_cp()
5585 template<
typename _InputIterator>
5586 param_type(_InputIterator __wbegin,
5587 _InputIterator __wend)
5588 : _M_prob(__wbegin, __wend), _M_cp()
5589 { _M_initialize(); }
5592 : _M_prob(__wil.begin(), __wil.end()), _M_cp()
5593 { _M_initialize(); }
5595 template<
typename _Func>
5596 param_type(
size_t __nw,
double __xmin,
double __xmax,
5600 param_type(
const param_type&) =
default;
5601 param_type& operator=(
const param_type&) =
default;
5608 operator==(
const param_type& __p1,
const param_type& __p2)
5609 {
return __p1._M_prob == __p2._M_prob; }
5611#if __cpp_impl_three_way_comparison < 201907L
5613 operator!=(
const param_type& __p1,
const param_type& __p2)
5614 {
return !(__p1 == __p2); }
5625 discrete_distribution()
5629 template<
typename _InputIterator>
5631 _InputIterator __wend)
5632 : _M_param(__wbegin, __wend)
5635 discrete_distribution(initializer_list<double> __wl)
5639 template<
typename _Func>
5640 discrete_distribution(
size_t __nw,
double __xmin,
double __xmax,
5642 : _M_param(__nw, __xmin, __xmax, __fw)
5663 return _M_param._M_prob.
empty()
5672 {
return _M_param; }
5680 { _M_param = __param; }
5695 return _M_param._M_prob.empty()
5702 template<
typename _UniformRandomNumberGenerator>
5705 {
return this->
operator()(__urng, _M_param); }
5707 template<
typename _UniformRandomNumberGenerator>
5709 operator()(_UniformRandomNumberGenerator& __urng,
5710 const param_type& __p);
5712 template<
typename _ForwardIterator,
5713 typename _UniformRandomNumberGenerator>
5715 __generate(_ForwardIterator __f, _ForwardIterator __t,
5716 _UniformRandomNumberGenerator& __urng)
5717 { this->__generate(__f, __t, __urng, _M_param); }
5719 template<
typename _ForwardIterator,
5720 typename _UniformRandomNumberGenerator>
5722 __generate(_ForwardIterator __f, _ForwardIterator __t,
5723 _UniformRandomNumberGenerator& __urng,
5724 const param_type& __p)
5725 { this->__generate_impl(__f, __t, __urng, __p); }
5727 template<
typename _UniformRandomNumberGenerator>
5730 _UniformRandomNumberGenerator& __urng,
5732 { this->__generate_impl(__f, __t, __urng, __p); }
5740 const discrete_distribution& __d2)
5741 {
return __d1._M_param == __d2._M_param; }
5753 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5769 template<
typename _IntType1,
typename _CharT,
typename _Traits>
5775 template<
typename _ForwardIterator,
5776 typename _UniformRandomNumberGenerator>
5778 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
5779 _UniformRandomNumberGenerator& __urng,
5780 const param_type& __p);
5782 param_type _M_param;
5785#if __cpp_impl_three_way_comparison < 201907L
5790 template<
typename _IntType>
5794 {
return !(__d1 == __d2); }
5813 template<
typename _RealType =
double>
5814 class piecewise_constant_distribution
5817 "result_type must be a floating point type");
5826 typedef piecewise_constant_distribution<_RealType> distribution_type;
5827 friend class piecewise_constant_distribution<_RealType>;
5830 : _M_int(), _M_den(), _M_cp()
5833 template<
typename _InputIteratorB,
typename _InputIteratorW>
5834 param_type(_InputIteratorB __bfirst,
5835 _InputIteratorB __bend,
5836 _InputIteratorW __wbegin);
5838 template<
typename _Func>
5841 template<
typename _Func>
5842 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5846 param_type(
const param_type&) =
default;
5847 param_type& operator=(
const param_type&) =
default;
5855 __tmp[1] = _RealType(1);
5867 operator==(
const param_type& __p1,
const param_type& __p2)
5868 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
5870#if __cpp_impl_three_way_comparison < 201907L
5872 operator!=(
const param_type& __p1,
const param_type& __p2)
5873 {
return !(__p1 == __p2); }
5885 piecewise_constant_distribution()
5889 template<
typename _InputIteratorB,
typename _InputIteratorW>
5891 _InputIteratorB __bend,
5892 _InputIteratorW __wbegin)
5893 : _M_param(__bfirst, __bend, __wbegin)
5896 template<
typename _Func>
5897 piecewise_constant_distribution(initializer_list<_RealType> __bl,
5899 : _M_param(__bl, __fw)
5902 template<
typename _Func>
5903 piecewise_constant_distribution(
size_t __nw,
5904 _RealType __xmin, _RealType __xmax,
5906 : _M_param(__nw, __xmin, __xmax, __fw)
5910 piecewise_constant_distribution(
const param_type& __p)
5927 if (_M_param._M_int.empty())
5930 __tmp[1] = _RealType(1);
5934 return _M_param._M_int;
5943 return _M_param._M_den.
empty()
5952 {
return _M_param; }
5960 { _M_param = __param; }
5968 return _M_param._M_int.empty()
5978 return _M_param._M_int.empty()
5985 template<
typename _UniformRandomNumberGenerator>
5988 {
return this->
operator()(__urng, _M_param); }
5990 template<
typename _UniformRandomNumberGenerator>
5992 operator()(_UniformRandomNumberGenerator& __urng,
5993 const param_type& __p);
5995 template<
typename _ForwardIterator,
5996 typename _UniformRandomNumberGenerator>
5998 __generate(_ForwardIterator __f, _ForwardIterator __t,
5999 _UniformRandomNumberGenerator& __urng)
6000 { this->__generate(__f, __t, __urng, _M_param); }
6002 template<
typename _ForwardIterator,
6003 typename _UniformRandomNumberGenerator>
6005 __generate(_ForwardIterator __f, _ForwardIterator __t,
6006 _UniformRandomNumberGenerator& __urng,
6007 const param_type& __p)
6008 { this->__generate_impl(__f, __t, __urng, __p); }
6010 template<
typename _UniformRandomNumberGenerator>
6013 _UniformRandomNumberGenerator& __urng,
6015 { this->__generate_impl(__f, __t, __urng, __p); }
6023 const piecewise_constant_distribution& __d2)
6024 {
return __d1._M_param == __d2._M_param; }
6037 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6053 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6059 template<
typename _ForwardIterator,
6060 typename _UniformRandomNumberGenerator>
6062 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6063 _UniformRandomNumberGenerator& __urng,
6064 const param_type& __p);
6066 param_type _M_param;
6069#if __cpp_impl_three_way_comparison < 201907L
6074 template<
typename _RealType>
6078 {
return !(__d1 == __d2); }
6093 template<
typename _RealType =
double>
6094 class piecewise_linear_distribution
6097 "result_type must be a floating point type");
6106 typedef piecewise_linear_distribution<_RealType> distribution_type;
6107 friend class piecewise_linear_distribution<_RealType>;
6110 : _M_int(), _M_den(), _M_cp(), _M_m()
6113 template<
typename _InputIteratorB,
typename _InputIteratorW>
6114 param_type(_InputIteratorB __bfirst,
6115 _InputIteratorB __bend,
6116 _InputIteratorW __wbegin);
6118 template<
typename _Func>
6121 template<
typename _Func>
6122 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
6126 param_type(
const param_type&) =
default;
6127 param_type& operator=(
const param_type&) =
default;
6135 __tmp[1] = _RealType(1);
6147 operator==(
const param_type& __p1,
const param_type& __p2)
6148 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
6150#if __cpp_impl_three_way_comparison < 201907L
6152 operator!=(
const param_type& __p1,
const param_type& __p2)
6153 {
return !(__p1 == __p2); }
6166 piecewise_linear_distribution()
6170 template<
typename _InputIteratorB,
typename _InputIteratorW>
6172 _InputIteratorB __bend,
6173 _InputIteratorW __wbegin)
6174 : _M_param(__bfirst, __bend, __wbegin)
6177 template<
typename _Func>
6178 piecewise_linear_distribution(initializer_list<_RealType> __bl,
6180 : _M_param(__bl, __fw)
6183 template<
typename _Func>
6184 piecewise_linear_distribution(
size_t __nw,
6185 _RealType __xmin, _RealType __xmax,
6187 : _M_param(__nw, __xmin, __xmax, __fw)
6191 piecewise_linear_distribution(
const param_type& __p)
6208 if (_M_param._M_int.empty())
6211 __tmp[1] = _RealType(1);
6215 return _M_param._M_int;
6225 return _M_param._M_den.
empty()
6234 {
return _M_param; }
6242 { _M_param = __param; }
6250 return _M_param._M_int.empty()
6260 return _M_param._M_int.empty()
6267 template<
typename _UniformRandomNumberGenerator>
6270 {
return this->
operator()(__urng, _M_param); }
6272 template<
typename _UniformRandomNumberGenerator>
6274 operator()(_UniformRandomNumberGenerator& __urng,
6275 const param_type& __p);
6277 template<
typename _ForwardIterator,
6278 typename _UniformRandomNumberGenerator>
6280 __generate(_ForwardIterator __f, _ForwardIterator __t,
6281 _UniformRandomNumberGenerator& __urng)
6282 { this->__generate(__f, __t, __urng, _M_param); }
6284 template<
typename _ForwardIterator,
6285 typename _UniformRandomNumberGenerator>
6287 __generate(_ForwardIterator __f, _ForwardIterator __t,
6288 _UniformRandomNumberGenerator& __urng,
6289 const param_type& __p)
6290 { this->__generate_impl(__f, __t, __urng, __p); }
6292 template<
typename _UniformRandomNumberGenerator>
6295 _UniformRandomNumberGenerator& __urng,
6297 { this->__generate_impl(__f, __t, __urng, __p); }
6305 const piecewise_linear_distribution& __d2)
6306 {
return __d1._M_param == __d2._M_param; }
6319 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6335 template<
typename _RealType1,
typename _CharT,
typename _Traits>
6341 template<
typename _ForwardIterator,
6342 typename _UniformRandomNumberGenerator>
6344 __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
6345 _UniformRandomNumberGenerator& __urng,
6346 const param_type& __p);
6348 param_type _M_param;
6351#if __cpp_impl_three_way_comparison < 201907L
6356 template<
typename _RealType>
6360 {
return !(__d1 == __d2); }
6391 template<
typename _IntType,
typename = _Require<is_
integral<_IntType>>>
6394 template<
typename _InputIterator>
6395 seed_seq(_InputIterator __begin, _InputIterator __end);
6398 template<
typename _RandomAccessIterator>
6400 generate(_RandomAccessIterator __begin, _RandomAccessIterator __end);
6403 size_t size() const noexcept
6404 {
return _M_v.
size(); }
6406 template<
typename _OutputIterator>
6408 param(_OutputIterator __dest)
const
6409 { std::copy(_M_v.
begin(), _M_v.
end(), __dest); }
6416 std::vector<result_type> _M_v;
6423_GLIBCXX_END_NAMESPACE_VERSION
constexpr bool operator<=(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr duration< __common_rep_t< _Rep1, __disable_if_is_duration< _Rep2 > >, _Period > operator%(const duration< _Rep1, _Period > &__d, const _Rep2 &__s)
constexpr bool operator<(const duration< _Rep1, _Period1 > &__lhs, const duration< _Rep2, _Period2 > &__rhs)
constexpr complex< _Tp > operator*(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x times y.
complex< _Tp > log(const complex< _Tp > &)
Return complex natural logarithm of z.
constexpr complex< _Tp > operator+(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x plus y.
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.
auto declval() noexcept -> decltype(__declval< _Tp >(0))
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
_RealType generate_canonical(_UniformRandomNumberGenerator &__g)
A function template for converting the output of a (integral) uniform random number generator to a fl...
basic_string< char > string
A string of char.
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
ISO C++ entities toplevel namespace is std.
constexpr _Tp __lg(_Tp __n)
This is a helper function for the sort routines and for random.tcc.
constexpr auto size(const _Container &__cont) noexcept(noexcept(__cont.size())) -> decltype(__cont.size())
Return the size of a container.
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.
Implementation details not part of the namespace std interface.
Template class basic_istream.
Template class basic_ostream.
static constexpr int digits
static constexpr _Tp max() noexcept
static constexpr _Tp lowest() noexcept
static constexpr _Tp min() noexcept
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.
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.
static constexpr result_type modulus
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
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.
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.
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.
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::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...
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.
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 ...
static constexpr result_type min()
Gets the smallest possible value in the output range.
The Marsaglia-Zaman generator.
void seed(result_type __sd=0u)
Seeds the initial state of the random number generator.
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...
void discard(unsigned long long __z)
Discard a sequence of random numbers.
result_type operator()()
Gets the next random number in the sequence.
static constexpr result_type min()
Gets the inclusive minimum value of the range of random integers returned by this 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 ...
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...
static constexpr result_type max()
Gets the inclusive maximum value of the range of random integers returned by this generator.
static constexpr result_type min()
Gets the minimum value in the generated random number range.
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...
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine object.
void seed()
Reseeds the discard_block_engine object with the default seed for the underlying base class generator...
void discard(unsigned long long __z)
Discard a sequence of random numbers.
friend 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 ...
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.
result_type operator()()
Gets the next value in the generated random number sequence.
_RandomNumberEngine::result_type result_type
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.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::independent_bits_engine< _RandomNumberEngine, __w, _UIntType > &__x)
Extracts the current state of a % subtract_with_carry_engine random number generator engine __x from ...
friend bool operator==(const 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.
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine object.
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()
const _RandomNumberEngine & base() const noexcept
void seed()
Reseeds the shuffle_order_engine object with the default seed for the underlying base class generator...
_RandomNumberEngine::result_type result_type
friend bool operator==(const shuffle_order_engine &__lhs, const shuffle_order_engine &__rhs)
void discard(unsigned long long __z)
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...
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 ...
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.
result_type operator()(_UniformRandomNumberGenerator &__urng, const param_type &__p)
_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.
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.
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.
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 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.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::lognormal_distribution< _RealType1 > &__x)
Extracts a lognormal_distribution random number distribution __x from the input stream __is.
result_type 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.
result_type operator()(_UniformRandomNumberGenerator &__urng, const param_type &__p)
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...
void param(const param_type &__param)
Sets the parameter set of the distribution.
_RealType beta() const
Returns the of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::gamma_distribution< _RealType1 > &__x)
Extracts a gamma_distribution random number distribution __x from the input stream __is.
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 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.
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.
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_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::chi_squared_distribution< _RealType1 > &__x)
Extracts a chi_squared_distribution random number distribution __x from the input stream __is.
A 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_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.
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.
A student_t_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.
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.
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.
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.
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.
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.
_IntType t() const
Returns the distribution t parameter.
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.
void reset()
Resets the distribution state.
double p() const
Returns the distribution p parameter.
result_type operator()(_UniformRandomNumberGenerator &__urng, const param_type &__p)
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.
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.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
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.
result_type operator()(_UniformRandomNumberGenerator &__urng, const param_type &__p)
void reset()
Resets the distribution state.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
double mean() const
Returns the distribution parameter mean.
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.
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.
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.
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.
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.
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.
result_type max() const
Returns the least upper bound value of the distribution.
void reset()
Resets the distribution state.
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.
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.
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.
std::vector< _RealType > intervals() const
Return the intervals 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.
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_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.
uint_least32_t result_type
A standard container which offers fixed time access to individual elements in any order.
constexpr iterator end() noexcept
constexpr iterator begin() noexcept
constexpr bool empty() const noexcept
constexpr size_type size() const noexcept