1*700637cbSDimitry Andric// -*- C++ -*- 2*700637cbSDimitry Andric//===----------------------------------------------------------------------===// 3*700637cbSDimitry Andric// 4*700637cbSDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5*700637cbSDimitry Andric// See https://llvm.org/LICENSE.txt for license information. 6*700637cbSDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7*700637cbSDimitry Andric// 8*700637cbSDimitry Andric//===----------------------------------------------------------------------===// 9*700637cbSDimitry Andric 10*700637cbSDimitry Andric#ifndef _LIBCPP___CXX03_RANDOM 11*700637cbSDimitry Andric#define _LIBCPP___CXX03_RANDOM 12*700637cbSDimitry Andric 13*700637cbSDimitry Andric/* 14*700637cbSDimitry Andric random synopsis 15*700637cbSDimitry Andric 16*700637cbSDimitry Andric#include <__cxx03/initializer_list> 17*700637cbSDimitry Andric 18*700637cbSDimitry Andricnamespace std 19*700637cbSDimitry Andric{ 20*700637cbSDimitry Andric// [rand.req.urng], uniform random bit generator requirements 21*700637cbSDimitry Andrictemplate<class G> 22*700637cbSDimitry Andricconcept uniform_random_bit_generator = see below; // C++20 23*700637cbSDimitry Andric 24*700637cbSDimitry Andric// Engines 25*700637cbSDimitry Andric 26*700637cbSDimitry Andrictemplate <class UIntType, UIntType a, UIntType c, UIntType m> 27*700637cbSDimitry Andricclass linear_congruential_engine 28*700637cbSDimitry Andric{ 29*700637cbSDimitry Andricpublic: 30*700637cbSDimitry Andric // types 31*700637cbSDimitry Andric typedef UIntType result_type; 32*700637cbSDimitry Andric 33*700637cbSDimitry Andric // engine characteristics 34*700637cbSDimitry Andric static constexpr result_type multiplier = a; 35*700637cbSDimitry Andric static constexpr result_type increment = c; 36*700637cbSDimitry Andric static constexpr result_type modulus = m; 37*700637cbSDimitry Andric static constexpr result_type min() { return c == 0u ? 1u: 0u;} 38*700637cbSDimitry Andric static constexpr result_type max() { return m - 1u;} 39*700637cbSDimitry Andric static constexpr result_type default_seed = 1u; 40*700637cbSDimitry Andric 41*700637cbSDimitry Andric // constructors and seeding functions 42*700637cbSDimitry Andric explicit linear_congruential_engine(result_type s = default_seed); // before C++20 43*700637cbSDimitry Andric linear_congruential_engine() : linear_congruential_engine(default_seed) {} // C++20 44*700637cbSDimitry Andric explicit linear_congruential_engine(result_type s); // C++20 45*700637cbSDimitry Andric template<class Sseq> explicit linear_congruential_engine(Sseq& q); 46*700637cbSDimitry Andric void seed(result_type s = default_seed); 47*700637cbSDimitry Andric template<class Sseq> void seed(Sseq& q); 48*700637cbSDimitry Andric 49*700637cbSDimitry Andric // generating functions 50*700637cbSDimitry Andric result_type operator()(); 51*700637cbSDimitry Andric void discard(unsigned long long z); 52*700637cbSDimitry Andric}; 53*700637cbSDimitry Andric 54*700637cbSDimitry Andrictemplate <class UIntType, UIntType a, UIntType c, UIntType m> 55*700637cbSDimitry Andricbool 56*700637cbSDimitry Andricoperator==(const linear_congruential_engine<UIntType, a, c, m>& x, 57*700637cbSDimitry Andric const linear_congruential_engine<UIntType, a, c, m>& y); 58*700637cbSDimitry Andric 59*700637cbSDimitry Andrictemplate <class UIntType, UIntType a, UIntType c, UIntType m> 60*700637cbSDimitry Andricbool 61*700637cbSDimitry Andricoperator!=(const linear_congruential_engine<UIntType, a, c, m>& x, 62*700637cbSDimitry Andric const linear_congruential_engine<UIntType, a, c, m>& y); 63*700637cbSDimitry Andric 64*700637cbSDimitry Andrictemplate <class charT, class traits, 65*700637cbSDimitry Andric class UIntType, UIntType a, UIntType c, UIntType m> 66*700637cbSDimitry Andricbasic_ostream<charT, traits>& 67*700637cbSDimitry Andricoperator<<(basic_ostream<charT, traits>& os, 68*700637cbSDimitry Andric const linear_congruential_engine<UIntType, a, c, m>& x); 69*700637cbSDimitry Andric 70*700637cbSDimitry Andrictemplate <class charT, class traits, 71*700637cbSDimitry Andric class UIntType, UIntType a, UIntType c, UIntType m> 72*700637cbSDimitry Andricbasic_istream<charT, traits>& 73*700637cbSDimitry Andricoperator>>(basic_istream<charT, traits>& is, 74*700637cbSDimitry Andric linear_congruential_engine<UIntType, a, c, m>& x); 75*700637cbSDimitry Andric 76*700637cbSDimitry Andrictemplate <class UIntType, size_t w, size_t n, size_t m, size_t r, 77*700637cbSDimitry Andric UIntType a, size_t u, UIntType d, size_t s, 78*700637cbSDimitry Andric UIntType b, size_t t, UIntType c, size_t l, UIntType f> 79*700637cbSDimitry Andricclass mersenne_twister_engine 80*700637cbSDimitry Andric{ 81*700637cbSDimitry Andricpublic: 82*700637cbSDimitry Andric // types 83*700637cbSDimitry Andric typedef UIntType result_type; 84*700637cbSDimitry Andric 85*700637cbSDimitry Andric // engine characteristics 86*700637cbSDimitry Andric static constexpr size_t word_size = w; 87*700637cbSDimitry Andric static constexpr size_t state_size = n; 88*700637cbSDimitry Andric static constexpr size_t shift_size = m; 89*700637cbSDimitry Andric static constexpr size_t mask_bits = r; 90*700637cbSDimitry Andric static constexpr result_type xor_mask = a; 91*700637cbSDimitry Andric static constexpr size_t tempering_u = u; 92*700637cbSDimitry Andric static constexpr result_type tempering_d = d; 93*700637cbSDimitry Andric static constexpr size_t tempering_s = s; 94*700637cbSDimitry Andric static constexpr result_type tempering_b = b; 95*700637cbSDimitry Andric static constexpr size_t tempering_t = t; 96*700637cbSDimitry Andric static constexpr result_type tempering_c = c; 97*700637cbSDimitry Andric static constexpr size_t tempering_l = l; 98*700637cbSDimitry Andric static constexpr result_type initialization_multiplier = f; 99*700637cbSDimitry Andric static constexpr result_type min () { return 0; } 100*700637cbSDimitry Andric static constexpr result_type max() { return 2^w - 1; } 101*700637cbSDimitry Andric static constexpr result_type default_seed = 5489u; 102*700637cbSDimitry Andric 103*700637cbSDimitry Andric // constructors and seeding functions 104*700637cbSDimitry Andric explicit mersenne_twister_engine(result_type s = default_seed); // before C++20 105*700637cbSDimitry Andric mersenne_twister_engine() : mersenne_twister_engine(default_seed) {} // C++20 106*700637cbSDimitry Andric explicit mersenne_twister_engine(result_type s); // C++20 107*700637cbSDimitry Andric template<class Sseq> explicit mersenne_twister_engine(Sseq& q); 108*700637cbSDimitry Andric void seed(result_type value = default_seed); 109*700637cbSDimitry Andric template<class Sseq> void seed(Sseq& q); 110*700637cbSDimitry Andric 111*700637cbSDimitry Andric // generating functions 112*700637cbSDimitry Andric result_type operator()(); 113*700637cbSDimitry Andric void discard(unsigned long long z); 114*700637cbSDimitry Andric}; 115*700637cbSDimitry Andric 116*700637cbSDimitry Andrictemplate <class UIntType, size_t w, size_t n, size_t m, size_t r, 117*700637cbSDimitry Andric UIntType a, size_t u, UIntType d, size_t s, 118*700637cbSDimitry Andric UIntType b, size_t t, UIntType c, size_t l, UIntType f> 119*700637cbSDimitry Andricbool 120*700637cbSDimitry Andricoperator==( 121*700637cbSDimitry Andric const mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>& x, 122*700637cbSDimitry Andric const mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>& y); 123*700637cbSDimitry Andric 124*700637cbSDimitry Andrictemplate <class UIntType, size_t w, size_t n, size_t m, size_t r, 125*700637cbSDimitry Andric UIntType a, size_t u, UIntType d, size_t s, 126*700637cbSDimitry Andric UIntType b, size_t t, UIntType c, size_t l, UIntType f> 127*700637cbSDimitry Andricbool 128*700637cbSDimitry Andricoperator!=( 129*700637cbSDimitry Andric const mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>& x, 130*700637cbSDimitry Andric const mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>& y); 131*700637cbSDimitry Andric 132*700637cbSDimitry Andrictemplate <class charT, class traits, 133*700637cbSDimitry Andric class UIntType, size_t w, size_t n, size_t m, size_t r, 134*700637cbSDimitry Andric UIntType a, size_t u, UIntType d, size_t s, 135*700637cbSDimitry Andric UIntType b, size_t t, UIntType c, size_t l, UIntType f> 136*700637cbSDimitry Andricbasic_ostream<charT, traits>& 137*700637cbSDimitry Andricoperator<<(basic_ostream<charT, traits>& os, 138*700637cbSDimitry Andric const mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>& x); 139*700637cbSDimitry Andric 140*700637cbSDimitry Andrictemplate <class charT, class traits, 141*700637cbSDimitry Andric class UIntType, size_t w, size_t n, size_t m, size_t r, 142*700637cbSDimitry Andric UIntType a, size_t u, UIntType d, size_t s, 143*700637cbSDimitry Andric UIntType b, size_t t, UIntType c, size_t l, UIntType f> 144*700637cbSDimitry Andricbasic_istream<charT, traits>& 145*700637cbSDimitry Andricoperator>>(basic_istream<charT, traits>& is, 146*700637cbSDimitry Andric mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>& x); 147*700637cbSDimitry Andric 148*700637cbSDimitry Andrictemplate<class UIntType, size_t w, size_t s, size_t r> 149*700637cbSDimitry Andricclass subtract_with_carry_engine 150*700637cbSDimitry Andric{ 151*700637cbSDimitry Andricpublic: 152*700637cbSDimitry Andric // types 153*700637cbSDimitry Andric typedef UIntType result_type; 154*700637cbSDimitry Andric 155*700637cbSDimitry Andric // engine characteristics 156*700637cbSDimitry Andric static constexpr size_t word_size = w; 157*700637cbSDimitry Andric static constexpr size_t short_lag = s; 158*700637cbSDimitry Andric static constexpr size_t long_lag = r; 159*700637cbSDimitry Andric static constexpr result_type min() { return 0; } 160*700637cbSDimitry Andric static constexpr result_type max() { return m-1; } 161*700637cbSDimitry Andric static constexpr result_type default_seed = 19780503u; 162*700637cbSDimitry Andric 163*700637cbSDimitry Andric // constructors and seeding functions 164*700637cbSDimitry Andric explicit subtract_with_carry_engine(result_type value = default_seed); // before C++20 165*700637cbSDimitry Andric subtract_with_carry_engine() : subtract_with_carry_engine(default_seed) {} // C++20 166*700637cbSDimitry Andric explicit subtract_with_carry_engine(result_type value); // C++20 167*700637cbSDimitry Andric template<class Sseq> explicit subtract_with_carry_engine(Sseq& q); 168*700637cbSDimitry Andric void seed(result_type value = default_seed); 169*700637cbSDimitry Andric template<class Sseq> void seed(Sseq& q); 170*700637cbSDimitry Andric 171*700637cbSDimitry Andric // generating functions 172*700637cbSDimitry Andric result_type operator()(); 173*700637cbSDimitry Andric void discard(unsigned long long z); 174*700637cbSDimitry Andric}; 175*700637cbSDimitry Andric 176*700637cbSDimitry Andrictemplate<class UIntType, size_t w, size_t s, size_t r> 177*700637cbSDimitry Andricbool 178*700637cbSDimitry Andricoperator==( 179*700637cbSDimitry Andric const subtract_with_carry_engine<UIntType, w, s, r>& x, 180*700637cbSDimitry Andric const subtract_with_carry_engine<UIntType, w, s, r>& y); 181*700637cbSDimitry Andric 182*700637cbSDimitry Andrictemplate<class UIntType, size_t w, size_t s, size_t r> 183*700637cbSDimitry Andricbool 184*700637cbSDimitry Andricoperator!=( 185*700637cbSDimitry Andric const subtract_with_carry_engine<UIntType, w, s, r>& x, 186*700637cbSDimitry Andric const subtract_with_carry_engine<UIntType, w, s, r>& y); 187*700637cbSDimitry Andric 188*700637cbSDimitry Andrictemplate <class charT, class traits, 189*700637cbSDimitry Andric class UIntType, size_t w, size_t s, size_t r> 190*700637cbSDimitry Andricbasic_ostream<charT, traits>& 191*700637cbSDimitry Andricoperator<<(basic_ostream<charT, traits>& os, 192*700637cbSDimitry Andric const subtract_with_carry_engine<UIntType, w, s, r>& x); 193*700637cbSDimitry Andric 194*700637cbSDimitry Andrictemplate <class charT, class traits, 195*700637cbSDimitry Andric class UIntType, size_t w, size_t s, size_t r> 196*700637cbSDimitry Andricbasic_istream<charT, traits>& 197*700637cbSDimitry Andricoperator>>(basic_istream<charT, traits>& is, 198*700637cbSDimitry Andric subtract_with_carry_engine<UIntType, w, s, r>& x); 199*700637cbSDimitry Andric 200*700637cbSDimitry Andrictemplate<class Engine, size_t p, size_t r> 201*700637cbSDimitry Andricclass discard_block_engine 202*700637cbSDimitry Andric{ 203*700637cbSDimitry Andricpublic: 204*700637cbSDimitry Andric // types 205*700637cbSDimitry Andric typedef typename Engine::result_type result_type; 206*700637cbSDimitry Andric 207*700637cbSDimitry Andric // engine characteristics 208*700637cbSDimitry Andric static constexpr size_t block_size = p; 209*700637cbSDimitry Andric static constexpr size_t used_block = r; 210*700637cbSDimitry Andric static constexpr result_type min() { return Engine::min(); } 211*700637cbSDimitry Andric static constexpr result_type max() { return Engine::max(); } 212*700637cbSDimitry Andric 213*700637cbSDimitry Andric // constructors and seeding functions 214*700637cbSDimitry Andric discard_block_engine(); 215*700637cbSDimitry Andric explicit discard_block_engine(const Engine& e); 216*700637cbSDimitry Andric explicit discard_block_engine(Engine&& e); 217*700637cbSDimitry Andric explicit discard_block_engine(result_type s); 218*700637cbSDimitry Andric template<class Sseq> explicit discard_block_engine(Sseq& q); 219*700637cbSDimitry Andric void seed(); 220*700637cbSDimitry Andric void seed(result_type s); 221*700637cbSDimitry Andric template<class Sseq> void seed(Sseq& q); 222*700637cbSDimitry Andric 223*700637cbSDimitry Andric // generating functions 224*700637cbSDimitry Andric result_type operator()(); 225*700637cbSDimitry Andric void discard(unsigned long long z); 226*700637cbSDimitry Andric 227*700637cbSDimitry Andric // property functions 228*700637cbSDimitry Andric const Engine& base() const noexcept; 229*700637cbSDimitry Andric}; 230*700637cbSDimitry Andric 231*700637cbSDimitry Andrictemplate<class Engine, size_t p, size_t r> 232*700637cbSDimitry Andricbool 233*700637cbSDimitry Andricoperator==( 234*700637cbSDimitry Andric const discard_block_engine<Engine, p, r>& x, 235*700637cbSDimitry Andric const discard_block_engine<Engine, p, r>& y); 236*700637cbSDimitry Andric 237*700637cbSDimitry Andrictemplate<class Engine, size_t p, size_t r> 238*700637cbSDimitry Andricbool 239*700637cbSDimitry Andricoperator!=( 240*700637cbSDimitry Andric const discard_block_engine<Engine, p, r>& x, 241*700637cbSDimitry Andric const discard_block_engine<Engine, p, r>& y); 242*700637cbSDimitry Andric 243*700637cbSDimitry Andrictemplate <class charT, class traits, 244*700637cbSDimitry Andric class Engine, size_t p, size_t r> 245*700637cbSDimitry Andricbasic_ostream<charT, traits>& 246*700637cbSDimitry Andricoperator<<(basic_ostream<charT, traits>& os, 247*700637cbSDimitry Andric const discard_block_engine<Engine, p, r>& x); 248*700637cbSDimitry Andric 249*700637cbSDimitry Andrictemplate <class charT, class traits, 250*700637cbSDimitry Andric class Engine, size_t p, size_t r> 251*700637cbSDimitry Andricbasic_istream<charT, traits>& 252*700637cbSDimitry Andricoperator>>(basic_istream<charT, traits>& is, 253*700637cbSDimitry Andric discard_block_engine<Engine, p, r>& x); 254*700637cbSDimitry Andric 255*700637cbSDimitry Andrictemplate<class Engine, size_t w, class UIntType> 256*700637cbSDimitry Andricclass independent_bits_engine 257*700637cbSDimitry Andric{ 258*700637cbSDimitry Andricpublic: 259*700637cbSDimitry Andric // types 260*700637cbSDimitry Andric typedef UIntType result_type; 261*700637cbSDimitry Andric 262*700637cbSDimitry Andric // engine characteristics 263*700637cbSDimitry Andric static constexpr result_type min() { return 0; } 264*700637cbSDimitry Andric static constexpr result_type max() { return 2^w - 1; } 265*700637cbSDimitry Andric 266*700637cbSDimitry Andric // constructors and seeding functions 267*700637cbSDimitry Andric independent_bits_engine(); 268*700637cbSDimitry Andric explicit independent_bits_engine(const Engine& e); 269*700637cbSDimitry Andric explicit independent_bits_engine(Engine&& e); 270*700637cbSDimitry Andric explicit independent_bits_engine(result_type s); 271*700637cbSDimitry Andric template<class Sseq> explicit independent_bits_engine(Sseq& q); 272*700637cbSDimitry Andric void seed(); 273*700637cbSDimitry Andric void seed(result_type s); 274*700637cbSDimitry Andric template<class Sseq> void seed(Sseq& q); 275*700637cbSDimitry Andric 276*700637cbSDimitry Andric // generating functions 277*700637cbSDimitry Andric result_type operator()(); void discard(unsigned long long z); 278*700637cbSDimitry Andric 279*700637cbSDimitry Andric // property functions 280*700637cbSDimitry Andric const Engine& base() const noexcept; 281*700637cbSDimitry Andric}; 282*700637cbSDimitry Andric 283*700637cbSDimitry Andrictemplate<class Engine, size_t w, class UIntType> 284*700637cbSDimitry Andricbool 285*700637cbSDimitry Andricoperator==( 286*700637cbSDimitry Andric const independent_bits_engine<Engine, w, UIntType>& x, 287*700637cbSDimitry Andric const independent_bits_engine<Engine, w, UIntType>& y); 288*700637cbSDimitry Andric 289*700637cbSDimitry Andrictemplate<class Engine, size_t w, class UIntType> 290*700637cbSDimitry Andricbool 291*700637cbSDimitry Andricoperator!=( 292*700637cbSDimitry Andric const independent_bits_engine<Engine, w, UIntType>& x, 293*700637cbSDimitry Andric const independent_bits_engine<Engine, w, UIntType>& y); 294*700637cbSDimitry Andric 295*700637cbSDimitry Andrictemplate <class charT, class traits, 296*700637cbSDimitry Andric class Engine, size_t w, class UIntType> 297*700637cbSDimitry Andricbasic_ostream<charT, traits>& 298*700637cbSDimitry Andricoperator<<(basic_ostream<charT, traits>& os, 299*700637cbSDimitry Andric const independent_bits_engine<Engine, w, UIntType>& x); 300*700637cbSDimitry Andric 301*700637cbSDimitry Andrictemplate <class charT, class traits, 302*700637cbSDimitry Andric class Engine, size_t w, class UIntType> 303*700637cbSDimitry Andricbasic_istream<charT, traits>& 304*700637cbSDimitry Andricoperator>>(basic_istream<charT, traits>& is, 305*700637cbSDimitry Andric independent_bits_engine<Engine, w, UIntType>& x); 306*700637cbSDimitry Andric 307*700637cbSDimitry Andrictemplate<class Engine, size_t k> 308*700637cbSDimitry Andricclass shuffle_order_engine 309*700637cbSDimitry Andric{ 310*700637cbSDimitry Andricpublic: 311*700637cbSDimitry Andric // types 312*700637cbSDimitry Andric typedef typename Engine::result_type result_type; 313*700637cbSDimitry Andric 314*700637cbSDimitry Andric // engine characteristics 315*700637cbSDimitry Andric static constexpr size_t table_size = k; 316*700637cbSDimitry Andric static constexpr result_type min() { return Engine::min; } 317*700637cbSDimitry Andric static constexpr result_type max() { return Engine::max; } 318*700637cbSDimitry Andric 319*700637cbSDimitry Andric // constructors and seeding functions 320*700637cbSDimitry Andric shuffle_order_engine(); 321*700637cbSDimitry Andric explicit shuffle_order_engine(const Engine& e); 322*700637cbSDimitry Andric explicit shuffle_order_engine(Engine&& e); 323*700637cbSDimitry Andric explicit shuffle_order_engine(result_type s); 324*700637cbSDimitry Andric template<class Sseq> explicit shuffle_order_engine(Sseq& q); 325*700637cbSDimitry Andric void seed(); 326*700637cbSDimitry Andric void seed(result_type s); 327*700637cbSDimitry Andric template<class Sseq> void seed(Sseq& q); 328*700637cbSDimitry Andric 329*700637cbSDimitry Andric // generating functions 330*700637cbSDimitry Andric result_type operator()(); 331*700637cbSDimitry Andric void discard(unsigned long long z); 332*700637cbSDimitry Andric 333*700637cbSDimitry Andric // property functions 334*700637cbSDimitry Andric const Engine& base() const noexcept; 335*700637cbSDimitry Andric}; 336*700637cbSDimitry Andric 337*700637cbSDimitry Andrictemplate<class Engine, size_t k> 338*700637cbSDimitry Andricbool 339*700637cbSDimitry Andricoperator==( 340*700637cbSDimitry Andric const shuffle_order_engine<Engine, k>& x, 341*700637cbSDimitry Andric const shuffle_order_engine<Engine, k>& y); 342*700637cbSDimitry Andric 343*700637cbSDimitry Andrictemplate<class Engine, size_t k> 344*700637cbSDimitry Andricbool 345*700637cbSDimitry Andricoperator!=( 346*700637cbSDimitry Andric const shuffle_order_engine<Engine, k>& x, 347*700637cbSDimitry Andric const shuffle_order_engine<Engine, k>& y); 348*700637cbSDimitry Andric 349*700637cbSDimitry Andrictemplate <class charT, class traits, 350*700637cbSDimitry Andric class Engine, size_t k> 351*700637cbSDimitry Andricbasic_ostream<charT, traits>& 352*700637cbSDimitry Andricoperator<<(basic_ostream<charT, traits>& os, 353*700637cbSDimitry Andric const shuffle_order_engine<Engine, k>& x); 354*700637cbSDimitry Andric 355*700637cbSDimitry Andrictemplate <class charT, class traits, 356*700637cbSDimitry Andric class Engine, size_t k> 357*700637cbSDimitry Andricbasic_istream<charT, traits>& 358*700637cbSDimitry Andricoperator>>(basic_istream<charT, traits>& is, 359*700637cbSDimitry Andric shuffle_order_engine<Engine, k>& x); 360*700637cbSDimitry Andric 361*700637cbSDimitry Andrictypedef linear_congruential_engine<uint_fast32_t, 16807, 0, 2147483647> 362*700637cbSDimitry Andric minstd_rand0; 363*700637cbSDimitry Andrictypedef linear_congruential_engine<uint_fast32_t, 48271, 0, 2147483647> 364*700637cbSDimitry Andric minstd_rand; 365*700637cbSDimitry Andrictypedef mersenne_twister_engine<uint_fast32_t, 32, 624, 397, 31, 366*700637cbSDimitry Andric 0x9908b0df, 367*700637cbSDimitry Andric 11, 0xffffffff, 368*700637cbSDimitry Andric 7, 0x9d2c5680, 369*700637cbSDimitry Andric 15, 0xefc60000, 370*700637cbSDimitry Andric 18, 1812433253> mt19937; 371*700637cbSDimitry Andrictypedef mersenne_twister_engine<uint_fast64_t, 64, 312, 156, 31, 372*700637cbSDimitry Andric 0xb5026f5aa96619e9, 373*700637cbSDimitry Andric 29, 0x5555555555555555, 374*700637cbSDimitry Andric 17, 0x71d67fffeda60000, 375*700637cbSDimitry Andric 37, 0xfff7eee000000000, 376*700637cbSDimitry Andric 43, 6364136223846793005> mt19937_64; 377*700637cbSDimitry Andrictypedef subtract_with_carry_engine<uint_fast32_t, 24, 10, 24> ranlux24_base; 378*700637cbSDimitry Andrictypedef subtract_with_carry_engine<uint_fast64_t, 48, 5, 12> ranlux48_base; 379*700637cbSDimitry Andrictypedef discard_block_engine<ranlux24_base, 223, 23> ranlux24; 380*700637cbSDimitry Andrictypedef discard_block_engine<ranlux48_base, 389, 11> ranlux48; 381*700637cbSDimitry Andrictypedef shuffle_order_engine<minstd_rand0, 256> knuth_b; 382*700637cbSDimitry Andrictypedef minstd_rand default_random_engine; 383*700637cbSDimitry Andric 384*700637cbSDimitry Andric// Generators 385*700637cbSDimitry Andric 386*700637cbSDimitry Andricclass random_device 387*700637cbSDimitry Andric{ 388*700637cbSDimitry Andricpublic: 389*700637cbSDimitry Andric // types 390*700637cbSDimitry Andric typedef unsigned int result_type; 391*700637cbSDimitry Andric 392*700637cbSDimitry Andric // generator characteristics 393*700637cbSDimitry Andric static constexpr result_type min() { return numeric_limits<result_type>::min(); } 394*700637cbSDimitry Andric static constexpr result_type max() { return numeric_limits<result_type>::max(); } 395*700637cbSDimitry Andric 396*700637cbSDimitry Andric // constructors 397*700637cbSDimitry Andric explicit random_device(const string& token = implementation-defined); // before C++20 398*700637cbSDimitry Andric random_device() : random_device(implementation-defined) {} // C++20 399*700637cbSDimitry Andric explicit random_device(const string& token); // C++20 400*700637cbSDimitry Andric 401*700637cbSDimitry Andric // generating functions 402*700637cbSDimitry Andric result_type operator()(); 403*700637cbSDimitry Andric 404*700637cbSDimitry Andric // property functions 405*700637cbSDimitry Andric double entropy() const noexcept; 406*700637cbSDimitry Andric 407*700637cbSDimitry Andric // no copy functions 408*700637cbSDimitry Andric random_device(const random_device& ) = delete; 409*700637cbSDimitry Andric void operator=(const random_device& ) = delete; 410*700637cbSDimitry Andric}; 411*700637cbSDimitry Andric 412*700637cbSDimitry Andric// Utilities 413*700637cbSDimitry Andric 414*700637cbSDimitry Andricclass seed_seq 415*700637cbSDimitry Andric{ 416*700637cbSDimitry Andricpublic: 417*700637cbSDimitry Andric // types 418*700637cbSDimitry Andric typedef uint_least32_t result_type; 419*700637cbSDimitry Andric 420*700637cbSDimitry Andric // constructors 421*700637cbSDimitry Andric seed_seq(); 422*700637cbSDimitry Andric template<class T> 423*700637cbSDimitry Andric seed_seq(initializer_list<T> il); 424*700637cbSDimitry Andric template<class InputIterator> 425*700637cbSDimitry Andric seed_seq(InputIterator begin, InputIterator end); 426*700637cbSDimitry Andric 427*700637cbSDimitry Andric // generating functions 428*700637cbSDimitry Andric template<class RandomAccessIterator> 429*700637cbSDimitry Andric void generate(RandomAccessIterator begin, RandomAccessIterator end); 430*700637cbSDimitry Andric 431*700637cbSDimitry Andric // property functions 432*700637cbSDimitry Andric size_t size() const; 433*700637cbSDimitry Andric template<class OutputIterator> 434*700637cbSDimitry Andric void param(OutputIterator dest) const; 435*700637cbSDimitry Andric 436*700637cbSDimitry Andric // no copy functions 437*700637cbSDimitry Andric seed_seq(const seed_seq&) = delete; 438*700637cbSDimitry Andric void operator=(const seed_seq& ) = delete; 439*700637cbSDimitry Andric}; 440*700637cbSDimitry Andric 441*700637cbSDimitry Andrictemplate<class RealType, size_t bits, class URNG> 442*700637cbSDimitry Andric RealType generate_canonical(URNG& g); 443*700637cbSDimitry Andric 444*700637cbSDimitry Andric// Distributions 445*700637cbSDimitry Andric 446*700637cbSDimitry Andrictemplate<class IntType = int> 447*700637cbSDimitry Andricclass uniform_int_distribution 448*700637cbSDimitry Andric{ 449*700637cbSDimitry Andricpublic: 450*700637cbSDimitry Andric // types 451*700637cbSDimitry Andric typedef IntType result_type; 452*700637cbSDimitry Andric 453*700637cbSDimitry Andric class param_type 454*700637cbSDimitry Andric { 455*700637cbSDimitry Andric public: 456*700637cbSDimitry Andric typedef uniform_int_distribution distribution_type; 457*700637cbSDimitry Andric 458*700637cbSDimitry Andric explicit param_type(IntType a = 0, 459*700637cbSDimitry Andric IntType b = numeric_limits<IntType>::max()); 460*700637cbSDimitry Andric 461*700637cbSDimitry Andric result_type a() const; 462*700637cbSDimitry Andric result_type b() const; 463*700637cbSDimitry Andric 464*700637cbSDimitry Andric friend bool operator==(const param_type& x, const param_type& y); 465*700637cbSDimitry Andric friend bool operator!=(const param_type& x, const param_type& y); 466*700637cbSDimitry Andric }; 467*700637cbSDimitry Andric 468*700637cbSDimitry Andric // constructors and reset functions 469*700637cbSDimitry Andric explicit uniform_int_distribution(IntType a = 0, 470*700637cbSDimitry Andric IntType b = numeric_limits<IntType>::max()); // before C++20 471*700637cbSDimitry Andric uniform_int_distribution() : uniform_int_distribution(0) {} // C++20 472*700637cbSDimitry Andric explicit uniform_int_distribution(IntType a, 473*700637cbSDimitry Andric IntType b = numeric_limits<IntType>::max()); // C++20 474*700637cbSDimitry Andric explicit uniform_int_distribution(const param_type& parm); 475*700637cbSDimitry Andric void reset(); 476*700637cbSDimitry Andric 477*700637cbSDimitry Andric // generating functions 478*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g); 479*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g, const param_type& parm); 480*700637cbSDimitry Andric 481*700637cbSDimitry Andric // property functions 482*700637cbSDimitry Andric result_type a() const; 483*700637cbSDimitry Andric result_type b() const; 484*700637cbSDimitry Andric 485*700637cbSDimitry Andric param_type param() const; 486*700637cbSDimitry Andric void param(const param_type& parm); 487*700637cbSDimitry Andric 488*700637cbSDimitry Andric result_type min() const; 489*700637cbSDimitry Andric result_type max() const; 490*700637cbSDimitry Andric 491*700637cbSDimitry Andric friend bool operator==(const uniform_int_distribution& x, 492*700637cbSDimitry Andric const uniform_int_distribution& y); 493*700637cbSDimitry Andric friend bool operator!=(const uniform_int_distribution& x, 494*700637cbSDimitry Andric const uniform_int_distribution& y); 495*700637cbSDimitry Andric 496*700637cbSDimitry Andric template <class charT, class traits> 497*700637cbSDimitry Andric friend 498*700637cbSDimitry Andric basic_ostream<charT, traits>& 499*700637cbSDimitry Andric operator<<(basic_ostream<charT, traits>& os, 500*700637cbSDimitry Andric const uniform_int_distribution& x); 501*700637cbSDimitry Andric 502*700637cbSDimitry Andric template <class charT, class traits> 503*700637cbSDimitry Andric friend 504*700637cbSDimitry Andric basic_istream<charT, traits>& 505*700637cbSDimitry Andric operator>>(basic_istream<charT, traits>& is, 506*700637cbSDimitry Andric uniform_int_distribution& x); 507*700637cbSDimitry Andric}; 508*700637cbSDimitry Andric 509*700637cbSDimitry Andrictemplate<class RealType = double> 510*700637cbSDimitry Andricclass uniform_real_distribution 511*700637cbSDimitry Andric{ 512*700637cbSDimitry Andricpublic: 513*700637cbSDimitry Andric // types 514*700637cbSDimitry Andric typedef RealType result_type; 515*700637cbSDimitry Andric 516*700637cbSDimitry Andric class param_type 517*700637cbSDimitry Andric { 518*700637cbSDimitry Andric public: 519*700637cbSDimitry Andric typedef uniform_real_distribution distribution_type; 520*700637cbSDimitry Andric 521*700637cbSDimitry Andric explicit param_type(RealType a = 0, 522*700637cbSDimitry Andric RealType b = 1); 523*700637cbSDimitry Andric 524*700637cbSDimitry Andric result_type a() const; 525*700637cbSDimitry Andric result_type b() const; 526*700637cbSDimitry Andric 527*700637cbSDimitry Andric friend bool operator==(const param_type& x, const param_type& y); 528*700637cbSDimitry Andric friend bool operator!=(const param_type& x, const param_type& y); 529*700637cbSDimitry Andric }; 530*700637cbSDimitry Andric 531*700637cbSDimitry Andric // constructors and reset functions 532*700637cbSDimitry Andric explicit uniform_real_distribution(RealType a = 0.0, RealType b = 1.0); // before C++20 533*700637cbSDimitry Andric uniform_real_distribution() : uniform_real_distribution(0.0) {} // C++20 534*700637cbSDimitry Andric explicit uniform_real_distribution(RealType a, RealType b = 1.0); // C++20 535*700637cbSDimitry Andric explicit uniform_real_distribution(const param_type& parm); 536*700637cbSDimitry Andric void reset(); 537*700637cbSDimitry Andric 538*700637cbSDimitry Andric // generating functions 539*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g); 540*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g, const param_type& parm); 541*700637cbSDimitry Andric 542*700637cbSDimitry Andric // property functions 543*700637cbSDimitry Andric result_type a() const; 544*700637cbSDimitry Andric result_type b() const; 545*700637cbSDimitry Andric 546*700637cbSDimitry Andric param_type param() const; 547*700637cbSDimitry Andric void param(const param_type& parm); 548*700637cbSDimitry Andric 549*700637cbSDimitry Andric result_type min() const; 550*700637cbSDimitry Andric result_type max() const; 551*700637cbSDimitry Andric 552*700637cbSDimitry Andric friend bool operator==(const uniform_real_distribution& x, 553*700637cbSDimitry Andric const uniform_real_distribution& y); 554*700637cbSDimitry Andric friend bool operator!=(const uniform_real_distribution& x, 555*700637cbSDimitry Andric const uniform_real_distribution& y); 556*700637cbSDimitry Andric 557*700637cbSDimitry Andric template <class charT, class traits> 558*700637cbSDimitry Andric friend 559*700637cbSDimitry Andric basic_ostream<charT, traits>& 560*700637cbSDimitry Andric operator<<(basic_ostream<charT, traits>& os, 561*700637cbSDimitry Andric const uniform_real_distribution& x); 562*700637cbSDimitry Andric 563*700637cbSDimitry Andric template <class charT, class traits> 564*700637cbSDimitry Andric friend 565*700637cbSDimitry Andric basic_istream<charT, traits>& 566*700637cbSDimitry Andric operator>>(basic_istream<charT, traits>& is, 567*700637cbSDimitry Andric uniform_real_distribution& x); 568*700637cbSDimitry Andric}; 569*700637cbSDimitry Andric 570*700637cbSDimitry Andricclass bernoulli_distribution 571*700637cbSDimitry Andric{ 572*700637cbSDimitry Andricpublic: 573*700637cbSDimitry Andric // types 574*700637cbSDimitry Andric typedef bool result_type; 575*700637cbSDimitry Andric 576*700637cbSDimitry Andric class param_type 577*700637cbSDimitry Andric { 578*700637cbSDimitry Andric public: 579*700637cbSDimitry Andric typedef bernoulli_distribution distribution_type; 580*700637cbSDimitry Andric 581*700637cbSDimitry Andric explicit param_type(double p = 0.5); 582*700637cbSDimitry Andric 583*700637cbSDimitry Andric double p() const; 584*700637cbSDimitry Andric 585*700637cbSDimitry Andric friend bool operator==(const param_type& x, const param_type& y); 586*700637cbSDimitry Andric friend bool operator!=(const param_type& x, const param_type& y); 587*700637cbSDimitry Andric }; 588*700637cbSDimitry Andric 589*700637cbSDimitry Andric // constructors and reset functions 590*700637cbSDimitry Andric explicit bernoulli_distribution(double p = 0.5); // before C++20 591*700637cbSDimitry Andric bernoulli_distribution() : bernoulli_distribution(0.5) {} // C++20 592*700637cbSDimitry Andric explicit bernoulli_distribution(double p); // C++20 593*700637cbSDimitry Andric explicit bernoulli_distribution(const param_type& parm); 594*700637cbSDimitry Andric void reset(); 595*700637cbSDimitry Andric 596*700637cbSDimitry Andric // generating functions 597*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g); 598*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g, const param_type& parm); 599*700637cbSDimitry Andric 600*700637cbSDimitry Andric // property functions 601*700637cbSDimitry Andric double p() const; 602*700637cbSDimitry Andric 603*700637cbSDimitry Andric param_type param() const; 604*700637cbSDimitry Andric void param(const param_type& parm); 605*700637cbSDimitry Andric 606*700637cbSDimitry Andric result_type min() const; 607*700637cbSDimitry Andric result_type max() const; 608*700637cbSDimitry Andric 609*700637cbSDimitry Andric friend bool operator==(const bernoulli_distribution& x, 610*700637cbSDimitry Andric const bernoulli_distribution& y); 611*700637cbSDimitry Andric friend bool operator!=(const bernoulli_distribution& x, 612*700637cbSDimitry Andric const bernoulli_distribution& y); 613*700637cbSDimitry Andric 614*700637cbSDimitry Andric template <class charT, class traits> 615*700637cbSDimitry Andric friend 616*700637cbSDimitry Andric basic_ostream<charT, traits>& 617*700637cbSDimitry Andric operator<<(basic_ostream<charT, traits>& os, 618*700637cbSDimitry Andric const bernoulli_distribution& x); 619*700637cbSDimitry Andric 620*700637cbSDimitry Andric template <class charT, class traits> 621*700637cbSDimitry Andric friend 622*700637cbSDimitry Andric basic_istream<charT, traits>& 623*700637cbSDimitry Andric operator>>(basic_istream<charT, traits>& is, 624*700637cbSDimitry Andric bernoulli_distribution& x); 625*700637cbSDimitry Andric}; 626*700637cbSDimitry Andric 627*700637cbSDimitry Andrictemplate<class IntType = int> 628*700637cbSDimitry Andricclass binomial_distribution 629*700637cbSDimitry Andric{ 630*700637cbSDimitry Andricpublic: 631*700637cbSDimitry Andric // types 632*700637cbSDimitry Andric typedef IntType result_type; 633*700637cbSDimitry Andric 634*700637cbSDimitry Andric class param_type 635*700637cbSDimitry Andric { 636*700637cbSDimitry Andric public: 637*700637cbSDimitry Andric typedef binomial_distribution distribution_type; 638*700637cbSDimitry Andric 639*700637cbSDimitry Andric explicit param_type(IntType t = 1, double p = 0.5); 640*700637cbSDimitry Andric 641*700637cbSDimitry Andric IntType t() const; 642*700637cbSDimitry Andric double p() const; 643*700637cbSDimitry Andric 644*700637cbSDimitry Andric friend bool operator==(const param_type& x, const param_type& y); 645*700637cbSDimitry Andric friend bool operator!=(const param_type& x, const param_type& y); 646*700637cbSDimitry Andric }; 647*700637cbSDimitry Andric 648*700637cbSDimitry Andric // constructors and reset functions 649*700637cbSDimitry Andric explicit binomial_distribution(IntType t = 1, double p = 0.5); // before C++20 650*700637cbSDimitry Andric binomial_distribution() : binomial_distribution(1) {} // C++20 651*700637cbSDimitry Andric explicit binomial_distribution(IntType t, double p = 0.5); // C++20 652*700637cbSDimitry Andric explicit binomial_distribution(const param_type& parm); 653*700637cbSDimitry Andric void reset(); 654*700637cbSDimitry Andric 655*700637cbSDimitry Andric // generating functions 656*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g); 657*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g, const param_type& parm); 658*700637cbSDimitry Andric 659*700637cbSDimitry Andric // property functions 660*700637cbSDimitry Andric IntType t() const; 661*700637cbSDimitry Andric double p() const; 662*700637cbSDimitry Andric 663*700637cbSDimitry Andric param_type param() const; 664*700637cbSDimitry Andric void param(const param_type& parm); 665*700637cbSDimitry Andric 666*700637cbSDimitry Andric result_type min() const; 667*700637cbSDimitry Andric result_type max() const; 668*700637cbSDimitry Andric 669*700637cbSDimitry Andric friend bool operator==(const binomial_distribution& x, 670*700637cbSDimitry Andric const binomial_distribution& y); 671*700637cbSDimitry Andric friend bool operator!=(const binomial_distribution& x, 672*700637cbSDimitry Andric const binomial_distribution& y); 673*700637cbSDimitry Andric 674*700637cbSDimitry Andric template <class charT, class traits> 675*700637cbSDimitry Andric friend 676*700637cbSDimitry Andric basic_ostream<charT, traits>& 677*700637cbSDimitry Andric operator<<(basic_ostream<charT, traits>& os, 678*700637cbSDimitry Andric const binomial_distribution& x); 679*700637cbSDimitry Andric 680*700637cbSDimitry Andric template <class charT, class traits> 681*700637cbSDimitry Andric friend 682*700637cbSDimitry Andric basic_istream<charT, traits>& 683*700637cbSDimitry Andric operator>>(basic_istream<charT, traits>& is, 684*700637cbSDimitry Andric binomial_distribution& x); 685*700637cbSDimitry Andric}; 686*700637cbSDimitry Andric 687*700637cbSDimitry Andrictemplate<class IntType = int> 688*700637cbSDimitry Andricclass geometric_distribution 689*700637cbSDimitry Andric{ 690*700637cbSDimitry Andricpublic: 691*700637cbSDimitry Andric // types 692*700637cbSDimitry Andric typedef IntType result_type; 693*700637cbSDimitry Andric 694*700637cbSDimitry Andric class param_type 695*700637cbSDimitry Andric { 696*700637cbSDimitry Andric public: 697*700637cbSDimitry Andric typedef geometric_distribution distribution_type; 698*700637cbSDimitry Andric 699*700637cbSDimitry Andric explicit param_type(double p = 0.5); 700*700637cbSDimitry Andric 701*700637cbSDimitry Andric double p() const; 702*700637cbSDimitry Andric 703*700637cbSDimitry Andric friend bool operator==(const param_type& x, const param_type& y); 704*700637cbSDimitry Andric friend bool operator!=(const param_type& x, const param_type& y); 705*700637cbSDimitry Andric }; 706*700637cbSDimitry Andric 707*700637cbSDimitry Andric // constructors and reset functions 708*700637cbSDimitry Andric explicit geometric_distribution(double p = 0.5); // before C++20 709*700637cbSDimitry Andric geometric_distribution() : geometric_distribution(0.5) {} // C++20 710*700637cbSDimitry Andric explicit geometric_distribution(double p); // C++20 711*700637cbSDimitry Andric explicit geometric_distribution(const param_type& parm); 712*700637cbSDimitry Andric void reset(); 713*700637cbSDimitry Andric 714*700637cbSDimitry Andric // generating functions 715*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g); 716*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g, const param_type& parm); 717*700637cbSDimitry Andric 718*700637cbSDimitry Andric // property functions 719*700637cbSDimitry Andric double p() const; 720*700637cbSDimitry Andric 721*700637cbSDimitry Andric param_type param() const; 722*700637cbSDimitry Andric void param(const param_type& parm); 723*700637cbSDimitry Andric 724*700637cbSDimitry Andric result_type min() const; 725*700637cbSDimitry Andric result_type max() const; 726*700637cbSDimitry Andric 727*700637cbSDimitry Andric friend bool operator==(const geometric_distribution& x, 728*700637cbSDimitry Andric const geometric_distribution& y); 729*700637cbSDimitry Andric friend bool operator!=(const geometric_distribution& x, 730*700637cbSDimitry Andric const geometric_distribution& y); 731*700637cbSDimitry Andric 732*700637cbSDimitry Andric template <class charT, class traits> 733*700637cbSDimitry Andric friend 734*700637cbSDimitry Andric basic_ostream<charT, traits>& 735*700637cbSDimitry Andric operator<<(basic_ostream<charT, traits>& os, 736*700637cbSDimitry Andric const geometric_distribution& x); 737*700637cbSDimitry Andric 738*700637cbSDimitry Andric template <class charT, class traits> 739*700637cbSDimitry Andric friend 740*700637cbSDimitry Andric basic_istream<charT, traits>& 741*700637cbSDimitry Andric operator>>(basic_istream<charT, traits>& is, 742*700637cbSDimitry Andric geometric_distribution& x); 743*700637cbSDimitry Andric}; 744*700637cbSDimitry Andric 745*700637cbSDimitry Andrictemplate<class IntType = int> 746*700637cbSDimitry Andricclass negative_binomial_distribution 747*700637cbSDimitry Andric{ 748*700637cbSDimitry Andricpublic: 749*700637cbSDimitry Andric // types 750*700637cbSDimitry Andric typedef IntType result_type; 751*700637cbSDimitry Andric 752*700637cbSDimitry Andric class param_type 753*700637cbSDimitry Andric { 754*700637cbSDimitry Andric public: 755*700637cbSDimitry Andric typedef negative_binomial_distribution distribution_type; 756*700637cbSDimitry Andric 757*700637cbSDimitry Andric explicit param_type(result_type k = 1, double p = 0.5); 758*700637cbSDimitry Andric 759*700637cbSDimitry Andric result_type k() const; 760*700637cbSDimitry Andric double p() const; 761*700637cbSDimitry Andric 762*700637cbSDimitry Andric friend bool operator==(const param_type& x, const param_type& y); 763*700637cbSDimitry Andric friend bool operator!=(const param_type& x, const param_type& y); 764*700637cbSDimitry Andric }; 765*700637cbSDimitry Andric 766*700637cbSDimitry Andric // constructor and reset functions 767*700637cbSDimitry Andric explicit negative_binomial_distribution(IntType k = 1, double p = 0.5); // before C++20 768*700637cbSDimitry Andric negative_binomial_distribution() : negative_binomial_distribution(1) {} // C++20 769*700637cbSDimitry Andric explicit negative_binomial_distribution(IntType k, double p = 0.5); // C++20 770*700637cbSDimitry Andric explicit negative_binomial_distribution(const param_type& parm); 771*700637cbSDimitry Andric void reset(); 772*700637cbSDimitry Andric 773*700637cbSDimitry Andric // generating functions 774*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g); 775*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g, const param_type& parm); 776*700637cbSDimitry Andric 777*700637cbSDimitry Andric // property functions 778*700637cbSDimitry Andric result_type k() const; 779*700637cbSDimitry Andric double p() const; 780*700637cbSDimitry Andric 781*700637cbSDimitry Andric param_type param() const; 782*700637cbSDimitry Andric void param(const param_type& parm); 783*700637cbSDimitry Andric 784*700637cbSDimitry Andric result_type min() const; 785*700637cbSDimitry Andric result_type max() const; 786*700637cbSDimitry Andric 787*700637cbSDimitry Andric friend bool operator==(const negative_binomial_distribution& x, 788*700637cbSDimitry Andric const negative_binomial_distribution& y); 789*700637cbSDimitry Andric friend bool operator!=(const negative_binomial_distribution& x, 790*700637cbSDimitry Andric const negative_binomial_distribution& y); 791*700637cbSDimitry Andric 792*700637cbSDimitry Andric template <class charT, class traits> 793*700637cbSDimitry Andric friend 794*700637cbSDimitry Andric basic_ostream<charT, traits>& 795*700637cbSDimitry Andric operator<<(basic_ostream<charT, traits>& os, 796*700637cbSDimitry Andric const negative_binomial_distribution& x); 797*700637cbSDimitry Andric 798*700637cbSDimitry Andric template <class charT, class traits> 799*700637cbSDimitry Andric friend 800*700637cbSDimitry Andric basic_istream<charT, traits>& 801*700637cbSDimitry Andric operator>>(basic_istream<charT, traits>& is, 802*700637cbSDimitry Andric negative_binomial_distribution& x); 803*700637cbSDimitry Andric}; 804*700637cbSDimitry Andric 805*700637cbSDimitry Andrictemplate<class IntType = int> 806*700637cbSDimitry Andricclass poisson_distribution 807*700637cbSDimitry Andric{ 808*700637cbSDimitry Andricpublic: 809*700637cbSDimitry Andric // types 810*700637cbSDimitry Andric typedef IntType result_type; 811*700637cbSDimitry Andric 812*700637cbSDimitry Andric class param_type 813*700637cbSDimitry Andric { 814*700637cbSDimitry Andric public: 815*700637cbSDimitry Andric typedef poisson_distribution distribution_type; 816*700637cbSDimitry Andric 817*700637cbSDimitry Andric explicit param_type(double mean = 1.0); 818*700637cbSDimitry Andric 819*700637cbSDimitry Andric double mean() const; 820*700637cbSDimitry Andric 821*700637cbSDimitry Andric friend bool operator==(const param_type& x, const param_type& y); 822*700637cbSDimitry Andric friend bool operator!=(const param_type& x, const param_type& y); 823*700637cbSDimitry Andric }; 824*700637cbSDimitry Andric 825*700637cbSDimitry Andric // constructors and reset functions 826*700637cbSDimitry Andric explicit poisson_distribution(double mean = 1.0); // before C++20 827*700637cbSDimitry Andric poisson_distribution() : poisson_distribution(1.0) {} // C++20 828*700637cbSDimitry Andric explicit poisson_distribution(double mean); // C++20 829*700637cbSDimitry Andric explicit poisson_distribution(const param_type& parm); 830*700637cbSDimitry Andric void reset(); 831*700637cbSDimitry Andric 832*700637cbSDimitry Andric // generating functions 833*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g); 834*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g, const param_type& parm); 835*700637cbSDimitry Andric 836*700637cbSDimitry Andric // property functions 837*700637cbSDimitry Andric double mean() const; 838*700637cbSDimitry Andric 839*700637cbSDimitry Andric param_type param() const; 840*700637cbSDimitry Andric void param(const param_type& parm); 841*700637cbSDimitry Andric 842*700637cbSDimitry Andric result_type min() const; 843*700637cbSDimitry Andric result_type max() const; 844*700637cbSDimitry Andric 845*700637cbSDimitry Andric friend bool operator==(const poisson_distribution& x, 846*700637cbSDimitry Andric const poisson_distribution& y); 847*700637cbSDimitry Andric friend bool operator!=(const poisson_distribution& x, 848*700637cbSDimitry Andric const poisson_distribution& y); 849*700637cbSDimitry Andric 850*700637cbSDimitry Andric template <class charT, class traits> 851*700637cbSDimitry Andric friend 852*700637cbSDimitry Andric basic_ostream<charT, traits>& 853*700637cbSDimitry Andric operator<<(basic_ostream<charT, traits>& os, 854*700637cbSDimitry Andric const poisson_distribution& x); 855*700637cbSDimitry Andric 856*700637cbSDimitry Andric template <class charT, class traits> 857*700637cbSDimitry Andric friend 858*700637cbSDimitry Andric basic_istream<charT, traits>& 859*700637cbSDimitry Andric operator>>(basic_istream<charT, traits>& is, 860*700637cbSDimitry Andric poisson_distribution& x); 861*700637cbSDimitry Andric}; 862*700637cbSDimitry Andric 863*700637cbSDimitry Andrictemplate<class RealType = double> 864*700637cbSDimitry Andricclass exponential_distribution 865*700637cbSDimitry Andric{ 866*700637cbSDimitry Andricpublic: 867*700637cbSDimitry Andric // types 868*700637cbSDimitry Andric typedef RealType result_type; 869*700637cbSDimitry Andric 870*700637cbSDimitry Andric class param_type 871*700637cbSDimitry Andric { 872*700637cbSDimitry Andric public: 873*700637cbSDimitry Andric typedef exponential_distribution distribution_type; 874*700637cbSDimitry Andric 875*700637cbSDimitry Andric explicit param_type(result_type lambda = 1.0); 876*700637cbSDimitry Andric 877*700637cbSDimitry Andric result_type lambda() const; 878*700637cbSDimitry Andric 879*700637cbSDimitry Andric friend bool operator==(const param_type& x, const param_type& y); 880*700637cbSDimitry Andric friend bool operator!=(const param_type& x, const param_type& y); 881*700637cbSDimitry Andric }; 882*700637cbSDimitry Andric 883*700637cbSDimitry Andric // constructors and reset functions 884*700637cbSDimitry Andric explicit exponential_distribution(RealType lambda = 1.0); // before C++20 885*700637cbSDimitry Andric exponential_distribution() : exponential_distribution(1.0) {} // C++20 886*700637cbSDimitry Andric explicit exponential_distribution(RealType lambda); // C++20 887*700637cbSDimitry Andric explicit exponential_distribution(const param_type& parm); 888*700637cbSDimitry Andric void reset(); 889*700637cbSDimitry Andric 890*700637cbSDimitry Andric // generating functions 891*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g); 892*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g, const param_type& parm); 893*700637cbSDimitry Andric 894*700637cbSDimitry Andric // property functions 895*700637cbSDimitry Andric result_type lambda() const; 896*700637cbSDimitry Andric 897*700637cbSDimitry Andric param_type param() const; 898*700637cbSDimitry Andric void param(const param_type& parm); 899*700637cbSDimitry Andric 900*700637cbSDimitry Andric result_type min() const; 901*700637cbSDimitry Andric result_type max() const; 902*700637cbSDimitry Andric 903*700637cbSDimitry Andric friend bool operator==(const exponential_distribution& x, 904*700637cbSDimitry Andric const exponential_distribution& y); 905*700637cbSDimitry Andric friend bool operator!=(const exponential_distribution& x, 906*700637cbSDimitry Andric const exponential_distribution& y); 907*700637cbSDimitry Andric 908*700637cbSDimitry Andric template <class charT, class traits> 909*700637cbSDimitry Andric friend 910*700637cbSDimitry Andric basic_ostream<charT, traits>& 911*700637cbSDimitry Andric operator<<(basic_ostream<charT, traits>& os, 912*700637cbSDimitry Andric const exponential_distribution& x); 913*700637cbSDimitry Andric 914*700637cbSDimitry Andric template <class charT, class traits> 915*700637cbSDimitry Andric friend 916*700637cbSDimitry Andric basic_istream<charT, traits>& 917*700637cbSDimitry Andric operator>>(basic_istream<charT, traits>& is, 918*700637cbSDimitry Andric exponential_distribution& x); 919*700637cbSDimitry Andric}; 920*700637cbSDimitry Andric 921*700637cbSDimitry Andrictemplate<class RealType = double> 922*700637cbSDimitry Andricclass gamma_distribution 923*700637cbSDimitry Andric{ 924*700637cbSDimitry Andricpublic: 925*700637cbSDimitry Andric // types 926*700637cbSDimitry Andric typedef RealType result_type; 927*700637cbSDimitry Andric 928*700637cbSDimitry Andric class param_type 929*700637cbSDimitry Andric { 930*700637cbSDimitry Andric public: 931*700637cbSDimitry Andric typedef gamma_distribution distribution_type; 932*700637cbSDimitry Andric 933*700637cbSDimitry Andric explicit param_type(result_type alpha = 1, result_type beta = 1); 934*700637cbSDimitry Andric 935*700637cbSDimitry Andric result_type alpha() const; 936*700637cbSDimitry Andric result_type beta() const; 937*700637cbSDimitry Andric 938*700637cbSDimitry Andric friend bool operator==(const param_type& x, const param_type& y); 939*700637cbSDimitry Andric friend bool operator!=(const param_type& x, const param_type& y); 940*700637cbSDimitry Andric }; 941*700637cbSDimitry Andric 942*700637cbSDimitry Andric // constructors and reset functions 943*700637cbSDimitry Andric explicit gamma_distribution(RealType alpha = 0.0, RealType beta = 1.0); // before C++20 944*700637cbSDimitry Andric gamma_distribution() : gamma_distribution(0.0) {} // C++20 945*700637cbSDimitry Andric explicit gamma_distribution(RealType alpha, RealType beta = 1.0); // C++20 946*700637cbSDimitry Andric explicit gamma_distribution(const param_type& parm); 947*700637cbSDimitry Andric void reset(); 948*700637cbSDimitry Andric 949*700637cbSDimitry Andric // generating functions 950*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g); 951*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g, const param_type& parm); 952*700637cbSDimitry Andric 953*700637cbSDimitry Andric // property functions 954*700637cbSDimitry Andric result_type alpha() const; 955*700637cbSDimitry Andric result_type beta() const; 956*700637cbSDimitry Andric 957*700637cbSDimitry Andric param_type param() const; 958*700637cbSDimitry Andric void param(const param_type& parm); 959*700637cbSDimitry Andric 960*700637cbSDimitry Andric result_type min() const; 961*700637cbSDimitry Andric result_type max() const; 962*700637cbSDimitry Andric 963*700637cbSDimitry Andric friend bool operator==(const gamma_distribution& x, 964*700637cbSDimitry Andric const gamma_distribution& y); 965*700637cbSDimitry Andric friend bool operator!=(const gamma_distribution& x, 966*700637cbSDimitry Andric const gamma_distribution& y); 967*700637cbSDimitry Andric 968*700637cbSDimitry Andric template <class charT, class traits> 969*700637cbSDimitry Andric friend 970*700637cbSDimitry Andric basic_ostream<charT, traits>& 971*700637cbSDimitry Andric operator<<(basic_ostream<charT, traits>& os, 972*700637cbSDimitry Andric const gamma_distribution& x); 973*700637cbSDimitry Andric 974*700637cbSDimitry Andric template <class charT, class traits> 975*700637cbSDimitry Andric friend 976*700637cbSDimitry Andric basic_istream<charT, traits>& 977*700637cbSDimitry Andric operator>>(basic_istream<charT, traits>& is, 978*700637cbSDimitry Andric gamma_distribution& x); 979*700637cbSDimitry Andric}; 980*700637cbSDimitry Andric 981*700637cbSDimitry Andrictemplate<class RealType = double> 982*700637cbSDimitry Andricclass weibull_distribution 983*700637cbSDimitry Andric{ 984*700637cbSDimitry Andricpublic: 985*700637cbSDimitry Andric // types 986*700637cbSDimitry Andric typedef RealType result_type; 987*700637cbSDimitry Andric 988*700637cbSDimitry Andric class param_type 989*700637cbSDimitry Andric { 990*700637cbSDimitry Andric public: 991*700637cbSDimitry Andric typedef weibull_distribution distribution_type; 992*700637cbSDimitry Andric 993*700637cbSDimitry Andric explicit param_type(result_type alpha = 1, result_type beta = 1); 994*700637cbSDimitry Andric 995*700637cbSDimitry Andric result_type a() const; 996*700637cbSDimitry Andric result_type b() const; 997*700637cbSDimitry Andric 998*700637cbSDimitry Andric friend bool operator==(const param_type& x, const param_type& y); 999*700637cbSDimitry Andric friend bool operator!=(const param_type& x, const param_type& y); 1000*700637cbSDimitry Andric }; 1001*700637cbSDimitry Andric 1002*700637cbSDimitry Andric // constructor and reset functions 1003*700637cbSDimitry Andric explicit weibull_distribution(RealType a = 1.0, RealType b = 1.0); // before C++20 1004*700637cbSDimitry Andric weibull_distribution() : weibull_distribution(1.0) {} // C++20 1005*700637cbSDimitry Andric explicit weibull_distribution(RealType a, RealType b = 1.0); // C++20 1006*700637cbSDimitry Andric explicit weibull_distribution(const param_type& parm); 1007*700637cbSDimitry Andric void reset(); 1008*700637cbSDimitry Andric 1009*700637cbSDimitry Andric // generating functions 1010*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g); 1011*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g, const param_type& parm); 1012*700637cbSDimitry Andric 1013*700637cbSDimitry Andric // property functions 1014*700637cbSDimitry Andric result_type a() const; 1015*700637cbSDimitry Andric result_type b() const; 1016*700637cbSDimitry Andric 1017*700637cbSDimitry Andric param_type param() const; 1018*700637cbSDimitry Andric void param(const param_type& parm); 1019*700637cbSDimitry Andric 1020*700637cbSDimitry Andric result_type min() const; 1021*700637cbSDimitry Andric result_type max() const; 1022*700637cbSDimitry Andric 1023*700637cbSDimitry Andric friend bool operator==(const weibull_distribution& x, 1024*700637cbSDimitry Andric const weibull_distribution& y); 1025*700637cbSDimitry Andric friend bool operator!=(const weibull_distribution& x, 1026*700637cbSDimitry Andric const weibull_distribution& y); 1027*700637cbSDimitry Andric 1028*700637cbSDimitry Andric template <class charT, class traits> 1029*700637cbSDimitry Andric friend 1030*700637cbSDimitry Andric basic_ostream<charT, traits>& 1031*700637cbSDimitry Andric operator<<(basic_ostream<charT, traits>& os, 1032*700637cbSDimitry Andric const weibull_distribution& x); 1033*700637cbSDimitry Andric 1034*700637cbSDimitry Andric template <class charT, class traits> 1035*700637cbSDimitry Andric friend 1036*700637cbSDimitry Andric basic_istream<charT, traits>& 1037*700637cbSDimitry Andric operator>>(basic_istream<charT, traits>& is, 1038*700637cbSDimitry Andric weibull_distribution& x); 1039*700637cbSDimitry Andric}; 1040*700637cbSDimitry Andric 1041*700637cbSDimitry Andrictemplate<class RealType = double> 1042*700637cbSDimitry Andricclass extreme_value_distribution 1043*700637cbSDimitry Andric{ 1044*700637cbSDimitry Andricpublic: 1045*700637cbSDimitry Andric // types 1046*700637cbSDimitry Andric typedef RealType result_type; 1047*700637cbSDimitry Andric 1048*700637cbSDimitry Andric class param_type 1049*700637cbSDimitry Andric { 1050*700637cbSDimitry Andric public: 1051*700637cbSDimitry Andric typedef extreme_value_distribution distribution_type; 1052*700637cbSDimitry Andric 1053*700637cbSDimitry Andric explicit param_type(result_type a = 0, result_type b = 1); 1054*700637cbSDimitry Andric 1055*700637cbSDimitry Andric result_type a() const; 1056*700637cbSDimitry Andric result_type b() const; 1057*700637cbSDimitry Andric 1058*700637cbSDimitry Andric friend bool operator==(const param_type& x, const param_type& y); 1059*700637cbSDimitry Andric friend bool operator!=(const param_type& x, const param_type& y); 1060*700637cbSDimitry Andric }; 1061*700637cbSDimitry Andric 1062*700637cbSDimitry Andric // constructor and reset functions 1063*700637cbSDimitry Andric explicit extreme_value_distribution(RealType a = 0.0, RealType b = 1.0); // before C++20 1064*700637cbSDimitry Andric extreme_value_distribution() : extreme_value_distribution(0.0) {} // C++20 1065*700637cbSDimitry Andric explicit extreme_value_distribution(RealType a, RealType b = 1.0); // C++20 1066*700637cbSDimitry Andric explicit extreme_value_distribution(const param_type& parm); 1067*700637cbSDimitry Andric void reset(); 1068*700637cbSDimitry Andric 1069*700637cbSDimitry Andric // generating functions 1070*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g); 1071*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g, const param_type& parm); 1072*700637cbSDimitry Andric 1073*700637cbSDimitry Andric // property functions 1074*700637cbSDimitry Andric result_type a() const; 1075*700637cbSDimitry Andric result_type b() const; 1076*700637cbSDimitry Andric 1077*700637cbSDimitry Andric param_type param() const; 1078*700637cbSDimitry Andric void param(const param_type& parm); 1079*700637cbSDimitry Andric 1080*700637cbSDimitry Andric result_type min() const; 1081*700637cbSDimitry Andric result_type max() const; 1082*700637cbSDimitry Andric 1083*700637cbSDimitry Andric friend bool operator==(const extreme_value_distribution& x, 1084*700637cbSDimitry Andric const extreme_value_distribution& y); 1085*700637cbSDimitry Andric friend bool operator!=(const extreme_value_distribution& x, 1086*700637cbSDimitry Andric const extreme_value_distribution& y); 1087*700637cbSDimitry Andric 1088*700637cbSDimitry Andric template <class charT, class traits> 1089*700637cbSDimitry Andric friend 1090*700637cbSDimitry Andric basic_ostream<charT, traits>& 1091*700637cbSDimitry Andric operator<<(basic_ostream<charT, traits>& os, 1092*700637cbSDimitry Andric const extreme_value_distribution& x); 1093*700637cbSDimitry Andric 1094*700637cbSDimitry Andric template <class charT, class traits> 1095*700637cbSDimitry Andric friend 1096*700637cbSDimitry Andric basic_istream<charT, traits>& 1097*700637cbSDimitry Andric operator>>(basic_istream<charT, traits>& is, 1098*700637cbSDimitry Andric extreme_value_distribution& x); 1099*700637cbSDimitry Andric}; 1100*700637cbSDimitry Andric 1101*700637cbSDimitry Andrictemplate<class RealType = double> 1102*700637cbSDimitry Andricclass normal_distribution 1103*700637cbSDimitry Andric{ 1104*700637cbSDimitry Andricpublic: 1105*700637cbSDimitry Andric // types 1106*700637cbSDimitry Andric typedef RealType result_type; 1107*700637cbSDimitry Andric 1108*700637cbSDimitry Andric class param_type 1109*700637cbSDimitry Andric { 1110*700637cbSDimitry Andric public: 1111*700637cbSDimitry Andric typedef normal_distribution distribution_type; 1112*700637cbSDimitry Andric 1113*700637cbSDimitry Andric explicit param_type(result_type mean = 0, result_type stddev = 1); 1114*700637cbSDimitry Andric 1115*700637cbSDimitry Andric result_type mean() const; 1116*700637cbSDimitry Andric result_type stddev() const; 1117*700637cbSDimitry Andric 1118*700637cbSDimitry Andric friend bool operator==(const param_type& x, const param_type& y); 1119*700637cbSDimitry Andric friend bool operator!=(const param_type& x, const param_type& y); 1120*700637cbSDimitry Andric }; 1121*700637cbSDimitry Andric 1122*700637cbSDimitry Andric // constructors and reset functions 1123*700637cbSDimitry Andric explicit normal_distribution(RealType mean = 0.0, RealType stddev = 1.0); // before C++20 1124*700637cbSDimitry Andric normal_distribution() : normal_distribution(0.0) {} // C++20 1125*700637cbSDimitry Andric explicit normal_distribution(RealType mean, RealType stddev = 1.0); // C++20 1126*700637cbSDimitry Andric explicit normal_distribution(const param_type& parm); 1127*700637cbSDimitry Andric void reset(); 1128*700637cbSDimitry Andric 1129*700637cbSDimitry Andric // generating functions 1130*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g); 1131*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g, const param_type& parm); 1132*700637cbSDimitry Andric 1133*700637cbSDimitry Andric // property functions 1134*700637cbSDimitry Andric result_type mean() const; 1135*700637cbSDimitry Andric result_type stddev() const; 1136*700637cbSDimitry Andric 1137*700637cbSDimitry Andric param_type param() const; 1138*700637cbSDimitry Andric void param(const param_type& parm); 1139*700637cbSDimitry Andric 1140*700637cbSDimitry Andric result_type min() const; 1141*700637cbSDimitry Andric result_type max() const; 1142*700637cbSDimitry Andric 1143*700637cbSDimitry Andric friend bool operator==(const normal_distribution& x, 1144*700637cbSDimitry Andric const normal_distribution& y); 1145*700637cbSDimitry Andric friend bool operator!=(const normal_distribution& x, 1146*700637cbSDimitry Andric const normal_distribution& y); 1147*700637cbSDimitry Andric 1148*700637cbSDimitry Andric template <class charT, class traits> 1149*700637cbSDimitry Andric friend 1150*700637cbSDimitry Andric basic_ostream<charT, traits>& 1151*700637cbSDimitry Andric operator<<(basic_ostream<charT, traits>& os, 1152*700637cbSDimitry Andric const normal_distribution& x); 1153*700637cbSDimitry Andric 1154*700637cbSDimitry Andric template <class charT, class traits> 1155*700637cbSDimitry Andric friend 1156*700637cbSDimitry Andric basic_istream<charT, traits>& 1157*700637cbSDimitry Andric operator>>(basic_istream<charT, traits>& is, 1158*700637cbSDimitry Andric normal_distribution& x); 1159*700637cbSDimitry Andric}; 1160*700637cbSDimitry Andric 1161*700637cbSDimitry Andrictemplate<class RealType = double> 1162*700637cbSDimitry Andricclass lognormal_distribution 1163*700637cbSDimitry Andric{ 1164*700637cbSDimitry Andricpublic: 1165*700637cbSDimitry Andric // types 1166*700637cbSDimitry Andric typedef RealType result_type; 1167*700637cbSDimitry Andric 1168*700637cbSDimitry Andric class param_type 1169*700637cbSDimitry Andric { 1170*700637cbSDimitry Andric public: 1171*700637cbSDimitry Andric typedef lognormal_distribution distribution_type; 1172*700637cbSDimitry Andric 1173*700637cbSDimitry Andric explicit param_type(result_type m = 0, result_type s = 1); 1174*700637cbSDimitry Andric 1175*700637cbSDimitry Andric result_type m() const; 1176*700637cbSDimitry Andric result_type s() const; 1177*700637cbSDimitry Andric 1178*700637cbSDimitry Andric friend bool operator==(const param_type& x, const param_type& y); 1179*700637cbSDimitry Andric friend bool operator!=(const param_type& x, const param_type& y); 1180*700637cbSDimitry Andric }; 1181*700637cbSDimitry Andric 1182*700637cbSDimitry Andric // constructor and reset functions 1183*700637cbSDimitry Andric explicit lognormal_distribution(RealType mean = 0.0, RealType stddev = 1.0); // before C++20 1184*700637cbSDimitry Andric lognormal_distribution() : lognormal_distribution(0.0) {} // C++20 1185*700637cbSDimitry Andric explicit lognormal_distribution(RealType mean, RealType stddev = 1.0); // C++20 1186*700637cbSDimitry Andric explicit lognormal_distribution(const param_type& parm); 1187*700637cbSDimitry Andric void reset(); 1188*700637cbSDimitry Andric 1189*700637cbSDimitry Andric // generating functions 1190*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g); 1191*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g, const param_type& parm); 1192*700637cbSDimitry Andric 1193*700637cbSDimitry Andric // property functions 1194*700637cbSDimitry Andric result_type m() const; 1195*700637cbSDimitry Andric result_type s() const; 1196*700637cbSDimitry Andric 1197*700637cbSDimitry Andric param_type param() const; 1198*700637cbSDimitry Andric void param(const param_type& parm); 1199*700637cbSDimitry Andric 1200*700637cbSDimitry Andric result_type min() const; 1201*700637cbSDimitry Andric result_type max() const; 1202*700637cbSDimitry Andric 1203*700637cbSDimitry Andric friend bool operator==(const lognormal_distribution& x, 1204*700637cbSDimitry Andric const lognormal_distribution& y); 1205*700637cbSDimitry Andric friend bool operator!=(const lognormal_distribution& x, 1206*700637cbSDimitry Andric const lognormal_distribution& y); 1207*700637cbSDimitry Andric 1208*700637cbSDimitry Andric template <class charT, class traits> 1209*700637cbSDimitry Andric friend 1210*700637cbSDimitry Andric basic_ostream<charT, traits>& 1211*700637cbSDimitry Andric operator<<(basic_ostream<charT, traits>& os, 1212*700637cbSDimitry Andric const lognormal_distribution& x); 1213*700637cbSDimitry Andric 1214*700637cbSDimitry Andric template <class charT, class traits> 1215*700637cbSDimitry Andric friend 1216*700637cbSDimitry Andric basic_istream<charT, traits>& 1217*700637cbSDimitry Andric operator>>(basic_istream<charT, traits>& is, 1218*700637cbSDimitry Andric lognormal_distribution& x); 1219*700637cbSDimitry Andric}; 1220*700637cbSDimitry Andric 1221*700637cbSDimitry Andrictemplate<class RealType = double> 1222*700637cbSDimitry Andricclass chi_squared_distribution 1223*700637cbSDimitry Andric{ 1224*700637cbSDimitry Andricpublic: 1225*700637cbSDimitry Andric // types 1226*700637cbSDimitry Andric typedef RealType result_type; 1227*700637cbSDimitry Andric 1228*700637cbSDimitry Andric class param_type 1229*700637cbSDimitry Andric { 1230*700637cbSDimitry Andric public: 1231*700637cbSDimitry Andric typedef chi_squared_distribution distribution_type; 1232*700637cbSDimitry Andric 1233*700637cbSDimitry Andric explicit param_type(result_type n = 1); 1234*700637cbSDimitry Andric 1235*700637cbSDimitry Andric result_type n() const; 1236*700637cbSDimitry Andric 1237*700637cbSDimitry Andric friend bool operator==(const param_type& x, const param_type& y); 1238*700637cbSDimitry Andric friend bool operator!=(const param_type& x, const param_type& y); 1239*700637cbSDimitry Andric }; 1240*700637cbSDimitry Andric 1241*700637cbSDimitry Andric // constructor and reset functions 1242*700637cbSDimitry Andric explicit chi_squared_distribution(RealType n = 1.0); // before C++20 1243*700637cbSDimitry Andric chi_squared_distribution() : chi_squared_distribution(1.0) {} // C++20 1244*700637cbSDimitry Andric explicit chi_squared_distribution(RealType n); // C++20 1245*700637cbSDimitry Andric explicit chi_squared_distribution(const param_type& parm); 1246*700637cbSDimitry Andric void reset(); 1247*700637cbSDimitry Andric 1248*700637cbSDimitry Andric // generating functions 1249*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g); 1250*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g, const param_type& parm); 1251*700637cbSDimitry Andric 1252*700637cbSDimitry Andric // property functions 1253*700637cbSDimitry Andric result_type n() const; 1254*700637cbSDimitry Andric 1255*700637cbSDimitry Andric param_type param() const; 1256*700637cbSDimitry Andric void param(const param_type& parm); 1257*700637cbSDimitry Andric 1258*700637cbSDimitry Andric result_type min() const; 1259*700637cbSDimitry Andric result_type max() const; 1260*700637cbSDimitry Andric 1261*700637cbSDimitry Andric friend bool operator==(const chi_squared_distribution& x, 1262*700637cbSDimitry Andric const chi_squared_distribution& y); 1263*700637cbSDimitry Andric friend bool operator!=(const chi_squared_distribution& x, 1264*700637cbSDimitry Andric const chi_squared_distribution& y); 1265*700637cbSDimitry Andric 1266*700637cbSDimitry Andric template <class charT, class traits> 1267*700637cbSDimitry Andric friend 1268*700637cbSDimitry Andric basic_ostream<charT, traits>& 1269*700637cbSDimitry Andric operator<<(basic_ostream<charT, traits>& os, 1270*700637cbSDimitry Andric const chi_squared_distribution& x); 1271*700637cbSDimitry Andric 1272*700637cbSDimitry Andric template <class charT, class traits> 1273*700637cbSDimitry Andric friend 1274*700637cbSDimitry Andric basic_istream<charT, traits>& 1275*700637cbSDimitry Andric operator>>(basic_istream<charT, traits>& is, 1276*700637cbSDimitry Andric chi_squared_distribution& x); 1277*700637cbSDimitry Andric}; 1278*700637cbSDimitry Andric 1279*700637cbSDimitry Andrictemplate<class RealType = double> 1280*700637cbSDimitry Andricclass cauchy_distribution 1281*700637cbSDimitry Andric{ 1282*700637cbSDimitry Andricpublic: 1283*700637cbSDimitry Andric // types 1284*700637cbSDimitry Andric typedef RealType result_type; 1285*700637cbSDimitry Andric 1286*700637cbSDimitry Andric class param_type 1287*700637cbSDimitry Andric { 1288*700637cbSDimitry Andric public: 1289*700637cbSDimitry Andric typedef cauchy_distribution distribution_type; 1290*700637cbSDimitry Andric 1291*700637cbSDimitry Andric explicit param_type(result_type a = 0, result_type b = 1); 1292*700637cbSDimitry Andric 1293*700637cbSDimitry Andric result_type a() const; 1294*700637cbSDimitry Andric result_type b() const; 1295*700637cbSDimitry Andric 1296*700637cbSDimitry Andric friend bool operator==(const param_type& x, const param_type& y); 1297*700637cbSDimitry Andric friend bool operator!=(const param_type& x, const param_type& y); 1298*700637cbSDimitry Andric }; 1299*700637cbSDimitry Andric 1300*700637cbSDimitry Andric // constructor and reset functions 1301*700637cbSDimitry Andric explicit cauchy_distribution(RealType a = 0.0, RealType b = 1.0); // before C++20 1302*700637cbSDimitry Andric cauchy_distribution() : cauchy_distribution(0.0) {} // C++20 1303*700637cbSDimitry Andric explicit cauchy_distribution(RealType a, RealType b = 1.0); // C++20 1304*700637cbSDimitry Andric explicit cauchy_distribution(const param_type& parm); 1305*700637cbSDimitry Andric void reset(); 1306*700637cbSDimitry Andric 1307*700637cbSDimitry Andric // generating functions 1308*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g); 1309*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g, const param_type& parm); 1310*700637cbSDimitry Andric 1311*700637cbSDimitry Andric // property functions 1312*700637cbSDimitry Andric result_type a() const; 1313*700637cbSDimitry Andric result_type b() const; 1314*700637cbSDimitry Andric 1315*700637cbSDimitry Andric param_type param() const; 1316*700637cbSDimitry Andric void param(const param_type& parm); 1317*700637cbSDimitry Andric 1318*700637cbSDimitry Andric result_type min() const; 1319*700637cbSDimitry Andric result_type max() const; 1320*700637cbSDimitry Andric 1321*700637cbSDimitry Andric friend bool operator==(const cauchy_distribution& x, 1322*700637cbSDimitry Andric const cauchy_distribution& y); 1323*700637cbSDimitry Andric friend bool operator!=(const cauchy_distribution& x, 1324*700637cbSDimitry Andric const cauchy_distribution& y); 1325*700637cbSDimitry Andric 1326*700637cbSDimitry Andric template <class charT, class traits> 1327*700637cbSDimitry Andric friend 1328*700637cbSDimitry Andric basic_ostream<charT, traits>& 1329*700637cbSDimitry Andric operator<<(basic_ostream<charT, traits>& os, 1330*700637cbSDimitry Andric const cauchy_distribution& x); 1331*700637cbSDimitry Andric 1332*700637cbSDimitry Andric template <class charT, class traits> 1333*700637cbSDimitry Andric friend 1334*700637cbSDimitry Andric basic_istream<charT, traits>& 1335*700637cbSDimitry Andric operator>>(basic_istream<charT, traits>& is, 1336*700637cbSDimitry Andric cauchy_distribution& x); 1337*700637cbSDimitry Andric}; 1338*700637cbSDimitry Andric 1339*700637cbSDimitry Andrictemplate<class RealType = double> 1340*700637cbSDimitry Andricclass fisher_f_distribution 1341*700637cbSDimitry Andric{ 1342*700637cbSDimitry Andricpublic: 1343*700637cbSDimitry Andric // types 1344*700637cbSDimitry Andric typedef RealType result_type; 1345*700637cbSDimitry Andric 1346*700637cbSDimitry Andric class param_type 1347*700637cbSDimitry Andric { 1348*700637cbSDimitry Andric public: 1349*700637cbSDimitry Andric typedef fisher_f_distribution distribution_type; 1350*700637cbSDimitry Andric 1351*700637cbSDimitry Andric explicit param_type(result_type m = 1, result_type n = 1); 1352*700637cbSDimitry Andric 1353*700637cbSDimitry Andric result_type m() const; 1354*700637cbSDimitry Andric result_type n() const; 1355*700637cbSDimitry Andric 1356*700637cbSDimitry Andric friend bool operator==(const param_type& x, const param_type& y); 1357*700637cbSDimitry Andric friend bool operator!=(const param_type& x, const param_type& y); 1358*700637cbSDimitry Andric }; 1359*700637cbSDimitry Andric 1360*700637cbSDimitry Andric // constructor and reset functions 1361*700637cbSDimitry Andric explicit fisher_f_distribution(RealType m = 1.0, RealType n = 1.0); // before C++20 1362*700637cbSDimitry Andric fisher_f_distribution() : fisher_f_distribution(1.0) {} // C++20 1363*700637cbSDimitry Andric explicit fisher_f_distribution(RealType m, RealType n = 1.0); // C++20 1364*700637cbSDimitry Andric explicit fisher_f_distribution(const param_type& parm); 1365*700637cbSDimitry Andric void reset(); 1366*700637cbSDimitry Andric 1367*700637cbSDimitry Andric // generating functions 1368*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g); 1369*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g, const param_type& parm); 1370*700637cbSDimitry Andric 1371*700637cbSDimitry Andric // property functions 1372*700637cbSDimitry Andric result_type m() const; 1373*700637cbSDimitry Andric result_type n() const; 1374*700637cbSDimitry Andric 1375*700637cbSDimitry Andric param_type param() const; 1376*700637cbSDimitry Andric void param(const param_type& parm); 1377*700637cbSDimitry Andric 1378*700637cbSDimitry Andric result_type min() const; 1379*700637cbSDimitry Andric result_type max() const; 1380*700637cbSDimitry Andric 1381*700637cbSDimitry Andric friend bool operator==(const fisher_f_distribution& x, 1382*700637cbSDimitry Andric const fisher_f_distribution& y); 1383*700637cbSDimitry Andric friend bool operator!=(const fisher_f_distribution& x, 1384*700637cbSDimitry Andric const fisher_f_distribution& y); 1385*700637cbSDimitry Andric 1386*700637cbSDimitry Andric template <class charT, class traits> 1387*700637cbSDimitry Andric friend 1388*700637cbSDimitry Andric basic_ostream<charT, traits>& 1389*700637cbSDimitry Andric operator<<(basic_ostream<charT, traits>& os, 1390*700637cbSDimitry Andric const fisher_f_distribution& x); 1391*700637cbSDimitry Andric 1392*700637cbSDimitry Andric template <class charT, class traits> 1393*700637cbSDimitry Andric friend 1394*700637cbSDimitry Andric basic_istream<charT, traits>& 1395*700637cbSDimitry Andric operator>>(basic_istream<charT, traits>& is, 1396*700637cbSDimitry Andric fisher_f_distribution& x); 1397*700637cbSDimitry Andric}; 1398*700637cbSDimitry Andric 1399*700637cbSDimitry Andrictemplate<class RealType = double> 1400*700637cbSDimitry Andricclass student_t_distribution 1401*700637cbSDimitry Andric{ 1402*700637cbSDimitry Andricpublic: 1403*700637cbSDimitry Andric // types 1404*700637cbSDimitry Andric typedef RealType result_type; 1405*700637cbSDimitry Andric 1406*700637cbSDimitry Andric class param_type 1407*700637cbSDimitry Andric { 1408*700637cbSDimitry Andric public: 1409*700637cbSDimitry Andric typedef student_t_distribution distribution_type; 1410*700637cbSDimitry Andric 1411*700637cbSDimitry Andric explicit param_type(result_type n = 1); 1412*700637cbSDimitry Andric 1413*700637cbSDimitry Andric result_type n() const; 1414*700637cbSDimitry Andric 1415*700637cbSDimitry Andric friend bool operator==(const param_type& x, const param_type& y); 1416*700637cbSDimitry Andric friend bool operator!=(const param_type& x, const param_type& y); 1417*700637cbSDimitry Andric }; 1418*700637cbSDimitry Andric 1419*700637cbSDimitry Andric // constructor and reset functions 1420*700637cbSDimitry Andric explicit student_t_distribution(RealType n = 1.0); // before C++20 1421*700637cbSDimitry Andric student_t_distribution() : student_t_distribution(1.0) {} // C++20 1422*700637cbSDimitry Andric explicit student_t_distribution(RealType n); // C++20 1423*700637cbSDimitry Andric explicit student_t_distribution(const param_type& parm); 1424*700637cbSDimitry Andric void reset(); 1425*700637cbSDimitry Andric 1426*700637cbSDimitry Andric // generating functions 1427*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g); 1428*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g, const param_type& parm); 1429*700637cbSDimitry Andric 1430*700637cbSDimitry Andric // property functions 1431*700637cbSDimitry Andric result_type n() const; 1432*700637cbSDimitry Andric 1433*700637cbSDimitry Andric param_type param() const; 1434*700637cbSDimitry Andric void param(const param_type& parm); 1435*700637cbSDimitry Andric 1436*700637cbSDimitry Andric result_type min() const; 1437*700637cbSDimitry Andric result_type max() const; 1438*700637cbSDimitry Andric 1439*700637cbSDimitry Andric friend bool operator==(const student_t_distribution& x, 1440*700637cbSDimitry Andric const student_t_distribution& y); 1441*700637cbSDimitry Andric friend bool operator!=(const student_t_distribution& x, 1442*700637cbSDimitry Andric const student_t_distribution& y); 1443*700637cbSDimitry Andric 1444*700637cbSDimitry Andric template <class charT, class traits> 1445*700637cbSDimitry Andric friend 1446*700637cbSDimitry Andric basic_ostream<charT, traits>& 1447*700637cbSDimitry Andric operator<<(basic_ostream<charT, traits>& os, 1448*700637cbSDimitry Andric const student_t_distribution& x); 1449*700637cbSDimitry Andric 1450*700637cbSDimitry Andric template <class charT, class traits> 1451*700637cbSDimitry Andric friend 1452*700637cbSDimitry Andric basic_istream<charT, traits>& 1453*700637cbSDimitry Andric operator>>(basic_istream<charT, traits>& is, 1454*700637cbSDimitry Andric student_t_distribution& x); 1455*700637cbSDimitry Andric}; 1456*700637cbSDimitry Andric 1457*700637cbSDimitry Andrictemplate<class IntType = int> 1458*700637cbSDimitry Andricclass discrete_distribution 1459*700637cbSDimitry Andric{ 1460*700637cbSDimitry Andricpublic: 1461*700637cbSDimitry Andric // types 1462*700637cbSDimitry Andric typedef IntType result_type; 1463*700637cbSDimitry Andric 1464*700637cbSDimitry Andric class param_type 1465*700637cbSDimitry Andric { 1466*700637cbSDimitry Andric public: 1467*700637cbSDimitry Andric typedef discrete_distribution distribution_type; 1468*700637cbSDimitry Andric 1469*700637cbSDimitry Andric param_type(); 1470*700637cbSDimitry Andric template<class InputIterator> 1471*700637cbSDimitry Andric param_type(InputIterator firstW, InputIterator lastW); 1472*700637cbSDimitry Andric param_type(initializer_list<double> wl); 1473*700637cbSDimitry Andric template<class UnaryOperation> 1474*700637cbSDimitry Andric param_type(size_t nw, double xmin, double xmax, UnaryOperation fw); 1475*700637cbSDimitry Andric 1476*700637cbSDimitry Andric vector<double> probabilities() const; 1477*700637cbSDimitry Andric 1478*700637cbSDimitry Andric friend bool operator==(const param_type& x, const param_type& y); 1479*700637cbSDimitry Andric friend bool operator!=(const param_type& x, const param_type& y); 1480*700637cbSDimitry Andric }; 1481*700637cbSDimitry Andric 1482*700637cbSDimitry Andric // constructor and reset functions 1483*700637cbSDimitry Andric discrete_distribution(); 1484*700637cbSDimitry Andric template<class InputIterator> 1485*700637cbSDimitry Andric discrete_distribution(InputIterator firstW, InputIterator lastW); 1486*700637cbSDimitry Andric discrete_distribution(initializer_list<double> wl); 1487*700637cbSDimitry Andric template<class UnaryOperation> 1488*700637cbSDimitry Andric discrete_distribution(size_t nw, double xmin, double xmax, 1489*700637cbSDimitry Andric UnaryOperation fw); 1490*700637cbSDimitry Andric explicit discrete_distribution(const param_type& parm); 1491*700637cbSDimitry Andric void reset(); 1492*700637cbSDimitry Andric 1493*700637cbSDimitry Andric // generating functions 1494*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g); 1495*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g, const param_type& parm); 1496*700637cbSDimitry Andric 1497*700637cbSDimitry Andric // property functions 1498*700637cbSDimitry Andric vector<double> probabilities() const; 1499*700637cbSDimitry Andric 1500*700637cbSDimitry Andric param_type param() const; 1501*700637cbSDimitry Andric void param(const param_type& parm); 1502*700637cbSDimitry Andric 1503*700637cbSDimitry Andric result_type min() const; 1504*700637cbSDimitry Andric result_type max() const; 1505*700637cbSDimitry Andric 1506*700637cbSDimitry Andric friend bool operator==(const discrete_distribution& x, 1507*700637cbSDimitry Andric const discrete_distribution& y); 1508*700637cbSDimitry Andric friend bool operator!=(const discrete_distribution& x, 1509*700637cbSDimitry Andric const discrete_distribution& y); 1510*700637cbSDimitry Andric 1511*700637cbSDimitry Andric template <class charT, class traits> 1512*700637cbSDimitry Andric friend 1513*700637cbSDimitry Andric basic_ostream<charT, traits>& 1514*700637cbSDimitry Andric operator<<(basic_ostream<charT, traits>& os, 1515*700637cbSDimitry Andric const discrete_distribution& x); 1516*700637cbSDimitry Andric 1517*700637cbSDimitry Andric template <class charT, class traits> 1518*700637cbSDimitry Andric friend 1519*700637cbSDimitry Andric basic_istream<charT, traits>& 1520*700637cbSDimitry Andric operator>>(basic_istream<charT, traits>& is, 1521*700637cbSDimitry Andric discrete_distribution& x); 1522*700637cbSDimitry Andric}; 1523*700637cbSDimitry Andric 1524*700637cbSDimitry Andrictemplate<class RealType = double> 1525*700637cbSDimitry Andricclass piecewise_constant_distribution 1526*700637cbSDimitry Andric{ 1527*700637cbSDimitry Andric // types 1528*700637cbSDimitry Andric typedef RealType result_type; 1529*700637cbSDimitry Andric 1530*700637cbSDimitry Andric class param_type 1531*700637cbSDimitry Andric { 1532*700637cbSDimitry Andric public: 1533*700637cbSDimitry Andric typedef piecewise_constant_distribution distribution_type; 1534*700637cbSDimitry Andric 1535*700637cbSDimitry Andric param_type(); 1536*700637cbSDimitry Andric template<class InputIteratorB, class InputIteratorW> 1537*700637cbSDimitry Andric param_type(InputIteratorB firstB, InputIteratorB lastB, 1538*700637cbSDimitry Andric InputIteratorW firstW); 1539*700637cbSDimitry Andric template<class UnaryOperation> 1540*700637cbSDimitry Andric param_type(initializer_list<result_type> bl, UnaryOperation fw); 1541*700637cbSDimitry Andric template<class UnaryOperation> 1542*700637cbSDimitry Andric param_type(size_t nw, result_type xmin, result_type xmax, 1543*700637cbSDimitry Andric UnaryOperation fw); 1544*700637cbSDimitry Andric 1545*700637cbSDimitry Andric vector<result_type> intervals() const; 1546*700637cbSDimitry Andric vector<result_type> densities() const; 1547*700637cbSDimitry Andric 1548*700637cbSDimitry Andric friend bool operator==(const param_type& x, const param_type& y); 1549*700637cbSDimitry Andric friend bool operator!=(const param_type& x, const param_type& y); 1550*700637cbSDimitry Andric }; 1551*700637cbSDimitry Andric 1552*700637cbSDimitry Andric // constructor and reset functions 1553*700637cbSDimitry Andric piecewise_constant_distribution(); 1554*700637cbSDimitry Andric template<class InputIteratorB, class InputIteratorW> 1555*700637cbSDimitry Andric piecewise_constant_distribution(InputIteratorB firstB, 1556*700637cbSDimitry Andric InputIteratorB lastB, 1557*700637cbSDimitry Andric InputIteratorW firstW); 1558*700637cbSDimitry Andric template<class UnaryOperation> 1559*700637cbSDimitry Andric piecewise_constant_distribution(initializer_list<result_type> bl, 1560*700637cbSDimitry Andric UnaryOperation fw); 1561*700637cbSDimitry Andric template<class UnaryOperation> 1562*700637cbSDimitry Andric piecewise_constant_distribution(size_t nw, result_type xmin, 1563*700637cbSDimitry Andric result_type xmax, UnaryOperation fw); 1564*700637cbSDimitry Andric explicit piecewise_constant_distribution(const param_type& parm); 1565*700637cbSDimitry Andric void reset(); 1566*700637cbSDimitry Andric 1567*700637cbSDimitry Andric // generating functions 1568*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g); 1569*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g, const param_type& parm); 1570*700637cbSDimitry Andric 1571*700637cbSDimitry Andric // property functions 1572*700637cbSDimitry Andric vector<result_type> intervals() const; 1573*700637cbSDimitry Andric vector<result_type> densities() const; 1574*700637cbSDimitry Andric 1575*700637cbSDimitry Andric param_type param() const; 1576*700637cbSDimitry Andric void param(const param_type& parm); 1577*700637cbSDimitry Andric 1578*700637cbSDimitry Andric result_type min() const; 1579*700637cbSDimitry Andric result_type max() const; 1580*700637cbSDimitry Andric 1581*700637cbSDimitry Andric friend bool operator==(const piecewise_constant_distribution& x, 1582*700637cbSDimitry Andric const piecewise_constant_distribution& y); 1583*700637cbSDimitry Andric friend bool operator!=(const piecewise_constant_distribution& x, 1584*700637cbSDimitry Andric const piecewise_constant_distribution& y); 1585*700637cbSDimitry Andric 1586*700637cbSDimitry Andric template <class charT, class traits> 1587*700637cbSDimitry Andric friend 1588*700637cbSDimitry Andric basic_ostream<charT, traits>& 1589*700637cbSDimitry Andric operator<<(basic_ostream<charT, traits>& os, 1590*700637cbSDimitry Andric const piecewise_constant_distribution& x); 1591*700637cbSDimitry Andric 1592*700637cbSDimitry Andric template <class charT, class traits> 1593*700637cbSDimitry Andric friend 1594*700637cbSDimitry Andric basic_istream<charT, traits>& 1595*700637cbSDimitry Andric operator>>(basic_istream<charT, traits>& is, 1596*700637cbSDimitry Andric piecewise_constant_distribution& x); 1597*700637cbSDimitry Andric}; 1598*700637cbSDimitry Andric 1599*700637cbSDimitry Andrictemplate<class RealType = double> 1600*700637cbSDimitry Andricclass piecewise_linear_distribution 1601*700637cbSDimitry Andric{ 1602*700637cbSDimitry Andric // types 1603*700637cbSDimitry Andric typedef RealType result_type; 1604*700637cbSDimitry Andric 1605*700637cbSDimitry Andric class param_type 1606*700637cbSDimitry Andric { 1607*700637cbSDimitry Andric public: 1608*700637cbSDimitry Andric typedef piecewise_linear_distribution distribution_type; 1609*700637cbSDimitry Andric 1610*700637cbSDimitry Andric param_type(); 1611*700637cbSDimitry Andric template<class InputIteratorB, class InputIteratorW> 1612*700637cbSDimitry Andric param_type(InputIteratorB firstB, InputIteratorB lastB, 1613*700637cbSDimitry Andric InputIteratorW firstW); 1614*700637cbSDimitry Andric template<class UnaryOperation> 1615*700637cbSDimitry Andric param_type(initializer_list<result_type> bl, UnaryOperation fw); 1616*700637cbSDimitry Andric template<class UnaryOperation> 1617*700637cbSDimitry Andric param_type(size_t nw, result_type xmin, result_type xmax, 1618*700637cbSDimitry Andric UnaryOperation fw); 1619*700637cbSDimitry Andric 1620*700637cbSDimitry Andric vector<result_type> intervals() const; 1621*700637cbSDimitry Andric vector<result_type> densities() const; 1622*700637cbSDimitry Andric 1623*700637cbSDimitry Andric friend bool operator==(const param_type& x, const param_type& y); 1624*700637cbSDimitry Andric friend bool operator!=(const param_type& x, const param_type& y); 1625*700637cbSDimitry Andric }; 1626*700637cbSDimitry Andric 1627*700637cbSDimitry Andric // constructor and reset functions 1628*700637cbSDimitry Andric piecewise_linear_distribution(); 1629*700637cbSDimitry Andric template<class InputIteratorB, class InputIteratorW> 1630*700637cbSDimitry Andric piecewise_linear_distribution(InputIteratorB firstB, 1631*700637cbSDimitry Andric InputIteratorB lastB, 1632*700637cbSDimitry Andric InputIteratorW firstW); 1633*700637cbSDimitry Andric 1634*700637cbSDimitry Andric template<class UnaryOperation> 1635*700637cbSDimitry Andric piecewise_linear_distribution(initializer_list<result_type> bl, 1636*700637cbSDimitry Andric UnaryOperation fw); 1637*700637cbSDimitry Andric 1638*700637cbSDimitry Andric template<class UnaryOperation> 1639*700637cbSDimitry Andric piecewise_linear_distribution(size_t nw, result_type xmin, 1640*700637cbSDimitry Andric result_type xmax, UnaryOperation fw); 1641*700637cbSDimitry Andric 1642*700637cbSDimitry Andric explicit piecewise_linear_distribution(const param_type& parm); 1643*700637cbSDimitry Andric void reset(); 1644*700637cbSDimitry Andric 1645*700637cbSDimitry Andric // generating functions 1646*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g); 1647*700637cbSDimitry Andric template<class URNG> result_type operator()(URNG& g, const param_type& parm); 1648*700637cbSDimitry Andric 1649*700637cbSDimitry Andric // property functions 1650*700637cbSDimitry Andric vector<result_type> intervals() const; 1651*700637cbSDimitry Andric vector<result_type> densities() const; 1652*700637cbSDimitry Andric 1653*700637cbSDimitry Andric param_type param() const; 1654*700637cbSDimitry Andric void param(const param_type& parm); 1655*700637cbSDimitry Andric 1656*700637cbSDimitry Andric result_type min() const; 1657*700637cbSDimitry Andric result_type max() const; 1658*700637cbSDimitry Andric 1659*700637cbSDimitry Andric friend bool operator==(const piecewise_linear_distribution& x, 1660*700637cbSDimitry Andric const piecewise_linear_distribution& y); 1661*700637cbSDimitry Andric friend bool operator!=(const piecewise_linear_distribution& x, 1662*700637cbSDimitry Andric const piecewise_linear_distribution& y); 1663*700637cbSDimitry Andric 1664*700637cbSDimitry Andric template <class charT, class traits> 1665*700637cbSDimitry Andric friend 1666*700637cbSDimitry Andric basic_ostream<charT, traits>& 1667*700637cbSDimitry Andric operator<<(basic_ostream<charT, traits>& os, 1668*700637cbSDimitry Andric const piecewise_linear_distribution& x); 1669*700637cbSDimitry Andric 1670*700637cbSDimitry Andric template <class charT, class traits> 1671*700637cbSDimitry Andric friend 1672*700637cbSDimitry Andric basic_istream<charT, traits>& 1673*700637cbSDimitry Andric operator>>(basic_istream<charT, traits>& is, 1674*700637cbSDimitry Andric piecewise_linear_distribution& x); 1675*700637cbSDimitry Andric}; 1676*700637cbSDimitry Andric 1677*700637cbSDimitry Andric} // std 1678*700637cbSDimitry Andric*/ 1679*700637cbSDimitry Andric 1680*700637cbSDimitry Andric#include <__cxx03/__config> 1681*700637cbSDimitry Andric#include <__cxx03/__random/bernoulli_distribution.h> 1682*700637cbSDimitry Andric#include <__cxx03/__random/binomial_distribution.h> 1683*700637cbSDimitry Andric#include <__cxx03/__random/cauchy_distribution.h> 1684*700637cbSDimitry Andric#include <__cxx03/__random/chi_squared_distribution.h> 1685*700637cbSDimitry Andric#include <__cxx03/__random/default_random_engine.h> 1686*700637cbSDimitry Andric#include <__cxx03/__random/discard_block_engine.h> 1687*700637cbSDimitry Andric#include <__cxx03/__random/discrete_distribution.h> 1688*700637cbSDimitry Andric#include <__cxx03/__random/exponential_distribution.h> 1689*700637cbSDimitry Andric#include <__cxx03/__random/extreme_value_distribution.h> 1690*700637cbSDimitry Andric#include <__cxx03/__random/fisher_f_distribution.h> 1691*700637cbSDimitry Andric#include <__cxx03/__random/gamma_distribution.h> 1692*700637cbSDimitry Andric#include <__cxx03/__random/generate_canonical.h> 1693*700637cbSDimitry Andric#include <__cxx03/__random/geometric_distribution.h> 1694*700637cbSDimitry Andric#include <__cxx03/__random/independent_bits_engine.h> 1695*700637cbSDimitry Andric#include <__cxx03/__random/is_seed_sequence.h> 1696*700637cbSDimitry Andric#include <__cxx03/__random/knuth_b.h> 1697*700637cbSDimitry Andric#include <__cxx03/__random/linear_congruential_engine.h> 1698*700637cbSDimitry Andric#include <__cxx03/__random/lognormal_distribution.h> 1699*700637cbSDimitry Andric#include <__cxx03/__random/mersenne_twister_engine.h> 1700*700637cbSDimitry Andric#include <__cxx03/__random/negative_binomial_distribution.h> 1701*700637cbSDimitry Andric#include <__cxx03/__random/normal_distribution.h> 1702*700637cbSDimitry Andric#include <__cxx03/__random/piecewise_constant_distribution.h> 1703*700637cbSDimitry Andric#include <__cxx03/__random/piecewise_linear_distribution.h> 1704*700637cbSDimitry Andric#include <__cxx03/__random/poisson_distribution.h> 1705*700637cbSDimitry Andric#include <__cxx03/__random/random_device.h> 1706*700637cbSDimitry Andric#include <__cxx03/__random/ranlux.h> 1707*700637cbSDimitry Andric#include <__cxx03/__random/seed_seq.h> 1708*700637cbSDimitry Andric#include <__cxx03/__random/shuffle_order_engine.h> 1709*700637cbSDimitry Andric#include <__cxx03/__random/student_t_distribution.h> 1710*700637cbSDimitry Andric#include <__cxx03/__random/subtract_with_carry_engine.h> 1711*700637cbSDimitry Andric#include <__cxx03/__random/uniform_int_distribution.h> 1712*700637cbSDimitry Andric#include <__cxx03/__random/uniform_real_distribution.h> 1713*700637cbSDimitry Andric#include <__cxx03/__random/weibull_distribution.h> 1714*700637cbSDimitry Andric#include <__cxx03/version> 1715*700637cbSDimitry Andric 1716*700637cbSDimitry Andric#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 1717*700637cbSDimitry Andric# pragma GCC system_header 1718*700637cbSDimitry Andric#endif 1719*700637cbSDimitry Andric 1720*700637cbSDimitry Andric#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) 1721*700637cbSDimitry Andric# include <__cxx03/algorithm> 1722*700637cbSDimitry Andric# include <__cxx03/climits> 1723*700637cbSDimitry Andric# include <__cxx03/cmath> 1724*700637cbSDimitry Andric# include <__cxx03/cstddef> 1725*700637cbSDimitry Andric# include <__cxx03/cstdint> 1726*700637cbSDimitry Andric# include <__cxx03/cstdlib> 1727*700637cbSDimitry Andric# include <__cxx03/iosfwd> 1728*700637cbSDimitry Andric# include <__cxx03/limits> 1729*700637cbSDimitry Andric# include <__cxx03/numeric> 1730*700637cbSDimitry Andric# include <__cxx03/string> 1731*700637cbSDimitry Andric# include <__cxx03/type_traits> 1732*700637cbSDimitry Andric# include <__cxx03/vector> 1733*700637cbSDimitry Andric#endif 1734*700637cbSDimitry Andric 1735*700637cbSDimitry Andric#endif // _LIBCPP___CXX03_RANDOM 1736