[rand.dist.norm] (original) (raw)
29 Numerics library [numerics]
29.5 Random number generation [rand]
29.5.9 Random number distribution class templates [rand.dist]
29.5.9.5 Normal distributions [rand.dist.norm]
29.5.9.5.1 Class template normal_distribution [rand.dist.norm.normal]
A normal_distribution random number distribution produces random numbers xdistributed according to the probability density function in Formula 29.13.
The distribution parameters μ and σare also known as this distribution's meanand standard deviation.
namespace std { template<class RealType = double> class normal_distribution { public: using result_type = RealType;using param_type = unspecified; normal_distribution() : normal_distribution(0.0) {} explicit normal_distribution(RealType mean, RealType stddev = 1.0);explicit normal_distribution(const param_type& parm);void reset();friend bool operator==(const normal_distribution& x, const normal_distribution& y);template<class URBG> result_type operator()(URBG& g);template<class URBG> result_type operator()(URBG& g, const param_type& parm); RealType mean() const; RealType stddev() const; param_type param() const;void param(const param_type& parm); result_type min() const; result_type max() const;template<class charT, class traits> friend basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& os, const normal_distribution& x);template<class charT, class traits> friend basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>& is, normal_distribution& x);};}
explicit normal_distribution(RealType mean, RealType stddev = 1.0);
Remarks: mean and stddevcorrespond to the respective parameters of the distribution.
Returns: The value of the mean parameter with which the object was constructed.
Returns: The value of the stddev parameter with which the object was constructed.
29.5.9.5.2 Class template lognormal_distribution [rand.dist.norm.lognormal]
A lognormal_distribution random number distribution produces random numbers distributed according to the probability density function in Formula 29.14.
namespace std { template<class RealType = double> class lognormal_distribution { public: using result_type = RealType;using param_type = unspecified; lognormal_distribution() : lognormal_distribution(0.0) {} explicit lognormal_distribution(RealType m, RealType s = 1.0);explicit lognormal_distribution(const param_type& parm);void reset();friend bool operator==(const lognormal_distribution& x, const lognormal_distribution& y);template<class URBG> result_type operator()(URBG& g);template<class URBG> result_type operator()(URBG& g, const param_type& parm); RealType m() const; RealType s() const; param_type param() const;void param(const param_type& parm); result_type min() const; result_type max() const;template<class charT, class traits> friend basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& os, const lognormal_distribution& x);template<class charT, class traits> friend basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>& is, lognormal_distribution& x);};}
explicit lognormal_distribution(RealType m, RealType s = 1.0);
Remarks: m and scorrespond to the respective parameters of the distribution.
Returns: The value of the m parameter with which the object was constructed.
Returns: The value of the s parameter with which the object was constructed.
29.5.9.5.3 Class template chi_squared_distribution [rand.dist.norm.chisq]
A chi_squared_distribution random number distribution produces random numbers distributed according to the probability density function in Formula 29.15.
namespace std { template<class RealType = double> class chi_squared_distribution { public: using result_type = RealType;using param_type = unspecified; chi_squared_distribution() : chi_squared_distribution(1.0) {} explicit chi_squared_distribution(RealType n);explicit chi_squared_distribution(const param_type& parm);void reset();friend bool operator==(const chi_squared_distribution& x, const chi_squared_distribution& y);template<class URBG> result_type operator()(URBG& g);template<class URBG> result_type operator()(URBG& g, const param_type& parm); RealType n() const; param_type param() const;void param(const param_type& parm); result_type min() const; result_type max() const;template<class charT, class traits> friend basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& os, const chi_squared_distribution& x);template<class charT, class traits> friend basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>& is, chi_squared_distribution& x);};}
explicit chi_squared_distribution(RealType n);
Remarks: n corresponds to the parameter of the distribution.
Returns: The value of the n parameter with which the object was constructed.
29.5.9.5.4 Class template cauchy_distribution [rand.dist.norm.cauchy]
A cauchy_distribution random number distribution produces random numbers xdistributed according to the probability density function in Formula 29.16.
namespace std { template<class RealType = double> class cauchy_distribution { public: using result_type = RealType;using param_type = unspecified; cauchy_distribution() : cauchy_distribution(0.0) {} explicit cauchy_distribution(RealType a, RealType b = 1.0);explicit cauchy_distribution(const param_type& parm);void reset();friend bool operator==(const cauchy_distribution& x, const cauchy_distribution& y);template<class URBG> result_type operator()(URBG& g);template<class URBG> result_type operator()(URBG& g, const param_type& parm); RealType a() const; RealType b() const; param_type param() const;void param(const param_type& parm); result_type min() const; result_type max() const;template<class charT, class traits> friend basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& os, const cauchy_distribution& x);template<class charT, class traits> friend basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>& is, cauchy_distribution& x);};}
explicit cauchy_distribution(RealType a, RealType b = 1.0);
Remarks: a and bcorrespond to the respective parameters of the distribution.
Returns: The value of the a parameter with which the object was constructed.
Returns: The value of the b parameter with which the object was constructed.
29.5.9.5.5 Class template fisher_f_distribution [rand.dist.norm.f]
A fisher_f_distribution random number distribution produces random numbers x ≥ 0distributed according to the probability density function in Formula 29.17.
namespace std { template<class RealType = double> class fisher_f_distribution { public: using result_type = RealType;using param_type = unspecified; fisher_f_distribution() : fisher_f_distribution(1.0) {} explicit fisher_f_distribution(RealType m, RealType n = 1.0);explicit fisher_f_distribution(const param_type& parm);void reset();friend bool operator==(const fisher_f_distribution& x, const fisher_f_distribution& y);template<class URBG> result_type operator()(URBG& g);template<class URBG> result_type operator()(URBG& g, const param_type& parm); RealType m() const; RealType n() const; param_type param() const;void param(const param_type& parm); result_type min() const; result_type max() const;template<class charT, class traits> friend basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& os, const fisher_f_distribution& x);template<class charT, class traits> friend basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>& is, fisher_f_distribution& x);};}
explicit fisher_f_distribution(RealType m, RealType n = 1);
Remarks: m and ncorrespond to the respective parameters of the distribution.
Returns: The value of the m parameter with which the object was constructed.
Returns: The value of the n parameter with which the object was constructed.
29.5.9.5.6 Class template student_t_distribution [rand.dist.norm.t]
A student_t_distribution random number distribution produces random numbers xdistributed according to the probability density function in Formula 29.18.
namespace std { template<class RealType = double> class student_t_distribution { public: using result_type = RealType;using param_type = unspecified; student_t_distribution() : student_t_distribution(1.0) {} explicit student_t_distribution(RealType n);explicit student_t_distribution(const param_type& parm);void reset();friend bool operator==(const student_t_distribution& x, const student_t_distribution& y);template<class URBG> result_type operator()(URBG& g);template<class URBG> result_type operator()(URBG& g, const param_type& parm); RealType n() const; param_type param() const;void param(const param_type& parm); result_type min() const; result_type max() const;template<class charT, class traits> friend basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& os, const student_t_distribution& x);template<class charT, class traits> friend basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>& is, student_t_distribution& x);};}
explicit student_t_distribution(RealType n);
Remarks: n corresponds to the parameter of the distribution.
Returns: The value of the n parameter with which the object was constructed.