Mantid
|
This class is used to store all data relating to a single domain to be fitted. More...
#include <FitDomain.h>
Public Member Functions | |
void | addFunction (Mantid::API::IFunction_sptr const &function) |
void | clearParameterTie (std::string const ¶meter) |
std::string | domainName () const |
double | endX () const noexcept |
FitDomain (std::string workspaceName, WorkspaceIndex workspaceIndex, double startX, double endX) | |
Mantid::API::IFunction::Attribute | getAttributeValue (std::string const &attribute) const |
Mantid::API::IFunction_sptr | getFunctionCopy () const |
std::string | getParameterConstraint (std::string const ¶meter) const |
std::vector< std::string > | getParametersTiedTo (std::string const ¶meter) const |
std::string | getParameterTie (std::string const ¶meter) const |
double | getParameterValue (std::string const ¶meter) const |
bool | hasParameter (std::string const ¶meter) const |
bool | isParameterActive (std::string const ¶meter) const |
bool | isParameterFixed (std::string const ¶meter) const |
bool | isParameterValueWithinConstraints (std::string const ¶meter, double value) const |
void | removeFunction (std::string const &function) |
void | removeParameterConstraint (std::string const ¶meter) |
void | setAttributeValue (std::string const &attribute, const Mantid::API::IFunction::Attribute &newValue) |
bool | setEndX (double startX) |
void | setFunction (Mantid::API::IFunction_sptr const &function) |
void | setParameterFixed (std::string const ¶meter, bool fix) const |
void | setParameterValue (std::string const ¶meter, double newValue) |
bool | setStartX (double startX) |
void | setWorkspaceName (std::string const &workspaceName) |
double | startX () const noexcept |
void | updateParameterConstraint (std::string const &functionIndex, std::string const ¶meter, std::string const &constraint) |
bool | updateParameterTie (std::string const ¶meter, std::string const &tie) |
WorkspaceIndex | workspaceIndex () const noexcept |
std::string | workspaceName () const noexcept |
Private Member Functions | |
void | addFunctionToExisting (Mantid::API::IFunction_sptr const &function) |
void | appendParametersTiedTo (std::vector< std::string > &tiedParameters, std::string const ¶meter, std::size_t const ¶meterIndex) const |
double | getTieValue (std::string const &tie) const |
bool | isValidEndX (double endX) const |
bool | isValidParameterConstraint (std::string const ¶meter, std::string const &constraint) const |
bool | isValidParameterTie (std::string const ¶meter, std::string const &tie) const |
bool | isValidStartX (double startX) const |
void | removeFunctionFromComposite (std::string const &function, Mantid::API::CompositeFunction_sptr &composite) |
void | removeFunctionFromIFunction (std::string const &function, Mantid::API::IFunction_sptr &iFunction) |
void | removeInvalidatedTies () |
bool | setParameterTie (std::string const ¶meter, std::string const &tie) |
void | updateParameterConstraint (Mantid::API::CompositeFunction_sptr &composite, std::string const &functionIndex, std::string const ¶meter, std::string const &constraint) |
std::pair< double, double > | xLimits () const |
std::pair< double, double > | xLimits (Mantid::API::MatrixWorkspace_const_sptr const &workspace, WorkspaceIndex workspaceIndex) const |
Private Attributes | |
double | m_endX |
Mantid::API::IFunction_sptr | m_function |
double | m_startX |
WorkspaceIndex | m_workspaceIndex |
std::string | m_workspaceName |
This class is used to store all data relating to a single domain to be fitted.
This includes the location of the domain (workspace Name & index), the fit range (start and end X), and the function to be fitted over.
Definition at line 27 of file FitDomain.h.
MantidQt::MantidWidgets::FitDomain::FitDomain | ( | std::string | workspaceName, |
WorkspaceIndex | workspaceIndex, | ||
double | startX, | ||
double | endX | ||
) |
Definition at line 54 of file FitDomain.cpp.
void MantidQt::MantidWidgets::FitDomain::addFunction | ( | Mantid::API::IFunction_sptr const & | function | ) |
Definition at line 116 of file FitDomain.cpp.
References addFunctionToExisting(), and m_function.
|
private |
Definition at line 124 of file FitDomain.cpp.
References Mantid::Kernel::Logger::error(), Mantid::API::g_log, and m_function.
Referenced by addFunction().
|
private |
Definition at line 301 of file FitDomain.cpp.
References m_function.
Referenced by getParametersTiedTo().
void MantidQt::MantidWidgets::FitDomain::clearParameterTie | ( | std::string const & | parameter | ) |
Definition at line 235 of file FitDomain.cpp.
References hasParameter(), and m_function.
Referenced by removeInvalidatedTies().
std::string MantidQt::MantidWidgets::FitDomain::domainName | ( | ) | const |
Definition at line 60 of file FitDomain.cpp.
References m_workspaceIndex, m_workspaceName, std::to_string(), and MantidQt::MantidWidgets::IndexType< Class >::value.
|
inlinenoexcept |
Definition at line 42 of file FitDomain.h.
Referenced by isValidEndX(), and setEndX().
Mantid::API::IFunction::Attribute MantidQt::MantidWidgets::FitDomain::getAttributeValue | ( | std::string const & | attribute | ) | const |
Definition at line 176 of file FitDomain.cpp.
References m_function.
Mantid::API::IFunction_sptr MantidQt::MantidWidgets::FitDomain::getFunctionCopy | ( | ) | const |
Definition at line 80 of file FitDomain.cpp.
References m_function.
std::string MantidQt::MantidWidgets::FitDomain::getParameterConstraint | ( | std::string const & | parameter | ) | const |
Definition at line 226 of file FitDomain.cpp.
References hasParameter(), and m_function.
Referenced by MantidQt::MantidWidgets::FitScriptGeneratorModel::getParameterConstraint().
std::vector< std::string > MantidQt::MantidWidgets::FitDomain::getParametersTiedTo | ( | std::string const & | parameter | ) | const |
Definition at line 292 of file FitDomain.cpp.
References appendParametersTiedTo(), and m_function.
std::string MantidQt::MantidWidgets::FitDomain::getParameterTie | ( | std::string const & | parameter | ) | const |
Definition at line 212 of file FitDomain.cpp.
References hasParameter(), and m_function.
Referenced by MantidQt::MantidWidgets::FitScriptGeneratorModel::getParameterTie().
double MantidQt::MantidWidgets::FitDomain::getParameterValue | ( | std::string const & | parameter | ) | const |
Definition at line 157 of file FitDomain.cpp.
References hasParameter(), and m_function.
Referenced by MantidQt::MantidWidgets::FitScriptGeneratorModel::getParameterValue(), getTieValue(), isValidParameterTie(), and setParameterFixed().
|
private |
Definition at line 163 of file FitDomain.cpp.
References getParameterValue(), and MantidQt::MantidWidgets::isNumber().
Referenced by setParameterTie().
bool MantidQt::MantidWidgets::FitDomain::hasParameter | ( | std::string const & | parameter | ) | const |
Definition at line 182 of file FitDomain.cpp.
References m_function.
Referenced by clearParameterTie(), getParameterConstraint(), getParameterTie(), getParameterValue(), MantidQt::MantidWidgets::FitScriptGeneratorModel::hasParameter(), isParameterActive(), isParameterFixed(), isParameterValueWithinConstraints(), isValidParameterConstraint(), removeParameterConstraint(), setParameterFixed(), setParameterValue(), and updateParameterTie().
bool MantidQt::MantidWidgets::FitDomain::isParameterActive | ( | std::string const & | parameter | ) | const |
Definition at line 188 of file FitDomain.cpp.
References hasParameter(), and m_function.
bool MantidQt::MantidWidgets::FitDomain::isParameterFixed | ( | std::string const & | parameter | ) | const |
Definition at line 205 of file FitDomain.cpp.
References hasParameter(), and m_function.
Referenced by MantidQt::MantidWidgets::FitScriptGeneratorModel::isParameterFixed().
bool MantidQt::MantidWidgets::FitDomain::isParameterValueWithinConstraints | ( | std::string const & | parameter, |
double | value | ||
) | const |
Definition at line 311 of file FitDomain.cpp.
References Mantid::API::g_log, hasParameter(), m_function, value, and Mantid::Kernel::Logger::warning().
Referenced by isValidParameterTie(), removeInvalidatedTies(), and setParameterValue().
|
private |
|
private |
Definition at line 334 of file FitDomain.cpp.
References Mantid::API::g_log, hasParameter(), m_function, and Mantid::Kernel::Logger::warning().
Referenced by updateParameterConstraint().
|
private |
Definition at line 326 of file FitDomain.cpp.
References getParameterValue(), MantidQt::MantidWidgets::isNumber(), and isParameterValueWithinConstraints().
Referenced by setParameterTie().
|
private |
Definition at line 345 of file FitDomain.cpp.
References m_endX, startX(), and xLimits().
Referenced by setStartX().
void MantidQt::MantidWidgets::FitDomain::removeFunction | ( | std::string const & | function | ) |
Definition at line 86 of file FitDomain.cpp.
References m_function, removeFunctionFromComposite(), and removeFunctionFromIFunction().
|
private |
Definition at line 104 of file FitDomain.cpp.
References m_function.
Referenced by removeFunction().
|
private |
Definition at line 95 of file FitDomain.cpp.
Referenced by removeFunction().
|
private |
Definition at line 147 of file FitDomain.cpp.
References clearParameterTie(), isParameterValueWithinConstraints(), and m_function.
Referenced by setParameterValue().
void MantidQt::MantidWidgets::FitDomain::removeParameterConstraint | ( | std::string const & | parameter | ) |
Definition at line 267 of file FitDomain.cpp.
References hasParameter(), and m_function.
void MantidQt::MantidWidgets::FitDomain::setAttributeValue | ( | std::string const & | attribute, |
const Mantid::API::IFunction::Attribute & | newValue | ||
) |
Definition at line 171 of file FitDomain.cpp.
References m_function.
bool MantidQt::MantidWidgets::FitDomain::setEndX | ( | double | startX | ) |
Definition at line 71 of file FitDomain.cpp.
References endX(), isValidEndX(), and m_endX.
void MantidQt::MantidWidgets::FitDomain::setFunction | ( | Mantid::API::IFunction_sptr const & | function | ) |
Definition at line 78 of file FitDomain.cpp.
References m_function.
void MantidQt::MantidWidgets::FitDomain::setParameterFixed | ( | std::string const & | parameter, |
bool | fix | ||
) | const |
Definition at line 194 of file FitDomain.cpp.
References getParameterValue(), hasParameter(), m_function, and std::to_string().
|
private |
Definition at line 251 of file FitDomain.cpp.
References Mantid::API::g_log, getTieValue(), isValidParameterTie(), m_function, setParameterValue(), and Mantid::Kernel::Logger::warning().
Referenced by updateParameterTie().
void MantidQt::MantidWidgets::FitDomain::setParameterValue | ( | std::string const & | parameter, |
double | newValue | ||
) |
Definition at line 140 of file FitDomain.cpp.
References hasParameter(), isParameterValueWithinConstraints(), m_function, and removeInvalidatedTies().
Referenced by setParameterTie().
bool MantidQt::MantidWidgets::FitDomain::setStartX | ( | double | startX | ) |
Definition at line 64 of file FitDomain.cpp.
References isValidStartX(), m_startX, and startX().
void MantidQt::MantidWidgets::FitDomain::setWorkspaceName | ( | std::string const & | workspaceName | ) |
Definition at line 58 of file FitDomain.cpp.
References m_workspaceName, and workspaceName().
|
inlinenoexcept |
Definition at line 41 of file FitDomain.h.
Referenced by isValidStartX(), and setStartX().
|
private |
Definition at line 282 of file FitDomain.cpp.
References MantidQt::MantidWidgets::getFunctionIndexAt(), and index.
void MantidQt::MantidWidgets::FitDomain::updateParameterConstraint | ( | std::string const & | functionIndex, |
std::string const & | parameter, | ||
std::string const & | constraint | ||
) |
Definition at line 272 of file FitDomain.cpp.
References isValidParameterConstraint(), m_function, and updateParameterConstraint().
Referenced by updateParameterConstraint().
bool MantidQt::MantidWidgets::FitDomain::updateParameterTie | ( | std::string const & | parameter, |
std::string const & | tie | ||
) |
Definition at line 240 of file FitDomain.cpp.
References hasParameter(), m_function, and setParameterTie().
|
inlinenoexcept |
Definition at line 36 of file FitDomain.h.
Referenced by xLimits().
|
inlinenoexcept |
Definition at line 35 of file FitDomain.h.
Referenced by setWorkspaceName().
|
private |
Definition at line 355 of file FitDomain.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance(), m_workspaceIndex, m_workspaceName, std::to_string(), MantidQt::MantidWidgets::IndexType< Class >::value, and xLimits().
Referenced by isValidEndX(), isValidStartX(), and xLimits().
|
private |
Definition at line 364 of file FitDomain.cpp.
References m_workspaceName, MantidQt::MantidWidgets::IndexType< Class >::value, workspace, and workspaceIndex().
|
private |
Definition at line 103 of file FitDomain.h.
Referenced by isValidStartX(), and setEndX().
|
private |
Definition at line 104 of file FitDomain.h.
Referenced by addFunction(), addFunctionToExisting(), appendParametersTiedTo(), clearParameterTie(), getAttributeValue(), getFunctionCopy(), getParameterConstraint(), getParametersTiedTo(), getParameterTie(), getParameterValue(), hasParameter(), isParameterActive(), isParameterFixed(), isParameterValueWithinConstraints(), isValidParameterConstraint(), removeFunction(), removeFunctionFromComposite(), removeInvalidatedTies(), removeParameterConstraint(), setAttributeValue(), setFunction(), setParameterFixed(), setParameterTie(), setParameterValue(), updateParameterConstraint(), and updateParameterTie().
|
private |
Definition at line 102 of file FitDomain.h.
Referenced by isValidEndX(), and setStartX().
|
private |
Definition at line 101 of file FitDomain.h.
Referenced by domainName(), and xLimits().
|
private |
Definition at line 100 of file FitDomain.h.
Referenced by domainName(), setWorkspaceName(), and xLimits().