当前头文件是数值库(Numeric library)中的 伪随机数生成 主题中的部分内容。

数值库(参考手册) ​数值库(标准)

  • 随机数引擎 

    linear_congruential_engine C++11 实现了线性同余算法
    mersenne_twister_engine C++11 实现了梅森旋转算法
    subtract_with_carry_engine C++11 实现了带进位减法算法

    随机数引擎适配器

    discard_block_engine C++11 忽略一个随机数引擎的部分输出
    independent_bits_engine C++11 使用一个随机数引擎产生指定位数的输出
    shuffle_order_engine C++11 将一个随机数引擎的输出打乱

    预定义的随机数生成器

    minstd_rand0 std::linear_congruential_engine<uint_fast32_t, 16807, 0, 2147483647>
    minstd_rand std::linear_congruential_engine<uint_fast32_t, 48271, 0, 2147483647>
    mt19937 std::mersenne_twister_engine<uint_fast32_t, 32, 624, 397, 31, 
                                 0x9908b0df, 11, 
                                 0xffffffff, 7, 
                                 0x9d2c5680, 15, 
                                 0xefc60000, 18, 1812433253>
    mt19937_64 std::mersenne_twister_engine<uint_fast64_t, 64, 312, 156, 31,
                                 0xb5026f5aa96619e9, 29,
                                 0x5555555555555555, 17,
                                 0x71d67fffeda60000, 37,
                                 0xfff7eee000000000, 43, 6364136223846793005>
    ranlux24_base std::subtract_with_carry_engine<uint_fast32_t, 24, 10, 24>
    ranlux48_base std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>
    ranlux24 std::discard_block_engine<ranlux24_base, 223, 23>
    ranlux48 std::discard_block_engine<ranlux48_base, 389, 11>
    knuth_b std::shuffle_order_engine<minstd_rand0, 256>
    default_random_engine 由编译器定义

    非确定随机数

    random_device 使用硬件信源熵(Entropy source)的非确定随机数生成器

    随机数分布 

    均匀分布(Uniform distribution)

    uniform_int_distribution C++11 整数型离散型均匀分布
    uniform_real_distribution C++11 浮点数型离散型均匀分布

    伯努利分布(Bernoulli distribution)

    bernoulli_distribution C++11 伯努利分布(Bernoulli distribution),产生随机 bool 值
    binomial_distribution C++11 二项式分布(Binomial distribution),产生随机非负整数(Non-negative)
    negative_binomial_distribution C++11 负二项分布(Negative binomial distribution),产生随机非负整数
    geometric_distribution C++11 几何分布(Geometric distribution),产生随机非负整数

    泊松分布(Poisson distribution)

    poisson_distribution C++11 泊松分布(Poisson distribution),产生随机非负整数
    exponential_distribution C++11 指数分布(Exponential distribution),产生随机非负浮点娄
    gamma_distribution C++11 伽马分布(Gamma distribution)
    weibull_distribution C++11 韦伯分布(Weibull distribution)
    extreme_value_distribution C++11 极值分布(Extreme value distribution)

    正态分布(Normal distribution)

    normal_distribution C++11 正态(高斯)分布(Normal(Gaussian)distribution)
    lognormal_distribution C++11 对数正态分布(Lognormal distribution)
    chi_squared_distribution C++11 卡方分布(Chi-squared distribution)
    cauchy_distribution C++11 柯西分布(Cauchy distribution)
    fisher_f_distribution C++11 f 分布(Fisher's F-distribution)
    student_t_distribution C++11 t 分布 (Student's t-distribution)

    抽本分布(Sampling distribution)

    discrete_distribution C++11 离散分布(Discrete distribution)
    piecewise_constant_distribution C++11 分段常数分布
    piecewise_linear_distribution C++11 分段线性分布

    工具

    seed_seq 种子序列
  • generate_canonical C++11 产生一个在 [0,1) 范围内的浮点数
  • #include <initializer_list>
    namespace std {
        // class template linear_congruential_engine
        template<class UIntType, UIntType a, UIntType c, UIntType m>
            class linear_congruential_engine;
     
        // class template mersenne_twister_engine
        template<class UIntType, size_t w, size_t n, size_t m, size_t r,
                 UIntType a, size_t u, UintType d, size_t s,
                 UIntType b, size_t t,
                 UIntType c, size_t l, UintType f>
         class mersenne_twister_engine;
     
        // class template subtract_with_carry_engine
        template<class UIntType, size_t w, size_t s, size_t r>
            class subtract_with_carry_engine;
     
        // class template discard_block_engine
        template<class Engine, size_t p, size_t r>
            class discard_block_engine;
     
        // class template independent_bits_engine
        template<class Engine, size_t w, class UIntType>
            class independent_bits_engine;
     
        // class template shuffle_order_engine
        template<class Engine, size_t k>
            class shuffle_order_engine;
     
        // engines and engine adaptors with predefined parameters
        typedef linear_congruential_engine<uint_fast32_t, 16807, 0, 2147483647>
            minstd_rand0;
        typedef  linear_congruential_engine<uint_fast32_t, 48271, 0, 2147483647>
            minstd_rand;
        typedef  mersenne_twister_engine<uint_fast32_t,
                32,624,397,31,0x9908b0df,11,0xffffffff,7,0x9d2c5680,15,
                0xefc60000,18,1812433253>
            mt19937;
        typedef mersenne_twister_engine<uint_fast64_t,
                    64,312,156,31,0xb5026f5aa96619e9,29,
                    0x5555555555555555,17,
                    0x71d67fffeda60000,37,
                    0xfff7eee000000000,43,
                    6364136223846793005>
            mt19937_64;
        typedef subtract_with_carry_engine<uint_fast32_t, 24, 10, 24>
            ranlux24_base;
        typedef subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>
            ranlux48_base;
        typedef  discard_block_engine<ranlux24_base, 223, 23>
            ranlux24;
        typedef discard_block_engine<ranlux48_base, 389, 11>
            ranlux48;
        typedef  shuffle_order_engine<minstd_rand0,256>
            knuth_b;
        typedef /*implementation-defined*/ default_random_engine;
     
        // class random_device
        class random_device;
     
        // class seed_seq
        class seed_seq;
     
        // function template generate_canonical
        template<class RealType, size_t bits, class URNG>
            RealType generate_canonical(URNG& g);
     
        // class template uniform_int_distribution
        template<class IntType = int>
            class uniform_int_distribution;
     
        // class template uniform_real_distribution
        template<class RealType = double>
            class uniform_real_distribution;
     
        // class bernoulli_distribution
        class bernoulli_distribution;
     
        // class template binomial_distribution
        template<class IntType = int>
            class binomial_distribution;
     
        // class template geometric_distribution
        template<class IntType = int>
            class geometric_distribution;
     
        // class template negative_binomial_distribution
        template<class IntType = int>
            class negative_binomial_distribution;
     
        // class template poisson_distribution
        template<class IntType = int>
            class poisson_distribution;
     
        // class template exponential_distribution
        template<class RealType = double>
            class exponential_distribution;
     
        // class template gamma_distribution
        template<class RealType = double>
            class gamma_distribution;
     
        // class template weibull_distribution
        template<class RealType = double>
            class weibull_distribution;
     
        // class template extreme_value_distribution
        template<class RealType = double>
            class extreme_value_distribution;
     
        // class template normal_distribution
        template<class RealType = double>
        class normal_distribution;
     
        // class template lognormal_distribution
        template<class RealType = double>
            class lognormal_distribution;
     
        // class template chi_squared_distribution
        template<class RealType = double>
            class chi_squared_distribution;
     
        // class template cauchy_distribution
        template<class RealType = double>
            class cauchy_distribution;
     
        // class template fisher_f_distribution
        template<class RealType = double>
            class fisher_f_distribution;
     
        // class template student_t_distribution
        template<class RealType = double>
            class student_t_distribution;
     
        // class template discrete_distribution
        template<class IntType = int>
            class discrete_distribution;
     
        // class template piecewise_constant_distribution
        template<class RealType = double>
            class piecewise_constant_distribution;
     
        // class template piecewise_linear_distribution
        template<class RealType = double>
            class piecewise_linear_distribution;
    } // namespace std
  • std::linear_congruential_engine 类模板

    template<class UIntType, UIntType a, UIntType c, UIntType m>
    class linear_congruential_engine
    {
    public:
        // types
        typedef UIntType result_type;
     
        // engine characteristics
        static constexpr result_type multiplier = a;
        static constexpr result_type increment = c;
        static constexpr result_type modulus = m;
        static constexpr result_type min() { return c == 0u ? 1u: 0u };
        static constexpr result_type max() { return m - 1u };
        static constexpr result_type default_seed = 1u;
     
        // constructors and seeding functions
        explicit linear_congruential_engine(result_type s = default_seed);
        template<class Sseq> explicit linear_congruential_engine(Sseq& q);
            void seed(result_type s = default_seed);
        template<class Sseq> void seed(Sseq& q);
     
        // generating functions
        result_type operator()();
        void discard(unsigned long long z);
    };

    std::mersenne_twister_engine 类模板

    template<class UIntType, size_t w, size_t n, size_t m, size_t r,
            UIntType a, size_t u, UIntType d, size_t s,
            UIntType b, size_t t,
            UIntType c, size_t l, UIntType f>
    class mersenne_twister_engine
    {
    public:
        // types
        typedef UIntType result_type;
     
        // engine characteristics
        static constexpr size_t word_size = w;
        static constexpr size_t state_size = n;
        static constexpr size_t shift_size = m;
        static constexpr size_t mask_bits = r;
        static constexpr UIntType xor_mask = a;
        static constexpr size_t tempering_u = u;
        static constexpr UIntType tempering_d = d;
        static constexpr size_t tempering_s = s;
        static constexpr UIntType tempering_b = b;
        static constexpr size_t tempering_t = t;
        static constexpr UIntType tempering_c = c;
        static constexpr size_t tempering_l = l;
        static constexpr UIntType initialization_multiplier = f;
        static constexpr result_type min () { return 0; }
        static constexpr result_type max() { return 2w − 1; }
        static constexpr result_type default_seed = 5489u;
     
        // constructors and seeding functions
        explicit mersenne_twister_engine(result_type value = default_seed);
        template<class Sseq> explicit mersenne_twister_engine(Sseq& q);
            void seed(result_type value = default_seed);
        template<class Sseq> void seed(Sseq& q);
     
        // generating functions
        result_type operator()();
        void discard(unsigned long long z);
    };

    std::subtract_with_carry_engine 类模板

    template<class UIntType, size_t w, size_t s, size_t r>
    class subtract_with_carry_engine
    {
    public:
        // types
        typedef UIntType result_type;
     
        // engine characteristics
        static constexpr size_t word_size = w;
        static constexpr size_t short_lag = s;
        static constexpr size_t long_lag = r;
        static constexpr result_type min() { return 0; }
        static constexpr result_type max() { return m − 1; }
        static constexpr result_type default_seed = 19780503u;
     
        // constructors and seeding functions
        explicit subtract_with_carry_engine(result_type value = default_seed);
        template<class Sseq> explicit subtract_with_carry_engine(Sseq& q);
            void seed(result_type value = default_seed);
        template<class Sseq> void seed(Sseq& q);
     
        // generating functions
        result_type operator()();
        void discard(unsigned long long z);
    };

    std::discard_block_engine 类模板

    template<class Engine, size_t p, size_t r>
    class discard_block_engine
    {
    public:
        // types
        typedef typename Engine::result_type result_type;
     
        // engine characteristics
        static constexpr size_t block_size = p;
        static constexpr size_t used_block = r;
        static constexpr result_type min() { return Engine::min(); }
        static constexpr result_type max() { return Engine::max(); }
     
        // constructors and seeding functions
        discard_block_engine();
        explicit discard_block_engine(const Engine& e);
        explicit discard_block_engine(Engine&& e);
        explicit discard_block_engine(result_type s);
        template<class Sseq> explicit discard_block_engine(Sseq& q);
        void seed();
        void seed(result_type s);
        template<class Sseq> void seed(Sseq& q);
     
        // generating functions
        result_type operator()();
        void discard(unsigned long long z);
     
        // property functions
        const Engine& base() const noexcept { return e; };
    private:
        Engine e; // exposition only
        int n; // exposition only
    };

    std::independent_bits_engine 类模板

    template<class Engine, size_t w, class UIntType>
    class independent_bits_engine
    {
    public:
        // types
        typedef UIntType result_type;
     
        // engine characteristics
        static constexpr result_type min() { return 0; }
        static constexpr result_type max() { return 2w - 1; }
     
        // constructors and seeding functions
        independent_bits_engine();
        explicit independent_bits_engine(const Engine& e);
        explicit independent_bits_engine(Engine&& e);
        explicit independent_bits_engine(result_type s);
        template<class Sseq> explicit independent_bits_engine(Sseq& q);
        void seed();
        void seed(result_type s);
        template<class Sseq> void seed(Sseq& q);
     
        // generating functions
        result_type operator()();
        void discard(unsigned long long z);
     
        // property functions
        const Engine& base() const noexcept { return e; };
     
    private:
        Engine e; // exposition only
    };

    std::shuffle_order_engine 类模板

    template<class Engine, size_t k>
    class shuffle_order_engine
    {
    public:
        // types
        typedef typename Engine::result_type result_type;
     
        // engine characteristics
        static constexpr size_t table_size = k;
        static constexpr result_type min() { return Engine::min(); }
        static constexpr result_type max() { return Engine::max(); }
     
        // constructors and seeding functions
        shuffle_order_engine();
        explicit shuffle_order_engine(const Engine& e);
        explicit shuffle_order_engine(Engine&& e);
        explicit shuffle_order_engine(result_type s);
        template<class Sseq> explicit shuffle_order_engine(Sseq& q);
        void seed();
        void seed(result_type s);
        template<class Sseq> void seed(Sseq& q);
     
        // generating functions
        result_type operator()();
        void discard(unsigned long long z);
     
        // property functions
        const Engine& base() const noexcept { return e; };
     
    private:
        Engine e;           // exposition only
        result_type Y;      // exposition only
        result_type V[k];   // exposition only
    };

    std::random_device 类

    class random_device
    {
    public:
        // types
        typedef unsigned int result_type;
     
        // generator characteristics
        static constexpr result_type min() { return numeric_limits<result_type>::min(); }
        static constexpr result_type max() { return numeric_limits<result_type>::max(); }
     
        // constructors
        explicit random_device(const string& token = implementation-defined);
     
        // generating functions
        result_type operator()();
     
        // property functions
        double entropy() const noexcept;
     
        // no copy functions
        random_device(const random_device& ) = delete;
        void operator=(const random_device& ) = delete;
    };

    std::seed_seq 类

    class seed_seq
    {
    public:
        // types
        typedef uint_least32_t result_type;
     
        // constructors
        seed_seq();
        template<class T>
        seed_seq(initializer_list<T> il);
        template<class InputIterator>
        seed_seq(InputIterator begin, InputIterator end);
     
        // generating functions
        template<class RandomAccessIterator>
        void generate(RandomAccessIterator begin, RandomAccessIterator end);
     
        // property functions
        size_t size() const;
        template<class OutputIterator>
        void param(OutputIterator dest) const;
     
        // no copy functions
        seed_seq(const seed_seq& ) = delete;
        void operator=(const seed_seq& ) = delete;
     
    private:
        vector<result_type> v; // exposition only
    };

    std::uniform_int_distribution 类模板

    template<class IntType = int>
    class uniform_int_distribution
    {
    public:
        // types
        typedef IntType result_type;
        typedef /*unspecified*/ param_type;
     
        // constructors and reset functions
        explicit uniform_int_distribution(IntType a = 0, IntType b = numeric_limits<IntType>::max());
        explicit uniform_int_distribution(const param_type& parm);
        void reset();
     
        // generating functions
        template<class URNG>
        result_type operator()(URNG& g);
        template<class URNG>
        result_type operator()(URNG& g, const param_type& parm);
     
        // property functions
        result_type a() const;
        result_type b() const;
        param_type param() const;
        void param(const param_type& parm);
        result_type min() const;
        result_type max() const;
    };

    std::bernoulli_distribution 类

    class bernoulli_distribution
    {
    public:
        // types
        typedef bool result_type;
        typedef /*unspecified*/ param_type;
     
        // constructors and reset functions
        explicit bernoulli_distribution(double p = 0.5);
        explicit bernoulli_distribution(const param_type& parm);
        void reset();
     
        // generating functions
        template<class URNG>
        result_type operator()(URNG& g);
        template<class URNG>
        result_type operator()(URNG& g, const param_type& parm);
     
        // property functions
        double p() const;
        param_type param() const;
        void param(const param_type& parm);
        result_type min() const;
        result_type max() const;
    };

    std::binomial_distribution 类模板

    template<class IntType = int>
    class binomial_distribution
    {
    public:
        // types
        typedef IntType result_type;
        typedef /*unspecified*/ param_type;
     
        // constructors and reset functions
        explicit binomial_distribution(IntType t = 1, double p = 0.5);
        explicit binomial_distribution(const param_type& parm);
        void reset();
     
        // generating functions
        template<class URNG>
        result_type operator()(URNG& g);
        template<class URNG>
        result_type operator()(URNG& g, const param_type& parm);
     
        // property functions
        IntType t() const;
        double p() const;
        param_type param() const;
        void param(const param_type& parm);
        result_type min() const;
        result_type max() const;
    };

    std::geometric_distribution 类模板

    template<class IntType = int>
    class geometric_distribution
    {
    public:
        // types
        typedef IntType result_type;
        typedef /*unspecified*/ param_type;
     
        // constructors and reset functions
        explicit geometric_distribution(double p = 0.5);
        explicit geometric_distribution(const param_type& parm);
        void reset();
     
        // generating functions
        template<class URNG>
        result_type operator()(URNG& g);
        template<class URNG>
        result_type operator()(URNG& g, const param_type& parm);
     
        // property functions
        double p() const;
        param_type param() const;
        void param(const param_type& parm);
        result_type min() const;
        result_type max() const;
    };

    std::negative_binomial_distribution 类模板

    template<class IntType = int>
    class negative_binomial_distribution
    {
    public:
        // types
        typedef IntType result_type;
        typedef /*unspecified*/ param_type;
        // constructor and reset functions
        explicit negative_binomial_distribution(IntType k = 1, double p = 0.5);
        explicit negative_binomial_distribution(const param_type& parm);
        void reset();
        // generating functions
        template<class URNG>
        result_type operator()(URNG& g);
        template<class URNG>
        result_type operator()(URNG& g, const param_type& parm);
        // property functions
        IntType k() const;
        double p() const;
        param_type param() const;
        void param(const param_type& parm);
        result_type min() const;
        result_type max() const;
    };

    std::poisson_distribution 类模板

    template<class IntType = int>
    class poisson_distribution
    {
    public:
     
        // types
        typedef IntType result_type;
        typedef /*unspecified*/ param_type;
     
        // constructors and reset functions
        explicit poisson_distribution(double mean = 1.0);
        explicit poisson_distribution(const param_type& parm);
        void reset();
     
        // generating functions
        template<class URNG>
        result_type operator()(URNG& g);
        template<class URNG>
        result_type operator()(URNG& g, const param_type& parm);
     
        // property functions
        double mean() const;
        param_type param() const;
        void param(const param_type& parm);
        result_type min() const;
        result_type max() const;
    };

    exponential_distribution 类模板

    template<class RealType = double>
    class exponential_distribution
    {
    public:
     
        // types
        typedef RealType result_type;
        typedef /*unspecified*/ param_type;
     
        // constructors and reset functions
        explicit exponential_distribution(RealType lambda = 1.0);
        explicit exponential_distribution(const param_type& parm);
        void reset();
     
        // generating functions
        template<class URNG>
        result_type operator()(URNG& g);
        template<class URNG>
        result_type operator()(URNG& g, const param_type& parm);
     
        // property functions
        RealType lambda() const;
        param_type param() const;
        void param(const param_type& parm);
        result_type min() const;
        result_type max() const;
    };

    std::gamma_distribution 类模板

    template<class RealType = double>
    class gamma_distribution
    {
    public:
     
        // types
        typedef RealType result_type;
        typedef /*unspecified*/ param_type;
     
        // constructors and reset functions
        explicit gamma_distribution(RealType alpha = 1.0, RealType beta = 1.0);
        explicit gamma_distribution(const param_type& parm);
        void reset();
     
        // generating functions
        template<class URNG>
        result_type operator()(URNG& g);
        template<class URNG>
        result_type operator()(URNG& g, const param_type& parm);
     
        // property functions
        RealType alpha() const;
        RealType beta() const;
        param_type param() const;
        void param(const param_type& parm);
        result_type min() const;
        result_type max() const;
    };

    std::weibull_distribution 类模板

    template<class RealType = double>
    class weibull_distribution
    {
    public:
     
        // types
        typedef RealType result_type;
        typedef /*unspecified*/ param_type;
     
        // constructor and reset functions
        explicit weibull_distribution(RealType a = 1.0, RealType b = 1.0)
        explicit weibull_distribution(const param_type& parm);
        void reset();
     
        // generating functions
        template<class URNG>
        result_type operator()(URNG& g);
        template<class URNG>
        result_type operator()(URNG& g, const param_type& parm);
     
        // property functions
        RealType a() const;
        RealType b() const;
        param_type param() const;
        void param(const param_type& parm);
        result_type min() const;
        result_type max() const;
    };

    std::extreme_value_distribution 类模板

    template<class RealType = double>
    class extreme_value_distribution
    {
    public:
     
        // types
        typedef RealType result_type;
        typedef /*unspecified*/ param_type;
     
        // constructor and reset functions
        explicit extreme_value_distribution(RealType a = 0.0, RealType b = 1.0);
        explicit extreme_value_distribution(const param_type& parm);
        void reset();
     
        // generating functions
        template<class URNG>
        result_type operator()(URNG& g);
        template<class URNG>
        result_type operator()(URNG& g, const param_type& parm);
     
        // property functions
        RealType a() const;
        RealType b() const;
        param_type param() const;
        void param(const param_type& parm);
        result_type min() const;
        result_type max() const;
    };

    std::normal_distribution 类模板

    template<class RealType = double>
    class normal_distribution
    {
    public:
     
        // types
        typedef RealType result_type;
        typedef /*unspecified*/ param_type;
     
        // constructors and reset functions
        explicit normal_distribution(RealType mean = 0.0, RealType stddev = 1.0);
        explicit normal_distribution(const param_type& parm);
        void reset();
     
        // generating functions
        template<class URNG>
        result_type operator()(URNG& g);
        template<class URNG>
        result_type operator()(URNG& g, const param_type& parm);
     
        // property functions
        RealType mean() const;
        RealType stddev() const;
        param_type param() const;
        void param(const param_type& parm);
        result_type min() const;
        result_type max() const;
    };

    std::lognormal_distribution 类模板

    template<class RealType = double>
    class lognormal_distribution
    {
    public:
     
        // types
        typedef RealType result_type;
        typedef /*unspecified*/ param_type;
     
        // constructor and reset functions
        explicit lognormal_distribution(RealType m = 0.0, RealType s = 1.0);
        explicit lognormal_distribution(const param_type& parm);
        void reset();
     
        // generating functions
        template<class URNG>
        result_type operator()(URNG& g);
        template<class URNG>
        result_type operator()(URNG& g, const param_type& parm);
     
        // property functions
        RealType m() const;
        RealType s() const;
        param_type param() const;
        void param(const param_type& parm);
        result_type min() const;
        result_type max() const;
    };

    std::chi_squared_distribution 类模板

    template<class RealType = double>
    class chi_squared_distribution
    {
    public:
     
        // types
        typedef RealType result_type;
        typedef /*unspecified*/ param_type;
     
        // constructor and reset functions
        explicit chi_squared_distribution(RealType n = 1);
        explicit chi_squared_distribution(const param_type& parm);
        void reset();
     
        // generating functions
        template<class URNG>
        result_type operator()(URNG& g);
        template<class URNG>
        result_type operator()(URNG& g, const param_type& parm);
     
        // property functions
        RealType n() const;
        param_type param() const;
        void param(const param_type& parm);
        result_type min() const;
        result_type max() const;
    };

    std::cauchy_distribution 类模板

    template<class RealType = double>
    class cauchy_distribution
    {
    public:
     
        // types
        typedef RealType result_type;
        typedef /*unspecified*/ param_type;
     
        // constructor and reset functions
        explicit cauchy_distribution(RealType a = 0.0, RealType b = 1.0);
        explicit cauchy_distribution(const param_type& parm);
        void reset();
     
        // generating functions
        template<class URNG>
        result_type operator()(URNG& g);
        template<class URNG>
        result_type operator()(URNG& g, const param_type& parm);
     
        // property functions
        RealType a() const;
        RealType b() const;
        param_type param() const;
        void param(const param_type& parm);
        result_type min() const;
        result_type max() const;
    };

    std::fisher_f_distribution 类模板

    template<class RealType = double>
    class fisher_f_distribution
    {
    public:
     
        // types
        typedef RealType result_type;
        typedef /*unspecified*/ param_type;
     
        // constructor and reset functions
        explicit fisher_f_distribution(RealType m = 1, RealType n = 1);
        explicit fisher_f_distribution(const param_type& parm);
        void reset();
     
        // generating functions
        template<class URNG>
        result_type operator()(URNG& g);
        template<class URNG>
        result_type operator()(URNG& g, const param_type& parm);
     
        // property functions
        RealType m() const;
        RealType n() const;
        param_type param() const;
        void param(const param_type& parm);
        result_type min() const;
        result_type max() const;
    };

    std::student_t_distribution 类模板

    template<class RealType = double>
    class student_t_distribution
    {
        public:
     
        // types
        typedef RealType result_type;
        typedef /*unspecified*/ param_type;
     
        // constructor and reset functions
        explicit student_t_distribution(RealType n = 1);
        explicit student_t_distribution(const param_type& parm);
        void reset();
     
        // generating functions
        template<class URNG>
        result_type operator()(URNG& g);
        template<class URNG>
        result_type operator()(URNG& g, const param_type& parm);
     
        // property functions
        RealType n() const;
        param_type param() const;
        void param(const param_type& parm);
        result_type min() const;
        result_type max() const;
    };

    std::discrete_distribution 类模板

    template<class IntType = int>
    class discrete_distribution
    {
    public:
     
        // types
        typedef IntType result_type;
        typedef /*unspecified*/ param_type;
     
        // constructor and reset functions
        discrete_distribution();
        template<class InputIterator>
        discrete_distribution(InputIterator firstW, InputIterator lastW);
        discrete_distribution(initializer_list<double> wl);
        template<class UnaryOperation>
        discrete_distribution(size_t nw, double xmin, double xmax, UnaryOperation fw);
        explicit discrete_distribution(const param_type& parm);
        void reset();
     
        // generating functions
        template<class URNG>
        result_type operator()(URNG& g);
        template<class URNG>
        result_type operator()(URNG& g, const param_type& parm);
     
        // property functions
        vector<double> probabilities() const;
        param_type param() const;
        void param(const param_type& parm);
        result_type min() const;
        result_type max() const;
    };

    std::piecewise_constant_distribution 类模板

    template<class RealType = double>
    class piecewise_constant_distribution
    {
    public:
     
        // types
        typedef RealType result_type;
        typedef /*unspecified*/ param_type;
     
        // constructor and reset functions
        piecewise_constant_distribution();
        template<class InputIteratorB, class InputIteratorW>
        piecewise_constant_distribution(InputIteratorB firstB, InputIteratorB lastB,
        InputIteratorW firstW);
        template<class UnaryOperation>
        piecewise_constant_distribution(initializer_list<RealType> bl, UnaryOperation fw);
        template<class UnaryOperation>
        piecewise_constant_distribution(size_t nw, RealType xmin, RealType xmax, UnaryOperation fw);
        explicit piecewise_constant_distribution(const param_type& parm);
        void reset();
     
        // generating functions
        template<class URNG>
        result_type operator()(URNG& g);
        template<class URNG>
        result_type operator()(URNG& g, const param_type& parm);
     
        // property functions
        vector<result_type> intervals() const;
        vector<result_type> densities() const;
        param_type param() const;
        void param(const param_type& parm);
        result_type min() const;
        result_type max() const;
    };

    std::piecewise_linear_distribution 类模板

    template<class RealType = double>
    class piecewise_linear_distribution
    {
    public:
     
        // types
        typedef RealType result_type;
        typedef /*unspecified*/ param_type;
     
        // constructor and reset functions
        piecewise_linear_distribution();
        template<class InputIteratorB, class InputIteratorW>
        piecewise_linear_distribution(InputIteratorB firstB, InputIteratorB lastB,
        InputIteratorW firstW);
        template<class UnaryOperation>
        piecewise_linear_distribution(initializer_list<RealType> bl, UnaryOperation fw);
        template<class UnaryOperation>
        piecewise_linear_distribution(size_t nw, RealType xmin, RealType xmax, UnaryOperation fw);
        explicit piecewise_linear_distribution(const param_type& parm);
        void reset();
     
        // generating functions
        template<class URNG>
        result_type operator()(URNG& g);
        template<class URNG>
        result_type operator()(URNG& g, const param_type& parm);
     
        // property functions
        vector<result_type> intervals() const;
        vector<result_type> densities() const;
        param_type param() const;
        void param(const param_type& parm);
        result_type min() const;
        result_type max() const;
    };