Mantid
|
#include <GeneralDomainCreator.h>
Public Member Functions | |
void | createDomain (std::shared_ptr< API::FunctionDomain > &domain, std::shared_ptr< API::FunctionValues > &values, size_t i0=0) override |
Creates a domain corresponding to the assigned MatrixWorkspace. More... | |
API::Workspace_sptr | createOutputWorkspace (const std::string &baseName, API::IFunction_sptr function, std::shared_ptr< API::FunctionDomain > domain, std::shared_ptr< API::FunctionValues > values, const std::string &outputWorkspacePropertyName="OutputWorkspace") override |
Creates an output workspace using the given function and domain. More... | |
void | declareDatasetProperties (const std::string &suffix="", bool addProp=true) override |
Declare properties that specify the dataset within the workspace to fit to. More... | |
GeneralDomainCreator (const API::IFunctionGeneral &fun, Kernel::IPropertyManager &manager, const std::string &workspacePropertyName) | |
Constructor. More... | |
size_t | getDomainSize () const override |
Returns the domain size. More... | |
Public Member Functions inherited from Mantid::API::IDomainCreator | |
virtual void | createDomain (std::shared_ptr< API::FunctionDomain > &domain, std::shared_ptr< API::FunctionValues > &values, size_t i0=0)=0 |
Create a domain and values from the input workspace. More... | |
virtual std::shared_ptr< API::Workspace > | createOutputWorkspace (const std::string &baseName, API::IFunction_sptr function, std::shared_ptr< API::FunctionDomain > domain, std::shared_ptr< API::FunctionValues > values, const std::string &outputWorkspacePropertyName="OutputWorkspace") |
Create an output workspace filled with data simulated with the fitting function. More... | |
virtual void | declareDatasetProperties (const std::string &suffix="", bool addProp=true) |
Declare properties that specify the dataset within the workspace to fit to. More... | |
virtual size_t | getDomainSize () const =0 |
Return the size of the domain to be created. More... | |
IDomainCreator (Kernel::IPropertyManager *manager, std::vector< std::string > workspacePropertyNames, DomainType domainType=Simple) | |
Constrcutor. More... | |
void | ignoreInvalidData (bool yes) |
Set to ignore invalid data. More... | |
virtual void | initFunction (API::IFunction_sptr function) |
Initialize the function. More... | |
virtual void | initialize (Kernel::IPropertyManager *, const std::string &, DomainType) |
Initialize. More... | |
void | separateCompositeMembersInOutput (const bool value, const bool conv=false) |
Toggle output of either just composite or composite + members. More... | |
virtual | ~IDomainCreator ()=default |
Virtual destructor. More... | |
Private Member Functions | |
std::shared_ptr< API::ITableWorkspace > | getInputWorkspace () const |
Retrive the input workspace from the property manager. More... | |
Private Attributes | |
std::vector< std::string > | m_dataColumnNames |
Property names for columns in a TableWorkspace to be used as the data to fit to. More... | |
size_t | m_defaultValuesSize |
Default number of values. More... | |
std::vector< std::string > | m_domainColumnNames |
Property names for columns in a TableWorkspace to be passed to the domain. More... | |
std::vector< std::string > | m_weightsColumnNames |
Property names for columns in a TableWorkspace to be used as the fitting weights. More... | |
Additional Inherited Members | |
Public Types inherited from Mantid::API::IDomainCreator | |
enum | DomainType { Simple = 0 , Sequential , Parallel } |
Type of domain to create. More... | |
Protected Member Functions inherited from Mantid::API::IDomainCreator | |
void | declareProperty (Kernel::Property *prop, const std::string &doc) |
Declare a property to the algorithm. More... | |
Protected Attributes inherited from Mantid::API::IDomainCreator | |
bool | m_convolutionCompositeMembers |
Perform convolution of output composite components. More... | |
DomainType | m_domainType |
Domain type. More... | |
bool | m_ignoreInvalidData |
Flag to ignore nans, infinities and zero errors. More... | |
Kernel::IPropertyManager * | m_manager |
Pointer to a property manager. More... | |
bool | m_outputCompositeMembers |
Output separate composite function values. More... | |
std::vector< std::string > | m_workspacePropertyNames |
Property names for workspaces to get the data from. More... | |
GeneralDomainCreator creates a FunctionDomainGeneral which is used with IFunctionGeneral.
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
Mantid is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
File change history is stored at: https://github.com/mantidproject/mantid Code Documentation is available at: http://doxygen.mantidproject.org
Definition at line 48 of file GeneralDomainCreator.h.
Mantid::CurveFitting::GeneralDomainCreator::GeneralDomainCreator | ( | const API::IFunctionGeneral & | fun, |
Kernel::IPropertyManager & | manager, | ||
const std::string & | workspacePropertyName | ||
) |
Constructor.
fun | :: A function for which a domain is required. |
manager | :: Pointer to IPropertyManager (Algorithm) instance. |
workspacePropertyName | :: Name of the output property for a created workspace in case a PropertyManager is used. |
Definition at line 27 of file GeneralDomainCreator.cpp.
References Mantid::API::IFunctionGeneral::getDefaultDomainSize(), Mantid::API::IFunctionGeneral::getNumberDomainColumns(), Mantid::API::IFunctionGeneral::getNumberValuesPerArgument(), m_dataColumnNames, m_defaultValuesSize, m_domainColumnNames, m_weightsColumnNames, and std::to_string().
|
overridevirtual |
Creates a domain corresponding to the assigned MatrixWorkspace.
domain | :: Pointer to outgoing FunctionDomain instance. |
values | :: Pointer to outgoing FunctionValues object. |
i0 | :: Size offset for values object if it already contains data. |
Implements Mantid::API::IDomainCreator.
Definition at line 94 of file GeneralDomainCreator.cpp.
References getInputWorkspace(), Mantid::Kernel::IPropertyManager::getPropertyValue(), m_dataColumnNames, m_defaultValuesSize, m_domainColumnNames, Mantid::API::IDomainCreator::m_manager, and m_weightsColumnNames.
|
overridevirtual |
Creates an output workspace using the given function and domain.
baseName | :: Basename for output workspace. |
function | :: Function that can handle a FunctionDomain1D-domain. |
domain | :: Pointer to FunctionDomain instance. |
values | :: Pointer to FunctionValues instance, currently not used. |
outputWorkspacePropertyName | :: Name of output workspace property, if used. |
Reimplemented from Mantid::API::IDomainCreator.
Definition at line 173 of file GeneralDomainCreator.cpp.
References Mantid::API::IDomainCreator::declareProperty(), Mantid::API::IFunctionGeneral::getDefaultDomainSize(), getInputWorkspace(), Mantid::Kernel::IPropertyManager::getPropertyValue(), Mantid::Kernel::SingletonHolder< T >::Instance(), m_dataColumnNames, m_domainColumnNames, Mantid::API::IDomainCreator::m_manager, Mantid::Kernel::Direction::Output, Mantid::Kernel::IPropertyManager::setProperty(), Mantid::Kernel::IPropertyManager::setPropertyValue(), and value.
|
overridevirtual |
Declare properties that specify the dataset within the workspace to fit to.
suffix | :: A suffix to give to all new properties. |
addProp | :: If false don't actually declare new properties but do other stuff if needed |
Reimplemented from Mantid::API::IDomainCreator.
Definition at line 58 of file GeneralDomainCreator.cpp.
References Mantid::API::IDomainCreator::declareProperty(), m_dataColumnNames, m_domainColumnNames, m_weightsColumnNames, and UNUSED_ARG.
|
overridevirtual |
Returns the domain size.
Throws if no MatrixWorkspace has been set.
Implements Mantid::API::IDomainCreator.
Definition at line 253 of file GeneralDomainCreator.cpp.
References getInputWorkspace(), m_defaultValuesSize, and m_domainColumnNames.
|
private |
Retrive the input workspace from the property manager.
Definition at line 74 of file GeneralDomainCreator.cpp.
References Mantid::Kernel::IPropertyManager::existsProperty(), Mantid::Kernel::IPropertyManager::getProperty(), Mantid::API::IDomainCreator::m_manager, and Mantid::API::IDomainCreator::m_workspacePropertyNames.
Referenced by createDomain(), createOutputWorkspace(), and getDomainSize().
|
private |
Property names for columns in a TableWorkspace to be used as the data to fit to.
Definition at line 74 of file GeneralDomainCreator.h.
Referenced by createDomain(), createOutputWorkspace(), declareDatasetProperties(), and GeneralDomainCreator().
|
private |
Default number of values.
Definition at line 79 of file GeneralDomainCreator.h.
Referenced by createDomain(), GeneralDomainCreator(), and getDomainSize().
|
private |
Property names for columns in a TableWorkspace to be passed to the domain.
Definition at line 71 of file GeneralDomainCreator.h.
Referenced by createDomain(), createOutputWorkspace(), declareDatasetProperties(), GeneralDomainCreator(), and getDomainSize().
|
private |
Property names for columns in a TableWorkspace to be used as the fitting weights.
Definition at line 77 of file GeneralDomainCreator.h.
Referenced by createDomain(), declareDatasetProperties(), and GeneralDomainCreator().