Mantid
|
An implementation of CompositeDomain. More...
#include <SeqDomain.h>
Public Member Functions | |
void | addCreator (const API::IDomainCreator_sptr &creator) |
Add new domain creator. More... | |
virtual void | additiveCostFunctionVal (const CostFunctions::CostFuncFitting &costFunction) |
Calculate the value of an additive cost function. More... | |
virtual void | additiveCostFunctionValDerivHessian (const CostFunctions::CostFuncFitting &costFunction, bool evalDeriv, bool evalHessian) |
Calculate the value, first and second derivatives of an additive cost function. More... | |
virtual void | getDomainAndValues (size_t i, API::FunctionDomain_sptr &domain, API::FunctionValues_sptr &values) const |
Create and return i-th domain and i-th values, (i-1)th domain is released. More... | |
virtual size_t | getNDomains () const |
Return the number of parts in the domain. More... | |
void | rwpVal (const CostFunctions::CostFuncRwp &rwp) |
Calculate the value of a Rwp cost function. More... | |
void | rwpValDerivHessian (const CostFunctions::CostFuncRwp &rwp, bool evalDeriv, bool evalHessian) |
Calculate the value, first and second derivatives of a RWP cost function. More... | |
SeqDomain () | |
size_t | size () const override |
Return the number of points in the domain. More... | |
Public Member Functions inherited from Mantid::API::FunctionDomain | |
virtual void | reset () const |
Reset the the domain so it can be reused. More... | |
virtual size_t | size () const =0 |
Return the number of points in the domain. More... | |
virtual | ~FunctionDomain ()=default |
Virtual destructor. More... | |
Static Public Member Functions | |
static SeqDomain * | create (API::IDomainCreator::DomainType type) |
Create an instance of SeqDomain in one of two forms: either SeqDomain for sequential domain creation or ParDomain for parallel calculations. More... | |
Protected Attributes | |
std::vector< std::shared_ptr< API::IDomainCreator > > | m_creators |
Domain creators. More... | |
size_t | m_currentIndex |
Current index. More... | |
std::vector< API::FunctionDomain_sptr > | m_domain |
Currently active domain. More... | |
std::vector< API::FunctionValues_sptr > | m_values |
Currently active values. More... | |
|
inline |
Definition at line 32 of file SeqDomain.h.
Referenced by create().
void Mantid::CurveFitting::SeqDomain::addCreator | ( | const API::IDomainCreator_sptr & | creator | ) |
Add new domain creator.
creator | :: A shared pointer to a new creator. |
Definition at line 48 of file SeqDomain.cpp.
References m_creators, m_domain, and m_values.
Referenced by Mantid::CurveFitting::FitMW::createDomain(), Mantid::CurveFitting::SeqDomainSpectrumCreator::createDomain(), and Mantid::CurveFitting::TableWorkspaceDomainCreator::createDomain().
|
virtual |
Calculate the value of an additive cost function.
Calculate the value of a least squares cost function.
costFunction | :: The cost func to calculate the value for |
Reimplemented in Mantid::CurveFitting::ParDomain.
Definition at line 73 of file SeqDomain.cpp.
References Mantid::CurveFitting::CostFunctions::CostFuncFitting::addVal(), getDomainAndValues(), getNDomains(), and n.
|
virtual |
Calculate the value, first and second derivatives of an additive cost function.
Calculate the value, first and second derivatives of a least squares cost function.
costFunction | :: The cost func to calculate the value for |
evalDeriv | :: Flag to evaluate the first derivatives |
evalHessian | :: Flag to evaluate the Hessian (second derivatives) |
Reimplemented in Mantid::CurveFitting::ParDomain.
Definition at line 113 of file SeqDomain.cpp.
References Mantid::CurveFitting::CostFunctions::CostFuncFitting::addValDerivHessian(), getDomainAndValues(), Mantid::CurveFitting::CostFunctions::CostFuncFitting::getFittingFunction(), getNDomains(), and n.
|
static |
Create an instance of SeqDomain in one of two forms: either SeqDomain for sequential domain creation or ParDomain for parallel calculations.
type | :: Either Sequential or Parallel |
Definition at line 60 of file SeqDomain.cpp.
References Mantid::API::IDomainCreator::Parallel, SeqDomain(), and Mantid::API::IDomainCreator::Sequential.
Referenced by Mantid::CurveFitting::FitMW::createDomain(), Mantid::CurveFitting::SeqDomainSpectrumCreator::createDomain(), and Mantid::CurveFitting::TableWorkspaceDomainCreator::createDomain().
|
virtual |
Create and return i-th domain and i-th values, (i-1)th domain is released.
i | :: Index of domain to return. |
domain | :: Output pointer to the returned domain. |
values | :: Output pointer to the returned values. |
Reimplemented in Mantid::CurveFitting::ParDomain.
Definition at line 31 of file SeqDomain.cpp.
References m_creators, m_currentIndex, m_domain, and m_values.
Referenced by additiveCostFunctionVal(), additiveCostFunctionValDerivHessian(), rwpVal(), and rwpValDerivHessian().
|
virtual |
Return the number of parts in the domain.
Definition at line 23 of file SeqDomain.cpp.
References m_creators.
Referenced by additiveCostFunctionVal(), Mantid::CurveFitting::ParDomain::additiveCostFunctionVal(), additiveCostFunctionValDerivHessian(), Mantid::CurveFitting::ParDomain::additiveCostFunctionValDerivHessian(), rwpVal(), and rwpValDerivHessian().
void Mantid::CurveFitting::SeqDomain::rwpVal | ( | const CostFunctions::CostFuncRwp & | rwp | ) |
Calculate the value of a Rwp cost function.
Calculate the value of a least squares cost function.
rwp | :: The RWP cost func to calculate the value for |
Definition at line 92 of file SeqDomain.cpp.
References Mantid::CurveFitting::CostFunctions::CostFuncLeastSquares::addVal(), getDomainAndValues(), getNDomains(), and n.
void Mantid::CurveFitting::SeqDomain::rwpValDerivHessian | ( | const CostFunctions::CostFuncRwp & | rwp, |
bool | evalDeriv, | ||
bool | evalHessian | ||
) |
Calculate the value, first and second derivatives of a RWP cost function.
rwp | :: The rwp cost func to calculate the value for |
evalDeriv | :: Flag to evaluate the first derivatives |
evalHessian | :: Flag to evaluate the Hessian (second derivatives) |
Definition at line 134 of file SeqDomain.cpp.
References Mantid::CurveFitting::CostFunctions::CostFuncLeastSquares::addValDerivHessian(), getDomainAndValues(), Mantid::CurveFitting::CostFunctions::CostFuncFitting::getFittingFunction(), getNDomains(), and n.
|
overridevirtual |
Return the number of points in the domain.
Implements Mantid::API::FunctionDomain.
Definition at line 17 of file SeqDomain.cpp.
References m_creators.
|
protected |
Domain creators.
Definition at line 65 of file SeqDomain.h.
Referenced by addCreator(), getDomainAndValues(), Mantid::CurveFitting::ParDomain::getDomainAndValues(), getNDomains(), and size().
|
mutableprotected |
|
mutableprotected |
Currently active domain.
Definition at line 61 of file SeqDomain.h.
Referenced by addCreator(), getDomainAndValues(), and Mantid::CurveFitting::ParDomain::getDomainAndValues().
|
mutableprotected |
Currently active values.
Definition at line 63 of file SeqDomain.h.
Referenced by addCreator(), getDomainAndValues(), and Mantid::CurveFitting::ParDomain::getDomainAndValues().