Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MantidQt::MantidWidgets::FitDomain Class Reference

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 &parameter)
 
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 &parameter) const
 
std::vector< std::string > getParametersTiedTo (std::string const &parameter) const
 
std::string getParameterTie (std::string const &parameter) const
 
double getParameterValue (std::string const &parameter) const
 
bool hasParameter (std::string const &parameter) const
 
bool isParameterActive (std::string const &parameter) const
 
bool isParameterFixed (std::string const &parameter) const
 
bool isParameterValueWithinConstraints (std::string const &parameter, double value) const
 
void removeFunction (std::string const &function)
 
void removeParameterConstraint (std::string const &parameter)
 
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 &parameter, bool fix) const
 
void setParameterValue (std::string const &parameter, 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 &parameter, std::string const &constraint)
 
bool updateParameterTie (std::string const &parameter, 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 &parameter, std::size_t const &parameterIndex) const
 
double getTieValue (std::string const &tie) const
 
bool isValidEndX (double endX) const
 
bool isValidParameterConstraint (std::string const &parameter, std::string const &constraint) const
 
bool isValidParameterTie (std::string const &parameter, 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 &parameter, std::string const &tie)
 
void updateParameterConstraint (Mantid::API::CompositeFunction_sptr &composite, std::string const &functionIndex, std::string const &parameter, 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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ FitDomain()

MantidQt::MantidWidgets::FitDomain::FitDomain ( std::string  workspaceName,
WorkspaceIndex  workspaceIndex,
double  startX,
double  endX 
)

Definition at line 54 of file FitDomain.cpp.

Member Function Documentation

◆ addFunction()

void MantidQt::MantidWidgets::FitDomain::addFunction ( Mantid::API::IFunction_sptr const &  function)

Definition at line 116 of file FitDomain.cpp.

References addFunctionToExisting(), and m_function.

◆ addFunctionToExisting()

void MantidQt::MantidWidgets::FitDomain::addFunctionToExisting ( Mantid::API::IFunction_sptr const &  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().

◆ appendParametersTiedTo()

void MantidQt::MantidWidgets::FitDomain::appendParametersTiedTo ( std::vector< std::string > &  tiedParameters,
std::string const &  parameter,
std::size_t const &  parameterIndex 
) const
private

Definition at line 301 of file FitDomain.cpp.

References m_function.

Referenced by getParametersTiedTo().

◆ clearParameterTie()

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().

◆ domainName()

std::string MantidQt::MantidWidgets::FitDomain::domainName ( ) const

◆ endX()

double MantidQt::MantidWidgets::FitDomain::endX ( ) const
inlinenoexcept

Definition at line 42 of file FitDomain.h.

Referenced by isValidEndX(), and setEndX().

◆ getAttributeValue()

Mantid::API::IFunction::Attribute MantidQt::MantidWidgets::FitDomain::getAttributeValue ( std::string const &  attribute) const

Definition at line 176 of file FitDomain.cpp.

References m_function.

◆ getFunctionCopy()

Mantid::API::IFunction_sptr MantidQt::MantidWidgets::FitDomain::getFunctionCopy ( ) const

Definition at line 80 of file FitDomain.cpp.

References m_function.

◆ getParameterConstraint()

std::string MantidQt::MantidWidgets::FitDomain::getParameterConstraint ( std::string const &  parameter) const

◆ getParametersTiedTo()

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.

◆ getParameterTie()

std::string MantidQt::MantidWidgets::FitDomain::getParameterTie ( std::string const &  parameter) const

◆ getParameterValue()

double MantidQt::MantidWidgets::FitDomain::getParameterValue ( std::string const &  parameter) const

◆ getTieValue()

double MantidQt::MantidWidgets::FitDomain::getTieValue ( std::string const &  tie) const
private

Definition at line 163 of file FitDomain.cpp.

References getParameterValue(), and MantidQt::MantidWidgets::isNumber().

Referenced by setParameterTie().

◆ hasParameter()

bool MantidQt::MantidWidgets::FitDomain::hasParameter ( std::string const &  parameter) const

◆ isParameterActive()

bool MantidQt::MantidWidgets::FitDomain::isParameterActive ( std::string const &  parameter) const

Definition at line 188 of file FitDomain.cpp.

References hasParameter(), and m_function.

◆ isParameterFixed()

bool MantidQt::MantidWidgets::FitDomain::isParameterFixed ( std::string const &  parameter) const

◆ isParameterValueWithinConstraints()

bool MantidQt::MantidWidgets::FitDomain::isParameterValueWithinConstraints ( std::string const &  parameter,
double  value 
) const

◆ isValidEndX()

bool MantidQt::MantidWidgets::FitDomain::isValidEndX ( double  endX) const
private

Definition at line 350 of file FitDomain.cpp.

References endX(), m_startX, and xLimits().

Referenced by setEndX().

◆ isValidParameterConstraint()

bool MantidQt::MantidWidgets::FitDomain::isValidParameterConstraint ( std::string const &  parameter,
std::string const &  constraint 
) const
private

◆ isValidParameterTie()

bool MantidQt::MantidWidgets::FitDomain::isValidParameterTie ( std::string const &  parameter,
std::string const &  tie 
) const
private

◆ isValidStartX()

bool MantidQt::MantidWidgets::FitDomain::isValidStartX ( double  startX) const
private

Definition at line 345 of file FitDomain.cpp.

References m_endX, startX(), and xLimits().

Referenced by setStartX().

◆ removeFunction()

void MantidQt::MantidWidgets::FitDomain::removeFunction ( std::string const &  function)

◆ removeFunctionFromComposite()

void MantidQt::MantidWidgets::FitDomain::removeFunctionFromComposite ( std::string const &  function,
Mantid::API::CompositeFunction_sptr composite 
)
private

Definition at line 104 of file FitDomain.cpp.

References m_function.

Referenced by removeFunction().

◆ removeFunctionFromIFunction()

void MantidQt::MantidWidgets::FitDomain::removeFunctionFromIFunction ( std::string const &  function,
Mantid::API::IFunction_sptr iFunction 
)
private

Definition at line 95 of file FitDomain.cpp.

Referenced by removeFunction().

◆ removeInvalidatedTies()

void MantidQt::MantidWidgets::FitDomain::removeInvalidatedTies ( )
private

Definition at line 147 of file FitDomain.cpp.

References clearParameterTie(), isParameterValueWithinConstraints(), and m_function.

Referenced by setParameterValue().

◆ removeParameterConstraint()

void MantidQt::MantidWidgets::FitDomain::removeParameterConstraint ( std::string const &  parameter)

Definition at line 267 of file FitDomain.cpp.

References hasParameter(), and m_function.

◆ setAttributeValue()

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.

◆ setEndX()

bool MantidQt::MantidWidgets::FitDomain::setEndX ( double  startX)

Definition at line 71 of file FitDomain.cpp.

References endX(), isValidEndX(), and m_endX.

◆ setFunction()

void MantidQt::MantidWidgets::FitDomain::setFunction ( Mantid::API::IFunction_sptr const &  function)

Definition at line 78 of file FitDomain.cpp.

References m_function.

◆ setParameterFixed()

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().

◆ setParameterTie()

bool MantidQt::MantidWidgets::FitDomain::setParameterTie ( std::string const &  parameter,
std::string const &  tie 
)
private

◆ setParameterValue()

void MantidQt::MantidWidgets::FitDomain::setParameterValue ( std::string const &  parameter,
double  newValue 
)

◆ setStartX()

bool MantidQt::MantidWidgets::FitDomain::setStartX ( double  startX)

Definition at line 64 of file FitDomain.cpp.

References isValidStartX(), m_startX, and startX().

◆ setWorkspaceName()

void MantidQt::MantidWidgets::FitDomain::setWorkspaceName ( std::string const &  workspaceName)

Definition at line 58 of file FitDomain.cpp.

References m_workspaceName, and workspaceName().

◆ startX()

double MantidQt::MantidWidgets::FitDomain::startX ( ) const
inlinenoexcept

Definition at line 41 of file FitDomain.h.

Referenced by isValidStartX(), and setStartX().

◆ updateParameterConstraint() [1/2]

void MantidQt::MantidWidgets::FitDomain::updateParameterConstraint ( Mantid::API::CompositeFunction_sptr composite,
std::string const &  functionIndex,
std::string const &  parameter,
std::string const &  constraint 
)
private

Definition at line 282 of file FitDomain.cpp.

References MantidQt::MantidWidgets::getFunctionIndexAt(), and index.

◆ updateParameterConstraint() [2/2]

void MantidQt::MantidWidgets::FitDomain::updateParameterConstraint ( std::string const &  functionIndex,
std::string const &  parameter,
std::string const &  constraint 
)

◆ updateParameterTie()

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().

◆ workspaceIndex()

WorkspaceIndex MantidQt::MantidWidgets::FitDomain::workspaceIndex ( ) const
inlinenoexcept

Definition at line 36 of file FitDomain.h.

Referenced by xLimits().

◆ workspaceName()

std::string MantidQt::MantidWidgets::FitDomain::workspaceName ( ) const
inlinenoexcept

Definition at line 35 of file FitDomain.h.

Referenced by setWorkspaceName().

◆ xLimits() [1/2]

std::pair< double, double > MantidQt::MantidWidgets::FitDomain::xLimits ( ) const
private

◆ xLimits() [2/2]

std::pair< double, double > MantidQt::MantidWidgets::FitDomain::xLimits ( Mantid::API::MatrixWorkspace_const_sptr const &  workspace,
WorkspaceIndex  workspaceIndex 
) const
private

Member Data Documentation

◆ m_endX

double MantidQt::MantidWidgets::FitDomain::m_endX
private

Definition at line 103 of file FitDomain.h.

Referenced by isValidStartX(), and setEndX().

◆ m_function

Mantid::API::IFunction_sptr MantidQt::MantidWidgets::FitDomain::m_function
private

◆ m_startX

double MantidQt::MantidWidgets::FitDomain::m_startX
private

Definition at line 102 of file FitDomain.h.

Referenced by isValidEndX(), and setStartX().

◆ m_workspaceIndex

WorkspaceIndex MantidQt::MantidWidgets::FitDomain::m_workspaceIndex
private

Definition at line 101 of file FitDomain.h.

Referenced by domainName(), and xLimits().

◆ m_workspaceName

std::string MantidQt::MantidWidgets::FitDomain::m_workspaceName
private

Definition at line 100 of file FitDomain.h.

Referenced by domainName(), setWorkspaceName(), and xLimits().


The documentation for this class was generated from the following files: