36 namespace std _GLIBCXX_VISIBILITY(default)
38 _GLIBCXX_BEGIN_NAMESPACE_VERSION
55 template<
typename _RealType,
size_t __bits,
56 typename _UniformRandomNumberGenerator>
60 _GLIBCXX_END_NAMESPACE_VERSION
67 _GLIBCXX_BEGIN_NAMESPACE_VERSION
69 template<
typename _UIntType,
size_t __w,
70 bool = __w < static_cast<size_t>
73 {
static const _UIntType __value = 0; };
75 template<
typename _UIntType,
size_t __w>
76 struct _Shift<_UIntType, __w, true>
77 {
static const _UIntType __value = _UIntType(1) << __w; };
79 template<
typename _Tp, _Tp __m, _Tp __a, _Tp __c,
bool>
84 template<
typename _Tp, _Tp __m, _Tp __a = 1, _Tp __c = 0>
87 {
return _Mod<_Tp, __m, __a, __c, __m == 0>::__calc(__x); }
93 template<
typename _Engine,
typename _DInputType>
98 _Adaptor(_Engine& __g)
103 {
return _DInputType(0); }
107 {
return _DInputType(1); }
126 _GLIBCXX_END_NAMESPACE_VERSION
129 _GLIBCXX_BEGIN_NAMESPACE_VERSION
169 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
173 "substituting _UIntType not an unsigned integral type");
174 static_assert(__m == 0u || (__a < __m && __c < __m),
175 "template argument substituting __m out of bounds");
179 static_assert(__m % __a < __m / __a,
180 "sorry, not implemented yet: try a smaller 'a' constant");
211 template<
typename _Sseq,
typename =
typename
234 template<
typename _Sseq>
246 {
return __c == 0u ? 1u : 0u; }
261 for (; __z != 0ULL; --__z)
271 _M_x = __detail::__mod<_UIntType, __m, __a, __c>(_M_x);
289 {
return __lhs._M_x == __rhs._M_x; }
299 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
300 _UIntType1 __m1,
typename _CharT,
typename _Traits>
302 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
304 __a1, __c1, __m1>& __lcr);
319 template<
typename _UIntType1, _UIntType1 __a1, _UIntType1 __c1,
320 _UIntType1 __m1,
typename _CharT,
typename _Traits>
341 template<
typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
347 {
return !(__lhs == __rhs); }
378 template<
typename _UIntType,
size_t __w,
379 size_t __n,
size_t __m,
size_t __r,
380 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
381 _UIntType __b,
size_t __t,
382 _UIntType __c,
size_t __l, _UIntType __f>
386 "substituting _UIntType not an unsigned integral type");
387 static_assert(1u <= __m && __m <= __n,
388 "template argument substituting __m out of bounds");
389 static_assert(__r <= __w,
"template argument substituting "
391 static_assert(__u <= __w,
"template argument substituting "
393 static_assert(__s <= __w,
"template argument substituting "
395 static_assert(__t <= __w,
"template argument substituting "
397 static_assert(__l <= __w,
"template argument substituting "
400 "template argument substituting __w out of bound");
401 static_assert(__a <= (__detail::_Shift<_UIntType, __w>::__value - 1),
402 "template argument substituting __a out of bound");
403 static_assert(__b <= (__detail::_Shift<_UIntType, __w>::__value - 1),
404 "template argument substituting __b out of bound");
405 static_assert(__c <= (__detail::_Shift<_UIntType, __w>::__value - 1),
406 "template argument substituting __c out of bound");
407 static_assert(__d <= (__detail::_Shift<_UIntType, __w>::__value - 1),
408 "template argument substituting __d out of bound");
409 static_assert(__f <= (__detail::_Shift<_UIntType, __w>::__value - 1),
410 "template argument substituting __f out of bound");
417 static constexpr
size_t word_size = __w;
418 static constexpr
size_t state_size = __n;
419 static constexpr
size_t shift_size = __m;
420 static constexpr
size_t mask_bits = __r;
422 static constexpr
size_t tempering_u = __u;
424 static constexpr
size_t tempering_s = __s;
426 static constexpr
size_t tempering_t = __t;
428 static constexpr
size_t tempering_l = __l;
429 static constexpr
result_type initialization_multiplier = __f;
443 template<
typename _Sseq,
typename =
typename
453 template<
typename _Sseq>
469 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
477 for (; __z != 0ULL; --__z)
499 {
return (
std::equal(__lhs._M_x, __lhs._M_x + state_size, __rhs._M_x)
500 && __lhs._M_p == __rhs._M_p); }
514 template<
typename _UIntType1,
515 size_t __w1,
size_t __n1,
516 size_t __m1,
size_t __r1,
517 _UIntType1 __a1,
size_t __u1,
518 _UIntType1 __d1,
size_t __s1,
519 _UIntType1 __b1,
size_t __t1,
520 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
521 typename _CharT,
typename _Traits>
523 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
525 __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
540 template<
typename _UIntType1,
541 size_t __w1,
size_t __n1,
542 size_t __m1,
size_t __r1,
543 _UIntType1 __a1,
size_t __u1,
544 _UIntType1 __d1,
size_t __s1,
545 _UIntType1 __b1,
size_t __t1,
546 _UIntType1 __c1,
size_t __l1, _UIntType1 __f1,
547 typename _CharT,
typename _Traits>
551 __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1,
555 _UIntType _M_x[state_size];
571 template<
typename _UIntType,
size_t __w,
572 size_t __n,
size_t __m,
size_t __r,
573 _UIntType __a,
size_t __u, _UIntType __d,
size_t __s,
574 _UIntType __b,
size_t __t,
575 _UIntType __c,
size_t __l, _UIntType __f>
578 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __lhs,
580 __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>& __rhs)
581 {
return !(__lhs == __rhs); }
603 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
604 class subtract_with_carry_engine
607 "substituting _UIntType not an unsigned integral type");
608 static_assert(0u < __s && __s < __r,
609 "template argument substituting __s out of bounds");
611 "template argument substituting __w out of bounds");
615 typedef _UIntType result_type;
618 static constexpr
size_t word_size = __w;
619 static constexpr
size_t short_lag = __s;
620 static constexpr
size_t long_lag = __r;
621 static constexpr result_type default_seed = 19780503u;
628 subtract_with_carry_engine(result_type __sd = default_seed)
637 template<
typename _Sseq,
typename =
typename
641 subtract_with_carry_engine(_Sseq& __q)
657 seed(result_type __sd = default_seed);
663 template<
typename _Sseq>
671 static constexpr result_type
679 static constexpr result_type
681 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
687 discard(
unsigned long long __z)
689 for (; __z != 0ULL; --__z)
712 operator==(
const subtract_with_carry_engine& __lhs,
713 const subtract_with_carry_engine& __rhs)
714 {
return (std::equal(__lhs._M_x, __lhs._M_x + long_lag, __rhs._M_x)
715 && __lhs._M_carry == __rhs._M_carry
716 && __lhs._M_p == __rhs._M_p); }
730 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
731 typename _CharT,
typename _Traits>
733 operator<<(std::basic_ostream<_CharT, _Traits>&,
734 const std::subtract_with_carry_engine<_UIntType1, __w1,
749 template<
typename _UIntType1,
size_t __w1,
size_t __s1,
size_t __r1,
750 typename _CharT,
typename _Traits>
753 std::subtract_with_carry_engine<_UIntType1, __w1,
757 _UIntType _M_x[long_lag];
774 template<
typename _UIntType,
size_t __w,
size_t __s,
size_t __r>
776 operator!=(
const std::subtract_with_carry_engine<_UIntType, __w,
778 const std::subtract_with_carry_engine<_UIntType, __w,
780 {
return !(__lhs == __rhs); }
789 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
792 static_assert(1 <= __r && __r <= __p,
793 "template argument substituting __r out of bounds");
797 typedef typename _RandomNumberEngine::result_type
result_type;
800 static constexpr
size_t block_size = __p;
801 static constexpr
size_t used_block = __r;
809 : _M_b(), _M_n(0) { }
819 : _M_b(__rng), _M_n(0) { }
829 : _M_b(std::move(__rng)), _M_n(0) { }
839 : _M_b(__s), _M_n(0) { }
846 template<
typename _Sseq,
typename =
typename
882 template<
typename _Sseq>
894 const _RandomNumberEngine&
918 for (; __z != 0ULL; --__z)
942 {
return __lhs._M_b == __rhs._M_b && __lhs._M_n == __rhs._M_n; }
955 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
956 typename _CharT,
typename _Traits>
958 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
973 template<
typename _RandomNumberEngine1,
size_t __p1,
size_t __r1,
974 typename _CharT,
typename _Traits>
981 _RandomNumberEngine _M_b;
996 template<
typename _RandomNumberEngine,
size_t __p,
size_t __r>
1002 {
return !(__lhs == __rhs); }
1009 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1013 "substituting _UIntType not an unsigned integral type");
1015 "template argument substituting __w out of bounds");
1047 : _M_b(std::move(__rng)) { }
1064 template<
typename _Sseq,
typename =
typename
1094 template<
typename _Sseq>
1103 const _RandomNumberEngine&
1119 {
return __detail::_Shift<_UIntType, __w>::__value - 1; }
1127 for (; __z != 0ULL; --__z)
1152 {
return __lhs._M_b == __rhs._M_b; }
1166 template<
typename _CharT,
typename _Traits>
1170 __w, _UIntType>& __x)
1177 _RandomNumberEngine _M_b;
1192 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType>
1198 {
return !(__lhs == __rhs); }
1210 template<
typename _RandomNumberEngine,
size_t __w,
typename _UIntType,
1211 typename _CharT,
typename _Traits>
1213 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1215 __w, _UIntType>& __x)
1227 template<
typename _RandomNumberEngine,
size_t __k>
1230 static_assert(1u <= __k,
"template argument substituting "
1231 "__k out of bound");
1235 typedef typename _RandomNumberEngine::result_type
result_type;
1237 static constexpr
size_t table_size = __k;
1246 { _M_initialize(); }
1257 { _M_initialize(); }
1267 : _M_b(std::move(__rng))
1268 { _M_initialize(); }
1279 { _M_initialize(); }
1286 template<
typename _Sseq,
typename =
typename
1293 { _M_initialize(); }
1322 template<
typename _Sseq>
1333 const _RandomNumberEngine&
1357 for (; __z != 0ULL; --__z)
1381 {
return (__lhs._M_b == __rhs._M_b
1382 &&
std::equal(__lhs._M_v, __lhs._M_v + __k, __rhs._M_v)
1383 && __lhs._M_y == __rhs._M_y); }
1396 template<
typename _RandomNumberEngine1,
size_t __k1,
1397 typename _CharT,
typename _Traits>
1399 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
1414 template<
typename _RandomNumberEngine1,
size_t __k1,
1415 typename _CharT,
typename _Traits>
1421 void _M_initialize()
1423 for (
size_t __i = 0; __i < __k; ++__i)
1428 _RandomNumberEngine _M_b;
1444 template<
typename _RandomNumberEngine,
size_t __k>
1450 {
return !(__lhs == __rhs); }
1456 typedef linear_congruential_engine<uint_fast32_t, 16807UL, 0UL, 2147483647UL>
1487 0xb5026f5aa96619e9ULL, 29,
1488 0x5555555555555555ULL, 17,
1489 0x71d67fffeda60000ULL, 37,
1490 0xfff7eee000000000ULL, 43,
1493 typedef subtract_with_carry_engine<uint_fast32_t, 24, 10, 24>
1496 typedef subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>
1519 #ifdef _GLIBCXX_USE_RANDOM_TR1
1524 if ((__token !=
"/dev/urandom" && __token !=
"/dev/random")
1525 || !(_M_file = std::fopen(__token.c_str(),
"rb")))
1526 std::__throw_runtime_error(__N(
"random_device::"
1527 "random_device(const std::string&)"));
1531 { std::fclose(_M_file); }
1536 random_device(
const std::string& __token =
"mt19937")
1537 : _M_mt(_M_strtoul(__token)) { }
1540 static unsigned long
1543 unsigned long __ret = 5489UL;
1544 if (__str !=
"mt19937")
1546 const char* __nptr = __str.
c_str();
1548 __ret = std::strtoul(__nptr, &__endptr, 0);
1549 if (*__nptr ==
'\0' || *__endptr !=
'\0')
1550 std::__throw_runtime_error(__N(
"random_device::_M_strtoul"
1551 "(const std::string&)"));
1569 entropy() const noexcept
1575 #ifdef _GLIBCXX_USE_RANDOM_TR1
1577 std::fread(reinterpret_cast<void*>(&__ret),
sizeof(
result_type),
1586 random_device(
const random_device&) =
delete;
1587 void operator=(
const random_device&) =
delete;
1591 #ifdef _GLIBCXX_USE_RANDOM_TR1
1617 template<
typename _IntType =
int>
1621 "template argument not an integral type");
1634 : _M_a(__a), _M_b(__b)
1636 _GLIBCXX_DEBUG_ASSERT(_M_a <= _M_b);
1649 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
1663 : _M_param(__a, __b)
1681 {
return _M_param.a(); }
1685 {
return _M_param.b(); }
1692 {
return _M_param; }
1700 { _M_param = __param; }
1707 {
return this->a(); }
1714 {
return this->b(); }
1719 template<
typename _UniformRandomNumberGenerator>
1724 template<
typename _UniformRandomNumberGenerator>
1726 operator()(_UniformRandomNumberGenerator& __urng,
1727 const param_type& __p);
1729 param_type _M_param;
1736 template<
typename _IntType>
1746 template<
typename _IntType>
1750 {
return !(__d1 == __d2); }
1762 template<
typename _IntType,
typename _CharT,
typename _Traits>
1764 operator<<(std::basic_ostream<_CharT, _Traits>&,
1776 template<
typename _IntType,
typename _CharT,
typename _Traits>
1789 template<
typename _RealType =
double>
1793 "template argument not a floating point type");
1805 _RealType __b = _RealType(1))
1806 : _M_a(__a), _M_b(__b)
1808 _GLIBCXX_DEBUG_ASSERT(_M_a <= _M_b);
1821 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
1837 _RealType __b = _RealType(1))
1838 : _M_param(__a, __b)
1856 {
return _M_param.a(); }
1860 {
return _M_param.b(); }
1867 {
return _M_param; }
1875 { _M_param = __param; }
1882 {
return this->a(); }
1889 {
return this->b(); }
1894 template<
typename _UniformRandomNumberGenerator>
1899 template<
typename _UniformRandomNumberGenerator>
1901 operator()(_UniformRandomNumberGenerator& __urng,
1902 const param_type& __p)
1904 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
1906 return (__aurng() * (__p.b() - __p.a())) + __p.a();
1910 param_type _M_param;
1917 template<
typename _IntType>
1927 template<
typename _IntType>
1931 {
return !(__d1 == __d2); }
1943 template<
typename _RealType,
typename _CharT,
typename _Traits>
1945 operator<<(std::basic_ostream<_CharT, _Traits>&,
1957 template<
typename _RealType,
typename _CharT,
typename _Traits>
1979 template<
typename _RealType =
double>
1983 "template argument not a floating point type");
1995 _RealType __stddev = _RealType(1))
1996 : _M_mean(__mean), _M_stddev(__stddev)
1998 _GLIBCXX_DEBUG_ASSERT(_M_stddev > _RealType(0));
2007 {
return _M_stddev; }
2011 {
return (__p1._M_mean == __p2._M_mean
2012 && __p1._M_stddev == __p2._M_stddev); }
2016 _RealType _M_stddev;
2027 : _M_param(__mean, __stddev), _M_saved_available(false)
2032 : _M_param(__p), _M_saved_available(false)
2040 { _M_saved_available =
false; }
2047 {
return _M_param.mean(); }
2054 {
return _M_param.stddev(); }
2061 {
return _M_param; }
2069 { _M_param = __param; }
2088 template<
typename _UniformRandomNumberGenerator>
2093 template<
typename _UniformRandomNumberGenerator>
2095 operator()(_UniformRandomNumberGenerator& __urng,
2096 const param_type& __p);
2103 template<
typename _RealType1>
2118 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2120 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2133 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2139 param_type _M_param;
2141 bool _M_saved_available;
2147 template<
typename _RealType>
2151 {
return !(__d1 == __d2); }
2163 template<
typename _RealType =
double>
2167 "template argument not a floating point type");
2179 _RealType __s = _RealType(1))
2180 : _M_m(__m), _M_s(__s)
2193 {
return __p1._M_m == __p2._M_m && __p1._M_s == __p2._M_s; }
2202 _RealType __s = _RealType(1))
2203 : _M_param(__m, __s), _M_nd()
2208 : _M_param(__p), _M_nd()
2223 {
return _M_param.m(); }
2227 {
return _M_param.s(); }
2234 {
return _M_param; }
2242 { _M_param = __param; }
2261 template<
typename _UniformRandomNumberGenerator>
2266 template<
typename _UniformRandomNumberGenerator>
2268 operator()(_UniformRandomNumberGenerator& __urng,
2269 const param_type& __p)
2270 {
return std::exp(__p.s() * _M_nd(__urng) + __p.m()); }
2281 && __d1._M_nd == __d2._M_nd); }
2293 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2295 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2308 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2314 param_type _M_param;
2322 template<
typename _RealType>
2326 {
return !(__d1 == __d2); }
2338 template<
typename _RealType =
double>
2342 "template argument not a floating point type");
2354 param_type(_RealType __alpha_val = _RealType(1),
2355 _RealType __beta_val = _RealType(1))
2356 : _M_alpha(__alpha_val), _M_beta(__beta_val)
2358 _GLIBCXX_DEBUG_ASSERT(_M_alpha > _RealType(0));
2364 {
return _M_alpha; }
2371 operator==(
const param_type& __p1,
const param_type& __p2)
2372 {
return (__p1._M_alpha == __p2._M_alpha
2373 && __p1._M_beta == __p2._M_beta); }
2382 _RealType _M_malpha, _M_a2;
2392 _RealType __beta_val = _RealType(1))
2393 : _M_param(__alpha_val, __beta_val), _M_nd()
2398 : _M_param(__p), _M_nd()
2413 {
return _M_param.alpha(); }
2420 {
return _M_param.beta(); }
2427 {
return _M_param; }
2435 { _M_param = __param; }
2454 template<
typename _UniformRandomNumberGenerator>
2459 template<
typename _UniformRandomNumberGenerator>
2461 operator()(_UniformRandomNumberGenerator& __urng,
2462 const param_type& __p);
2473 && __d1._M_nd == __d2._M_nd); }
2485 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2487 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2499 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2505 param_type _M_param;
2513 template<
typename _RealType>
2517 {
return !(__d1 == __d2); }
2526 template<
typename _RealType =
double>
2530 "template argument not a floating point type");
2551 {
return __p1._M_n == __p2._M_n; }
2559 : _M_param(__n), _M_gd(__n / 2)
2564 : _M_param(__p), _M_gd(__p.n() / 2)
2579 {
return _M_param.n(); }
2586 {
return _M_param; }
2594 { _M_param = __param; }
2613 template<
typename _UniformRandomNumberGenerator>
2616 {
return 2 * _M_gd(__urng); }
2618 template<
typename _UniformRandomNumberGenerator>
2620 operator()(_UniformRandomNumberGenerator& __urng,
2621 const param_type& __p)
2625 return 2 * _M_gd(__urng, param_type(__p.n() / 2));
2636 {
return __d1.
param() == __d2.
param() && __d1._M_gd == __d2._M_gd; }
2648 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2650 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2663 template<
typename _RealType1,
typename _CharT,
typename _Traits>
2669 param_type _M_param;
2677 template<
typename _RealType>
2681 {
return !(__d1 == __d2); }
2690 template<
typename _RealType =
double>
2694 "template argument not a floating point type");
2706 _RealType __b = _RealType(1))
2707 : _M_a(__a), _M_b(__b)
2720 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
2729 _RealType __b = _RealType(1))
2730 : _M_param(__a, __b)
2750 {
return _M_param.a(); }
2754 {
return _M_param.b(); }
2761 {
return _M_param; }
2769 { _M_param = __param; }
2788 template<
typename _UniformRandomNumberGenerator>
2793 template<
typename _UniformRandomNumberGenerator>
2795 operator()(_UniformRandomNumberGenerator& __urng,
2796 const param_type& __p);
2799 param_type _M_param;
2806 template<
typename _RealType>
2816 template<
typename _RealType>
2820 {
return !(__d1 == __d2); }
2832 template<
typename _RealType,
typename _CharT,
typename _Traits>
2834 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
2847 template<
typename _RealType,
typename _CharT,
typename _Traits>
2863 template<
typename _RealType =
double>
2867 "template argument not a floating point type");
2879 _RealType __n = _RealType(1))
2880 : _M_m(__m), _M_n(__n)
2893 {
return __p1._M_m == __p2._M_m && __p1._M_n == __p2._M_n; }
2902 _RealType __n = _RealType(1))
2903 : _M_param(__m, __n), _M_gd_x(__m / 2), _M_gd_y(__n / 2)
2908 : _M_param(__p), _M_gd_x(__p.m() / 2), _M_gd_y(__p.n() / 2)
2926 {
return _M_param.m(); }
2930 {
return _M_param.n(); }
2937 {
return _M_param; }
2945 { _M_param = __param; }
2964 template<
typename _UniformRandomNumberGenerator>
2967 {
return (_M_gd_x(__urng) * n()) / (_M_gd_y(__urng) * m()); }
2969 template<
typename _UniformRandomNumberGenerator>
2971 operator()(_UniformRandomNumberGenerator& __urng,
2972 const param_type& __p)
2976 return ((_M_gd_x(__urng, param_type(__p.m() / 2)) * n())
2977 / (_M_gd_y(__urng, param_type(__p.n() / 2)) * m()));
2989 && __d1._M_gd_x == __d2._M_gd_x
2990 && __d1._M_gd_y == __d2._M_gd_y); }
3002 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3004 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3017 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3023 param_type _M_param;
3031 template<
typename _RealType>
3035 {
return !(__d1 == __d2); }
3046 template<
typename _RealType =
double>
3050 "template argument not a floating point type");
3061 param_type(_RealType __n = _RealType(1))
3070 operator==(
const param_type& __p1,
const param_type& __p2)
3071 {
return __p1._M_n == __p2._M_n; }
3079 : _M_param(__n), _M_nd(), _M_gd(__n / 2, 2)
3084 : _M_param(__p), _M_nd(), _M_gd(__p.n() / 2, 2)
3102 {
return _M_param.n(); }
3109 {
return _M_param; }
3117 { _M_param = __param; }
3136 template<
typename _UniformRandomNumberGenerator>
3139 {
return _M_nd(__urng) *
std::sqrt(n() / _M_gd(__urng)); }
3141 template<
typename _UniformRandomNumberGenerator>
3143 operator()(_UniformRandomNumberGenerator& __urng,
3144 const param_type& __p)
3149 const result_type __g = _M_gd(__urng, param_type(__p.n() / 2, 2));
3150 return _M_nd(__urng) *
std::sqrt(__p.n() / __g);
3162 && __d1._M_nd == __d2._M_nd && __d1._M_gd == __d2._M_gd); }
3174 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3176 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3189 template<
typename _RealType1,
typename _CharT,
typename _Traits>
3195 param_type _M_param;
3204 template<
typename _RealType>
3208 {
return !(__d1 == __d2); }
3236 param_type(
double __p = 0.5)
3239 _GLIBCXX_DEBUG_ASSERT((_M_p >= 0.0) && (_M_p <= 1.0));
3247 operator==(
const param_type& __p1,
const param_type& __p2)
3248 {
return __p1._M_p == __p2._M_p; }
3284 {
return _M_param.p(); }
3291 {
return _M_param; }
3299 { _M_param = __param; }
3318 template<
typename _UniformRandomNumberGenerator>
3323 template<
typename _UniformRandomNumberGenerator>
3325 operator()(_UniformRandomNumberGenerator& __urng,
3326 const param_type& __p)
3328 __detail::_Adaptor<_UniformRandomNumberGenerator, double>
3330 if ((__aurng() - __aurng.min())
3331 < __p.p() * (__aurng.max() - __aurng.min()))
3337 param_type _M_param;
3356 {
return !(__d1 == __d2); }
3368 template<
typename _CharT,
typename _Traits>
3370 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3382 template<
typename _CharT,
typename _Traits>
3401 template<
typename _IntType =
int>
3405 "template argument not an integral type");
3417 param_type(_IntType __t = _IntType(1),
double __p = 0.5)
3418 : _M_t(__t), _M_p(__p)
3420 _GLIBCXX_DEBUG_ASSERT((_M_t >= _IntType(0))
3435 operator==(
const param_type& __p1,
const param_type& __p2)
3436 {
return __p1._M_t == __p2._M_t && __p1._M_p == __p2._M_p; }
3446 #if _GLIBCXX_USE_C99_MATH_TR1
3447 double _M_d1, _M_d2, _M_s1, _M_s2, _M_c,
3448 _M_a1, _M_a123, _M_s, _M_lf, _M_lp1p;
3457 : _M_param(__t, __p), _M_nd()
3462 : _M_param(__p), _M_nd()
3477 {
return _M_param.t(); }
3484 {
return _M_param.p(); }
3491 {
return _M_param; }
3499 { _M_param = __param; }
3513 {
return _M_param.t(); }
3518 template<
typename _UniformRandomNumberGenerator>
3523 template<
typename _UniformRandomNumberGenerator>
3525 operator()(_UniformRandomNumberGenerator& __urng,
3526 const param_type& __p);
3536 #ifdef _GLIBCXX_USE_C99_MATH_TR1
3537 {
return __d1.
param() == __d2.
param() && __d1._M_nd == __d2._M_nd; }
3552 template<
typename _IntType1,
3553 typename _CharT,
typename _Traits>
3555 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3568 template<
typename _IntType1,
3569 typename _CharT,
typename _Traits>
3575 template<
typename _UniformRandomNumberGenerator>
3577 _M_waiting(_UniformRandomNumberGenerator& __urng, _IntType __t);
3579 param_type _M_param;
3588 template<
typename _IntType>
3592 {
return !(__d1 == __d2); }
3602 template<
typename _IntType =
int>
3606 "template argument not an integral type");
3618 param_type(
double __p = 0.5)
3621 _GLIBCXX_DEBUG_ASSERT((_M_p > 0.0) && (_M_p < 1.0));
3630 operator==(
const param_type& __p1,
const param_type& __p2)
3631 {
return __p1._M_p == __p2._M_p; }
3636 { _M_log_1_p =
std::log(1.0 - _M_p); }
3667 {
return _M_param.p(); }
3674 {
return _M_param; }
3682 { _M_param = __param; }
3701 template<
typename _UniformRandomNumberGenerator>
3706 template<
typename _UniformRandomNumberGenerator>
3708 operator()(_UniformRandomNumberGenerator& __urng,
3709 const param_type& __p);
3712 param_type _M_param;
3719 template<
typename _IntType>
3729 template<
typename _IntType>
3733 {
return !(__d1 == __d2); }
3745 template<
typename _IntType,
3746 typename _CharT,
typename _Traits>
3748 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3760 template<
typename _IntType,
3761 typename _CharT,
typename _Traits>
3774 template<
typename _IntType =
int>
3778 "template argument not an integral type");
3789 param_type(_IntType __k = 1,
double __p = 0.5)
3790 : _M_k(__k), _M_p(__p)
3792 _GLIBCXX_DEBUG_ASSERT((_M_k > 0) && (_M_p > 0.0) && (_M_p <= 1.0));
3804 operator==(
const param_type& __p1,
const param_type& __p2)
3805 {
return __p1._M_k == __p2._M_k && __p1._M_p == __p2._M_p; }
3814 : _M_param(__k, __p), _M_gd(__k, (1.0 - __p) / __p)
3819 : _M_param(__p), _M_gd(__p.
k(), (1.0 - __p.
p()) / __p.
p())
3834 {
return _M_param.k(); }
3841 {
return _M_param.p(); }
3848 {
return _M_param; }
3856 { _M_param = __param; }
3875 template<
typename _UniformRandomNumberGenerator>
3877 operator()(_UniformRandomNumberGenerator& __urng);
3879 template<
typename _UniformRandomNumberGenerator>
3881 operator()(_UniformRandomNumberGenerator& __urng,
3882 const param_type& __p);
3892 {
return __d1.
param() == __d2.
param() && __d1._M_gd == __d2._M_gd; }
3905 template<
typename _IntType1,
typename _CharT,
typename _Traits>
3907 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
3920 template<
typename _IntType1,
typename _CharT,
typename _Traits>
3926 param_type _M_param;
3934 template<
typename _IntType>
3938 {
return !(__d1 == __d2); }
3956 template<
typename _IntType =
int>
3960 "template argument not an integral type");
3972 param_type(
double __mean = 1.0)
3975 _GLIBCXX_DEBUG_ASSERT(_M_mean > 0.0);
3984 operator==(
const param_type& __p1,
const param_type& __p2)
3985 {
return __p1._M_mean == __p2._M_mean; }
3995 #if _GLIBCXX_USE_C99_MATH_TR1
3996 double _M_lfm, _M_sm, _M_d, _M_scx, _M_1cx, _M_c2b, _M_cb;
4003 : _M_param(__mean), _M_nd()
4008 : _M_param(__p), _M_nd()
4023 {
return _M_param.mean(); }
4030 {
return _M_param; }
4038 { _M_param = __param; }
4057 template<
typename _UniformRandomNumberGenerator>
4062 template<
typename _UniformRandomNumberGenerator>
4064 operator()(_UniformRandomNumberGenerator& __urng,
4065 const param_type& __p);
4075 #ifdef _GLIBCXX_USE_C99_MATH_TR1
4076 {
return __d1.
param() == __d2.
param() && __d1._M_nd == __d2._M_nd; }
4091 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4093 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4106 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4112 param_type _M_param;
4121 template<
typename _IntType>
4125 {
return !(__d1 == __d2); }
4143 template<
typename _RealType =
double>
4147 "template argument not a floating point type");
4158 param_type(_RealType __lambda = _RealType(1))
4159 : _M_lambda(__lambda)
4161 _GLIBCXX_DEBUG_ASSERT(_M_lambda > _RealType(0));
4166 {
return _M_lambda; }
4169 operator==(
const param_type& __p1,
const param_type& __p2)
4170 {
return __p1._M_lambda == __p2._M_lambda; }
4173 _RealType _M_lambda;
4183 : _M_param(__lambda)
4204 {
return _M_param.lambda(); }
4211 {
return _M_param; }
4219 { _M_param = __param; }
4238 template<
typename _UniformRandomNumberGenerator>
4243 template<
typename _UniformRandomNumberGenerator>
4245 operator()(_UniformRandomNumberGenerator& __urng,
4246 const param_type& __p)
4248 __detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
4250 return -
std::log(__aurng()) / __p.lambda();
4254 param_type _M_param;
4261 template<
typename _RealType>
4271 template<
typename _RealType>
4275 {
return !(__d1 == __d2); }
4287 template<
typename _RealType,
typename _CharT,
typename _Traits>
4289 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4302 template<
typename _RealType,
typename _CharT,
typename _Traits>
4317 template<
typename _RealType =
double>
4321 "template argument not a floating point type");
4332 param_type(_RealType __a = _RealType(1),
4333 _RealType __b = _RealType(1))
4334 : _M_a(__a), _M_b(__b)
4346 operator==(
const param_type& __p1,
const param_type& __p2)
4347 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
4356 _RealType __b = _RealType(1))
4357 : _M_param(__a, __b)
4377 {
return _M_param.a(); }
4384 {
return _M_param.b(); }
4391 {
return _M_param; }
4399 { _M_param = __param; }
4418 template<
typename _UniformRandomNumberGenerator>
4423 template<
typename _UniformRandomNumberGenerator>
4425 operator()(_UniformRandomNumberGenerator& __urng,
4426 const param_type& __p);
4429 param_type _M_param;
4436 template<
typename _RealType>
4446 template<
typename _RealType>
4450 {
return !(__d1 == __d2); }
4462 template<
typename _RealType,
typename _CharT,
typename _Traits>
4464 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4477 template<
typename _RealType,
typename _CharT,
typename _Traits>
4492 template<
typename _RealType =
double>
4496 "template argument not a floating point type");
4507 param_type(_RealType __a = _RealType(0),
4508 _RealType __b = _RealType(1))
4509 : _M_a(__a), _M_b(__b)
4521 operator==(
const param_type& __p1,
const param_type& __p2)
4522 {
return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
4531 _RealType __b = _RealType(1))
4532 : _M_param(__a, __b)
4552 {
return _M_param.a(); }
4559 {
return _M_param.b(); }
4566 {
return _M_param; }
4574 { _M_param = __param; }
4593 template<
typename _UniformRandomNumberGenerator>
4598 template<
typename _UniformRandomNumberGenerator>
4600 operator()(_UniformRandomNumberGenerator& __urng,
4601 const param_type& __p);
4604 param_type _M_param;
4611 template<
typename _RealType>
4621 template<
typename _RealType>
4625 {
return !(__d1 == __d2); }
4637 template<
typename _RealType,
typename _CharT,
typename _Traits>
4639 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4652 template<
typename _RealType,
typename _CharT,
typename _Traits>
4664 template<
typename _IntType =
int>
4668 "template argument not an integral type");
4680 : _M_prob(), _M_cp()
4683 template<
typename _InputIterator>
4684 param_type(_InputIterator __wbegin,
4685 _InputIterator __wend)
4686 : _M_prob(__wbegin, __wend), _M_cp()
4687 { _M_initialize(); }
4690 : _M_prob(__wil.begin(), __wil.end()), _M_cp()
4691 { _M_initialize(); }
4693 template<
typename _Func>
4694 param_type(
size_t __nw,
double __xmin,
double __xmax,
4698 param_type(
const param_type&) =
default;
4699 param_type& operator=(
const param_type&) =
default;
4702 probabilities()
const
4706 operator==(
const param_type& __p1,
const param_type& __p2)
4707 {
return __p1._M_prob == __p2._M_prob; }
4721 template<
typename _InputIterator>
4723 _InputIterator __wend)
4724 : _M_param(__wbegin, __wend)
4727 discrete_distribution(initializer_list<double> __wl)
4731 template<
typename _Func>
4732 discrete_distribution(
size_t __nw,
double __xmin,
double __xmax,
4734 : _M_param(__nw, __xmin, __xmax, __fw)
4738 discrete_distribution(
const param_type& __p)
4755 return _M_param._M_prob.
empty()
4764 {
return _M_param; }
4772 { _M_param = __param; }
4787 return _M_param._M_prob.
empty()
4794 template<
typename _UniformRandomNumberGenerator>
4799 template<
typename _UniformRandomNumberGenerator>
4801 operator()(_UniformRandomNumberGenerator& __urng,
4802 const param_type& __p);
4814 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4816 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
4830 template<
typename _IntType1,
typename _CharT,
typename _Traits>
4836 param_type _M_param;
4843 template<
typename _IntType>
4853 template<
typename _IntType>
4857 {
return !(__d1 == __d2); }
4866 template<
typename _RealType =
double>
4870 "template argument not a floating point type");
4882 : _M_int(), _M_den(), _M_cp()
4885 template<
typename _InputIteratorB,
typename _InputIteratorW>
4886 param_type(_InputIteratorB __bfirst,
4887 _InputIteratorB __bend,
4888 _InputIteratorW __wbegin);
4890 template<
typename _Func>
4893 template<
typename _Func>
4894 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
4898 param_type(
const param_type&) =
default;
4899 param_type& operator=(
const param_type&) =
default;
4907 __tmp[1] = _RealType(1);
4919 operator==(
const param_type& __p1,
const param_type& __p2)
4920 {
return __p1._M_int == __p2._M_int && __p1._M_den == __p2._M_den; }
4936 template<
typename _InputIteratorB,
typename _InputIteratorW>
4938 _InputIteratorB __bend,
4939 _InputIteratorW __wbegin)
4940 : _M_param(__bfirst, __bend, __wbegin)
4943 template<
typename _Func>
4944 piecewise_constant_distribution(initializer_list<_RealType> __bl,
4946 : _M_param(__bl, __fw)
4949 template<
typename _Func>
4950 piecewise_constant_distribution(
size_t __nw,
4951 _RealType __xmin, _RealType __xmax,
4953 : _M_param(__nw, __xmin, __xmax, __fw)
4957 piecewise_constant_distribution(
const param_type& __p)
4974 if (_M_param._M_int.
empty())
4977 __tmp[1] = _RealType(1);
4981 return _M_param._M_int;
4990 return _M_param._M_den.
empty()
4999 {
return _M_param; }
5007 { _M_param = __param; }
5015 return _M_param._M_int.
empty()
5025 return _M_param._M_int.
empty()
5032 template<
typename _UniformRandomNumberGenerator>
5037 template<
typename _UniformRandomNumberGenerator>
5039 operator()(_UniformRandomNumberGenerator& __urng,
5040 const param_type& __p);
5053 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5055 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5069 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5075 param_type _M_param;
5082 template<
typename _RealType>
5092 template<
typename _RealType>
5096 {
return !(__d1 == __d2); }
5105 template<
typename _RealType =
double>
5109 "template argument not a floating point type");
5121 : _M_int(), _M_den(), _M_cp(), _M_m()
5124 template<
typename _InputIteratorB,
typename _InputIteratorW>
5125 param_type(_InputIteratorB __bfirst,
5126 _InputIteratorB __bend,
5127 _InputIteratorW __wbegin);
5129 template<
typename _Func>
5132 template<
typename _Func>
5133 param_type(
size_t __nw, _RealType __xmin, _RealType __xmax,
5137 param_type(
const param_type&) =
default;
5138 param_type& operator=(
const param_type&) =
default;
5146 __tmp[1] = _RealType(1);
5158 operator==(
const param_type& __p1,
const param_type& __p2)
5159 {
return (__p1._M_int == __p2._M_int
5160 && __p1._M_den == __p2._M_den); }
5177 template<
typename _InputIteratorB,
typename _InputIteratorW>
5179 _InputIteratorB __bend,
5180 _InputIteratorW __wbegin)
5181 : _M_param(__bfirst, __bend, __wbegin)
5184 template<
typename _Func>
5185 piecewise_linear_distribution(initializer_list<_RealType> __bl,
5187 : _M_param(__bl, __fw)
5190 template<
typename _Func>
5191 piecewise_linear_distribution(
size_t __nw,
5192 _RealType __xmin, _RealType __xmax,
5194 : _M_param(__nw, __xmin, __xmax, __fw)
5198 piecewise_linear_distribution(
const param_type& __p)
5215 if (_M_param._M_int.
empty())
5218 __tmp[1] = _RealType(1);
5222 return _M_param._M_int;
5232 return _M_param._M_den.
empty()
5241 {
return _M_param; }
5249 { _M_param = __param; }
5257 return _M_param._M_int.
empty()
5267 return _M_param._M_int.
empty()
5274 template<
typename _UniformRandomNumberGenerator>
5279 template<
typename _UniformRandomNumberGenerator>
5281 operator()(_UniformRandomNumberGenerator& __urng,
5282 const param_type& __p);
5295 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5297 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
5311 template<
typename _RealType1,
typename _CharT,
typename _Traits>
5317 param_type _M_param;
5324 template<
typename _RealType>
5334 template<
typename _RealType>
5338 {
return !(__d1 == __d2); }
5367 template<
typename _IntType>
5370 template<
typename _InputIterator>
5371 seed_seq(_InputIterator __begin, _InputIterator __end);
5374 template<
typename _RandomAccessIterator>
5376 generate(_RandomAccessIterator __begin, _RandomAccessIterator __end);
5380 {
return _M_v.
size(); }
5382 template<
typename OutputIterator>
5384 param(OutputIterator __dest)
const
5385 { std::copy(_M_v.
begin(), _M_v.
end(), __dest); }
5396 _GLIBCXX_END_NAMESPACE_VERSION
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::mersenne_twister_engine< _UIntType1, __w1, __n1, __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1, __l1, __f1 > &__x)
Extracts the current state of a % mersenne_twister_engine random number generator engine __x from the...
void reset()
Resets the distribution state.
const _RandomNumberEngine & base() const noexcept
static constexpr result_type max()
void discard(unsigned long long __z)
Discard a sequence of random numbers.
One of the math functors.
exponential_distribution(const result_type &__lambda=result_type(1))
Constructs an exponential distribution with inverse scale parameter .
double p() const
Returns the distribution parameter p.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void seed(_Sseq &__q)
Reseeds the independent_bits_engine object with the given seed sequence.
param_type param() const
Returns the parameter set of the distribution.
independent_bits_engine(_RandomNumberEngine &&__rng)
Move constructs a independent_bits_engine engine.
static constexpr result_type min()
Gets the smallest possible value in the output range.
void param(const param_type &__param)
Sets the parameter set of the distribution.
static constexpr result_type max()
Gets the maximum value in the generated random number range.
void param(const param_type &__param)
Sets the parameter set of the distribution.
_IntType k() const
Return the parameter of the distribution.
friend bool operator==(const shuffle_order_engine &__lhs, const shuffle_order_engine &__rhs)
linear_congruential_engine(_Sseq &__q)
Constructs a linear_congruential_engine random number generator engine seeded from the seed sequence ...
discard_block_engine(_RandomNumberEngine &&__rng)
Move constructs a discard_block_engine engine.
param_type param() const
Returns the parameter set of the distribution.
friend bool operator==(const independent_bits_engine &__lhs, const independent_bits_engine &__rhs)
Compares two independent_bits_engine random number generator objects of the same type for equality...
bool operator==(const std::piecewise_linear_distribution< _RealType > &__d1, const std::piecewise_linear_distribution< _RealType > &__d2)
Return true if two piecewise linear distributions have the same parameters.
A lognormal_distribution random number distribution.
bitset< _Nb > operator>>(size_t __position) const _GLIBCXX_NOEXCEPT
Self-explanatory.
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...
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 param(const param_type &__param)
Sets the parameter set of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
void reset()
Resets the distribution state.
bernoulli_distribution(double __p=0.5)
Constructs a Bernoulli distribution with likelihood p.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
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...
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...
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 seed()
Reseeds the shuffle_order_engine object with the default seed for the underlying base class generator...
result_type max() const
Returns the least upper bound value of the distribution.
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...
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine object.
const _Tp & max(const _Tp &, const _Tp &)
This does what you think it does.
static constexpr result_type max()
Gets the maximum value in the generated random number range.
Template class basic_ostream.This is the base class for all output streams. It provides text formatti...
void param(const param_type &__param)
Sets the parameter set of the distribution.
void reset()
Resets the distribution state.
discard_block_engine()
Constructs a default discard_block_engine engine.
result_type max() const
Returns the least upper bound value of the distribution.
result_type max() const
Returns the inclusive upper bound of the distribution range.
mersenne_twister_engine< uint_fast64_t, 64, 312, 156, 31, 0xb5026f5aa96619e9ULL, 29, 0x5555555555555555ULL, 17, 0x71d67fffeda60000ULL, 37, 0xfff7eee000000000ULL, 43, 6364136223846793005ULL > mt19937_64
friend bool operator==(const 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_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...
param_type param() const
Returns the parameter set of the distribution.
void reset()
Resets the distribution state.
independent_bits_engine(const _RandomNumberEngine &__rng)
Copy constructs a independent_bits_engine engine.
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...
_RealType b() const
Return the parameter of the distribution.
A model of a linear congruential random number generator.
shuffle_order_engine()
Constructs a default shuffle_order_engine engine.
shuffle_order_engine(_RandomNumberEngine &&__rng)
Move constructs a shuffle_order_engine engine.
void seed()
Reseeds the independent_bits_engine object with the default seed for the underlying base class genera...
Define a member typedef type only if a boolean constant is true.
A piecewise_linear_distribution random number distribution.
double p() const
Returns the p parameter of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type max() const
Returns the least upper bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
static constexpr result_type max()
Gets the largest possible value in the output range.
result_type min() const
Returns the greatest lower bound value of the distribution.
void seed()
Reseeds the discard_block_engine object with the default seed for the underlying base class generator...
_RealType stddev() const
Returns the standard deviation of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type operator()()
Gets the next random number in the sequence.
shuffle_order_engine(const _RandomNumberEngine &__rng)
Copy constructs a shuffle_order_engine engine.
A discrete_distribution random number distribution.
void seed(result_type __s)
Reseeds the discard_block_engine object with the default seed for the underlying base class generator...
_IntType t() const
Returns the distribution t parameter.
result_type max() const
Returns the least upper bound value of the distribution.
Uniform discrete distribution for random numbers. A discrete random distribution on the range with e...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
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::independent_bits_engine< _RandomNumberEngine, __w, _UIntType > &__x)
Extracts the current state of a % subtract_with_carry_engine random number generator engine __x from ...
void seed(result_type __s=default_seed)
Reseeds the linear_congruential_engine random number generator engine sequence to the seed __s...
const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
result_type min() const
Returns the greatest lower bound value of the distribution.
double p() const
Return the parameter of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
A weibull_distribution random number distribution.
param_type param() const
Returns the parameter set of the distribution.
result_type max() const
Returns the inclusive upper bound of the distribution range.
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.
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
Properties of fundamental types.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
shuffle_order_engine(result_type __s)
Seed constructs a shuffle_order_engine engine.
__gnu_cxx::__promote_2< _Tpx, _Tpy >::__type beta(_Tpx __x, _Tpy __y)
5.2.1.3 Beta functions.
static constexpr result_type increment
Template class basic_istream.This is the base class for all input streams. It provides text formattin...
param_type param() const
Returns the parameter set of the distribution.
void reset()
Resets the distribution state.
linear_congruential_engine< uint_fast32_t, 16807UL, 0UL, 2147483647UL > minstd_rand0
result_type min() const
Returns the inclusive lower bound of the distribution range.
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...
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
bool empty() const _GLIBCXX_NOEXCEPT
void reset()
Resets the distribution state.
void reset()
Resets the distribution state.
result_type min() const
Returns the greatest lower bound value of the distribution.
static constexpr result_type min()
Gets the minimum value in the generated random number range.
result_type min() const
Returns the inclusive lower bound of the distribution range.
A extreme_value_distribution random number distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::discard_block_engine< _RandomNumberEngine1, __p1, __r1 > &__x)
Extracts the current state of a % subtract_with_carry_engine random number generator engine __x from ...
mersenne_twister_engine(_Sseq &__q)
Constructs a mersenne_twister_engine random number generator engine seeded from the seed sequence __q...
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 ...
result_type max() const
Returns the least upper bound value of the distribution.
result_type operator()()
Gets the next value in the generated random number sequence.
void reset()
Resets the distribution state.
void discard(unsigned long long __z)
Discard a sequence of random numbers.
result_type max() const
Returns the least upper bound value 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.
std::vector< double > densities() const
Return a vector of the probability densities of the distribution.
static constexpr result_type min()
Gets the minimum value in the generated random number range.
void reset()
Resets the distribution state.
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 min() const
Returns the greatest lower bound value of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
The seed_seq class generates sequences of seeds for random number generators.
result_type max() const
Returns the least upper bound value of the distribution.
_RealType beta() const
Returns the of the distribution.
independent_bits_engine(result_type __s)
Seed constructs a independent_bits_engine engine.
_RealType a() const
Return the parameter of the distribution.
A discrete binomial random number distribution.
bool equal(_II1 __first1, _II1 __last1, _II2 __first2)
Tests a range for element-wise equality.
A discrete Poisson random number distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
void reset()
Resets the distribution state.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type max() const
Returns the least upper bound value of the distribution.
param_type param() const
Returns the parameter set of the distribution.
friend bool operator==(const poisson_distribution &__d1, const poisson_distribution &__d2)
Return true if two Poisson distributions have the same parameters and the sequences that would be gen...
void reset()
Resets the distribution state.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
independent_bits_engine(_Sseq &__q)
Generator construct a independent_bits_engine engine.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
const _RandomNumberEngine & base() const noexcept
Gets a const reference to the underlying generator engine object.
param_type param() const
Returns the parameter set of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
friend bool operator==(const lognormal_distribution &__d1, const lognormal_distribution &__d2)
Return true if two lognormal distributions have the same parameters and the sequences that would be g...
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
_RandomNumberEngine::result_type result_type
void reset()
Resets the distribution state.
_RealType lambda() const
Returns the inverse scale parameter 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...
void reset()
Resets the distribution state.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
_RealType b() const
Return the parameter of the distribution.
static constexpr _Tp min() _GLIBCXX_USE_NOEXCEPT
result_type max() const
Returns the least upper bound value of the distribution.
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...
independent_bits_engine()
Constructs a default independent_bits_engine engine.
result_type min() const
Returns the greatest lower bound value of the distribution.
void reset()
Resets the distribution state.
_RealType generate_canonical(_UniformRandomNumberGenerator &__g)
A function template for converting the output of a (integral) uniform random number generator to a fl...
void param(const param_type &__param)
Sets the parameter set of the distribution.
gamma_distribution(_RealType __alpha_val=_RealType(1), _RealType __beta_val=_RealType(1))
Constructs a gamma distribution with parameters and .
result_type operator()()
Gets the next value in the generated random number sequence.
result_type max() const
Returns the least upper bound value of the distribution.
_RealType alpha() const
Returns the of the distribution.
const _CharT * c_str() const _GLIBCXX_NOEXCEPT
Return const pointer to null-terminated contents.
friend bool operator==(const std::normal_distribution< _RealType1 > &__d1, const std::normal_distribution< _RealType1 > &__d2)
Return true if two normal distributions have the same parameters and the sequences that would be gene...
friend 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< double > probabilities() const
Returns the probabilities of the distribution.
void seed(_Sseq &__q)
Reseeds the discard_block_engine object with the given seed sequence.
complex< _Tp > log(const complex< _Tp > &)
Return complex natural logarithm of z.
Uniform continuous distribution for random numbers.
Produces random numbers by combining random numbers from some base engine to produce random numbers w...
void reset()
Resets the distribution state.
result_type min() const
Returns the greatest lower bound value of the distribution.
normal_distribution(result_type __mean=result_type(0), result_type __stddev=result_type(1))
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...
param_type param() const
Returns the parameter set of the distribution.
shuffle_order_engine(_Sseq &__q)
Generator construct a shuffle_order_engine engine.
mersenne_twister_engine< uint_fast32_t, 32, 624, 397, 31, 0x9908b0dfUL, 11, 0xffffffffUL, 7, 0x9d2c5680UL, 15, 0xefc60000UL, 18, 1812433253UL > mt19937
_RealType mean() const
Returns the mean of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
void seed(result_type __s)
Reseeds the independent_bits_engine object with the default seed for the underlying base class genera...
void param(const param_type &__param)
Sets the parameter set of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
param_type param() const
Returns the parameter set of the distribution.
size_type size() const _GLIBCXX_NOEXCEPT
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.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
A discrete geometric random number distribution.
complex< _Tp > exp(const complex< _Tp > &)
Return complex base e exponential of z.
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...
_RealType a() const
Return the parameter of the distribution.
static constexpr _Tp max() _GLIBCXX_USE_NOEXCEPT
std::vector< _RealType > intervals() const
Return the intervals 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.
result_type max() const
Returns the least upper bound value of the distribution.
param_type param() const
Returns the parameter set of the distribution.
A chi_squared_distribution random number distribution.
void seed(result_type __s)
Reseeds the shuffle_order_engine object with the default seed for the underlying base class generator...
discard_block_engine(result_type __s)
Seed constructs a discard_block_engine engine.
A normal continuous distribution for random numbers.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
discard_block_engine(const _RandomNumberEngine &__rng)
Copy constructs a discard_block_engine engine.
An exponential continuous distribution for random numbers.
std::vector< double > densities() const
Returns a vector of the probability densities.
result_type min() const
Returns the greatest lower bound value of the distribution.
void param(const param_type &__param)
Sets the parameter set of the distribution.
uint_least32_t result_type
iterator end() _GLIBCXX_NOEXCEPT
result_type max() const
Returns the least upper bound value of the distribution.
double p() const
Returns the distribution p parameter.
static constexpr result_type max()
Gets the largest possible value in the output range.
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::discrete_distribution< _IntType1 > &__x)
Extracts a discrete_distribution random number distribution __x from the input stream __is...
param_type param() const
Returns the parameter set of the distribution.
iterator begin() _GLIBCXX_NOEXCEPT
uniform_real_distribution(_RealType __a=_RealType(0), _RealType __b=_RealType(1))
Constructs a uniform_real_distribution object.
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...
void reset()
Resets the distribution state.
A Bernoulli random number distribution.
A fisher_f_distribution random number distribution.
linear_congruential_engine< uint_fast32_t, 48271UL, 0UL, 2147483647UL > minstd_rand
void discard(unsigned long long __z)
Discard a sequence of random numbers.
complex< _Tp > sqrt(const complex< _Tp > &)
Return complex square root of z.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
result_type min() const
Returns the greatest lower bound value of the distribution.
result_type min() const
Returns the greatest lower bound value of the distribution.
static constexpr result_type multiplier
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_constant_distribution< _RealType1 > &__x)
Extracts a piecewise_constan_distribution random number distribution __x from the input stream __is...
param_type param() const
Returns the parameter set of the distribution.
void param(const param_type &__param)
Sets 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...
static constexpr result_type min()
Gets the smallest possible value in the output range.
void reset()
Resets the distribution state.
static constexpr result_type min()
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void param(const param_type &__param)
Sets the parameter set of the distribution.
param_type param() const
Returns the parameter set of the distribution.
A student_t_distribution random number distribution.
linear_congruential_engine(result_type __s=default_seed)
Constructs a linear_congruential_engine random number generator engine with seed __s. The default seed value is 1.
bool operator!=(const std::piecewise_linear_distribution< _RealType > &__d1, const std::piecewise_linear_distribution< _RealType > &__d2)
Return true if two piecewise linear distributions have different parameters.
void param(const param_type &__param)
Sets the parameter set of the distribution.
result_type max() const
Returns the least upper bound value of the distribution.
A cauchy_distribution random number distribution.
_RandomNumberEngine::result_type result_type
param_type param() const
Returns the parameter set of the distribution.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
void seed(_Sseq &__q)
Reseeds the shuffle_order_engine object with the given seed sequence.
param_type param() const
Returns the parameter set of the distribution.
param_type param() const
Returns the parameter set of the distribution.
friend std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, std::negative_binomial_distribution< _IntType1 > &__x)
Extracts a negative_binomial_distribution random number distribution __x from the input stream __is...
A gamma continuous distribution for random numbers.
A piecewise_constant_distribution random number distribution.
uniform_int_distribution(_IntType __a=0, _IntType __b=std::numeric_limits< _IntType >::max())
Constructs a uniform distribution object.
result_type operator()(_UniformRandomNumberGenerator &__urng)
Generating functions.
double mean() const
Returns the distribution parameter mean.
std::vector< _RealType > intervals() const
Returns a vector of the intervals.
void discard(unsigned long long __z)
discard_block_engine(_Sseq &__q)
Generator construct a discard_block_engine engine.
void reset()
Resets the distribution state.
A negative_binomial_distribution random number distribution.