Mantid
Loading...
Searching...
No Matches
ParameterTie.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//----------------------------------------------------------------------
12#include "MantidAPI/DllConfig.h"
14
15#include <map>
16#include <memory>
17#include <vector>
18
19namespace mu {
20class Parser;
21}
22
23namespace Mantid {
24namespace API {
35class MANTID_API_DLL ParameterTie final : public ParameterReference {
36public:
38 ParameterTie(IFunction *funct, const std::string &parName, const std::string &expr = "", bool isDefault = false);
40 ~ParameterTie() override;
42 virtual void set(const std::string &expr);
44 virtual double eval(bool setParameterValue = true);
46 virtual std::string asString(const IFunction *fun = nullptr) const;
47
49 bool findParametersOf(const IFunction *fun) const;
51 bool isConstant() const;
53 std::vector<ParameterReference> getRHSParameters() const;
54
55protected:
56 std::unique_ptr<mu::Parser> m_parser;
59 std::map<double *, ParameterReference> m_varMap;
64 std::string m_expression;
65
66private:
68 static double *AddVariable(const char *varName, void *palg);
69};
70
71} // namespace API
72} // namespace Mantid
This is an interface to a fitting function - a semi-abstarct class.
Definition: IFunction.h:163
A reference to a parameter in a function.
Ties fitting parameters.
Definition: ParameterTie.h:35
std::map< double *, ParameterReference > m_varMap
Store for parameters used in the tie.
Definition: ParameterTie.h:59
std::string m_expression
Keep the template for the input string passed to this->set(...) In the template CompositeFunction pre...
Definition: ParameterTie.h:64
std::unique_ptr< mu::Parser > m_parser
math parser
Definition: ParameterTie.h:56
IFunction * m_function1
Keep the function that was passed to the constructor.
Definition: ParameterTie.h:61
Helper class which provides the Collimation Length for SANS instruments.