EMAN2
Public Member Functions | Private Attributes
Gaussian Class Reference

Gaussian function class. More...

#include <util_sparx.h>

List of all members.

Public Member Functions

 Gaussian (float sigma_=1.0)
float operator() (float x) const

Private Attributes

float sigma
float rttwopisigma
float twosigma2

Detailed Description

Gaussian function class.

Usage:

Gaussian gauss(sigma); float g = gauss(x);

Definition at line 492 of file util_sparx.h.


Constructor & Destructor Documentation

Gaussian::Gaussian ( float  sigma_ = 1.0) [inline]

Definition at line 497 of file util_sparx.h.

References rttwopisigma, sigma, twopi, and twosigma2.

                                                     : sigma(sigma_) {
                                rttwopisigma = sqrtf(static_cast<float>(twopi)*sigma);
                                twosigma2 = 2*sigma*sigma;
                        }

Member Function Documentation

float Gaussian::operator() ( float  x) const [inline]

Definition at line 501 of file util_sparx.h.

References rttwopisigma, and twosigma2.

                                                               {
                                return exp(-x*x/(twosigma2))/rttwopisigma;
                        }

Member Data Documentation

float Gaussian::rttwopisigma [private]

Definition at line 494 of file util_sparx.h.

Referenced by Gaussian(), and operator()().

float Gaussian::sigma [private]

Definition at line 493 of file util_sparx.h.

Referenced by Gaussian().

float Gaussian::twosigma2 [private]

Definition at line 495 of file util_sparx.h.

Referenced by Gaussian(), and operator()().


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