All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes
o2scl::prob_dens_gaussian Class Reference

A one-dimensional Gaussian probability density. More...

Detailed Description

The distribution

\[ P(x)=\frac{1}{\sigma \sqrt{2 \pi}} e^{-\frac{\left(x-x_0\right)^2}{2\sigma^2}} \]

This class is experimental.

Definition at line 81 of file prob_dens_func.h.

#include <prob_dens_func.h>

Inheritance diagram for o2scl::prob_dens_gaussian:
o2scl::prob_dens_func

Public Member Functions

 prob_dens_gaussian ()
 Create a standard normal distribution.
 
 prob_dens_gaussian (double cent, double sigma)
 Create a Gaussian distribution with width sigma. More...
 
 prob_dens_gaussian (const prob_dens_gaussian &pdg)
 Copy constructor.
 
prob_dens_gaussianoperator= (const prob_dens_gaussian &pdg)
 Copy constructor with operator=.
 
void set_seed (unsigned long int s)
 Set the seed.
 
void set_center (double cent)
 Set the center.
 
void set_sigma (double sigma)
 Set the Gaussian width.
 
double get_center ()
 Get the center.
 
double get_sigma ()
 Get the Gaussian width.
 
virtual double sample () const
 Sample from the specified density.
 
virtual double operator() (double x) const
 The normalized density.
 
virtual double cdf (double x) const
 The cumulative distribution function (from the lower tail)
 
virtual double invert_cdf (double in_cdf) const
 The inverse cumulative distribution function.
 
virtual double entropy () const
 The inverse cumulative distribution function.
 

Protected Attributes

double cent_
 Central value.
 
double sigma_
 Width parameter. More...
 
gsl_rng * r
 Base GSL random number generator.
 

Constructor & Destructor Documentation

o2scl::prob_dens_gaussian::prob_dens_gaussian ( double  cent,
double  sigma 
)
inline

The value of sigma must be larger than zero.

Definition at line 112 of file prob_dens_func.h.

Field Documentation

double o2scl::prob_dens_gaussian::sigma_
protected

A value of -1 indicates it is yet unspecified.

Definition at line 93 of file prob_dens_func.h.


The documentation for this class was generated from the following file:

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).
Hosted at Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads..