Mantid
Loading...
Searching...
No Matches
IFunction1D.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2009 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//----------------------------------------------------------------------
12#include "MantidAPI/DllConfig.h"
14#include "MantidAPI/IFunction.h"
15#include "MantidKernel/Logger.h"
16
17namespace Mantid {
18
19namespace CurveFitting {
20namespace Algorithms {
21class Fit;
22}
23} // namespace CurveFitting
24namespace API {
25
26//----------------------------------------------------------------------
27// Forward declaration
28//----------------------------------------------------------------------
29class MatrixWorkspace;
30class Jacobian;
31class ParameterTie;
32class IConstraint;
34class FunctionHandler;
43class MANTID_API_DLL IFunction1D : public virtual IFunction {
44public:
45 /* Overidden methods */
46
47 void function(const FunctionDomain &domain, FunctionValues &values) const override;
48 void functionDeriv(const FunctionDomain &domain, Jacobian &jacobian) override;
49
50 virtual void derivative(const FunctionDomain &domain, FunctionValues &values, const size_t order = 1) const;
51
53 virtual void function1D(double *out, const double *xValues, const size_t nData) const = 0;
54
56 virtual void derivative1D(double *out, const double *xValues, const size_t nData, const size_t order) const;
57
59 virtual void functionDeriv1D(Jacobian *jacobian, const double *xValues, const size_t nData);
60
61protected:
62 template <typename FunctionType>
63 using Function1DMethod = void (FunctionType::*)(double *, const double *, const size_t) const;
65 template <typename EvaluationMethod>
66 void calcNumericalDerivative1D(Jacobian *jacobian, EvaluationMethod func1D, const double *xValues,
67 const size_t nData);
69 virtual void histogram1D(double *out, double left, const double *right, const size_t nBins) const;
71 virtual void histogramDerivative1D(Jacobian *jacobian, double left, const double *right, const size_t nBins) const;
72
75
78};
79
80using IFunction1D_sptr = std::shared_ptr<IFunction1D>;
81
82} // namespace API
83} // namespace Mantid
double left
Definition: LineProfile.cpp:80
double right
Definition: LineProfile.cpp:81
Base class that represents the domain of a function.
Classes inherited from FunctionHandler will handle the function.
Definition: IFunction.h:743
A class to store values calculated by a function.
An interface to a constraint.
Definition: IConstraint.h:26
This is a specialization of IFunction for functions of one real argument.
Definition: IFunction1D.h:43
void(FunctionType::*)(double *, const double *, const size_t) const Function1DMethod
Definition: IFunction1D.h:63
void calcNumericalDerivative1D(Jacobian *jacobian, EvaluationMethod func1D, const double *xValues, const size_t nData)
Calculate a numerical derivative for the 1D data.
virtual void function1D(double *out, const double *xValues, const size_t nData) const =0
Function you want to fit to.
static Kernel::Logger g_log
Logger instance.
Definition: IFunction1D.h:74
This is an interface to a fitting function - a semi-abstarct class.
Definition: IFunction.h:163
Represents the Jacobian in IFitFunction::functionDeriv.
Definition: Jacobian.h:22
Base MatrixWorkspace Abstract Class.
A reference to a parameter in a function.
Ties fitting parameters.
Definition: ParameterTie.h:35
A generic fitting algorithm.
Definition: Fit.h:78
The Logger class is in charge of the publishing messages from the framework through various channels.
Definition: Logger.h:52
std::shared_ptr< IFunction1D > IFunction1D_sptr
Definition: IFunction1D.h:80
Helper class which provides the Collimation Length for SANS instruments.