Mantid
Loading...
Searching...
No Matches
IPeakFunction.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
9#include <boost/python/class.hpp>
10#include <boost/python/register_ptr_to_python.hpp>
11
15using namespace boost::python;
16
18
19 register_ptr_to_python<std::shared_ptr<IPeakFunction>>();
20
21 class_<IPeakFunction, bases<IFunction1D>, std::shared_ptr<IPeakFunctionAdapter>, boost::noncopyable>(
22 "IPeakFunction", "Base class for peak Fit functions")
23 .def("functionLocal",
24 (object(IPeakFunctionAdapter::*)(const object &) const) & IPeakFunctionAdapter::functionLocal,
25 (arg("self"), arg("vec_x")),
26 "Calculate the values of the function for the given x values. The "
27 "output should be stored in the out array")
28 .def("fwhm", &IPeakFunction::fwhm, arg("self"), "Returns the fwhm of the peak function.")
29 .def("intensity", &IPeakFunction::intensity, arg("self"), "Returns the integral intensity of the peak function.")
30 .def("intensityError", &IPeakFunction::intensityError, arg("self"),
31 "Returns the integral intensity error of the peak function due to uncertainties in uncorrelated fit "
32 "parameters.")
33 .def("setIntensity", &IPeakFunction::setIntensity, (arg("self"), arg("new_intensity")),
34 "Changes the integral intensity of the peak function by setting its "
35 "height.");
36}
void export_IPeakFunction()
This is a specialization of IFunction for functions of one real argument.
Definition: IFunction1D.h:43
An interface to a peak function, which extend the interface of IFunctionWithLocation by adding method...
Definition: IPeakFunction.h:51
virtual void setIntensity(const double newIntensity)
Sets the integral intensity of the peak.
virtual double fwhm() const =0
Returns the peak FWHM.
virtual double intensity() const
Returns the integral intensity of the peak.
virtual double intensityError() const
Error in the integrated intensity of the peak due to uncertainties in the values of the fit parameter...
Provides a layer class for boost::python to allow C++ virtual functions to be overridden in a Python ...
void functionLocal(double *out, const double *xValues, const size_t nData) const override
Implemented Base-class method.