Mantid
Loading...
Searching...
No Matches
Polynomial.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2012 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
10#include "MantidKernel/System.h"
11#include <cmath>
12
13namespace Mantid {
14namespace CurveFitting {
15namespace Functions {
16
19class MANTID_CURVEFITTING_DLL Polynomial : public BackgroundFunction {
20public:
21 Polynomial();
22
24 std::string name() const override { return "Polynomial"; }
25
26 const std::string category() const override { return "Background; Muon\\MuonModelling"; }
27
28 void function1D(double *out, const double *xValues, const size_t nData) const override;
29
30 void functionDeriv1D(API::Jacobian *out, const double *xValues, const size_t nData) override;
31
34 size_t nAttributes() const override { return 1; }
35
37 std::vector<std::string> getAttributeNames() const override;
38
40 Attribute getAttribute(const std::string &attName) const override;
41
43 void setAttribute(const std::string &attName, const Attribute &) override;
44
46 bool hasAttribute(const std::string &attName) const override;
47
48private:
50 int m_n;
51};
52
53using Polynomial_sptr = std::shared_ptr<Polynomial>;
54
55} // namespace Functions
56} // namespace CurveFitting
57} // namespace Mantid
Attribute is a non-fitting parameter.
Definition: IFunction.h:282
Represents the Jacobian in IFitFunction::functionDeriv.
Definition: Jacobian.h:22
Polynomial : N-th polynomial background function.
Definition: Polynomial.h:19
const std::string category() const override
overwrite IFunction base class methods
Definition: Polynomial.h:26
std::string name() const override
Overwrite IFunction base class.
Definition: Polynomial.h:24
size_t nAttributes() const override
Returns the number of attributes associated with the function (polynomial order n)
Definition: Polynomial.h:34
std::shared_ptr< Polynomial > Polynomial_sptr
Definition: Polynomial.h:53
Helper class which provides the Collimation Length for SANS instruments.