Mantid
Loading...
Searching...
No Matches
Chebyshev.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 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//----------------------------------------------------------------------
13#include <valarray>
14
15namespace Mantid {
16namespace CurveFitting {
17namespace Functions {
30class MANTID_CURVEFITTING_DLL Chebyshev : public BackgroundFunction {
31public:
33 Chebyshev();
34
36 std::string name() const override { return "Chebyshev"; }
37 void function1D(double *out, const double *xValues, const size_t nData) const override;
38 void functionDeriv1D(API::Jacobian *out, const double *xValues, const size_t nData) override;
39
41 void setAttribute(const std::string &attName, const Attribute &) override;
42
43private:
45 int m_n;
47 double m_StartX;
49 double m_EndX;
51 mutable std::valarray<double> m_b;
52};
53
54using Chebyshev_sptr = std::shared_ptr<Chebyshev>;
55
56} // namespace Functions
57} // namespace CurveFitting
58} // namespace Mantid
Attribute is a non-fitting parameter.
Definition IFunction.h:285
Represents the Jacobian in IFitFunction::functionDeriv.
Definition Jacobian.h:22
Implements Chebyshev polynomial expansion.
Definition Chebyshev.h:30
double m_EndX
Upper x boundary. The default is 1.
Definition Chebyshev.h:49
std::string name() const override
overwrite IFunction base class methods
Definition Chebyshev.h:36
double m_StartX
Lower x boundary. The default is -1.
Definition Chebyshev.h:47
std::valarray< double > m_b
Keep intermediate calculatons.
Definition Chebyshev.h:51
std::shared_ptr< Chebyshev > Chebyshev_sptr
Definition Chebyshev.h:54
Helper class which provides the Collimation Length for SANS instruments.