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#include "MantidKernel/System.h"
13
14namespace Mantid {
15
16namespace API {
17class IFunction;
18}
19
20namespace CurveFitting {
21
22namespace CostFunctions {
23class CostFuncFitting;
24}
25
39class MANTID_CURVEFITTING_DLL IFittingAlgorithm : public API::ParallelAlgorithm {
40public:
41 const std::string category() const override;
42
43private:
44 void init() override;
45 void exec() override;
47 virtual void initConcrete() = 0;
49 virtual void execConcrete() = 0;
50
51 void afterPropertySet(const std::string &propName) override;
52 void addWorkspace(const std::string &workspacePropertyName, bool addProperties = true);
54 void setDomainType();
55
56protected:
57 void setFunction();
58 void setStepSizeMethod();
59 void addWorkspaces();
60 std::vector<std::string> getCostFunctionNames() const;
61 void declareCostFunctionProperty();
62 std::shared_ptr<CostFunctions::CostFuncFitting> getCostFunctionInitialized() const;
63
65 API::IDomainCreator::DomainType m_domainType{API::IDomainCreator::Simple};
67 std::shared_ptr<API::IFunction> m_function;
69 std::shared_ptr<API::IDomainCreator> m_domainCreator;
70 std::vector<std::string> m_workspacePropertyNames;
71 std::vector<std::string> m_workspaceIndexPropertyNames;
72
73 friend class API::IDomainCreator;
74};
75
76} // namespace CurveFitting
77} // namespace Mantid
void addWorkspace(WorkspaceGroup &self, const boost::python::object &pyobj)
An base class for domain creators for use in Fit.
DomainType
Type of domain to create.
Base class for algorithms that can run in parallel on all MPI ranks but not in a distributed fashion.
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.