Mantid
Loading...
Searching...
No Matches
IPeakFunctionAdapter.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2011 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 +
7#pragma once
8
9//-----------------------------------------------------------------------------
10// Includes
11//-----------------------------------------------------------------------------
14
15#include <boost/python/object.hpp>
16
17namespace Mantid {
18namespace PythonInterface {
19
28public:
29 // Convenience typedef
31
33 IPeakFunctionAdapter(PyObject *self);
34
38
41
43 double centre() const override;
45 double height() const override;
47 void setCentre(const double c) override;
49 void setHeight(const double h) override;
50
52 double fwhm() const override;
54 void setFwhm(const double w) override;
55
58 void function1D(double *out, const double *xValues, const size_t nData) const override {
59 IPeakFunction::function1D(out, xValues, nData);
60 }
63 void functionDeriv1D(API::Jacobian *out, const double *xValues, const size_t nData) override {
64 IPeakFunction::functionDeriv1D(out, xValues, nData);
65 }
66
68 void functionLocal(double *out, const double *xValues, const size_t nData) const override;
70 boost::python::object functionLocal(const boost::python::object &xvals) const;
72 void functionDerivLocal(API::Jacobian *jacobian, const double *xValues, const size_t nData) override;
74 void functionDerivLocal(const boost::python::object &xvals, boost::python::object &jacobian);
75
76private:
77};
78} // namespace PythonInterface
79} // namespace Mantid
An interface to a peak function, which extend the interface of IFunctionWithLocation by adding method...
Definition: IPeakFunction.h:51
void functionDeriv1D(Jacobian *out, const double *xValues, const size_t nData) override
General implementation of the method for all peaks.
void function1D(double *out, const double *xValues, const size_t nData) const override
General implementation of the method for all peaks.
Represents the Jacobian in IFitFunction::functionDeriv.
Definition: Jacobian.h:22
Provides a layer to hook into the protected functions of IFunction.
Provides a layer class for boost::python to allow C++ virtual functions to be overridden in a Python ...
void setCentre(const double c) override
Calls 'setCentre' method in Python.
void functionLocal(double *out, const double *xValues, const size_t nData) const override
Implemented Base-class method.
void functionDeriv1D(API::Jacobian *out, const double *xValues, const size_t nData) override
Required to solve compiler ambiguity between IPeakFunction & IFunction1DAdapter.
double height() const override
Calls 'height' method in Python.
void function1D(double *out, const double *xValues, const size_t nData) const override
Required to solve compiler ambiguity between IPeakFunction & IFunction1DAdapter.
void setHeight(const double h) override
Calls 'setHeight' method in Python.
double fwhm() const override
Calls Python fwhm method.
IPeakFunctionAdapter(const IPeakFunctionAdapter &)=delete
Disable copy operator - The PyObject must be supplied to construct the object.
IPeakFunctionAdapter & operator=(const IPeakFunctionAdapter &)=delete
Disable assignment operator.
double centre() const override
Calls 'centre' method in Python.
void setFwhm(const double w) override
Called by framework when the width is changed.
void functionDerivLocal(API::Jacobian *jacobian, const double *xValues, const size_t nData) override
Implemented base-class method.
Helper class which provides the Collimation Length for SANS instruments.