Compartilhar via


normal_distribution Class

Generates a normal distribution.

template<class RealType = double>
    class normal_distribution {
public:
    typedef T1 input_type;
    typedef RealType result_type;
    struct param_type;
    explicit normal_distribution(result_type mean0 = result_type(0.0),
        result_type sigma0 = result_type(1.0));
    explicit normal_distribution(const param_type& par0);
    result_type mean() const;
    result_type sigma() const;
    result_type stddev() const;
    param_type param() const;
    void param(const param_type& par0);
    result_type min() const;
    result_type max() const;
    void reset();
    template<class Engine>
        result_type operator()(Engine& eng);
    template<class Engine>
        result_type operator()(Engine& eng,
            const param_type& par0);
private:
    result_type stored_mean;     // exposition only
    result_type stored_sigma;    // exposition only
    };

Parameters

  • RealType
    The floating-point distribution value type.

Remarks

The template class describes a distribution that produces values of a user-specified floating-point type with a normal distribution.

Requirements

Header: <random>

Namespace: std

See Also

Reference

<random>

normal_distribution::mean

normal_distribution::normal_distribution

normal_distribution::operator()

normal_distribution::sigma

normal_distribution::param

normal_distribution::param_type

Other Resources

<random> Members