xref: /openbsd-src/gnu/llvm/libcxx/include/random (revision 4bdff4bed0e3d54e55670334c7d0077db4170f86)
146035553Spatrick// -*- C++ -*-
2*4bdff4beSrobert//===----------------------------------------------------------------------===//
346035553Spatrick//
446035553Spatrick// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
546035553Spatrick// See https://llvm.org/LICENSE.txt for license information.
646035553Spatrick// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
746035553Spatrick//
846035553Spatrick//===----------------------------------------------------------------------===//
946035553Spatrick
1046035553Spatrick#ifndef _LIBCPP_RANDOM
1146035553Spatrick#define _LIBCPP_RANDOM
1246035553Spatrick
1346035553Spatrick/*
1446035553Spatrick    random synopsis
1546035553Spatrick
1646035553Spatrick#include <initializer_list>
1746035553Spatrick
1846035553Spatricknamespace std
1946035553Spatrick{
2076d0caaeSpatrick// [rand.req.urng], uniform random bit generator requirements
2176d0caaeSpatricktemplate<class G>
2276d0caaeSpatrickconcept uniform_random_bit_generator = see below; // C++20
2346035553Spatrick
2446035553Spatrick// Engines
2546035553Spatrick
2646035553Spatricktemplate <class UIntType, UIntType a, UIntType c, UIntType m>
2746035553Spatrickclass linear_congruential_engine
2846035553Spatrick{
2946035553Spatrickpublic:
3046035553Spatrick    // types
3146035553Spatrick    typedef UIntType result_type;
3246035553Spatrick
3346035553Spatrick    // engine characteristics
3446035553Spatrick    static constexpr result_type multiplier = a;
3546035553Spatrick    static constexpr result_type increment = c;
3646035553Spatrick    static constexpr result_type modulus = m;
3746035553Spatrick    static constexpr result_type min() { return c == 0u ? 1u: 0u;}
3846035553Spatrick    static constexpr result_type max() { return m - 1u;}
3946035553Spatrick    static constexpr result_type default_seed = 1u;
4046035553Spatrick
4146035553Spatrick    // constructors and seeding functions
4276d0caaeSpatrick    explicit linear_congruential_engine(result_type s = default_seed);         // before C++20
4376d0caaeSpatrick    linear_congruential_engine() : linear_congruential_engine(default_seed) {} // C++20
4476d0caaeSpatrick    explicit linear_congruential_engine(result_type s);                        // C++20
4546035553Spatrick    template<class Sseq> explicit linear_congruential_engine(Sseq& q);
4646035553Spatrick    void seed(result_type s = default_seed);
4746035553Spatrick    template<class Sseq> void seed(Sseq& q);
4846035553Spatrick
4946035553Spatrick    // generating functions
5046035553Spatrick    result_type operator()();
5146035553Spatrick    void discard(unsigned long long z);
5246035553Spatrick};
5346035553Spatrick
5446035553Spatricktemplate <class UIntType, UIntType a, UIntType c, UIntType m>
5546035553Spatrickbool
5646035553Spatrickoperator==(const linear_congruential_engine<UIntType, a, c, m>& x,
5746035553Spatrick           const linear_congruential_engine<UIntType, a, c, m>& y);
5846035553Spatrick
5946035553Spatricktemplate <class UIntType, UIntType a, UIntType c, UIntType m>
6046035553Spatrickbool
6146035553Spatrickoperator!=(const linear_congruential_engine<UIntType, a, c, m>& x,
6246035553Spatrick           const linear_congruential_engine<UIntType, a, c, m>& y);
6346035553Spatrick
6446035553Spatricktemplate <class charT, class traits,
6546035553Spatrick          class UIntType, UIntType a, UIntType c, UIntType m>
6646035553Spatrickbasic_ostream<charT, traits>&
6746035553Spatrickoperator<<(basic_ostream<charT, traits>& os,
6846035553Spatrick           const linear_congruential_engine<UIntType, a, c, m>& x);
6946035553Spatrick
7046035553Spatricktemplate <class charT, class traits,
7146035553Spatrick          class UIntType, UIntType a, UIntType c, UIntType m>
7246035553Spatrickbasic_istream<charT, traits>&
7346035553Spatrickoperator>>(basic_istream<charT, traits>& is,
7446035553Spatrick           linear_congruential_engine<UIntType, a, c, m>& x);
7546035553Spatrick
7646035553Spatricktemplate <class UIntType, size_t w, size_t n, size_t m, size_t r,
7746035553Spatrick          UIntType a, size_t u, UIntType d, size_t s,
7846035553Spatrick          UIntType b, size_t t, UIntType c, size_t l, UIntType f>
7946035553Spatrickclass mersenne_twister_engine
8046035553Spatrick{
8146035553Spatrickpublic:
8246035553Spatrick    // types
8346035553Spatrick    typedef UIntType result_type;
8446035553Spatrick
8546035553Spatrick    // engine characteristics
8646035553Spatrick    static constexpr size_t word_size = w;
8746035553Spatrick    static constexpr size_t state_size = n;
8846035553Spatrick    static constexpr size_t shift_size = m;
8946035553Spatrick    static constexpr size_t mask_bits = r;
9046035553Spatrick    static constexpr result_type xor_mask = a;
9146035553Spatrick    static constexpr size_t tempering_u = u;
9246035553Spatrick    static constexpr result_type tempering_d = d;
9346035553Spatrick    static constexpr size_t tempering_s = s;
9446035553Spatrick    static constexpr result_type tempering_b = b;
9546035553Spatrick    static constexpr size_t tempering_t = t;
9646035553Spatrick    static constexpr result_type tempering_c = c;
9746035553Spatrick    static constexpr size_t tempering_l = l;
9846035553Spatrick    static constexpr result_type initialization_multiplier = f;
9946035553Spatrick    static constexpr result_type min () { return 0; }
10046035553Spatrick    static constexpr result_type max() { return 2^w - 1; }
10146035553Spatrick    static constexpr result_type default_seed = 5489u;
10246035553Spatrick
10346035553Spatrick    // constructors and seeding functions
10476d0caaeSpatrick    explicit mersenne_twister_engine(result_type s = default_seed);      // before C++20
10576d0caaeSpatrick    mersenne_twister_engine() : mersenne_twister_engine(default_seed) {} // C++20
10676d0caaeSpatrick    explicit mersenne_twister_engine(result_type s);                     // C++20
10746035553Spatrick    template<class Sseq> explicit mersenne_twister_engine(Sseq& q);
10846035553Spatrick    void seed(result_type value = default_seed);
10946035553Spatrick    template<class Sseq> void seed(Sseq& q);
11046035553Spatrick
11146035553Spatrick    // generating functions
11246035553Spatrick    result_type operator()();
11346035553Spatrick    void discard(unsigned long long z);
11446035553Spatrick};
11546035553Spatrick
11646035553Spatricktemplate <class UIntType, size_t w, size_t n, size_t m, size_t r,
11746035553Spatrick          UIntType a, size_t u, UIntType d, size_t s,
11846035553Spatrick          UIntType b, size_t t, UIntType c, size_t l, UIntType f>
11946035553Spatrickbool
12046035553Spatrickoperator==(
12146035553Spatrick    const mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>& x,
12246035553Spatrick    const mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>& y);
12346035553Spatrick
12446035553Spatricktemplate <class UIntType, size_t w, size_t n, size_t m, size_t r,
12546035553Spatrick          UIntType a, size_t u, UIntType d, size_t s,
12646035553Spatrick          UIntType b, size_t t, UIntType c, size_t l, UIntType f>
12746035553Spatrickbool
12846035553Spatrickoperator!=(
12946035553Spatrick    const mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>& x,
13046035553Spatrick    const mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>& y);
13146035553Spatrick
13246035553Spatricktemplate <class charT, class traits,
13346035553Spatrick          class UIntType, size_t w, size_t n, size_t m, size_t r,
13446035553Spatrick          UIntType a, size_t u, UIntType d, size_t s,
13546035553Spatrick          UIntType b, size_t t, UIntType c, size_t l, UIntType f>
13646035553Spatrickbasic_ostream<charT, traits>&
13746035553Spatrickoperator<<(basic_ostream<charT, traits>& os,
13846035553Spatrick           const mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>& x);
13946035553Spatrick
14046035553Spatricktemplate <class charT, class traits,
14146035553Spatrick          class UIntType, size_t w, size_t n, size_t m, size_t r,
14246035553Spatrick          UIntType a, size_t u, UIntType d, size_t s,
14346035553Spatrick          UIntType b, size_t t, UIntType c, size_t l, UIntType f>
14446035553Spatrickbasic_istream<charT, traits>&
14546035553Spatrickoperator>>(basic_istream<charT, traits>& is,
14646035553Spatrick           mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>& x);
14746035553Spatrick
14846035553Spatricktemplate<class UIntType, size_t w, size_t s, size_t r>
14946035553Spatrickclass subtract_with_carry_engine
15046035553Spatrick{
15146035553Spatrickpublic:
15246035553Spatrick    // types
15346035553Spatrick    typedef UIntType result_type;
15446035553Spatrick
15546035553Spatrick    // engine characteristics
15646035553Spatrick    static constexpr size_t word_size = w;
15746035553Spatrick    static constexpr size_t short_lag = s;
15846035553Spatrick    static constexpr size_t long_lag = r;
15946035553Spatrick    static constexpr result_type min() { return 0; }
16046035553Spatrick    static constexpr result_type max() { return m-1; }
16146035553Spatrick    static constexpr result_type default_seed = 19780503u;
16246035553Spatrick
16346035553Spatrick    // constructors and seeding functions
16476d0caaeSpatrick    explicit subtract_with_carry_engine(result_type value = default_seed);     // before C++20
16576d0caaeSpatrick    subtract_with_carry_engine() : subtract_with_carry_engine(default_seed) {} // C++20
16676d0caaeSpatrick    explicit subtract_with_carry_engine(result_type value);                    // C++20
16746035553Spatrick    template<class Sseq> explicit subtract_with_carry_engine(Sseq& q);
16846035553Spatrick    void seed(result_type value = default_seed);
16946035553Spatrick    template<class Sseq> void seed(Sseq& q);
17046035553Spatrick
17146035553Spatrick    // generating functions
17246035553Spatrick    result_type operator()();
17346035553Spatrick    void discard(unsigned long long z);
17446035553Spatrick};
17546035553Spatrick
17646035553Spatricktemplate<class UIntType, size_t w, size_t s, size_t r>
17746035553Spatrickbool
17846035553Spatrickoperator==(
17946035553Spatrick    const subtract_with_carry_engine<UIntType, w, s, r>& x,
18046035553Spatrick    const subtract_with_carry_engine<UIntType, w, s, r>& y);
18146035553Spatrick
18246035553Spatricktemplate<class UIntType, size_t w, size_t s, size_t r>
18346035553Spatrickbool
18446035553Spatrickoperator!=(
18546035553Spatrick    const subtract_with_carry_engine<UIntType, w, s, r>& x,
18646035553Spatrick    const subtract_with_carry_engine<UIntType, w, s, r>& y);
18746035553Spatrick
18846035553Spatricktemplate <class charT, class traits,
18946035553Spatrick          class UIntType, size_t w, size_t s, size_t r>
19046035553Spatrickbasic_ostream<charT, traits>&
19146035553Spatrickoperator<<(basic_ostream<charT, traits>& os,
19246035553Spatrick           const subtract_with_carry_engine<UIntType, w, s, r>& x);
19346035553Spatrick
19446035553Spatricktemplate <class charT, class traits,
19546035553Spatrick          class UIntType, size_t w, size_t s, size_t r>
19646035553Spatrickbasic_istream<charT, traits>&
19746035553Spatrickoperator>>(basic_istream<charT, traits>& is,
19846035553Spatrick           subtract_with_carry_engine<UIntType, w, s, r>& x);
19946035553Spatrick
20046035553Spatricktemplate<class Engine, size_t p, size_t r>
20146035553Spatrickclass discard_block_engine
20246035553Spatrick{
20346035553Spatrickpublic:
20446035553Spatrick    // types
20546035553Spatrick    typedef typename Engine::result_type result_type;
20646035553Spatrick
20746035553Spatrick    // engine characteristics
20846035553Spatrick    static constexpr size_t block_size = p;
20946035553Spatrick    static constexpr size_t used_block = r;
21046035553Spatrick    static constexpr result_type min() { return Engine::min(); }
21146035553Spatrick    static constexpr result_type max() { return Engine::max(); }
21246035553Spatrick
21346035553Spatrick    // constructors and seeding functions
21446035553Spatrick    discard_block_engine();
21546035553Spatrick    explicit discard_block_engine(const Engine& e);
21646035553Spatrick    explicit discard_block_engine(Engine&& e);
21746035553Spatrick    explicit discard_block_engine(result_type s);
21846035553Spatrick    template<class Sseq> explicit discard_block_engine(Sseq& q);
21946035553Spatrick    void seed();
22046035553Spatrick    void seed(result_type s);
22146035553Spatrick    template<class Sseq> void seed(Sseq& q);
22246035553Spatrick
22346035553Spatrick    // generating functions
22446035553Spatrick    result_type operator()();
22546035553Spatrick    void discard(unsigned long long z);
22646035553Spatrick
22746035553Spatrick    // property functions
22846035553Spatrick    const Engine& base() const noexcept;
22946035553Spatrick};
23046035553Spatrick
23146035553Spatricktemplate<class Engine, size_t p, size_t r>
23246035553Spatrickbool
23346035553Spatrickoperator==(
23446035553Spatrick    const discard_block_engine<Engine, p, r>& x,
23546035553Spatrick    const discard_block_engine<Engine, p, r>& y);
23646035553Spatrick
23746035553Spatricktemplate<class Engine, size_t p, size_t r>
23846035553Spatrickbool
23946035553Spatrickoperator!=(
24046035553Spatrick    const discard_block_engine<Engine, p, r>& x,
24146035553Spatrick    const discard_block_engine<Engine, p, r>& y);
24246035553Spatrick
24346035553Spatricktemplate <class charT, class traits,
24446035553Spatrick          class Engine, size_t p, size_t r>
24546035553Spatrickbasic_ostream<charT, traits>&
24646035553Spatrickoperator<<(basic_ostream<charT, traits>& os,
24746035553Spatrick           const discard_block_engine<Engine, p, r>& x);
24846035553Spatrick
24946035553Spatricktemplate <class charT, class traits,
25046035553Spatrick          class Engine, size_t p, size_t r>
25146035553Spatrickbasic_istream<charT, traits>&
25246035553Spatrickoperator>>(basic_istream<charT, traits>& is,
25346035553Spatrick           discard_block_engine<Engine, p, r>& x);
25446035553Spatrick
25546035553Spatricktemplate<class Engine, size_t w, class UIntType>
25646035553Spatrickclass independent_bits_engine
25746035553Spatrick{
25846035553Spatrickpublic:
25946035553Spatrick    // types
26046035553Spatrick    typedef UIntType result_type;
26146035553Spatrick
26246035553Spatrick    // engine characteristics
26346035553Spatrick    static constexpr result_type min() { return 0; }
26446035553Spatrick    static constexpr result_type max() { return 2^w - 1; }
26546035553Spatrick
26646035553Spatrick    // constructors and seeding functions
26746035553Spatrick    independent_bits_engine();
26846035553Spatrick    explicit independent_bits_engine(const Engine& e);
26946035553Spatrick    explicit independent_bits_engine(Engine&& e);
27046035553Spatrick    explicit independent_bits_engine(result_type s);
27146035553Spatrick    template<class Sseq> explicit independent_bits_engine(Sseq& q);
27246035553Spatrick    void seed();
27346035553Spatrick    void seed(result_type s);
27446035553Spatrick    template<class Sseq> void seed(Sseq& q);
27546035553Spatrick
27646035553Spatrick    // generating functions
27746035553Spatrick    result_type operator()(); void discard(unsigned long long z);
27846035553Spatrick
27946035553Spatrick    // property functions
28046035553Spatrick    const Engine& base() const noexcept;
28146035553Spatrick};
28246035553Spatrick
28346035553Spatricktemplate<class Engine, size_t w, class UIntType>
28446035553Spatrickbool
28546035553Spatrickoperator==(
28646035553Spatrick    const independent_bits_engine<Engine, w, UIntType>& x,
28746035553Spatrick    const independent_bits_engine<Engine, w, UIntType>& y);
28846035553Spatrick
28946035553Spatricktemplate<class Engine, size_t w, class UIntType>
29046035553Spatrickbool
29146035553Spatrickoperator!=(
29246035553Spatrick    const independent_bits_engine<Engine, w, UIntType>& x,
29346035553Spatrick    const independent_bits_engine<Engine, w, UIntType>& y);
29446035553Spatrick
29546035553Spatricktemplate <class charT, class traits,
29646035553Spatrick          class Engine, size_t w, class UIntType>
29746035553Spatrickbasic_ostream<charT, traits>&
29846035553Spatrickoperator<<(basic_ostream<charT, traits>& os,
29946035553Spatrick           const independent_bits_engine<Engine, w, UIntType>& x);
30046035553Spatrick
30146035553Spatricktemplate <class charT, class traits,
30246035553Spatrick          class Engine, size_t w, class UIntType>
30346035553Spatrickbasic_istream<charT, traits>&
30446035553Spatrickoperator>>(basic_istream<charT, traits>& is,
30546035553Spatrick           independent_bits_engine<Engine, w, UIntType>& x);
30646035553Spatrick
30746035553Spatricktemplate<class Engine, size_t k>
30846035553Spatrickclass shuffle_order_engine
30946035553Spatrick{
31046035553Spatrickpublic:
31146035553Spatrick    // types
31246035553Spatrick    typedef typename Engine::result_type result_type;
31346035553Spatrick
31446035553Spatrick    // engine characteristics
31546035553Spatrick    static constexpr size_t table_size = k;
31646035553Spatrick    static constexpr result_type min() { return Engine::min; }
31746035553Spatrick    static constexpr result_type max() { return Engine::max; }
31846035553Spatrick
31946035553Spatrick    // constructors and seeding functions
32046035553Spatrick    shuffle_order_engine();
32146035553Spatrick    explicit shuffle_order_engine(const Engine& e);
32246035553Spatrick    explicit shuffle_order_engine(Engine&& e);
32346035553Spatrick    explicit shuffle_order_engine(result_type s);
32446035553Spatrick    template<class Sseq> explicit shuffle_order_engine(Sseq& q);
32546035553Spatrick    void seed();
32646035553Spatrick    void seed(result_type s);
32746035553Spatrick    template<class Sseq> void seed(Sseq& q);
32846035553Spatrick
32946035553Spatrick    // generating functions
33046035553Spatrick    result_type operator()();
33146035553Spatrick    void discard(unsigned long long z);
33246035553Spatrick
33346035553Spatrick    // property functions
33446035553Spatrick    const Engine& base() const noexcept;
33546035553Spatrick};
33646035553Spatrick
33746035553Spatricktemplate<class Engine, size_t k>
33846035553Spatrickbool
33946035553Spatrickoperator==(
34046035553Spatrick    const shuffle_order_engine<Engine, k>& x,
34146035553Spatrick    const shuffle_order_engine<Engine, k>& y);
34246035553Spatrick
34346035553Spatricktemplate<class Engine, size_t k>
34446035553Spatrickbool
34546035553Spatrickoperator!=(
34646035553Spatrick    const shuffle_order_engine<Engine, k>& x,
34746035553Spatrick    const shuffle_order_engine<Engine, k>& y);
34846035553Spatrick
34946035553Spatricktemplate <class charT, class traits,
35046035553Spatrick          class Engine, size_t k>
35146035553Spatrickbasic_ostream<charT, traits>&
35246035553Spatrickoperator<<(basic_ostream<charT, traits>& os,
35346035553Spatrick           const shuffle_order_engine<Engine, k>& x);
35446035553Spatrick
35546035553Spatricktemplate <class charT, class traits,
35646035553Spatrick          class Engine, size_t k>
35746035553Spatrickbasic_istream<charT, traits>&
35846035553Spatrickoperator>>(basic_istream<charT, traits>& is,
35946035553Spatrick           shuffle_order_engine<Engine, k>& x);
36046035553Spatrick
36146035553Spatricktypedef linear_congruential_engine<uint_fast32_t, 16807, 0, 2147483647>
36246035553Spatrick                                                                   minstd_rand0;
36346035553Spatricktypedef linear_congruential_engine<uint_fast32_t, 48271, 0, 2147483647>
36446035553Spatrick                                                                    minstd_rand;
36546035553Spatricktypedef mersenne_twister_engine<uint_fast32_t, 32, 624, 397, 31,
36646035553Spatrick                                0x9908b0df,
36746035553Spatrick                                11, 0xffffffff,
36846035553Spatrick                                7,  0x9d2c5680,
36946035553Spatrick                                15, 0xefc60000,
37046035553Spatrick                                18, 1812433253>                         mt19937;
37146035553Spatricktypedef mersenne_twister_engine<uint_fast64_t, 64, 312, 156, 31,
37246035553Spatrick                                0xb5026f5aa96619e9,
37346035553Spatrick                                29, 0x5555555555555555,
37446035553Spatrick                                17, 0x71d67fffeda60000,
37546035553Spatrick                                37, 0xfff7eee000000000,
37646035553Spatrick                                43, 6364136223846793005>             mt19937_64;
37746035553Spatricktypedef subtract_with_carry_engine<uint_fast32_t, 24, 10, 24>     ranlux24_base;
37846035553Spatricktypedef subtract_with_carry_engine<uint_fast64_t, 48,  5, 12>     ranlux48_base;
37946035553Spatricktypedef discard_block_engine<ranlux24_base, 223, 23>                   ranlux24;
38046035553Spatricktypedef discard_block_engine<ranlux48_base, 389, 11>                   ranlux48;
38146035553Spatricktypedef shuffle_order_engine<minstd_rand0, 256>                         knuth_b;
38246035553Spatricktypedef minstd_rand                                       default_random_engine;
38346035553Spatrick
38446035553Spatrick// Generators
38546035553Spatrick
38646035553Spatrickclass random_device
38746035553Spatrick{
38846035553Spatrickpublic:
38946035553Spatrick    // types
39046035553Spatrick    typedef unsigned int result_type;
39146035553Spatrick
39246035553Spatrick    // generator characteristics
39346035553Spatrick    static constexpr result_type min() { return numeric_limits<result_type>::min(); }
39446035553Spatrick    static constexpr result_type max() { return numeric_limits<result_type>::max(); }
39546035553Spatrick
39646035553Spatrick    // constructors
39776d0caaeSpatrick    explicit random_device(const string& token = implementation-defined); // before C++20
39876d0caaeSpatrick    random_device() : random_device(implementation-defined) {}            // C++20
39976d0caaeSpatrick    explicit random_device(const string& token);                          // C++20
40046035553Spatrick
40146035553Spatrick    // generating functions
40246035553Spatrick    result_type operator()();
40346035553Spatrick
40446035553Spatrick    // property functions
40546035553Spatrick    double entropy() const noexcept;
40646035553Spatrick
40746035553Spatrick    // no copy functions
40846035553Spatrick    random_device(const random_device& ) = delete;
40946035553Spatrick    void operator=(const random_device& ) = delete;
41046035553Spatrick};
41146035553Spatrick
41246035553Spatrick// Utilities
41346035553Spatrick
41446035553Spatrickclass seed_seq
41546035553Spatrick{
41646035553Spatrickpublic:
41746035553Spatrick    // types
41846035553Spatrick    typedef uint_least32_t result_type;
41946035553Spatrick
42046035553Spatrick    // constructors
42146035553Spatrick    seed_seq();
42246035553Spatrick    template<class T>
42346035553Spatrick        seed_seq(initializer_list<T> il);
42446035553Spatrick    template<class InputIterator>
42546035553Spatrick        seed_seq(InputIterator begin, InputIterator end);
42646035553Spatrick
42746035553Spatrick    // generating functions
42846035553Spatrick    template<class RandomAccessIterator>
42946035553Spatrick        void generate(RandomAccessIterator begin, RandomAccessIterator end);
43046035553Spatrick
43146035553Spatrick    // property functions
43246035553Spatrick    size_t size() const;
43346035553Spatrick    template<class OutputIterator>
43446035553Spatrick        void param(OutputIterator dest) const;
43546035553Spatrick
43646035553Spatrick    // no copy functions
43746035553Spatrick    seed_seq(const seed_seq&) = delete;
43846035553Spatrick    void operator=(const seed_seq& ) = delete;
43946035553Spatrick};
44046035553Spatrick
44146035553Spatricktemplate<class RealType, size_t bits, class URNG>
44246035553Spatrick    RealType generate_canonical(URNG& g);
44346035553Spatrick
44446035553Spatrick// Distributions
44546035553Spatrick
44646035553Spatricktemplate<class IntType = int>
44746035553Spatrickclass uniform_int_distribution
44846035553Spatrick{
44946035553Spatrickpublic:
45046035553Spatrick    // types
45146035553Spatrick    typedef IntType result_type;
45246035553Spatrick
45346035553Spatrick    class param_type
45446035553Spatrick    {
45546035553Spatrick    public:
45646035553Spatrick        typedef uniform_int_distribution distribution_type;
45746035553Spatrick
45846035553Spatrick        explicit param_type(IntType a = 0,
45946035553Spatrick                                    IntType b = numeric_limits<IntType>::max());
46046035553Spatrick
46146035553Spatrick        result_type a() const;
46246035553Spatrick        result_type b() const;
46346035553Spatrick
46446035553Spatrick        friend bool operator==(const param_type& x, const param_type& y);
46546035553Spatrick        friend bool operator!=(const param_type& x, const param_type& y);
46646035553Spatrick    };
46746035553Spatrick
46846035553Spatrick    // constructors and reset functions
46946035553Spatrick    explicit uniform_int_distribution(IntType a = 0,
47076d0caaeSpatrick                                      IntType b = numeric_limits<IntType>::max()); // before C++20
47176d0caaeSpatrick    uniform_int_distribution() : uniform_int_distribution(0) {}                    // C++20
47276d0caaeSpatrick    explicit uniform_int_distribution(IntType a,
47376d0caaeSpatrick                                      IntType b = numeric_limits<IntType>::max()); // C++20
47446035553Spatrick    explicit uniform_int_distribution(const param_type& parm);
47546035553Spatrick    void reset();
47646035553Spatrick
47746035553Spatrick    // generating functions
47846035553Spatrick    template<class URNG> result_type operator()(URNG& g);
47946035553Spatrick    template<class URNG> result_type operator()(URNG& g, const param_type& parm);
48046035553Spatrick
48146035553Spatrick    // property functions
48246035553Spatrick    result_type a() const;
48346035553Spatrick    result_type b() const;
48446035553Spatrick
48546035553Spatrick    param_type param() const;
48646035553Spatrick    void param(const param_type& parm);
48746035553Spatrick
48846035553Spatrick    result_type min() const;
48946035553Spatrick    result_type max() const;
49046035553Spatrick
49146035553Spatrick    friend bool operator==(const uniform_int_distribution& x,
49246035553Spatrick                           const uniform_int_distribution& y);
49346035553Spatrick    friend bool operator!=(const uniform_int_distribution& x,
49446035553Spatrick                           const uniform_int_distribution& y);
49546035553Spatrick
49646035553Spatrick    template <class charT, class traits>
49746035553Spatrick    friend
49846035553Spatrick    basic_ostream<charT, traits>&
49946035553Spatrick    operator<<(basic_ostream<charT, traits>& os,
50046035553Spatrick               const uniform_int_distribution& x);
50146035553Spatrick
50246035553Spatrick    template <class charT, class traits>
50346035553Spatrick    friend
50446035553Spatrick    basic_istream<charT, traits>&
50546035553Spatrick    operator>>(basic_istream<charT, traits>& is,
50646035553Spatrick               uniform_int_distribution& x);
50746035553Spatrick};
50846035553Spatrick
50946035553Spatricktemplate<class RealType = double>
51046035553Spatrickclass uniform_real_distribution
51146035553Spatrick{
51246035553Spatrickpublic:
51346035553Spatrick    // types
51446035553Spatrick    typedef RealType result_type;
51546035553Spatrick
51646035553Spatrick    class param_type
51746035553Spatrick    {
51846035553Spatrick    public:
51946035553Spatrick        typedef uniform_real_distribution distribution_type;
52046035553Spatrick
52146035553Spatrick        explicit param_type(RealType a = 0,
52246035553Spatrick                            RealType b = 1);
52346035553Spatrick
52446035553Spatrick        result_type a() const;
52546035553Spatrick        result_type b() const;
52646035553Spatrick
52746035553Spatrick        friend bool operator==(const param_type& x, const param_type& y);
52846035553Spatrick        friend bool operator!=(const param_type& x, const param_type& y);
52946035553Spatrick    };
53046035553Spatrick
53146035553Spatrick    // constructors and reset functions
53276d0caaeSpatrick    explicit uniform_real_distribution(RealType a = 0.0, RealType b = 1.0); // before C++20
53376d0caaeSpatrick    uniform_real_distribution() : uniform_real_distribution(0.0) {}         // C++20
53476d0caaeSpatrick    explicit uniform_real_distribution(RealType a, RealType b = 1.0);       // C++20
53546035553Spatrick    explicit uniform_real_distribution(const param_type& parm);
53646035553Spatrick    void reset();
53746035553Spatrick
53846035553Spatrick    // generating functions
53946035553Spatrick    template<class URNG> result_type operator()(URNG& g);
54046035553Spatrick    template<class URNG> result_type operator()(URNG& g, const param_type& parm);
54146035553Spatrick
54246035553Spatrick    // property functions
54346035553Spatrick    result_type a() const;
54446035553Spatrick    result_type b() const;
54546035553Spatrick
54646035553Spatrick    param_type param() const;
54746035553Spatrick    void param(const param_type& parm);
54846035553Spatrick
54946035553Spatrick    result_type min() const;
55046035553Spatrick    result_type max() const;
55146035553Spatrick
55246035553Spatrick    friend bool operator==(const uniform_real_distribution& x,
55346035553Spatrick                           const uniform_real_distribution& y);
55446035553Spatrick    friend bool operator!=(const uniform_real_distribution& x,
55546035553Spatrick                           const uniform_real_distribution& y);
55646035553Spatrick
55746035553Spatrick    template <class charT, class traits>
55846035553Spatrick    friend
55946035553Spatrick    basic_ostream<charT, traits>&
56046035553Spatrick    operator<<(basic_ostream<charT, traits>& os,
56146035553Spatrick               const uniform_real_distribution& x);
56246035553Spatrick
56346035553Spatrick    template <class charT, class traits>
56446035553Spatrick    friend
56546035553Spatrick    basic_istream<charT, traits>&
56646035553Spatrick    operator>>(basic_istream<charT, traits>& is,
56746035553Spatrick               uniform_real_distribution& x);
56846035553Spatrick};
56946035553Spatrick
57046035553Spatrickclass bernoulli_distribution
57146035553Spatrick{
57246035553Spatrickpublic:
57346035553Spatrick    // types
57446035553Spatrick    typedef bool result_type;
57546035553Spatrick
57646035553Spatrick    class param_type
57746035553Spatrick    {
57846035553Spatrick    public:
57946035553Spatrick        typedef bernoulli_distribution distribution_type;
58046035553Spatrick
58146035553Spatrick        explicit param_type(double p = 0.5);
58246035553Spatrick
58346035553Spatrick        double p() const;
58446035553Spatrick
58546035553Spatrick        friend bool operator==(const param_type& x, const param_type& y);
58646035553Spatrick        friend bool operator!=(const param_type& x, const param_type& y);
58746035553Spatrick    };
58846035553Spatrick
58946035553Spatrick    // constructors and reset functions
59076d0caaeSpatrick    explicit bernoulli_distribution(double p = 0.5);          // before C++20
59176d0caaeSpatrick    bernoulli_distribution() : bernoulli_distribution(0.5) {} // C++20
59276d0caaeSpatrick    explicit bernoulli_distribution(double p);                // C++20
59346035553Spatrick    explicit bernoulli_distribution(const param_type& parm);
59446035553Spatrick    void reset();
59546035553Spatrick
59646035553Spatrick    // generating functions
59746035553Spatrick    template<class URNG> result_type operator()(URNG& g);
59846035553Spatrick    template<class URNG> result_type operator()(URNG& g, const param_type& parm);
59946035553Spatrick
60046035553Spatrick    // property functions
60146035553Spatrick    double p() const;
60246035553Spatrick
60346035553Spatrick    param_type param() const;
60446035553Spatrick    void param(const param_type& parm);
60546035553Spatrick
60646035553Spatrick    result_type min() const;
60746035553Spatrick    result_type max() const;
60846035553Spatrick
60946035553Spatrick    friend bool operator==(const bernoulli_distribution& x,
61046035553Spatrick                           const bernoulli_distribution& y);
61146035553Spatrick    friend bool operator!=(const bernoulli_distribution& x,
61246035553Spatrick                           const bernoulli_distribution& y);
61346035553Spatrick
61446035553Spatrick    template <class charT, class traits>
61546035553Spatrick    friend
61646035553Spatrick    basic_ostream<charT, traits>&
61746035553Spatrick    operator<<(basic_ostream<charT, traits>& os,
61846035553Spatrick               const bernoulli_distribution& x);
61946035553Spatrick
62046035553Spatrick    template <class charT, class traits>
62146035553Spatrick    friend
62246035553Spatrick    basic_istream<charT, traits>&
62346035553Spatrick    operator>>(basic_istream<charT, traits>& is,
62446035553Spatrick               bernoulli_distribution& x);
62546035553Spatrick};
62646035553Spatrick
62746035553Spatricktemplate<class IntType = int>
62846035553Spatrickclass binomial_distribution
62946035553Spatrick{
63046035553Spatrickpublic:
63146035553Spatrick    // types
63246035553Spatrick    typedef IntType result_type;
63346035553Spatrick
63446035553Spatrick    class param_type
63546035553Spatrick    {
63646035553Spatrick    public:
63746035553Spatrick        typedef binomial_distribution distribution_type;
63846035553Spatrick
63946035553Spatrick        explicit param_type(IntType t = 1, double p = 0.5);
64046035553Spatrick
64146035553Spatrick        IntType t() const;
64246035553Spatrick        double p() const;
64346035553Spatrick
64446035553Spatrick        friend bool operator==(const param_type& x, const param_type& y);
64546035553Spatrick        friend bool operator!=(const param_type& x, const param_type& y);
64646035553Spatrick    };
64746035553Spatrick
64846035553Spatrick    // constructors and reset functions
64976d0caaeSpatrick    explicit binomial_distribution(IntType t = 1, double p = 0.5); // before C++20
65076d0caaeSpatrick    binomial_distribution() : binomial_distribution(1) {}          // C++20
65176d0caaeSpatrick    explicit binomial_distribution(IntType t, double p = 0.5);     // C++20
65246035553Spatrick    explicit binomial_distribution(const param_type& parm);
65346035553Spatrick    void reset();
65446035553Spatrick
65546035553Spatrick    // generating functions
65646035553Spatrick    template<class URNG> result_type operator()(URNG& g);
65746035553Spatrick    template<class URNG> result_type operator()(URNG& g, const param_type& parm);
65846035553Spatrick
65946035553Spatrick    // property functions
66046035553Spatrick    IntType t() const;
66146035553Spatrick    double p() const;
66246035553Spatrick
66346035553Spatrick    param_type param() const;
66446035553Spatrick    void param(const param_type& parm);
66546035553Spatrick
66646035553Spatrick    result_type min() const;
66746035553Spatrick    result_type max() const;
66846035553Spatrick
66946035553Spatrick    friend bool operator==(const binomial_distribution& x,
67046035553Spatrick                           const binomial_distribution& y);
67146035553Spatrick    friend bool operator!=(const binomial_distribution& x,
67246035553Spatrick                           const binomial_distribution& y);
67346035553Spatrick
67446035553Spatrick    template <class charT, class traits>
67546035553Spatrick    friend
67646035553Spatrick    basic_ostream<charT, traits>&
67746035553Spatrick    operator<<(basic_ostream<charT, traits>& os,
67846035553Spatrick               const binomial_distribution& x);
67946035553Spatrick
68046035553Spatrick    template <class charT, class traits>
68146035553Spatrick    friend
68246035553Spatrick    basic_istream<charT, traits>&
68346035553Spatrick    operator>>(basic_istream<charT, traits>& is,
68446035553Spatrick               binomial_distribution& x);
68546035553Spatrick};
68646035553Spatrick
68746035553Spatricktemplate<class IntType = int>
68846035553Spatrickclass geometric_distribution
68946035553Spatrick{
69046035553Spatrickpublic:
69146035553Spatrick    // types
69246035553Spatrick    typedef IntType result_type;
69346035553Spatrick
69446035553Spatrick    class param_type
69546035553Spatrick    {
69646035553Spatrick    public:
69746035553Spatrick        typedef geometric_distribution distribution_type;
69846035553Spatrick
69946035553Spatrick        explicit param_type(double p = 0.5);
70046035553Spatrick
70146035553Spatrick        double p() const;
70246035553Spatrick
70346035553Spatrick        friend bool operator==(const param_type& x, const param_type& y);
70446035553Spatrick        friend bool operator!=(const param_type& x, const param_type& y);
70546035553Spatrick    };
70646035553Spatrick
70746035553Spatrick    // constructors and reset functions
70876d0caaeSpatrick    explicit geometric_distribution(double p = 0.5);          // before C++20
70976d0caaeSpatrick    geometric_distribution() : geometric_distribution(0.5) {} // C++20
71076d0caaeSpatrick    explicit geometric_distribution(double p);                // C++20
71146035553Spatrick    explicit geometric_distribution(const param_type& parm);
71246035553Spatrick    void reset();
71346035553Spatrick
71446035553Spatrick    // generating functions
71546035553Spatrick    template<class URNG> result_type operator()(URNG& g);
71646035553Spatrick    template<class URNG> result_type operator()(URNG& g, const param_type& parm);
71746035553Spatrick
71846035553Spatrick    // property functions
71946035553Spatrick    double p() const;
72046035553Spatrick
72146035553Spatrick    param_type param() const;
72246035553Spatrick    void param(const param_type& parm);
72346035553Spatrick
72446035553Spatrick    result_type min() const;
72546035553Spatrick    result_type max() const;
72646035553Spatrick
72746035553Spatrick    friend bool operator==(const geometric_distribution& x,
72846035553Spatrick                           const geometric_distribution& y);
72946035553Spatrick    friend bool operator!=(const geometric_distribution& x,
73046035553Spatrick                           const geometric_distribution& y);
73146035553Spatrick
73246035553Spatrick    template <class charT, class traits>
73346035553Spatrick    friend
73446035553Spatrick    basic_ostream<charT, traits>&
73546035553Spatrick    operator<<(basic_ostream<charT, traits>& os,
73646035553Spatrick               const geometric_distribution& x);
73746035553Spatrick
73846035553Spatrick    template <class charT, class traits>
73946035553Spatrick    friend
74046035553Spatrick    basic_istream<charT, traits>&
74146035553Spatrick    operator>>(basic_istream<charT, traits>& is,
74246035553Spatrick               geometric_distribution& x);
74346035553Spatrick};
74446035553Spatrick
74546035553Spatricktemplate<class IntType = int>
74646035553Spatrickclass negative_binomial_distribution
74746035553Spatrick{
74846035553Spatrickpublic:
74946035553Spatrick    // types
75046035553Spatrick    typedef IntType result_type;
75146035553Spatrick
75246035553Spatrick    class param_type
75346035553Spatrick    {
75446035553Spatrick    public:
75546035553Spatrick        typedef negative_binomial_distribution distribution_type;
75646035553Spatrick
75746035553Spatrick        explicit param_type(result_type k = 1, double p = 0.5);
75846035553Spatrick
75946035553Spatrick        result_type k() const;
76046035553Spatrick        double p() const;
76146035553Spatrick
76246035553Spatrick        friend bool operator==(const param_type& x, const param_type& y);
76346035553Spatrick        friend bool operator!=(const param_type& x, const param_type& y);
76446035553Spatrick    };
76546035553Spatrick
76646035553Spatrick    // constructor and reset functions
76776d0caaeSpatrick    explicit negative_binomial_distribution(IntType k = 1, double p = 0.5); // before C++20
76876d0caaeSpatrick    negative_binomial_distribution() : negative_binomial_distribution(1) {} // C++20
76976d0caaeSpatrick    explicit negative_binomial_distribution(IntType k, double p = 0.5);     // C++20
77046035553Spatrick    explicit negative_binomial_distribution(const param_type& parm);
77146035553Spatrick    void reset();
77246035553Spatrick
77346035553Spatrick    // generating functions
77446035553Spatrick    template<class URNG> result_type operator()(URNG& g);
77546035553Spatrick    template<class URNG> result_type operator()(URNG& g, const param_type& parm);
77646035553Spatrick
77746035553Spatrick    // property functions
77846035553Spatrick    result_type k() const;
77946035553Spatrick    double p() const;
78046035553Spatrick
78146035553Spatrick    param_type param() const;
78246035553Spatrick    void param(const param_type& parm);
78346035553Spatrick
78446035553Spatrick    result_type min() const;
78546035553Spatrick    result_type max() const;
78646035553Spatrick
78746035553Spatrick    friend bool operator==(const negative_binomial_distribution& x,
78846035553Spatrick                           const negative_binomial_distribution& y);
78946035553Spatrick    friend bool operator!=(const negative_binomial_distribution& x,
79046035553Spatrick                           const negative_binomial_distribution& y);
79146035553Spatrick
79246035553Spatrick    template <class charT, class traits>
79346035553Spatrick    friend
79446035553Spatrick    basic_ostream<charT, traits>&
79546035553Spatrick    operator<<(basic_ostream<charT, traits>& os,
79646035553Spatrick               const negative_binomial_distribution& x);
79746035553Spatrick
79846035553Spatrick    template <class charT, class traits>
79946035553Spatrick    friend
80046035553Spatrick    basic_istream<charT, traits>&
80146035553Spatrick    operator>>(basic_istream<charT, traits>& is,
80246035553Spatrick               negative_binomial_distribution& x);
80346035553Spatrick};
80446035553Spatrick
80546035553Spatricktemplate<class IntType = int>
80646035553Spatrickclass poisson_distribution
80746035553Spatrick{
80846035553Spatrickpublic:
80946035553Spatrick    // types
81046035553Spatrick    typedef IntType result_type;
81146035553Spatrick
81246035553Spatrick    class param_type
81346035553Spatrick    {
81446035553Spatrick    public:
81546035553Spatrick        typedef poisson_distribution distribution_type;
81646035553Spatrick
81746035553Spatrick        explicit param_type(double mean = 1.0);
81846035553Spatrick
81946035553Spatrick        double mean() const;
82046035553Spatrick
82146035553Spatrick        friend bool operator==(const param_type& x, const param_type& y);
82246035553Spatrick        friend bool operator!=(const param_type& x, const param_type& y);
82346035553Spatrick    };
82446035553Spatrick
82546035553Spatrick    // constructors and reset functions
82676d0caaeSpatrick    explicit poisson_distribution(double mean = 1.0);     // before C++20
82776d0caaeSpatrick    poisson_distribution() : poisson_distribution(1.0) {} // C++20
82876d0caaeSpatrick    explicit poisson_distribution(double mean);           // C++20
82946035553Spatrick    explicit poisson_distribution(const param_type& parm);
83046035553Spatrick    void reset();
83146035553Spatrick
83246035553Spatrick    // generating functions
83346035553Spatrick    template<class URNG> result_type operator()(URNG& g);
83446035553Spatrick    template<class URNG> result_type operator()(URNG& g, const param_type& parm);
83546035553Spatrick
83646035553Spatrick    // property functions
83746035553Spatrick    double mean() const;
83846035553Spatrick
83946035553Spatrick    param_type param() const;
84046035553Spatrick    void param(const param_type& parm);
84146035553Spatrick
84246035553Spatrick    result_type min() const;
84346035553Spatrick    result_type max() const;
84446035553Spatrick
84546035553Spatrick    friend bool operator==(const poisson_distribution& x,
84646035553Spatrick                           const poisson_distribution& y);
84746035553Spatrick    friend bool operator!=(const poisson_distribution& x,
84846035553Spatrick                           const poisson_distribution& y);
84946035553Spatrick
85046035553Spatrick    template <class charT, class traits>
85146035553Spatrick    friend
85246035553Spatrick    basic_ostream<charT, traits>&
85346035553Spatrick    operator<<(basic_ostream<charT, traits>& os,
85446035553Spatrick               const poisson_distribution& x);
85546035553Spatrick
85646035553Spatrick    template <class charT, class traits>
85746035553Spatrick    friend
85846035553Spatrick    basic_istream<charT, traits>&
85946035553Spatrick    operator>>(basic_istream<charT, traits>& is,
86046035553Spatrick               poisson_distribution& x);
86146035553Spatrick};
86246035553Spatrick
86346035553Spatricktemplate<class RealType = double>
86446035553Spatrickclass exponential_distribution
86546035553Spatrick{
86646035553Spatrickpublic:
86746035553Spatrick    // types
86846035553Spatrick    typedef RealType result_type;
86946035553Spatrick
87046035553Spatrick    class param_type
87146035553Spatrick    {
87246035553Spatrick    public:
87346035553Spatrick        typedef exponential_distribution distribution_type;
87446035553Spatrick
87546035553Spatrick        explicit param_type(result_type lambda = 1.0);
87646035553Spatrick
87746035553Spatrick        result_type lambda() const;
87846035553Spatrick
87946035553Spatrick        friend bool operator==(const param_type& x, const param_type& y);
88046035553Spatrick        friend bool operator!=(const param_type& x, const param_type& y);
88146035553Spatrick    };
88246035553Spatrick
88346035553Spatrick    // constructors and reset functions
88476d0caaeSpatrick    explicit exponential_distribution(RealType lambda = 1.0);     // before C++20
88576d0caaeSpatrick    exponential_distribution() : exponential_distribution(1.0) {} // C++20
88676d0caaeSpatrick    explicit exponential_distribution(RealType lambda);           // C++20
88746035553Spatrick    explicit exponential_distribution(const param_type& parm);
88846035553Spatrick    void reset();
88946035553Spatrick
89046035553Spatrick    // generating functions
89146035553Spatrick    template<class URNG> result_type operator()(URNG& g);
89246035553Spatrick    template<class URNG> result_type operator()(URNG& g, const param_type& parm);
89346035553Spatrick
89446035553Spatrick    // property functions
89546035553Spatrick    result_type lambda() const;
89646035553Spatrick
89746035553Spatrick    param_type param() const;
89846035553Spatrick    void param(const param_type& parm);
89946035553Spatrick
90046035553Spatrick    result_type min() const;
90146035553Spatrick    result_type max() const;
90246035553Spatrick
90346035553Spatrick    friend bool operator==(const exponential_distribution& x,
90446035553Spatrick                           const exponential_distribution& y);
90546035553Spatrick    friend bool operator!=(const exponential_distribution& x,
90646035553Spatrick                           const exponential_distribution& y);
90746035553Spatrick
90846035553Spatrick    template <class charT, class traits>
90946035553Spatrick    friend
91046035553Spatrick    basic_ostream<charT, traits>&
91146035553Spatrick    operator<<(basic_ostream<charT, traits>& os,
91246035553Spatrick               const exponential_distribution& x);
91346035553Spatrick
91446035553Spatrick    template <class charT, class traits>
91546035553Spatrick    friend
91646035553Spatrick    basic_istream<charT, traits>&
91746035553Spatrick    operator>>(basic_istream<charT, traits>& is,
91846035553Spatrick               exponential_distribution& x);
91946035553Spatrick};
92046035553Spatrick
92146035553Spatricktemplate<class RealType = double>
92246035553Spatrickclass gamma_distribution
92346035553Spatrick{
92446035553Spatrickpublic:
92546035553Spatrick    // types
92646035553Spatrick    typedef RealType result_type;
92746035553Spatrick
92846035553Spatrick    class param_type
92946035553Spatrick    {
93046035553Spatrick    public:
93146035553Spatrick        typedef gamma_distribution distribution_type;
93246035553Spatrick
93346035553Spatrick        explicit param_type(result_type alpha = 1, result_type beta = 1);
93446035553Spatrick
93546035553Spatrick        result_type alpha() const;
93646035553Spatrick        result_type beta() const;
93746035553Spatrick
93846035553Spatrick        friend bool operator==(const param_type& x, const param_type& y);
93946035553Spatrick        friend bool operator!=(const param_type& x, const param_type& y);
94046035553Spatrick    };
94146035553Spatrick
94246035553Spatrick    // constructors and reset functions
94376d0caaeSpatrick    explicit gamma_distribution(RealType alpha = 0.0, RealType beta = 1.0); // before C++20
94476d0caaeSpatrick    gamma_distribution() : gamma_distribution(0.0) {}                       // C++20
94576d0caaeSpatrick    explicit gamma_distribution(RealType alpha, RealType beta = 1.0);       // C++20
94646035553Spatrick    explicit gamma_distribution(const param_type& parm);
94746035553Spatrick    void reset();
94846035553Spatrick
94946035553Spatrick    // generating functions
95046035553Spatrick    template<class URNG> result_type operator()(URNG& g);
95146035553Spatrick    template<class URNG> result_type operator()(URNG& g, const param_type& parm);
95246035553Spatrick
95346035553Spatrick    // property functions
95446035553Spatrick    result_type alpha() const;
95546035553Spatrick    result_type beta() const;
95646035553Spatrick
95746035553Spatrick    param_type param() const;
95846035553Spatrick    void param(const param_type& parm);
95946035553Spatrick
96046035553Spatrick    result_type min() const;
96146035553Spatrick    result_type max() const;
96246035553Spatrick
96346035553Spatrick    friend bool operator==(const gamma_distribution& x,
96446035553Spatrick                           const gamma_distribution& y);
96546035553Spatrick    friend bool operator!=(const gamma_distribution& x,
96646035553Spatrick                           const gamma_distribution& y);
96746035553Spatrick
96846035553Spatrick    template <class charT, class traits>
96946035553Spatrick    friend
97046035553Spatrick    basic_ostream<charT, traits>&
97146035553Spatrick    operator<<(basic_ostream<charT, traits>& os,
97246035553Spatrick               const gamma_distribution& x);
97346035553Spatrick
97446035553Spatrick    template <class charT, class traits>
97546035553Spatrick    friend
97646035553Spatrick    basic_istream<charT, traits>&
97746035553Spatrick    operator>>(basic_istream<charT, traits>& is,
97846035553Spatrick               gamma_distribution& x);
97946035553Spatrick};
98046035553Spatrick
98146035553Spatricktemplate<class RealType = double>
98246035553Spatrickclass weibull_distribution
98346035553Spatrick{
98446035553Spatrickpublic:
98546035553Spatrick    // types
98646035553Spatrick    typedef RealType result_type;
98746035553Spatrick
98846035553Spatrick    class param_type
98946035553Spatrick    {
99046035553Spatrick    public:
99146035553Spatrick        typedef weibull_distribution distribution_type;
99246035553Spatrick
99346035553Spatrick        explicit param_type(result_type alpha = 1, result_type beta = 1);
99446035553Spatrick
99546035553Spatrick        result_type a() const;
99646035553Spatrick        result_type b() const;
99746035553Spatrick
99846035553Spatrick        friend bool operator==(const param_type& x, const param_type& y);
99946035553Spatrick        friend bool operator!=(const param_type& x, const param_type& y);
100046035553Spatrick    };
100146035553Spatrick
100246035553Spatrick    // constructor and reset functions
100376d0caaeSpatrick    explicit weibull_distribution(RealType a = 1.0, RealType b = 1.0); // before C++20
100476d0caaeSpatrick    weibull_distribution() : weibull_distribution(1.0) {}              // C++20
100576d0caaeSpatrick    explicit weibull_distribution(RealType a, RealType b = 1.0);       // C++20
100646035553Spatrick    explicit weibull_distribution(const param_type& parm);
100746035553Spatrick    void reset();
100846035553Spatrick
100946035553Spatrick    // generating functions
101046035553Spatrick    template<class URNG> result_type operator()(URNG& g);
101146035553Spatrick    template<class URNG> result_type operator()(URNG& g, const param_type& parm);
101246035553Spatrick
101346035553Spatrick    // property functions
101446035553Spatrick    result_type a() const;
101546035553Spatrick    result_type b() const;
101646035553Spatrick
101746035553Spatrick    param_type param() const;
101846035553Spatrick    void param(const param_type& parm);
101946035553Spatrick
102046035553Spatrick    result_type min() const;
102146035553Spatrick    result_type max() const;
102246035553Spatrick
102346035553Spatrick    friend bool operator==(const weibull_distribution& x,
102446035553Spatrick                           const weibull_distribution& y);
102546035553Spatrick    friend bool operator!=(const weibull_distribution& x,
102646035553Spatrick                           const weibull_distribution& y);
102746035553Spatrick
102846035553Spatrick    template <class charT, class traits>
102946035553Spatrick    friend
103046035553Spatrick    basic_ostream<charT, traits>&
103146035553Spatrick    operator<<(basic_ostream<charT, traits>& os,
103246035553Spatrick               const weibull_distribution& x);
103346035553Spatrick
103446035553Spatrick    template <class charT, class traits>
103546035553Spatrick    friend
103646035553Spatrick    basic_istream<charT, traits>&
103746035553Spatrick    operator>>(basic_istream<charT, traits>& is,
103846035553Spatrick               weibull_distribution& x);
103946035553Spatrick};
104046035553Spatrick
104146035553Spatricktemplate<class RealType = double>
104246035553Spatrickclass extreme_value_distribution
104346035553Spatrick{
104446035553Spatrickpublic:
104546035553Spatrick    // types
104646035553Spatrick    typedef RealType result_type;
104746035553Spatrick
104846035553Spatrick    class param_type
104946035553Spatrick    {
105046035553Spatrick    public:
105146035553Spatrick        typedef extreme_value_distribution distribution_type;
105246035553Spatrick
105346035553Spatrick        explicit param_type(result_type a = 0, result_type b = 1);
105446035553Spatrick
105546035553Spatrick        result_type a() const;
105646035553Spatrick        result_type b() const;
105746035553Spatrick
105846035553Spatrick        friend bool operator==(const param_type& x, const param_type& y);
105946035553Spatrick        friend bool operator!=(const param_type& x, const param_type& y);
106046035553Spatrick    };
106146035553Spatrick
106246035553Spatrick    // constructor and reset functions
106376d0caaeSpatrick    explicit extreme_value_distribution(RealType a = 0.0, RealType b = 1.0); // before C++20
106476d0caaeSpatrick    extreme_value_distribution() : extreme_value_distribution(0.0) {}        // C++20
106576d0caaeSpatrick    explicit extreme_value_distribution(RealType a, RealType b = 1.0);       // C++20
106646035553Spatrick    explicit extreme_value_distribution(const param_type& parm);
106746035553Spatrick    void reset();
106846035553Spatrick
106946035553Spatrick    // generating functions
107046035553Spatrick    template<class URNG> result_type operator()(URNG& g);
107146035553Spatrick    template<class URNG> result_type operator()(URNG& g, const param_type& parm);
107246035553Spatrick
107346035553Spatrick    // property functions
107446035553Spatrick    result_type a() const;
107546035553Spatrick    result_type b() const;
107646035553Spatrick
107746035553Spatrick    param_type param() const;
107846035553Spatrick    void param(const param_type& parm);
107946035553Spatrick
108046035553Spatrick    result_type min() const;
108146035553Spatrick    result_type max() const;
108246035553Spatrick
108346035553Spatrick    friend bool operator==(const extreme_value_distribution& x,
108446035553Spatrick                           const extreme_value_distribution& y);
108546035553Spatrick    friend bool operator!=(const extreme_value_distribution& x,
108646035553Spatrick                           const extreme_value_distribution& y);
108746035553Spatrick
108846035553Spatrick    template <class charT, class traits>
108946035553Spatrick    friend
109046035553Spatrick    basic_ostream<charT, traits>&
109146035553Spatrick    operator<<(basic_ostream<charT, traits>& os,
109246035553Spatrick               const extreme_value_distribution& x);
109346035553Spatrick
109446035553Spatrick    template <class charT, class traits>
109546035553Spatrick    friend
109646035553Spatrick    basic_istream<charT, traits>&
109746035553Spatrick    operator>>(basic_istream<charT, traits>& is,
109846035553Spatrick               extreme_value_distribution& x);
109946035553Spatrick};
110046035553Spatrick
110146035553Spatricktemplate<class RealType = double>
110246035553Spatrickclass normal_distribution
110346035553Spatrick{
110446035553Spatrickpublic:
110546035553Spatrick    // types
110646035553Spatrick    typedef RealType result_type;
110746035553Spatrick
110846035553Spatrick    class param_type
110946035553Spatrick    {
111046035553Spatrick    public:
111146035553Spatrick        typedef normal_distribution distribution_type;
111246035553Spatrick
111346035553Spatrick        explicit param_type(result_type mean = 0, result_type stddev = 1);
111446035553Spatrick
111546035553Spatrick        result_type mean() const;
111646035553Spatrick        result_type stddev() const;
111746035553Spatrick
111846035553Spatrick        friend bool operator==(const param_type& x, const param_type& y);
111946035553Spatrick        friend bool operator!=(const param_type& x, const param_type& y);
112046035553Spatrick    };
112146035553Spatrick
112246035553Spatrick    // constructors and reset functions
112376d0caaeSpatrick    explicit normal_distribution(RealType mean = 0.0, RealType stddev = 1.0); // before C++20
112476d0caaeSpatrick    normal_distribution() : normal_distribution(0.0) {}                       // C++20
112576d0caaeSpatrick    explicit normal_distribution(RealType mean, RealType stddev = 1.0);       // C++20
112646035553Spatrick    explicit normal_distribution(const param_type& parm);
112746035553Spatrick    void reset();
112846035553Spatrick
112946035553Spatrick    // generating functions
113046035553Spatrick    template<class URNG> result_type operator()(URNG& g);
113146035553Spatrick    template<class URNG> result_type operator()(URNG& g, const param_type& parm);
113246035553Spatrick
113346035553Spatrick    // property functions
113446035553Spatrick    result_type mean() const;
113546035553Spatrick    result_type stddev() const;
113646035553Spatrick
113746035553Spatrick    param_type param() const;
113846035553Spatrick    void param(const param_type& parm);
113946035553Spatrick
114046035553Spatrick    result_type min() const;
114146035553Spatrick    result_type max() const;
114246035553Spatrick
114346035553Spatrick    friend bool operator==(const normal_distribution& x,
114446035553Spatrick                           const normal_distribution& y);
114546035553Spatrick    friend bool operator!=(const normal_distribution& x,
114646035553Spatrick                           const normal_distribution& y);
114746035553Spatrick
114846035553Spatrick    template <class charT, class traits>
114946035553Spatrick    friend
115046035553Spatrick    basic_ostream<charT, traits>&
115146035553Spatrick    operator<<(basic_ostream<charT, traits>& os,
115246035553Spatrick               const normal_distribution& x);
115346035553Spatrick
115446035553Spatrick    template <class charT, class traits>
115546035553Spatrick    friend
115646035553Spatrick    basic_istream<charT, traits>&
115746035553Spatrick    operator>>(basic_istream<charT, traits>& is,
115846035553Spatrick               normal_distribution& x);
115946035553Spatrick};
116046035553Spatrick
116146035553Spatricktemplate<class RealType = double>
116246035553Spatrickclass lognormal_distribution
116346035553Spatrick{
116446035553Spatrickpublic:
116546035553Spatrick    // types
116646035553Spatrick    typedef RealType result_type;
116746035553Spatrick
116846035553Spatrick    class param_type
116946035553Spatrick    {
117046035553Spatrick    public:
117146035553Spatrick        typedef lognormal_distribution distribution_type;
117246035553Spatrick
117346035553Spatrick        explicit param_type(result_type m = 0, result_type s = 1);
117446035553Spatrick
117546035553Spatrick        result_type m() const;
117646035553Spatrick        result_type s() const;
117746035553Spatrick
117846035553Spatrick        friend bool operator==(const param_type& x, const param_type& y);
117946035553Spatrick        friend bool operator!=(const param_type& x, const param_type& y);
118046035553Spatrick    };
118146035553Spatrick
118246035553Spatrick    // constructor and reset functions
118376d0caaeSpatrick    explicit lognormal_distribution(RealType mean = 0.0, RealType stddev = 1.0); // before C++20
118476d0caaeSpatrick    lognormal_distribution() : lognormal_distribution(0.0) {}                    // C++20
118576d0caaeSpatrick    explicit lognormal_distribution(RealType mean, RealType stddev = 1.0);       // C++20
118646035553Spatrick    explicit lognormal_distribution(const param_type& parm);
118746035553Spatrick    void reset();
118846035553Spatrick
118946035553Spatrick    // generating functions
119046035553Spatrick    template<class URNG> result_type operator()(URNG& g);
119146035553Spatrick    template<class URNG> result_type operator()(URNG& g, const param_type& parm);
119246035553Spatrick
119346035553Spatrick    // property functions
119446035553Spatrick    result_type m() const;
119546035553Spatrick    result_type s() const;
119646035553Spatrick
119746035553Spatrick    param_type param() const;
119846035553Spatrick    void param(const param_type& parm);
119946035553Spatrick
120046035553Spatrick    result_type min() const;
120146035553Spatrick    result_type max() const;
120246035553Spatrick
120346035553Spatrick    friend bool operator==(const lognormal_distribution& x,
120446035553Spatrick                           const lognormal_distribution& y);
120546035553Spatrick    friend bool operator!=(const lognormal_distribution& x,
120646035553Spatrick                           const lognormal_distribution& y);
120746035553Spatrick
120846035553Spatrick    template <class charT, class traits>
120946035553Spatrick    friend
121046035553Spatrick    basic_ostream<charT, traits>&
121146035553Spatrick    operator<<(basic_ostream<charT, traits>& os,
121246035553Spatrick               const lognormal_distribution& x);
121346035553Spatrick
121446035553Spatrick    template <class charT, class traits>
121546035553Spatrick    friend
121646035553Spatrick    basic_istream<charT, traits>&
121746035553Spatrick    operator>>(basic_istream<charT, traits>& is,
121846035553Spatrick               lognormal_distribution& x);
121946035553Spatrick};
122046035553Spatrick
122146035553Spatricktemplate<class RealType = double>
122246035553Spatrickclass chi_squared_distribution
122346035553Spatrick{
122446035553Spatrickpublic:
122546035553Spatrick    // types
122646035553Spatrick    typedef RealType result_type;
122746035553Spatrick
122846035553Spatrick    class param_type
122946035553Spatrick    {
123046035553Spatrick    public:
123146035553Spatrick        typedef chi_squared_distribution distribution_type;
123246035553Spatrick
123346035553Spatrick        explicit param_type(result_type n = 1);
123446035553Spatrick
123546035553Spatrick        result_type n() const;
123646035553Spatrick
123746035553Spatrick        friend bool operator==(const param_type& x, const param_type& y);
123846035553Spatrick        friend bool operator!=(const param_type& x, const param_type& y);
123946035553Spatrick    };
124046035553Spatrick
124146035553Spatrick    // constructor and reset functions
124276d0caaeSpatrick    explicit chi_squared_distribution(RealType n = 1.0);          // before C++20
124376d0caaeSpatrick    chi_squared_distribution() : chi_squared_distribution(1.0) {} // C++20
124476d0caaeSpatrick    explicit chi_squared_distribution(RealType n);                // C++20
124546035553Spatrick    explicit chi_squared_distribution(const param_type& parm);
124646035553Spatrick    void reset();
124746035553Spatrick
124846035553Spatrick    // generating functions
124946035553Spatrick    template<class URNG> result_type operator()(URNG& g);
125046035553Spatrick    template<class URNG> result_type operator()(URNG& g, const param_type& parm);
125146035553Spatrick
125246035553Spatrick    // property functions
125346035553Spatrick    result_type n() const;
125446035553Spatrick
125546035553Spatrick    param_type param() const;
125646035553Spatrick    void param(const param_type& parm);
125746035553Spatrick
125846035553Spatrick    result_type min() const;
125946035553Spatrick    result_type max() const;
126046035553Spatrick
126146035553Spatrick    friend bool operator==(const chi_squared_distribution& x,
126246035553Spatrick                           const chi_squared_distribution& y);
126346035553Spatrick    friend bool operator!=(const chi_squared_distribution& x,
126446035553Spatrick                           const chi_squared_distribution& y);
126546035553Spatrick
126646035553Spatrick    template <class charT, class traits>
126746035553Spatrick    friend
126846035553Spatrick    basic_ostream<charT, traits>&
126946035553Spatrick    operator<<(basic_ostream<charT, traits>& os,
127046035553Spatrick               const chi_squared_distribution& x);
127146035553Spatrick
127246035553Spatrick    template <class charT, class traits>
127346035553Spatrick    friend
127446035553Spatrick    basic_istream<charT, traits>&
127546035553Spatrick    operator>>(basic_istream<charT, traits>& is,
127646035553Spatrick               chi_squared_distribution& x);
127746035553Spatrick};
127846035553Spatrick
127946035553Spatricktemplate<class RealType = double>
128046035553Spatrickclass cauchy_distribution
128146035553Spatrick{
128246035553Spatrickpublic:
128346035553Spatrick    // types
128446035553Spatrick    typedef RealType result_type;
128546035553Spatrick
128646035553Spatrick    class param_type
128746035553Spatrick    {
128846035553Spatrick    public:
128946035553Spatrick        typedef cauchy_distribution distribution_type;
129046035553Spatrick
129146035553Spatrick        explicit param_type(result_type a = 0, result_type b = 1);
129246035553Spatrick
129346035553Spatrick        result_type a() const;
129446035553Spatrick        result_type b() const;
129546035553Spatrick
129646035553Spatrick        friend bool operator==(const param_type& x, const param_type& y);
129746035553Spatrick        friend bool operator!=(const param_type& x, const param_type& y);
129846035553Spatrick    };
129946035553Spatrick
130046035553Spatrick    // constructor and reset functions
130176d0caaeSpatrick    explicit cauchy_distribution(RealType a = 0.0, RealType b = 1.0); // before C++20
130276d0caaeSpatrick    cauchy_distribution() : cauchy_distribution(0.0) {}               // C++20
130376d0caaeSpatrick    explicit cauchy_distribution(RealType a, RealType b = 1.0);       // C++20
130446035553Spatrick    explicit cauchy_distribution(const param_type& parm);
130546035553Spatrick    void reset();
130646035553Spatrick
130746035553Spatrick    // generating functions
130846035553Spatrick    template<class URNG> result_type operator()(URNG& g);
130946035553Spatrick    template<class URNG> result_type operator()(URNG& g, const param_type& parm);
131046035553Spatrick
131146035553Spatrick    // property functions
131246035553Spatrick    result_type a() const;
131346035553Spatrick    result_type b() const;
131446035553Spatrick
131546035553Spatrick    param_type param() const;
131646035553Spatrick    void param(const param_type& parm);
131746035553Spatrick
131846035553Spatrick    result_type min() const;
131946035553Spatrick    result_type max() const;
132046035553Spatrick
132146035553Spatrick    friend bool operator==(const cauchy_distribution& x,
132246035553Spatrick                           const cauchy_distribution& y);
132346035553Spatrick    friend bool operator!=(const cauchy_distribution& x,
132446035553Spatrick                           const cauchy_distribution& y);
132546035553Spatrick
132646035553Spatrick    template <class charT, class traits>
132746035553Spatrick    friend
132846035553Spatrick    basic_ostream<charT, traits>&
132946035553Spatrick    operator<<(basic_ostream<charT, traits>& os,
133046035553Spatrick               const cauchy_distribution& x);
133146035553Spatrick
133246035553Spatrick    template <class charT, class traits>
133346035553Spatrick    friend
133446035553Spatrick    basic_istream<charT, traits>&
133546035553Spatrick    operator>>(basic_istream<charT, traits>& is,
133646035553Spatrick               cauchy_distribution& x);
133746035553Spatrick};
133846035553Spatrick
133946035553Spatricktemplate<class RealType = double>
134046035553Spatrickclass fisher_f_distribution
134146035553Spatrick{
134246035553Spatrickpublic:
134346035553Spatrick    // types
134446035553Spatrick    typedef RealType result_type;
134546035553Spatrick
134646035553Spatrick    class param_type
134746035553Spatrick    {
134846035553Spatrick    public:
134946035553Spatrick        typedef fisher_f_distribution distribution_type;
135046035553Spatrick
135146035553Spatrick        explicit param_type(result_type m = 1, result_type n = 1);
135246035553Spatrick
135346035553Spatrick        result_type m() const;
135446035553Spatrick        result_type n() const;
135546035553Spatrick
135646035553Spatrick        friend bool operator==(const param_type& x, const param_type& y);
135746035553Spatrick        friend bool operator!=(const param_type& x, const param_type& y);
135846035553Spatrick    };
135946035553Spatrick
136046035553Spatrick    // constructor and reset functions
136176d0caaeSpatrick    explicit fisher_f_distribution(RealType m = 1.0, RealType n = 1.0); // before C++20
136276d0caaeSpatrick    fisher_f_distribution() : fisher_f_distribution(1.0) {}             // C++20
136376d0caaeSpatrick    explicit fisher_f_distribution(RealType m, RealType n = 1.0);       // C++20
136446035553Spatrick    explicit fisher_f_distribution(const param_type& parm);
136546035553Spatrick    void reset();
136646035553Spatrick
136746035553Spatrick    // generating functions
136846035553Spatrick    template<class URNG> result_type operator()(URNG& g);
136946035553Spatrick    template<class URNG> result_type operator()(URNG& g, const param_type& parm);
137046035553Spatrick
137146035553Spatrick    // property functions
137246035553Spatrick    result_type m() const;
137346035553Spatrick    result_type n() const;
137446035553Spatrick
137546035553Spatrick    param_type param() const;
137646035553Spatrick    void param(const param_type& parm);
137746035553Spatrick
137846035553Spatrick    result_type min() const;
137946035553Spatrick    result_type max() const;
138046035553Spatrick
138146035553Spatrick    friend bool operator==(const fisher_f_distribution& x,
138246035553Spatrick                           const fisher_f_distribution& y);
138346035553Spatrick    friend bool operator!=(const fisher_f_distribution& x,
138446035553Spatrick                           const fisher_f_distribution& y);
138546035553Spatrick
138646035553Spatrick    template <class charT, class traits>
138746035553Spatrick    friend
138846035553Spatrick    basic_ostream<charT, traits>&
138946035553Spatrick    operator<<(basic_ostream<charT, traits>& os,
139046035553Spatrick               const fisher_f_distribution& x);
139146035553Spatrick
139246035553Spatrick    template <class charT, class traits>
139346035553Spatrick    friend
139446035553Spatrick    basic_istream<charT, traits>&
139546035553Spatrick    operator>>(basic_istream<charT, traits>& is,
139646035553Spatrick               fisher_f_distribution& x);
139746035553Spatrick};
139846035553Spatrick
139946035553Spatricktemplate<class RealType = double>
140046035553Spatrickclass student_t_distribution
140146035553Spatrick{
140246035553Spatrickpublic:
140346035553Spatrick    // types
140446035553Spatrick    typedef RealType result_type;
140546035553Spatrick
140646035553Spatrick    class param_type
140746035553Spatrick    {
140846035553Spatrick    public:
140946035553Spatrick        typedef student_t_distribution distribution_type;
141046035553Spatrick
141146035553Spatrick        explicit param_type(result_type n = 1);
141246035553Spatrick
141346035553Spatrick        result_type n() const;
141446035553Spatrick
141546035553Spatrick        friend bool operator==(const param_type& x, const param_type& y);
141646035553Spatrick        friend bool operator!=(const param_type& x, const param_type& y);
141746035553Spatrick    };
141846035553Spatrick
141946035553Spatrick    // constructor and reset functions
142076d0caaeSpatrick    explicit student_t_distribution(RealType n = 1.0);        // before C++20
142176d0caaeSpatrick    student_t_distribution() : student_t_distribution(1.0) {} // C++20
142276d0caaeSpatrick    explicit student_t_distribution(RealType n);              // C++20
142346035553Spatrick    explicit student_t_distribution(const param_type& parm);
142446035553Spatrick    void reset();
142546035553Spatrick
142646035553Spatrick    // generating functions
142746035553Spatrick    template<class URNG> result_type operator()(URNG& g);
142846035553Spatrick    template<class URNG> result_type operator()(URNG& g, const param_type& parm);
142946035553Spatrick
143046035553Spatrick    // property functions
143146035553Spatrick    result_type n() const;
143246035553Spatrick
143346035553Spatrick    param_type param() const;
143446035553Spatrick    void param(const param_type& parm);
143546035553Spatrick
143646035553Spatrick    result_type min() const;
143746035553Spatrick    result_type max() const;
143846035553Spatrick
143946035553Spatrick    friend bool operator==(const student_t_distribution& x,
144046035553Spatrick                           const student_t_distribution& y);
144146035553Spatrick    friend bool operator!=(const student_t_distribution& x,
144246035553Spatrick                           const student_t_distribution& y);
144346035553Spatrick
144446035553Spatrick    template <class charT, class traits>
144546035553Spatrick    friend
144646035553Spatrick    basic_ostream<charT, traits>&
144746035553Spatrick    operator<<(basic_ostream<charT, traits>& os,
144846035553Spatrick               const student_t_distribution& x);
144946035553Spatrick
145046035553Spatrick    template <class charT, class traits>
145146035553Spatrick    friend
145246035553Spatrick    basic_istream<charT, traits>&
145346035553Spatrick    operator>>(basic_istream<charT, traits>& is,
145446035553Spatrick               student_t_distribution& x);
145546035553Spatrick};
145646035553Spatrick
145746035553Spatricktemplate<class IntType = int>
145846035553Spatrickclass discrete_distribution
145946035553Spatrick{
146046035553Spatrickpublic:
146146035553Spatrick    // types
146246035553Spatrick    typedef IntType result_type;
146346035553Spatrick
146446035553Spatrick    class param_type
146546035553Spatrick    {
146646035553Spatrick    public:
146746035553Spatrick        typedef discrete_distribution distribution_type;
146846035553Spatrick
146946035553Spatrick        param_type();
147046035553Spatrick        template<class InputIterator>
147146035553Spatrick            param_type(InputIterator firstW, InputIterator lastW);
147246035553Spatrick        param_type(initializer_list<double> wl);
147346035553Spatrick        template<class UnaryOperation>
147446035553Spatrick            param_type(size_t nw, double xmin, double xmax, UnaryOperation fw);
147546035553Spatrick
147646035553Spatrick        vector<double> probabilities() const;
147746035553Spatrick
147846035553Spatrick        friend bool operator==(const param_type& x, const param_type& y);
147946035553Spatrick        friend bool operator!=(const param_type& x, const param_type& y);
148046035553Spatrick    };
148146035553Spatrick
148246035553Spatrick    // constructor and reset functions
148346035553Spatrick    discrete_distribution();
148446035553Spatrick    template<class InputIterator>
148546035553Spatrick        discrete_distribution(InputIterator firstW, InputIterator lastW);
148646035553Spatrick    discrete_distribution(initializer_list<double> wl);
148746035553Spatrick    template<class UnaryOperation>
148846035553Spatrick        discrete_distribution(size_t nw, double xmin, double xmax,
148946035553Spatrick                              UnaryOperation fw);
149046035553Spatrick    explicit discrete_distribution(const param_type& parm);
149146035553Spatrick    void reset();
149246035553Spatrick
149346035553Spatrick    // generating functions
149446035553Spatrick    template<class URNG> result_type operator()(URNG& g);
149546035553Spatrick    template<class URNG> result_type operator()(URNG& g, const param_type& parm);
149646035553Spatrick
149746035553Spatrick    // property functions
149846035553Spatrick    vector<double> probabilities() const;
149946035553Spatrick
150046035553Spatrick    param_type param() const;
150146035553Spatrick    void param(const param_type& parm);
150246035553Spatrick
150346035553Spatrick    result_type min() const;
150446035553Spatrick    result_type max() const;
150546035553Spatrick
150646035553Spatrick    friend bool operator==(const discrete_distribution& x,
150746035553Spatrick                           const discrete_distribution& y);
150846035553Spatrick    friend bool operator!=(const discrete_distribution& x,
150946035553Spatrick                           const discrete_distribution& y);
151046035553Spatrick
151146035553Spatrick    template <class charT, class traits>
151246035553Spatrick    friend
151346035553Spatrick    basic_ostream<charT, traits>&
151446035553Spatrick    operator<<(basic_ostream<charT, traits>& os,
151546035553Spatrick               const discrete_distribution& x);
151646035553Spatrick
151746035553Spatrick    template <class charT, class traits>
151846035553Spatrick    friend
151946035553Spatrick    basic_istream<charT, traits>&
152046035553Spatrick    operator>>(basic_istream<charT, traits>& is,
152146035553Spatrick               discrete_distribution& x);
152246035553Spatrick};
152346035553Spatrick
152446035553Spatricktemplate<class RealType = double>
152546035553Spatrickclass piecewise_constant_distribution
152646035553Spatrick{
152746035553Spatrick    // types
152846035553Spatrick    typedef RealType result_type;
152946035553Spatrick
153046035553Spatrick    class param_type
153146035553Spatrick    {
153246035553Spatrick    public:
153346035553Spatrick        typedef piecewise_constant_distribution distribution_type;
153446035553Spatrick
153546035553Spatrick        param_type();
153646035553Spatrick        template<class InputIteratorB, class InputIteratorW>
153746035553Spatrick            param_type(InputIteratorB firstB, InputIteratorB lastB,
153846035553Spatrick                       InputIteratorW firstW);
153946035553Spatrick        template<class UnaryOperation>
154046035553Spatrick            param_type(initializer_list<result_type> bl, UnaryOperation fw);
154146035553Spatrick        template<class UnaryOperation>
154246035553Spatrick            param_type(size_t nw, result_type xmin, result_type xmax,
154346035553Spatrick                       UnaryOperation fw);
154446035553Spatrick
154546035553Spatrick        vector<result_type> intervals() const;
154646035553Spatrick        vector<result_type> densities() const;
154746035553Spatrick
154846035553Spatrick        friend bool operator==(const param_type& x, const param_type& y);
154946035553Spatrick        friend bool operator!=(const param_type& x, const param_type& y);
155046035553Spatrick    };
155146035553Spatrick
155246035553Spatrick    // constructor and reset functions
155346035553Spatrick    piecewise_constant_distribution();
155446035553Spatrick    template<class InputIteratorB, class InputIteratorW>
155546035553Spatrick        piecewise_constant_distribution(InputIteratorB firstB,
155646035553Spatrick                                        InputIteratorB lastB,
155746035553Spatrick                                        InputIteratorW firstW);
155846035553Spatrick    template<class UnaryOperation>
155946035553Spatrick        piecewise_constant_distribution(initializer_list<result_type> bl,
156046035553Spatrick                                        UnaryOperation fw);
156146035553Spatrick    template<class UnaryOperation>
156246035553Spatrick        piecewise_constant_distribution(size_t nw, result_type xmin,
156346035553Spatrick                                        result_type xmax, UnaryOperation fw);
156446035553Spatrick    explicit piecewise_constant_distribution(const param_type& parm);
156546035553Spatrick    void reset();
156646035553Spatrick
156746035553Spatrick    // generating functions
156846035553Spatrick    template<class URNG> result_type operator()(URNG& g);
156946035553Spatrick    template<class URNG> result_type operator()(URNG& g, const param_type& parm);
157046035553Spatrick
157146035553Spatrick    // property functions
157246035553Spatrick    vector<result_type> intervals() const;
157346035553Spatrick    vector<result_type> densities() const;
157446035553Spatrick
157546035553Spatrick    param_type param() const;
157646035553Spatrick    void param(const param_type& parm);
157746035553Spatrick
157846035553Spatrick    result_type min() const;
157946035553Spatrick    result_type max() const;
158046035553Spatrick
158146035553Spatrick    friend bool operator==(const piecewise_constant_distribution& x,
158246035553Spatrick                           const piecewise_constant_distribution& y);
158346035553Spatrick    friend bool operator!=(const piecewise_constant_distribution& x,
158446035553Spatrick                           const piecewise_constant_distribution& y);
158546035553Spatrick
158646035553Spatrick    template <class charT, class traits>
158746035553Spatrick    friend
158846035553Spatrick    basic_ostream<charT, traits>&
158946035553Spatrick    operator<<(basic_ostream<charT, traits>& os,
159046035553Spatrick               const piecewise_constant_distribution& x);
159146035553Spatrick
159246035553Spatrick    template <class charT, class traits>
159346035553Spatrick    friend
159446035553Spatrick    basic_istream<charT, traits>&
159546035553Spatrick    operator>>(basic_istream<charT, traits>& is,
159646035553Spatrick               piecewise_constant_distribution& x);
159746035553Spatrick};
159846035553Spatrick
159946035553Spatricktemplate<class RealType = double>
160046035553Spatrickclass piecewise_linear_distribution
160146035553Spatrick{
160246035553Spatrick    // types
160346035553Spatrick    typedef RealType result_type;
160446035553Spatrick
160546035553Spatrick    class param_type
160646035553Spatrick    {
160746035553Spatrick    public:
160846035553Spatrick        typedef piecewise_linear_distribution distribution_type;
160946035553Spatrick
161046035553Spatrick        param_type();
161146035553Spatrick        template<class InputIteratorB, class InputIteratorW>
161246035553Spatrick            param_type(InputIteratorB firstB, InputIteratorB lastB,
161346035553Spatrick                       InputIteratorW firstW);
161446035553Spatrick        template<class UnaryOperation>
161546035553Spatrick            param_type(initializer_list<result_type> bl, UnaryOperation fw);
161646035553Spatrick        template<class UnaryOperation>
161746035553Spatrick            param_type(size_t nw, result_type xmin, result_type xmax,
161846035553Spatrick                       UnaryOperation fw);
161946035553Spatrick
162046035553Spatrick        vector<result_type> intervals() const;
162146035553Spatrick        vector<result_type> densities() const;
162246035553Spatrick
162346035553Spatrick        friend bool operator==(const param_type& x, const param_type& y);
162446035553Spatrick        friend bool operator!=(const param_type& x, const param_type& y);
162546035553Spatrick    };
162646035553Spatrick
162746035553Spatrick    // constructor and reset functions
162846035553Spatrick    piecewise_linear_distribution();
162946035553Spatrick    template<class InputIteratorB, class InputIteratorW>
163046035553Spatrick        piecewise_linear_distribution(InputIteratorB firstB,
163146035553Spatrick                                      InputIteratorB lastB,
163246035553Spatrick                                      InputIteratorW firstW);
163346035553Spatrick
163446035553Spatrick    template<class UnaryOperation>
163546035553Spatrick        piecewise_linear_distribution(initializer_list<result_type> bl,
163646035553Spatrick                                      UnaryOperation fw);
163746035553Spatrick
163846035553Spatrick    template<class UnaryOperation>
163946035553Spatrick        piecewise_linear_distribution(size_t nw, result_type xmin,
164046035553Spatrick                                      result_type xmax, UnaryOperation fw);
164146035553Spatrick
164246035553Spatrick    explicit piecewise_linear_distribution(const param_type& parm);
164346035553Spatrick    void reset();
164446035553Spatrick
164546035553Spatrick    // generating functions
164646035553Spatrick    template<class URNG> result_type operator()(URNG& g);
164746035553Spatrick    template<class URNG> result_type operator()(URNG& g, const param_type& parm);
164846035553Spatrick
164946035553Spatrick    // property functions
165046035553Spatrick    vector<result_type> intervals() const;
165146035553Spatrick    vector<result_type> densities() const;
165246035553Spatrick
165346035553Spatrick    param_type param() const;
165446035553Spatrick    void param(const param_type& parm);
165546035553Spatrick
165646035553Spatrick    result_type min() const;
165746035553Spatrick    result_type max() const;
165846035553Spatrick
165946035553Spatrick    friend bool operator==(const piecewise_linear_distribution& x,
166046035553Spatrick                           const piecewise_linear_distribution& y);
166146035553Spatrick    friend bool operator!=(const piecewise_linear_distribution& x,
166246035553Spatrick                           const piecewise_linear_distribution& y);
166346035553Spatrick
166446035553Spatrick    template <class charT, class traits>
166546035553Spatrick    friend
166646035553Spatrick    basic_ostream<charT, traits>&
166746035553Spatrick    operator<<(basic_ostream<charT, traits>& os,
166846035553Spatrick               const piecewise_linear_distribution& x);
166946035553Spatrick
167046035553Spatrick    template <class charT, class traits>
167146035553Spatrick    friend
167246035553Spatrick    basic_istream<charT, traits>&
167346035553Spatrick    operator>>(basic_istream<charT, traits>& is,
167446035553Spatrick               piecewise_linear_distribution& x);
167546035553Spatrick};
167646035553Spatrick
167746035553Spatrick} // std
167846035553Spatrick*/
167946035553Spatrick
1680*4bdff4beSrobert#include <__assert> // all public C++ headers provide the assertion handler
168146035553Spatrick#include <__config>
1682*4bdff4beSrobert#include <__random/bernoulli_distribution.h>
1683*4bdff4beSrobert#include <__random/binomial_distribution.h>
1684*4bdff4beSrobert#include <__random/cauchy_distribution.h>
1685*4bdff4beSrobert#include <__random/chi_squared_distribution.h>
1686*4bdff4beSrobert#include <__random/clamp_to_integral.h>
1687*4bdff4beSrobert#include <__random/default_random_engine.h>
1688*4bdff4beSrobert#include <__random/discard_block_engine.h>
1689*4bdff4beSrobert#include <__random/discrete_distribution.h>
1690*4bdff4beSrobert#include <__random/exponential_distribution.h>
1691*4bdff4beSrobert#include <__random/extreme_value_distribution.h>
1692*4bdff4beSrobert#include <__random/fisher_f_distribution.h>
1693*4bdff4beSrobert#include <__random/gamma_distribution.h>
1694*4bdff4beSrobert#include <__random/generate_canonical.h>
1695*4bdff4beSrobert#include <__random/geometric_distribution.h>
1696*4bdff4beSrobert#include <__random/independent_bits_engine.h>
1697*4bdff4beSrobert#include <__random/is_seed_sequence.h>
1698*4bdff4beSrobert#include <__random/is_valid.h>
1699*4bdff4beSrobert#include <__random/knuth_b.h>
1700*4bdff4beSrobert#include <__random/linear_congruential_engine.h>
1701*4bdff4beSrobert#include <__random/log2.h>
1702*4bdff4beSrobert#include <__random/lognormal_distribution.h>
1703*4bdff4beSrobert#include <__random/mersenne_twister_engine.h>
1704*4bdff4beSrobert#include <__random/negative_binomial_distribution.h>
1705*4bdff4beSrobert#include <__random/normal_distribution.h>
1706*4bdff4beSrobert#include <__random/piecewise_constant_distribution.h>
1707*4bdff4beSrobert#include <__random/piecewise_linear_distribution.h>
1708*4bdff4beSrobert#include <__random/poisson_distribution.h>
1709*4bdff4beSrobert#include <__random/random_device.h>
1710*4bdff4beSrobert#include <__random/ranlux.h>
1711*4bdff4beSrobert#include <__random/seed_seq.h>
1712*4bdff4beSrobert#include <__random/shuffle_order_engine.h>
1713*4bdff4beSrobert#include <__random/student_t_distribution.h>
1714*4bdff4beSrobert#include <__random/subtract_with_carry_engine.h>
171576d0caaeSpatrick#include <__random/uniform_int_distribution.h>
1716*4bdff4beSrobert#include <__random/uniform_random_bit_generator.h>
1717*4bdff4beSrobert#include <__random/uniform_real_distribution.h>
1718*4bdff4beSrobert#include <__random/weibull_distribution.h>
1719*4bdff4beSrobert#include <version>
1720*4bdff4beSrobert
1721*4bdff4beSrobert// standard-mandated includes
1722*4bdff4beSrobert
1723*4bdff4beSrobert// [rand.synopsis]
1724*4bdff4beSrobert#include <initializer_list>
1725*4bdff4beSrobert
1726*4bdff4beSrobert#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
1727*4bdff4beSrobert#  pragma GCC system_header
1728*4bdff4beSrobert#endif
1729*4bdff4beSrobert
1730*4bdff4beSrobert#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
173176d0caaeSpatrick#  include <algorithm>
1732*4bdff4beSrobert#  include <climits>
173376d0caaeSpatrick#  include <cmath>
173476d0caaeSpatrick#  include <concepts>
173546035553Spatrick#  include <cstddef>
173646035553Spatrick#  include <cstdint>
173776d0caaeSpatrick#  include <iosfwd>
173846035553Spatrick#  include <limits>
173946035553Spatrick#  include <numeric>
174046035553Spatrick#  include <string>
174176d0caaeSpatrick#  include <type_traits>
174276d0caaeSpatrick#  include <vector>
174346035553Spatrick#endif
174446035553Spatrick
174546035553Spatrick#endif // _LIBCPP_RANDOM
1746