Mantid
Loading...
Searching...
No Matches
SplineInterpolation.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2013 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
11#include "MantidKernel/System.h"
12
13namespace Mantid {
14namespace CurveFitting {
15namespace Algorithms {
16
30class MANTID_CURVEFITTING_DLL SplineInterpolation final : public API::Algorithm {
31public:
33
34 const std::string name() const override;
35 int version() const override;
36 const std::vector<std::string> seeAlso() const override { return {"Fit", "SplineBackground", "SplineSmoothing"}; }
37 const std::string category() const override;
38 const std::string summary() const override;
39 std::map<std::string, std::string> validateInputs() override;
40
41private:
42 void init() override;
43 void exec() override;
44
46 std::shared_ptr<Functions::CubicSpline> m_cspline;
47
50 API::MatrixWorkspace_sptr setupOutputWorkspace(const API::MatrixWorkspace_sptr &mws,
51 const API::MatrixWorkspace_sptr &iws) const;
52
55
58 void setInterpolationPoints(const API::MatrixWorkspace_const_sptr &inputWorkspace, const size_t row) const;
59
62 void calculateSpline(const API::MatrixWorkspace_const_sptr &inputWorkspace,
63 const API::MatrixWorkspace_sptr &outputWorkspace, const size_t row) const;
64
66 void calculateDerivatives(const API::MatrixWorkspace_const_sptr &inputWorkspace,
67 const API::MatrixWorkspace_sptr &outputWorkspace, const size_t order) const;
68
70 std::pair<size_t, size_t> findInterpolationRange(const API::MatrixWorkspace_const_sptr &iwspt,
71 const API::MatrixWorkspace_sptr &mwspt, const size_t row);
72
74 void extrapolateFlat(const API::MatrixWorkspace_sptr &ows, const API::MatrixWorkspace_const_sptr &iwspt,
75 const size_t row, const std::pair<size_t, size_t> &indices, const bool doDerivs,
76 std::vector<API::MatrixWorkspace_sptr> &derivs) const;
77};
78
79} // namespace Algorithms
80} // namespace CurveFitting
81} // namespace Mantid
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
std::shared_ptr< Functions::CubicSpline > m_cspline
CubicSpline member used to perform interpolation.
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Helper class which provides the Collimation Length for SANS instruments.