Mantid
|
A reference to a parameter in a function. More...
#include <ParameterReference.h>
Public Member Functions | |
IFunction * | getLocalFunction () const |
Return pointer to the local function. More... | |
std::size_t | getLocalIndex () const |
Return parameter index in the local function. More... | |
double | getParameter () const |
Get the value of the parameter. More... | |
bool | isDefault () const |
Returns the default value flag. More... | |
bool | isParameterOf (const IFunction *fun) const |
Find out if this refers to a parameter of a function: direct or via composite function member. More... | |
IFunction * | ownerFunction () const |
std::size_t | parameterIndex () const |
Return parameter index in the owning function. More... | |
std::string | parameterName () const |
Return parameter name in the owning function. More... | |
ParameterReference () | |
Default constructor. More... | |
ParameterReference (IFunction *fun, std::size_t index, bool isDefault=false) | |
Constructor. More... | |
void | setParameter (const double &value, bool isExplicitlySet=true) |
Set the parameter. More... | |
virtual | ~ParameterReference ()=default |
Protected Member Functions | |
void | reset (IFunction *fun, std::size_t index, bool isDefault=false) |
Reset the reference. More... | |
Private Attributes | |
IFunction * | m_function |
Function that together with m_index uniquely identify the parameter. More... | |
std::size_t | m_index |
Index of the parameter in m_function. More... | |
bool | m_isDefault |
Flag to mark as default the value of an object associated with this reference: a tie or a constraint. More... | |
IFunction * | m_owner |
Function-owner of this reference. More... | |
A reference to a parameter in a function.
To uniquely identify a parameter in a composite function
Definition at line 25 of file ParameterReference.h.
Mantid::API::ParameterReference::ParameterReference | ( | ) |
Default constructor.
Definition at line 13 of file ParameterReference.cpp.
Mantid::API::ParameterReference::ParameterReference | ( | IFunction * | fun, |
std::size_t | index, | ||
bool | isDefault = false |
||
) |
Constructor.
fun | :: Pointer to a function (composite or simple). |
index | :: Index of a parameter of fun |
isDefault | :: Flag to mark as default the value of an object associated with this reference: a tie or a constraint. |
Definition at line 23 of file ParameterReference.cpp.
References index, isDefault(), and reset().
|
virtualdefault |
IFunction * Mantid::API::ParameterReference::getLocalFunction | ( | ) | const |
Return pointer to the local function.
Definition at line 29 of file ParameterReference.cpp.
References m_function.
Referenced by MantidQt::MantidWidgets::FitPropertyBrowser::addTieToFunction(), Mantid::API::ParameterTie::asString(), MantidQt::MantidWidgets::FitPropertyBrowser::deleteTie(), Mantid::API::ParameterTie::findParametersOf(), Mantid::CurveFitting::Functions::CrystalFieldFunction::getParameterIndex(), Mantid::API::CompositeFunction::getParameterIndex(), Mantid::API::FunctionGenerator::getParameterIndex(), Mantid::API::FunctionParameterDecorator::getParameterIndex(), and Mantid::API::ParamFunction::getParameterIndex().
std::size_t Mantid::API::ParameterReference::getLocalIndex | ( | ) | const |
Return parameter index in the local function.
Definition at line 32 of file ParameterReference.cpp.
References m_index.
Referenced by MantidQt::MantidWidgets::FitPropertyBrowser::addTieToFunction(), MantidQt::MantidWidgets::FitPropertyBrowser::deleteTie(), Mantid::CurveFitting::Functions::CrystalFieldFunction::getParameterIndex(), Mantid::API::CompositeFunction::getParameterIndex(), Mantid::API::FunctionGenerator::getParameterIndex(), Mantid::API::FunctionParameterDecorator::getParameterIndex(), and Mantid::API::ParamFunction::getParameterIndex().
double Mantid::API::ParameterReference::getParameter | ( | ) | const |
Get the value of the parameter.
Definition at line 76 of file ParameterReference.cpp.
References Mantid::API::IFunction::getParameter(), m_function, and m_index.
Referenced by Mantid::CurveFitting::Constraints::BoundaryConstraint::check(), Mantid::CurveFitting::Constraints::BoundaryConstraint::checkDeriv(), Mantid::CurveFitting::Constraints::BoundaryConstraint::checkDeriv2(), and Mantid::CurveFitting::Constraints::BoundaryConstraint::setParamToSatisfyConstraint().
bool Mantid::API::ParameterReference::isDefault | ( | ) | const |
Returns the default value flag.
Definition at line 81 of file ParameterReference.cpp.
References m_isDefault.
Referenced by Mantid::CurveFitting::Constraints::BoundaryConstraint::BoundaryConstraint(), Mantid::CurveFitting::Constraints::BoundaryConstraint::initialize(), ParameterReference(), and reset().
bool Mantid::API::ParameterReference::isParameterOf | ( | const IFunction * | fun | ) | const |
Find out if this refers to a parameter of a function: direct or via composite function member.
fun | :: A function to check. |
Definition at line 86 of file ParameterReference.cpp.
References Mantid::API::CompositeFunction::functionIndex(), m_function, and m_index.
IFunction * Mantid::API::ParameterReference::ownerFunction | ( | ) | const |
Definition at line 78 of file ParameterReference.cpp.
References m_owner.
std::size_t Mantid::API::ParameterReference::parameterIndex | ( | ) | const |
Return parameter index in the owning function.
Definition at line 35 of file ParameterReference.cpp.
References Mantid::API::IFunction::getParameterIndex(), and m_owner.
Referenced by parameterName().
std::string Mantid::API::ParameterReference::parameterName | ( | ) | const |
Return parameter name in the owning function.
Definition at line 38 of file ParameterReference.cpp.
References m_owner, parameterIndex(), and Mantid::API::IFunction::parameterName().
Referenced by Mantid::CurveFitting::Constraints::BoundaryConstraint::asString(), Mantid::CurveFitting::Constraints::BoundaryConstraint::check(), and Mantid::CurveFitting::Constraints::BoundaryConstraint::setParamToSatisfyConstraint().
|
protected |
Reset the reference.
fun | :: Pointer to a function (composite or simple). |
index | :: Index of a parameter of fun |
isDefault | :: Flag to mark as default the value of an object associated with this reference: a tie or a constraint. |
Definition at line 48 of file ParameterReference.cpp.
References Mantid::API::CompositeFunction::functionIndex(), Mantid::API::IFunction::getFunction(), index, isDefault(), m_function, m_index, m_isDefault, m_owner, and Mantid::API::IFunction::parameterIndex().
Referenced by Mantid::CurveFitting::Constraints::BoundaryConstraint::BoundaryConstraint(), Mantid::CurveFitting::Constraints::BoundaryConstraint::initialize(), and ParameterReference().
void Mantid::API::ParameterReference::setParameter | ( | const double & | value, |
bool | isExplicitlySet = true |
||
) |
Set the parameter.
value | :: A value to set. |
isExplicitlySet | :: Flag that user explicitly set this parameter. |
Definition at line 71 of file ParameterReference.cpp.
References m_function, m_index, Mantid::API::IFunction::setParameter(), and value.
Referenced by Mantid::API::ParameterTie::eval(), and Mantid::CurveFitting::Constraints::BoundaryConstraint::setParamToSatisfyConstraint().
|
private |
Function that together with m_index uniquely identify the parameter.
Definition at line 48 of file ParameterReference.h.
Referenced by getLocalFunction(), getParameter(), isParameterOf(), reset(), and setParameter().
|
private |
Index of the parameter in m_function.
It is assumed that this index uniquely identifies the parameter withing m_function
Definition at line 51 of file ParameterReference.h.
Referenced by getLocalIndex(), getParameter(), isParameterOf(), reset(), and setParameter().
|
private |
Flag to mark as default the value of an object associated with this reference: a tie or a constraint.
Definition at line 54 of file ParameterReference.h.
Referenced by isDefault(), and reset().
|
private |
Function-owner of this reference.
parameterName() and parameterIndex() return values relative to this function.
Definition at line 46 of file ParameterReference.h.
Referenced by ownerFunction(), parameterIndex(), parameterName(), and reset().