Mantid
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Mantid::CurveFitting::SeqDomain Class Reference

An implementation of CompositeDomain. More...

#include <SeqDomain.h>

Inheritance diagram for Mantid::CurveFitting::SeqDomain:
Mantid::API::FunctionDomain Mantid::CurveFitting::ParDomain

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 SeqDomaincreate (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_sptrm_domain
 Currently active domain. More...
 
std::vector< API::FunctionValues_sptrm_values
 Currently active values. More...
 

Detailed Description

An implementation of CompositeDomain.

Author
Roman Tolchenov, Tessella plc
Date
15/11/2011

Definition at line 30 of file SeqDomain.h.

Constructor & Destructor Documentation

◆ SeqDomain()

Mantid::CurveFitting::SeqDomain::SeqDomain ( )
inline

Definition at line 32 of file SeqDomain.h.

Referenced by create().

Member Function Documentation

◆ addCreator()

void Mantid::CurveFitting::SeqDomain::addCreator ( const API::IDomainCreator_sptr creator)

Add new domain creator.

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

◆ additiveCostFunctionVal()

void Mantid::CurveFitting::SeqDomain::additiveCostFunctionVal ( const CostFunctions::CostFuncFitting costFunction)
virtual

Calculate the value of an additive cost function.

Calculate the value of a least squares cost function.

Parameters
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.

◆ additiveCostFunctionValDerivHessian()

void Mantid::CurveFitting::SeqDomain::additiveCostFunctionValDerivHessian ( const CostFunctions::CostFuncFitting costFunction,
bool  evalDeriv,
bool  evalHessian 
)
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.

Parameters
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.

◆ create()

SeqDomain * Mantid::CurveFitting::SeqDomain::create ( API::IDomainCreator::DomainType  type)
static

Create an instance of SeqDomain in one of two forms: either SeqDomain for sequential domain creation or ParDomain for parallel calculations.

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

◆ getDomainAndValues()

void Mantid::CurveFitting::SeqDomain::getDomainAndValues ( size_t  i,
API::FunctionDomain_sptr domain,
API::FunctionValues_sptr values 
) const
virtual

Create and return i-th domain and i-th values, (i-1)th domain is released.

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

◆ getNDomains()

size_t Mantid::CurveFitting::SeqDomain::getNDomains ( ) const
virtual

◆ rwpVal()

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.

Parameters
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.

◆ rwpValDerivHessian()

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.

Parameters
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.

◆ size()

size_t Mantid::CurveFitting::SeqDomain::size ( ) const
overridevirtual

Return the number of points in the domain.

Implements Mantid::API::FunctionDomain.

Definition at line 17 of file SeqDomain.cpp.

References m_creators.

Member Data Documentation

◆ m_creators

std::vector<std::shared_ptr<API::IDomainCreator> > Mantid::CurveFitting::SeqDomain::m_creators
protected

◆ m_currentIndex

size_t Mantid::CurveFitting::SeqDomain::m_currentIndex
mutableprotected

Current index.

Definition at line 59 of file SeqDomain.h.

Referenced by getDomainAndValues().

◆ m_domain

std::vector<API::FunctionDomain_sptr> Mantid::CurveFitting::SeqDomain::m_domain
mutableprotected

Currently active domain.

Definition at line 61 of file SeqDomain.h.

Referenced by addCreator(), getDomainAndValues(), and Mantid::CurveFitting::ParDomain::getDomainAndValues().

◆ m_values

std::vector<API::FunctionValues_sptr> Mantid::CurveFitting::SeqDomain::m_values
mutableprotected

Currently active values.

Definition at line 63 of file SeqDomain.h.

Referenced by addCreator(), getDomainAndValues(), and Mantid::CurveFitting::ParDomain::getDomainAndValues().


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