Mantid
Loading...
Searching...
No Matches
TempFunction.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"
13#include "MantidAPI/IFunction.h"
15
16#ifdef _WIN32
17#pragma warning(disable : 4250)
18
19namespace Mantid {
20namespace API {
27class MANTID_API_DLL TempFunction : public virtual IFunction {
28public:
30 TempFunction(IFunctionMW *function);
31
33 virtual std::string name() const { return m_function->name(); }
36 virtual void setWorkspace(std::shared_ptr<const Workspace> ws) { UNUSED_ARG(ws) }
38 // virtual std::shared_ptr<const API::Workspace> getWorkspace()const {return
39 // m_function->getWorkspace();}
40
46 virtual const std::string category() const { return m_function->category(); }
47
48 virtual void function(FunctionDomain &domain) const;
49 virtual void functionDeriv(FunctionDomain &domain, Jacobian &jacobian);
50
52 virtual void setParameter(size_t i, const double &value, bool explicitlySet = true) {
53 m_function->setParameter(i, value, explicitlySet);
54 }
56 virtual void setParameterDescription(size_t i, const std::string &description) {
57 m_function->setParameterDescription(i, description);
58 }
60 virtual double getParameter(size_t i) const { return m_function->getParameter(i); }
62 virtual void setParameter(const std::string &name, const double &value, bool explicitlySet = true) {
63 m_function->setParameter(name, value, explicitlySet);
64 }
66 virtual void setParameterDescription(const std::string &name, const std::string &description) {
67 m_function->setParameterDescription(name, description);
68 }
70 virtual double getParameter(const std::string &name) const { return m_function->getParameter(name); }
72 virtual size_t nParams() const { return m_function->nParams(); }
74 virtual size_t parameterIndex(const std::string &name) const { return m_function->parameterIndex(name); }
76 virtual std::string parameterName(size_t i) const { return m_function->parameterName(i); }
78 virtual std::string parameterDescription(size_t i) const { return m_function->parameterDescription(i); }
80 virtual bool isExplicitlySet(size_t i) const { return m_function->isExplicitlySet(i); }
81
83 virtual size_t nActive() const { return m_function->nActive(); }
85 virtual size_t indexOfActive(size_t i) const { return m_function->indexOfActive(i); }
87 virtual std::string nameOfActive(size_t i) const { return m_function->nameOfActive(i); }
89 virtual std::string descriptionOfActive(size_t i) const { return m_function->descriptionOfActive(i); }
90
92 virtual bool isActive(size_t i) const { return m_function->isActive(i); }
94 virtual size_t activeIndex(size_t i) const { return m_function->activeIndex(i); }
96 virtual void removeActive(size_t i) { m_function->removeActive(i); }
98 virtual void restoreActive(size_t i) { m_function->restoreActive(i); }
99
102 virtual size_t getParameterIndex(const ParameterReference &ref) const { return m_function->getParameterIndex(ref); }
111 virtual IFunction *getContainingFunction(const ParameterReference &ref) const {
112 return m_function->getContainingFunction(ref);
113 }
115 virtual IFunction *getContainingFunction(const IFunction *fun) { return m_function->getContainingFunction(fun); }
116
118 virtual void applyTies() { m_function->applyTies(); }
120 virtual void clearTies() { m_function->clearTies(); }
122 virtual bool removeTie(size_t i) { return m_function->removeTie(i); }
123 virtual void removeTie(const std::string &parName) { IFunction::removeTie(parName); }
125 virtual ParameterTie *getTie(size_t i) const { return m_function->getTie(i); }
126
128 virtual void addConstraint(IConstraint *ic) { m_function->addConstraint(ic); }
130 virtual IConstraint *getConstraint(size_t i) const { return m_function->getConstraint(i); }
132 virtual void removeConstraint(const std::string &parName) { m_function->removeConstraint(parName); }
133
134protected:
136 virtual void init() { m_function->init(); }
138 virtual void declareParameter(const std::string &name, double initValue = 0, const std::string &description = "") {
139 m_function->declareParameter(name, initValue, description);
140 }
142 virtual void addTie(ParameterTie *tie) { m_function->addTie(tie); }
143
145 IFunctionMW *m_function;
146};
147
151class MANTID_API_DLL FunctionDomain1D : public FunctionDomain {
152public:
153 FunctionDomain1D(double start, double end, size_t n);
154 FunctionDomain1D(const std::vector<double> &xvalues);
157 double getX(size_t i) const { return m_X.at(i); }
158
159protected:
160 std::vector<double> m_X;
161 friend class TempFunction;
162};
163
164} // namespace API
165} // namespace Mantid
166
167/*MANTID_API_TEMPFUNCTION_H_*/
double value
The value of the point.
Definition: FitMW.cpp:51
#define UNUSED_ARG(x)
Function arguments are sometimes unused in certain implmentations but are required for documentation ...
Definition: System.h:64
Helper class which provides the Collimation Length for SANS instruments.