14#include "MantidCurveFitting/DllConfig.h"
19namespace CurveFitting {
22namespace CostFunctions {
33 size_t nParams()
const override;
37 double getParameter(
size_t i)
const override;
41 void setParameter(
size_t i,
const double &
value)
override;
43 std::string parameterName(
size_t i)
const;
50 virtual double val()
const override;
52 virtual void deriv(std::vector<double> &der)
const override;
54 virtual double valAndDeriv(std::vector<double> &der)
const override;
57 virtual double valDerivHessian(
bool evalDeriv =
true,
bool evalHessian =
true)
const;
73 virtual void calCovarianceMatrix(
EigenMatrix &covar,
double epsrel = 1e-8);
76 virtual void calFittingErrors(
const EigenMatrix &covar,
double chi2);
88 virtual void calActiveCovarianceMatrix(
EigenMatrix &covar,
double epsrel = 1e-8);
96 bool evalHessian =
true)
const = 0;
99 void checkValidity()
const;
100 void calTransformationMatrixNumerically(
EigenMatrix &tm);
double value
The value of the point.
An interface for specifying the cost function to be used with Fit algorithm or minimizers,...
A semi-abstract class for a cost function for fitting functions.
bool m_includePenalty
Flag to include constraint in cost function value.
bool m_dirtyHessian
dirty hessian flag
API::FunctionValues_sptr m_values
Shared poinetr to the function values.
std::vector< size_t > m_indexMap
maps the cost function's parameters to the ones of the fitting function.
API::FunctionDomain_sptr m_domain
Shared pointer to the function domain.
API::FunctionValues_sptr getValues() const
Get FunctionValues where function values are stored.
virtual void addVal(API::FunctionDomain_sptr domain, API::FunctionValues_sptr values) const =0
Increment to the cost function by evaluating it on a domain.
API::IFunction_sptr m_function
Shared pointer to the fitting function.
bool m_dirtyVal
dirty value flag
EigenVector m_pushedParams
virtual void addValDerivHessian(API::IFunction_sptr function, API::FunctionDomain_sptr domain, API::FunctionValues_sptr values, bool evalDeriv=true, bool evalHessian=true) const =0
Increments the cost function and its derivatives by evaluating them on a domain.
size_t m_numberFunParams
Number of all parameters in the fitting function.
virtual API::IFunction_sptr getFittingFunction() const
Get fitting function.
bool m_dirtyDeriv
dirty derivatives flag
API::FunctionDomain_sptr getDomain() const
Get the domain the fitting function is applied to.
A wrapper around Eigen::Matrix.
A wrapper around Eigen::Vector.
An implementation of SeqDomain for parallel cost function and derivatives computation.
An implementation of CompositeDomain.
std::shared_ptr< FunctionValues > FunctionValues_sptr
typedef for a shared pointer
std::shared_ptr< IFunction > IFunction_sptr
shared pointer to the function base class
std::shared_ptr< FunctionDomain > FunctionDomain_sptr
typedef for a shared pointer
Helper class which provides the Collimation Length for SANS instruments.