| Home | Libraries | People | FAQ | More

## Class template normal_distribution

boost::normal_distribution

## Synopsis

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

    template<typename RealType = double>
    class normal_distribution {
    public:
      // 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 &);
    };

## Description

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);