Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.

Class template normal_distribution



// In header: <boost/random/normal_distribution.hpp>

template<typename RealType = double> 
class normal_distribution {
  // types
  typedef RealType input_type; 
  typedef RealType result_type;

  // construct/copy/destruct
  normal_distribution(const result_type & = result_type(0), 
                      const result_type & = result_type(1));
  normal_distribution(const normal_distribution &);

  // public member functions
  RealType mean() const;
  RealType sigma() const;
  void reset();
  template<typename Engine> result_type operator()(Engine &);


Instantiations of class template normal_distribution model a random distribution . Such a distribution produces random numbers x distributed with probability density function , where mean and sigma are the parameters of the distribution.

normal_distribution public construct/copy/destruct

  1. normal_distribution(const result_type & mean_arg = result_type(0), 
                        const result_type & sigma_arg = result_type(1));

    Constructs a normal_distribution object. mean and sigma are the parameters for the distribution.

    Requires: sigma > 0

  2. normal_distribution(const normal_distribution & other);

normal_distribution public member functions

  1. RealType mean() const;

    Returns: The "mean" parameter of the distribution.

  2. RealType sigma() const;

    Returns: The "sigma" parameter of the distribution.

  3. void reset();
  4. template<typename Engine> result_type operator()(Engine & eng);