15 #ifndef BORNAGAIN_FIT_ROOTADAPTER_ROOTRESIDUALFUNCTION_H
16 #define BORNAGAIN_FIT_ROOTADAPTER_ROOTRESIDUALFUNCTION_H
21 #include <Math/FitMethodFunction.h>
23 #pragma GCC diagnostic push
24 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
25 #include <Math/FitMethodFunction.h>
26 #pragma GCC diagnostic pop
35 typedef ROOT::Math::BasicFitMethodFunction<ROOT::Math::IMultiGenFunction>::Type_t
Type_t;
39 size_t npars,
size_t ndatasize);
43 ROOT::Math::IMultiGenFunction*
Clone()
const override;
46 double DataElement(
const double* pars,
unsigned int index,
47 double* gradients = 0)
const override;
51 double DoEval(
const double* pars)
const override;
Defines common types for fitting library.
std::function< double(const std::vector< double > &)> scalar_function_t
std::function< double(const std::vector< double > &, unsigned int, std::vector< double > &)> gradient_function_t
Minimizer function with access to single data element residuals, required by Fumili2 and GSLMultiMin ...
double DoEval(const double *pars) const override
evaluation of chi2
Type_t Type() const override
double DataElement(const double *pars, unsigned int index, double *gradients=0) const override
Evaluation of single data element residual. Will be called by ROOT minimizer.
scalar_function_t m_objective_fun
User function to get value to minimizer.
ROOT::Math::BasicFitMethodFunction< ROOT::Math::IMultiGenFunction >::Type_t Type_t
RootResidualFunction(scalar_function_t objective_fun, gradient_function_t gradient_fun, size_t npars, size_t ndatasize)
Constructs RootResidualFunction.
ROOT::Math::IMultiGenFunction * Clone() const override
gradient_function_t m_gradient_fun
User function to get residual and gradients.