Mantid
Loading...
Searching...
No Matches
ImmutableCompositeFunction.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2009 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
14#include <map>
15
16namespace Mantid {
17namespace API {
26class MANTID_API_DLL ImmutableCompositeFunction : public CompositeFunction {
27public:
28 /* Overriden methods */
29
31 std::string name() const override { return "ImmutableCompositeFunction"; }
33 void setParameter(size_t i, const double &value, bool explicitlySet = true) override {
34 CompositeFunction::setParameter(i, value, explicitlySet);
35 }
37 void setParameterDescription(size_t i, const std::string &description) override {
38 CompositeFunction::setParameterDescription(i, description);
39 }
41 void setParameter(const std::string &name, const double &value, bool explicitlySet = true) override;
43 void setParameterDescription(const std::string &name, const std::string &description) override;
45 double getParameter(size_t i) const override { return CompositeFunction::getParameter(i); }
47 double getParameter(const std::string &name) const override;
49 size_t parameterIndex(const std::string &name) const override;
51 std::string parameterName(size_t i) const override;
52
53protected:
55 using CompositeFunction::addFunction;
57 void addFunction(IFunction *fun);
59 void setAlias(const std::string &parName, const std::string &alias);
61 void addDefaultTies(const std::string &ties);
63 void addDefaultConstraints(const std::string &constraints);
65 std::string writeToString(const std::string &parentLocalAttributesStr = "") const override;
66
67private:
69 std::map<std::string, size_t> m_aliases;
70};
71
72} // namespace API
73} // namespace Mantid
double value
The value of the point.
Definition: FitMW.cpp:51
A composite function is a function containing other functions.
This is an interface to a fitting function - a semi-abstarct class.
Definition: IFunction.h:163
Immutable composite function is a composite function which members cannot be added or removed after c...
void setParameter(size_t i, const double &value, bool explicitlySet=true) override
Set i-th parameter.
void setParameterDescription(size_t i, const std::string &description) override
Set i-th parameter description.
std::map< std::string, size_t > m_aliases
Keep paramater aliases.
std::string name() const override
Returns the function's name.
double getParameter(size_t i) const override
Get i-th parameter.
Helper class which provides the Collimation Length for SANS instruments.