Mantid
Loading...
Searching...
No Matches
IFunctionWithLocation.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"
15
16namespace Mantid {
17namespace API {
26class MANTID_API_DLL IFunctionWithLocation : public virtual ParamFunction, public virtual IFunction1D {
27public:
31 ~IFunctionWithLocation() override = default;
32
38 virtual double centre() const = 0;
39
43 virtual double height() const = 0;
44
46 virtual void setCentre(const double c) = 0;
47
49 virtual void setHeight(const double h) = 0;
50
55 virtual void fixCentre(bool isDefault = false) {
56 UNUSED_ARG(isDefault);
57 throw std::runtime_error("Generic centre fixing isn't implemented for this function.");
58 }
59
61 virtual void unfixCentre() { throw std::runtime_error("Generic centre fixing isn't implemented for this function."); }
62};
63
64} // namespace API
65} // namespace Mantid
#define UNUSED_ARG(x)
Function arguments are sometimes unused in certain implmentations but are required for documentation ...
Definition: System.h:64
This is a specialization of IFunction for functions of one real argument.
Definition: IFunction1D.h:43
An interface to a function with location, which here means a function for which the user may ask what...
~IFunctionWithLocation() override=default
Virtual destructor (avoids warnings about non-trivial move assignment in virtually inheriting classes...
virtual void setHeight(const double h)=0
Sets the parameters such that height == h.
virtual void unfixCentre()
Free the centre parameter.
virtual double height() const =0
Returns the height of the function.
virtual void setCentre(const double c)=0
Sets the parameters such that centre == c.
virtual void fixCentre(bool isDefault=false)
Fix a parameter or set up a tie such that value returned by centre() is constant during fitting.
virtual double centre() const =0
Returns the centre of the function, which may be something as simple as the centre of the fitting ran...
Implements the part of IFunction interface dealing with parameters.
Definition: ParamFunction.h:33
Helper class which provides the Collimation Length for SANS instruments.