Mantid
Loading...
Searching...
No Matches
IFittingAlgorithm.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2015 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 "MantidCurveFitting/DllConfig.h"
12
13namespace Mantid {
14
15namespace API {
16class IFunction;
17}
18
19namespace CurveFitting {
20
21namespace CostFunctions {
22class CostFuncFitting;
23}
24
38class MANTID_CURVEFITTING_DLL IFittingAlgorithm : public API::Algorithm {
39public:
40 const std::string category() const override;
41
42private:
43 void init() override;
44 void exec() override;
46 virtual void initConcrete() = 0;
48 virtual void execConcrete() = 0;
49
50 void afterPropertySet(const std::string &propName) override;
51 void addWorkspace(const std::string &workspacePropertyName, bool addProperties = true);
53 void setDomainType();
54
55protected:
56 void setFunction();
57 void setStepSizeMethod();
58 void addWorkspaces();
59 std::vector<std::string> getCostFunctionNames() const;
60 void declareCostFunctionProperty();
61 std::shared_ptr<CostFunctions::CostFuncFitting> getCostFunctionInitialized() const;
62
64 API::IDomainCreator::DomainType m_domainType{API::IDomainCreator::Simple};
66 std::shared_ptr<API::IFunction> m_function;
68 std::shared_ptr<API::IDomainCreator> m_domainCreator;
69 std::vector<std::string> m_workspacePropertyNames;
70 std::vector<std::string> m_workspaceIndexPropertyNames;
71
72 friend class API::IDomainCreator;
73};
74
75} // namespace CurveFitting
76} // namespace Mantid
void addWorkspace(WorkspaceGroup &self, const boost::python::object &pyobj)
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:76
An base class for domain creators for use in Fit.
DomainType
Type of domain to create.
A base class for fitting algorithms.
virtual void execConcrete()=0
Child classes implement the algorithm logic here.
std::shared_ptr< API::IDomainCreator > m_domainCreator
Pointer to a domain creator.
std::vector< std::string > m_workspacePropertyNames
std::shared_ptr< API::IFunction > m_function
Pointer to the fitting function.
virtual void initConcrete()=0
Child classes declare their properties here.
std::vector< std::string > m_workspaceIndexPropertyNames
Helper class which provides the Collimation Length for SANS instruments.