|
Mantid
|
#include <FunctionModel.h>
Public Member Functions | |
| void | addConstraint (std::string const &functionIndex, std::string const &constraint) override |
| void | addDatasets (const std::vector< std::string > &datasetNames) |
| Adds datasets based on their workspace names. | |
| void | addFunction (std::string const &prefix, std::string const &funStr) override |
| void | changeTie (std::string const ¶meterName, std::string const &tie) override |
| int | currentDomainIndex () const override |
| IFunction::Attribute | getAttribute (std::string const &attrName) const |
| std::vector< std::string > | getAttributeNames () const |
| IFunction_sptr | getCurrentFunction () const override |
| std::vector< std::string > | getDatasetDomainNames () const override |
| Returns names for the domains of each dataset. | |
| std::vector< std::string > | getDatasetNames () const override |
| Returns the workspace names of the datasets. | |
| IFunction_sptr | getFitFunction () const override |
| IFunction_sptr | getFullFunction () const override |
| std::vector< std::string > | getGlobalParameters () const override |
| std::string | getLocalParameterConstraint (std::string const ¶meterName, int i) const override |
| std::vector< std::string > | getLocalParameters () const override |
| std::string | getLocalParameterTie (std::string const ¶meterName, int i) const override |
| double | getLocalParameterValue (std::string const ¶meterName, int i) const override |
| int | getNumberDomains () const override |
| double | getParameter (std::string const ¶meterName) const override |
| std::string | getParameterDescription (std::string const ¶meterName) const override |
| double | getParameterError (std::string const ¶meterName) const override |
| std::vector< std::string > | getParameterNames () const override |
| std::string | getParameterTie (std::string const ¶meterName) const |
| IFunction_sptr | getSingleFunction (int index) const override |
| bool | hasFunction () const override |
| bool | isGlobal (std::string const ¶meterName) const override |
| bool | isLocalParameterFixed (std::string const ¶meterName, int i) const override |
| bool | isParameterFixed (std::string const ¶meterName) const |
| void | removeConstraint (std::string const ¶meterName) override |
| void | removeDatasets (QList< int > &indices) |
| Removes datasets (i.e. | |
| void | removeFunction (std::string const &functionIndex) override |
| void | setAttribute (std::string const &attrName, const IFunction::Attribute &val) |
| std::string | setBackgroundA0 (double value) override |
| void | setCurrentDomainIndex (int) override |
| void | setDatasets (const QList< FunctionModelDataset > &datasets) override |
| Sets the datasets using a map of <workspace name, spectra list>. | |
| void | setDatasets (const std::vector< std::string > &datasetNames) |
| Sets the datasets based on their workspace names. | |
| void | setFunction (IFunction_sptr) override |
| virtual void | setGlobal (std::string const ¶meterName, bool on) override |
| void | setGlobalParameters (const std::vector< std::string > &globals) override |
| void | setGlobalParameterValue (std::string const ¶meterName, double value) override |
| void | setLocalParameterConstraint (std::string const ¶meterName, int i, std::string const &constraint) override |
| void | setLocalParameterFixed (std::string const ¶meterName, int i, bool fixed) override |
| void | setLocalParameterTie (std::string const ¶meterName, int i, std::string const &tie) override |
| void | setLocalParameterValue (std::string const ¶meterName, int i, double value) override |
| void | setLocalParameterValue (std::string const ¶meterName, int i, double value, double error) override |
| void | setNumberDomains (int) override |
| void | setParameter (std::string const ¶meterName, double value) override |
| void | setParameterError (std::string const ¶meterName, double value) override |
| void | setParameterFixed (std::string const ¶meterName, bool fixed) |
| void | setParameterTie (std::string const ¶meterName, std::string const &tie) |
| void | setQValues (const std::vector< double > &qValues) override |
| void | setResolution (const std::vector< std::pair< std::string, size_t > > &fitResolutions) override |
| void | updateMultiDatasetAttributes (const IFunction &fun) |
| void | updateMultiDatasetParameters (const IFunction &fun) override |
| void | updateMultiDatasetParameters (const ITableWorkspace ¶mTable) override |
| void | updateParameters (const IFunction &fun) override |
Public Member Functions inherited from MantidQt::MantidWidgets::IFunctionModel | |
| void | clear () |
| std::string | getFitFunctionString () const |
| std::string | getFunctionString () const |
| int | getNumberLocalFunctions () const |
| void | setFunctionString (std::string const &funStr) |
| virtual | ~IFunctionModel ()=default |
Protected Attributes | |
| MultiDomainFunction_sptr | m_function |
| size_t | m_numberDomains = 0 |
Private Member Functions | |
| void | checkDatasets () |
| Check that the number of domains is correct for m_datasets. | |
| bool | checkIndex (int const index) const |
| void | checkNumberOfDomains (const QList< FunctionModelDataset > &datasets) const |
| Check that the datasets supplied have the expected total number of domains. | |
| IFunction_sptr | getFitFunctionWithGlobals (std::size_t const &index) const |
| int | numberOfDomains (const QList< FunctionModelDataset > &datasets) const |
| void | setResolutionFromWorkspace (const IFunction_sptr &fun) |
| void | setResolutionFromWorkspace (const IFunction_sptr &fun, const MatrixWorkspace_sptr &workspace) |
| void | updateGlobals () |
Private Attributes | |
| size_t | m_currentDomainIndex = 0 |
| QList< FunctionModelDataset > | m_datasets |
| std::vector< std::string > | m_globalParameterNames |
Additional Inherited Members | |
Protected Member Functions inherited from MantidQt::MantidWidgets::IFunctionModel | |
| void | copyParametersAndErrorsToAllLocalFunctions (const IFunction &fun) |
Static Protected Member Functions inherited from MantidQt::MantidWidgets::IFunctionModel | |
| static void | copyParametersAndErrors (const IFunction &funFrom, IFunction &funTo) |
Definition at line 23 of file FunctionModel.h.
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 464 of file FunctionModel.cpp.
References getCurrentFunction(), and MantidQt::MantidWidgets::getFunctionWithPrefix().
| void MantidQt::MantidWidgets::FunctionModel::addDatasets | ( | const std::vector< std::string > & | datasetNames | ) |
Adds datasets based on their workspace names.
This assumes there is only a single spectrum in the added workspaces.
| datasetNames | :: Names of the workspaces to be added. |
Definition at line 296 of file FunctionModel.cpp.
References m_datasets, numberOfDomains(), and setNumberDomains().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 101 of file FunctionModel.cpp.
References MantidQt::MantidWidgets::IFunctionModel::getFunctionString(), MantidQt::MantidWidgets::getFunctionWithPrefix(), getSingleFunction(), hasFunction(), m_function, m_numberDomains, MantidQt::MantidWidgets::IFunctionModel::setFunctionString(), and updateGlobals().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 456 of file FunctionModel.cpp.
References m_currentDomainIndex, and setLocalParameterTie().
|
private |
Check that the number of domains is correct for m_datasets.
Definition at line 500 of file FunctionModel.cpp.
References m_datasets, m_numberDomains, numberOfDomains(), and std::to_string().
Referenced by removeDatasets().
|
private |
Definition at line 521 of file FunctionModel.cpp.
References getNumberDomains(), and index.
Referenced by getSingleFunction(), and setCurrentDomainIndex().
|
private |
Check that the datasets supplied have the expected total number of domains.
Definition at line 509 of file FunctionModel.cpp.
References m_numberDomains, and numberOfDomains().
Referenced by setDatasets().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 351 of file FunctionModel.cpp.
References m_currentDomainIndex.
Referenced by removeDatasets(), and updateMultiDatasetParameters().
| IFunction::Attribute MantidQt::MantidWidgets::FunctionModel::getAttribute | ( | std::string const & | attrName | ) | const |
Definition at line 181 of file FunctionModel.cpp.
References getCurrentFunction().
| std::vector< std::string > MantidQt::MantidWidgets::FunctionModel::getAttributeNames | ( | ) | const |
Definition at line 218 of file FunctionModel.cpp.
References getCurrentFunction(), and hasFunction().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 232 of file FunctionModel.cpp.
References getSingleFunction(), and m_currentDomainIndex.
Referenced by addConstraint(), MantidQt::MantidWidgets::ConvolutionFunctionModel::findComponentPrefixes(), getAttribute(), getAttributeNames(), getParameter(), getParameterDescription(), getParameterError(), getParameterNames(), removeConstraint(), setAttribute(), setBackgroundA0(), setParameterError(), updateGlobals(), and updateParameters().
|
overridevirtual |
Returns names for the domains of each dataset.
If a dataset has multiple spectra, then a domain name will include the spectrum number of a domain in a workspace. This is required for EditLocalParameterDialog.
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 340 of file FunctionModel.cpp.
References m_datasets.
|
overridevirtual |
Returns the workspace names of the datasets.
If a dataset has N spectra, then the workspace name is multiplied by N. This is required for EditLocalParameterDialog.
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 327 of file FunctionModel.cpp.
References m_datasets, and UNUSED_ARG.
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 52 of file FunctionModel.cpp.
References getFitFunctionWithGlobals(), m_currentDomainIndex, and m_function.
|
private |
Definition at line 74 of file FunctionModel.cpp.
References index, m_function, and m_globalParameterNames.
Referenced by getFitFunction().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 47 of file FunctionModel.cpp.
References m_function.
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 473 of file FunctionModel.cpp.
References m_globalParameterNames.
Referenced by updateMultiDatasetParameters().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 380 of file FunctionModel.cpp.
References getSingleFunction().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 491 of file FunctionModel.cpp.
References getParameterNames().
Referenced by updateMultiDatasetParameters().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 369 of file FunctionModel.cpp.
References getSingleFunction().
Referenced by getParameterTie().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 359 of file FunctionModel.cpp.
References getSingleFunction().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 349 of file FunctionModel.cpp.
References m_numberDomains.
Referenced by checkIndex(), and setGlobalParameterValue().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 176 of file FunctionModel.cpp.
References getCurrentFunction().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 191 of file FunctionModel.cpp.
References getCurrentFunction().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 186 of file FunctionModel.cpp.
References getCurrentFunction().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 212 of file FunctionModel.cpp.
References getCurrentFunction(), and hasFunction().
Referenced by getLocalParameters().
| std::string MantidQt::MantidWidgets::FunctionModel::getParameterTie | ( | std::string const & | parameterName | ) | const |
Definition at line 200 of file FunctionModel.cpp.
References getLocalParameterTie(), and m_currentDomainIndex.
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 225 of file FunctionModel.cpp.
References checkIndex(), hasFunction(), index, and m_function.
Referenced by addFunction(), getCurrentFunction(), getLocalParameterConstraint(), getLocalParameterTie(), getLocalParameterValue(), isLocalParameterFixed(), removeFunction(), setLocalParameterConstraint(), setLocalParameterFixed(), setLocalParameterTie(), setLocalParameterValue(), and setLocalParameterValue().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 95 of file FunctionModel.cpp.
References m_function.
Referenced by addFunction(), getAttributeNames(), getParameterNames(), getSingleFunction(), setNumberDomains(), updateMultiDatasetAttributes(), updateMultiDatasetParameters(), and updateParameters().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 626 of file FunctionModel.cpp.
References m_globalParameterNames.
Referenced by setGlobalParameterValue(), and setParameter().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 363 of file FunctionModel.cpp.
References getSingleFunction().
Referenced by isParameterFixed().
| bool MantidQt::MantidWidgets::FunctionModel::isParameterFixed | ( | std::string const & | parameterName | ) | const |
Definition at line 196 of file FunctionModel.cpp.
References isLocalParameterFixed(), and m_currentDomainIndex.
|
private |
Definition at line 515 of file FunctionModel.cpp.
Referenced by addDatasets(), checkDatasets(), checkNumberOfDomains(), and removeDatasets().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 469 of file FunctionModel.cpp.
References getCurrentFunction().
| void MantidQt::MantidWidgets::FunctionModel::removeDatasets | ( | QList< int > & | indices | ) |
Removes datasets (i.e.
workspaces) from the Function model based on the index of the dataset in the QList.
Definition at line 305 of file FunctionModel.cpp.
References checkDatasets(), currentDomainIndex(), m_datasets, numberOfDomains(), setCurrentDomainIndex(), and setNumberDomains().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 125 of file FunctionModel.cpp.
References MantidQt::MantidWidgets::IFunctionModel::clear(), MantidQt::MantidWidgets::getFunctionWithPrefix(), getSingleFunction(), index, m_function, m_numberDomains, MantidQt::MantidWidgets::splitFunctionPrefix(), and updateGlobals().
| void MantidQt::MantidWidgets::FunctionModel::setAttribute | ( | std::string const & | attrName, |
| const IFunction::Attribute & | val | ||
| ) |
Definition at line 160 of file FunctionModel.cpp.
References getCurrentFunction(), and value.
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 631 of file FunctionModel.cpp.
References getCurrentFunction(), std::to_string(), and value.
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 353 of file FunctionModel.cpp.
References checkIndex(), index, and m_currentDomainIndex.
Referenced by removeDatasets().
|
overridevirtual |
Sets the datasets using a map of <workspace name, spectra list>.
This should be used when the workspaces being fitted have multiple spectra.
| datasets | :: Names of workspaces to be fitted paired to a spectra list. |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 288 of file FunctionModel.cpp.
References checkNumberOfDomains(), and m_datasets.
| void MantidQt::MantidWidgets::FunctionModel::setDatasets | ( | const std::vector< std::string > & | datasetNames | ) |
Sets the datasets based on their workspace names.
This assumes there is only a single spectrum in the workspaces being fitted.
| datasetNames | :: Names of the workspaces to be fitted. |
Definition at line 276 of file FunctionModel.cpp.
References setDatasets().
Referenced by setDatasets().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 29 of file FunctionModel.cpp.
References m_function, m_globalParameterNames, m_numberDomains, and setResolutionFromWorkspace().
Referenced by MantidQt::MantidWidgets::ConvolutionFunctionModel::setFunction().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 475 of file FunctionModel.cpp.
References m_globalParameterNames.
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 489 of file FunctionModel.cpp.
References m_globalParameterNames.
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 450 of file FunctionModel.cpp.
References getNumberDomains(), isGlobal(), setLocalParameterValue(), and value.
Referenced by setParameter().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 431 of file FunctionModel.cpp.
References Mantid::Kernel::Logger::error(), Mantid::API::g_log, MantidQt::MantidWidgets::getFunctionWithPrefix(), getSingleFunction(), name, MantidQt::MantidWidgets::splitConstraintString(), and MantidQt::MantidWidgets::splitParameterName().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 401 of file FunctionModel.cpp.
References getSingleFunction().
Referenced by setParameterFixed().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 411 of file FunctionModel.cpp.
References Mantid::Kernel::Logger::error(), Mantid::API::g_log, getSingleFunction(), and name.
Referenced by changeTie(), and setParameterTie().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 388 of file FunctionModel.cpp.
References getSingleFunction(), and value.
Referenced by setGlobalParameterValue(), setParameter(), and updateMultiDatasetParameters().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 394 of file FunctionModel.cpp.
References error, getSingleFunction(), and value.
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 236 of file FunctionModel.cpp.
References hasFunction(), m_currentDomainIndex, m_function, and m_numberDomains.
Referenced by addDatasets(), and removeDatasets().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 153 of file FunctionModel.cpp.
References isGlobal(), m_currentDomainIndex, setGlobalParameterValue(), setLocalParameterValue(), and value.
Referenced by updateMultiDatasetParameters().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 170 of file FunctionModel.cpp.
References getCurrentFunction(), index, and value.
Referenced by updateMultiDatasetParameters().
| void MantidQt::MantidWidgets::FunctionModel::setParameterFixed | ( | std::string const & | parameterName, |
| bool | fixed | ||
| ) |
Definition at line 204 of file FunctionModel.cpp.
References m_currentDomainIndex, and setLocalParameterFixed().
| void MantidQt::MantidWidgets::FunctionModel::setParameterTie | ( | std::string const & | parameterName, |
| std::string const & | tie | ||
| ) |
Definition at line 208 of file FunctionModel.cpp.
References m_currentDomainIndex, and setLocalParameterTie().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 659 of file FunctionModel.cpp.
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 655 of file FunctionModel.cpp.
|
private |
Definition at line 593 of file FunctionModel.cpp.
References index, n, and setResolutionFromWorkspace().
Referenced by setFunction(), and setResolutionFromWorkspace().
|
private |
Definition at line 610 of file FunctionModel.cpp.
References workspace.
|
private |
Definition at line 582 of file FunctionModel.cpp.
References getCurrentFunction(), and m_globalParameterNames.
Referenced by addFunction(), and removeFunction().
| void MantidQt::MantidWidgets::FunctionModel::updateMultiDatasetAttributes | ( | const IFunction & | fun | ) |
Definition at line 565 of file FunctionModel.cpp.
References Mantid::API::IFunction::getAttribute(), Mantid::API::IFunction::getAttributeNames(), hasFunction(), m_function, name, and Mantid::API::IFunction::nAttributes().
Referenced by updateMultiDatasetParameters().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 530 of file FunctionModel.cpp.
References MantidQt::MantidWidgets::IFunctionModel::copyParametersAndErrors(), hasFunction(), m_function, and updateMultiDatasetAttributes().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 537 of file FunctionModel.cpp.
References currentDomainIndex(), Mantid::API::ITableWorkspace::getColumn(), getGlobalParameters(), getLocalParameters(), name, Mantid::API::ITableWorkspace::rowCount(), setLocalParameterValue(), setParameter(), and setParameterError().
|
overridevirtual |
Implements MantidQt::MantidWidgets::IFunctionModel.
Definition at line 575 of file FunctionModel.cpp.
References MantidQt::MantidWidgets::IFunctionModel::copyParametersAndErrors(), getCurrentFunction(), and hasFunction().
|
private |
Definition at line 96 of file FunctionModel.h.
Referenced by changeTie(), currentDomainIndex(), getCurrentFunction(), getFitFunction(), getParameterTie(), isParameterFixed(), setCurrentDomainIndex(), setNumberDomains(), setParameter(), setParameterFixed(), and setParameterTie().
|
mutableprivate |
Definition at line 99 of file FunctionModel.h.
Referenced by addDatasets(), checkDatasets(), getDatasetDomainNames(), getDatasetNames(), removeDatasets(), and setDatasets().
|
protected |
Definition at line 84 of file FunctionModel.h.
Referenced by addFunction(), getFitFunction(), getFitFunctionWithGlobals(), getFullFunction(), getSingleFunction(), hasFunction(), removeFunction(), setFunction(), setNumberDomains(), updateMultiDatasetAttributes(), and updateMultiDatasetParameters().
|
mutableprivate |
Definition at line 100 of file FunctionModel.h.
Referenced by getFitFunctionWithGlobals(), getGlobalParameters(), isGlobal(), setFunction(), setGlobal(), setGlobalParameters(), and updateGlobals().
|
protected |
Definition at line 83 of file FunctionModel.h.
Referenced by addFunction(), checkDatasets(), checkNumberOfDomains(), getNumberDomains(), removeFunction(), setFunction(), MantidQt::MantidWidgets::ConvolutionFunctionModel::setModel(), and setNumberDomains().