Mantid
Loading...
Searching...
No Matches
FitParameter.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 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 "MantidGeometry/DllConfig.h"
15
16namespace Mantid {
17namespace Geometry {
27class MANTID_GEOMETRY_DLL FitParameter {
28public:
30 FitParameter() : m_value(0.0), m_tie(""), m_function("") {};
31
33 double getValue(const double &at) const;
35 double getValue() const;
37 void setValue(double value) { m_value = value; }
39 const std::string &getTie() const { return m_tie; }
41 void setTie(const std::string &tie) { m_tie = tie; }
43 std::string getConstraint() const;
45 const std::string &getConstraintPenaltyFactor() const { return m_constraintPenaltyFactor; }
47 void setConstraintMin(const std::string &constraintMin) { m_constraintMin = constraintMin; }
49 void setConstraintMax(const std::string &constraintMax) { m_constraintMax = constraintMax; }
51 void setConstraintPenaltyFactor(const std::string &constraintPenaltyFactor) {
52 m_constraintPenaltyFactor = constraintPenaltyFactor;
53 }
55 const std::string &getFormula() const { return m_formula; }
57 void setFormula(const std::string &formula) { m_formula = formula; }
59 const std::string &getFormulaUnit() const { return m_formulaUnit; }
61 void setFormulaUnit(const std::string &formulaUnit) { m_formulaUnit = formulaUnit; }
63 const std::string &getResultUnit() const { return m_resultUnit; }
65 void setResultUnit(const std::string &resultUnit) { m_resultUnit = resultUnit; }
67 const std::string &getFunction() const { return m_function; }
69 void setFunction(const std::string &function) { m_function = function; }
71 const std::string &getName() const { return m_name; }
73 void setName(const std::string &name) { m_name = name; }
75 const Kernel::Interpolation &getLookUpTable() const { return m_lookUpTable; }
77 void setLookUpTable(const Kernel::Interpolation &lookupTable) { m_lookUpTable = lookupTable; }
78
80 void printSelf(std::ostream &os) const;
81
82private:
84 mutable double m_value;
86 std::string m_tie;
87 std::string m_constraintMin;
88 std::string m_constraintMax;
91 std::string m_function;
93 std::string m_name;
96
97 std::string m_formula;
98 std::string m_formulaUnit;
99 std::string m_resultUnit;
100};
101
102// defining operator << and >>
103MANTID_GEOMETRY_DLL std::ostream &operator<<(std::ostream &, const FitParameter &);
104MANTID_GEOMETRY_DLL std::istream &operator>>(std::istream &, FitParameter &);
105
106// Instantiated and exported by Parameter.cpp
108
109} // namespace Geometry
110} // namespace Mantid
const std::string & m_value
Definition Algorithm.cpp:72
std::string name
Definition Run.cpp:60
double value
The value of the point.
Definition FitMW.cpp:51
Store information about a fitting parameter such as its value if it is constrained or tied.
void setName(const std::string &name)
set name
void setFormulaUnit(const std::string &formulaUnit)
set formula unit
const std::string & getTie() const
get tie
std::string m_tie
tie of parameter
void setResultUnit(const std::string &resultUnit)
set result formula unit
void setLookUpTable(const Kernel::Interpolation &lookupTable)
set look up table
const std::string & getName() const
get name
const std::string & getFormula() const
get formula
void setFormula(const std::string &formula)
set formula
const std::string & getFormulaUnit() const
get formula unit, and Empty string is no unit has been specified
void setTie(const std::string &tie)
set tie
Kernel::Interpolation m_lookUpTable
look up table
std::string m_constraintPenaltyFactor
the penalty factor
std::string m_constraintMin
constraint min boundary
void setConstraintMax(const std::string &constraintMax)
set constraint max
void setFunction(const std::string &function)
set function
void setConstraintMin(const std::string &constraintMin)
set constraint min
std::string m_formulaUnit
the unit that the formula expects
void setConstraintPenaltyFactor(const std::string &constraintPenaltyFactor)
set the constraint penalty
std::string m_name
name of parameter
void setValue(double value)
set parameter value
std::string m_formula
the formula
std::string m_function
name of fitting function
const Kernel::Interpolation & getLookUpTable() const
get look up table
const std::string & getFunction() const
get function
const std::string & getResultUnit() const
get result formula unit, and Empty string is no unit has been specified
std::string m_resultUnit
the result unit
double m_value
value of parameter
std::string m_constraintMax
constraint max boundary
const std::string & getConstraintPenaltyFactor() const
get penalty factor
Templated class for parameters of type Type.
Definition Parameter.h:114
Provide interpolation over a series of points.
MANTID_GEOMETRY_EXTERN_TEMPLATE(ParameterType< FitParameter >)
MANTID_GEOMETRY_DLL std::istream & operator>>(std::istream &stream, SymmetryOperation &operation)
Reads identifier from stream and tries to parse as a symbol.
MANTID_GEOMETRY_DLL std::ostream & operator<<(std::ostream &stream, const PointGroup &self)
Returns a streamed representation of the PointGroup object.
Helper class which provides the Collimation Length for SANS instruments.