Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Mantid::API::PeakFunctionIntegrator Class Reference

#include <PeakFunctionIntegrator.h>

Public Member Functions

IntegrationResult integrate (const IPeakFunction &peakFunction, double lowerLimit, double upperLimit) const
 Integration of peak function on the interval [a, b]. More...
 
double integrateError (const IPeakFunction &peakFunction, double lowerLimit, double upperLimit) const
 Error in the integrated intensity within an continuous interval due to uncertainties in the values of the fit parameters. More...
 
IntegrationResult integrateInfinity (const IPeakFunction &peakFunction) const
 Integration of peak function on the interval [-Inf, +Inf]. More...
 
IntegrationResult integrateNegativeInfinity (const IPeakFunction &peakFunction, double upperLimit) const
 Integration of peak function on the interval [-Inf, b]. More...
 
IntegrationResult integratePositiveInfinity (const IPeakFunction &peakFunction, double lowerLimit) const
 Integration of peak function on the interval [a, +Inf]. More...
 
 PeakFunctionIntegrator (double requiredRelativePrecision=1e-8)
 Constructor with required relative precision argument. More...
 
double requiredRelativePrecision () const
 Returns the currently set precision. More...
 
void setRequiredRelativePrecision (double newPrecision)
 This method sets the desired numerical relative precision that's passed on to the GSL integration-routines. More...
 
virtual ~PeakFunctionIntegrator ()
 

Protected Member Functions

gsl_function getGSLFunction (const IPeakFunction &peakFunction) const
 Method that wraps an IPeakFunction for use with GSL functions. More...
 

Protected Attributes

gsl_integration_workspace * m_integrationWorkspace
 
double m_relativePrecision
 

Detailed Description

Definition at line 37 of file PeakFunctionIntegrator.h.

Constructor & Destructor Documentation

◆ PeakFunctionIntegrator()

Mantid::API::PeakFunctionIntegrator::PeakFunctionIntegrator ( double  requiredRelativePrecision = 1e-8)

Constructor with required relative precision argument.

The default is 1e-8. See also PeakFunctionIntegrator::setRequiredRelativePrecision.

Parameters
requiredRelativePrecision:: Desired relative precision of the integral estimations.

Definition at line 20 of file PeakFunctionIntegrator.cpp.

◆ ~PeakFunctionIntegrator()

Mantid::API::PeakFunctionIntegrator::~PeakFunctionIntegrator ( )
virtual

Definition at line 29 of file PeakFunctionIntegrator.cpp.

References m_integrationWorkspace.

Member Function Documentation

◆ getGSLFunction()

gsl_function Mantid::API::PeakFunctionIntegrator::getGSLFunction ( const IPeakFunction peakFunction) const
protected

Method that wraps an IPeakFunction for use with GSL functions.

Parameters
peakFunction:: Peak function to wrap.

Definition at line 181 of file PeakFunctionIntegrator.cpp.

References Mantid::API::gsl_peak_wrapper().

Referenced by integrate(), integrateInfinity(), integrateNegativeInfinity(), and integratePositiveInfinity().

◆ integrate()

IntegrationResult Mantid::API::PeakFunctionIntegrator::integrate ( const IPeakFunction peakFunction,
double  lowerLimit,
double  upperLimit 
) const

Integration of peak function on the interval [a, b].

Internally, gsl_integration_qags is used for this.

Parameters
peakFunction:: Peak function to integrate.
lowerLimit:: Lower limit of the integration.
upperLimit:: Upper limit of the integration.

Definition at line 109 of file PeakFunctionIntegrator.cpp.

References Mantid::API::IntegrationResult::error, Mantid::API::IntegrationResult::errorCode, getGSLFunction(), Mantid::API::IntegrationResult::intervals, m_integrationWorkspace, m_relativePrecision, Mantid::API::IntegrationResult::result, and Mantid::API::IntegrationResult::success.

Referenced by Mantid::API::IPeakFunction::integrate(), integrateError(), and Mantid::CurveFitting::Functions::IkedaCarpenterPV::intensity().

◆ integrateError()

double Mantid::API::PeakFunctionIntegrator::integrateError ( const IPeakFunction peakFunction,
double  lowerLimit,
double  upperLimit 
) const

Error in the integrated intensity within an continuous interval due to uncertainties in the values of the fit parameters.

if the peak function contains no fit-parameter uncertainties, then the integration error is set to NaN. Also, this function assumes no correlation between the fit parameters, so that their corresponding errors are summed up in quadrature.

Parameters
peakFunctionthe peak function to integrate
lowerLimitlower limit of the interval over which we integrate
upperLimitupper limit of the interval over which we integrate

Definition at line 132 of file PeakFunctionIntegrator.cpp.

References Mantid::API::IFunction::clone(), error, Mantid::API::ParamFunction::getError(), Mantid::API::ParamFunction::getParameter(), integrate(), and Mantid::API::ParamFunction::nParams().

Referenced by Mantid::API::IPeakFunction::intensityError().

◆ integrateInfinity()

IntegrationResult Mantid::API::PeakFunctionIntegrator::integrateInfinity ( const IPeakFunction peakFunction) const

Integration of peak function on the interval [-Inf, +Inf].

Internally, gsl_integration_qagi is used for this. The results are returned as IntegrationResult-struct, which contains the approximation of the integral along with other information such as an error estimate (absolute).

Parameters
peakFunction:: Peak function to integrate.

Definition at line 49 of file PeakFunctionIntegrator.cpp.

References Mantid::API::IntegrationResult::error, Mantid::API::IntegrationResult::errorCode, getGSLFunction(), Mantid::API::IntegrationResult::intervals, m_integrationWorkspace, m_relativePrecision, Mantid::API::IntegrationResult::result, and Mantid::API::IntegrationResult::success.

◆ integrateNegativeInfinity()

IntegrationResult Mantid::API::PeakFunctionIntegrator::integrateNegativeInfinity ( const IPeakFunction peakFunction,
double  upperLimit 
) const

Integration of peak function on the interval [-Inf, b].

Internally, gsl_integration_qagil is used for this.

Parameters
peakFunction:: Peak function to integrate.
upperLimit:: Upper limit of the integration.

Definition at line 88 of file PeakFunctionIntegrator.cpp.

References Mantid::API::IntegrationResult::error, Mantid::API::IntegrationResult::errorCode, getGSLFunction(), Mantid::API::IntegrationResult::intervals, m_integrationWorkspace, m_relativePrecision, Mantid::API::IntegrationResult::result, and Mantid::API::IntegrationResult::success.

◆ integratePositiveInfinity()

IntegrationResult Mantid::API::PeakFunctionIntegrator::integratePositiveInfinity ( const IPeakFunction peakFunction,
double  lowerLimit 
) const

Integration of peak function on the interval [a, +Inf].

Internally, gsl_integration_qagiu is used for this.

Parameters
peakFunction:: Peak function to integrate.
lowerLimit:: Lower limit of the integration.

Definition at line 68 of file PeakFunctionIntegrator.cpp.

References Mantid::API::IntegrationResult::error, Mantid::API::IntegrationResult::errorCode, getGSLFunction(), Mantid::API::IntegrationResult::intervals, m_integrationWorkspace, m_relativePrecision, Mantid::API::IntegrationResult::result, and Mantid::API::IntegrationResult::success.

◆ requiredRelativePrecision()

double Mantid::API::PeakFunctionIntegrator::requiredRelativePrecision ( ) const

Returns the currently set precision.

Definition at line 40 of file PeakFunctionIntegrator.cpp.

References m_relativePrecision.

◆ setRequiredRelativePrecision()

void Mantid::API::PeakFunctionIntegrator::setRequiredRelativePrecision ( double  newPrecision)

This method sets the desired numerical relative precision that's passed on to the GSL integration-routines.

Parameters
newPrecision:: Desired relative precision for integrations.

Definition at line 36 of file PeakFunctionIntegrator.cpp.

References m_relativePrecision.

Member Data Documentation

◆ m_integrationWorkspace

gsl_integration_workspace* Mantid::API::PeakFunctionIntegrator::m_integrationWorkspace
protected

◆ m_relativePrecision

double Mantid::API::PeakFunctionIntegrator::m_relativePrecision
protected

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