10#ifndef ROOT_Minuit2_FCNGradAdapter
11#define ROOT_Minuit2_FCNGradAdapter
33template <
class Function>
41 double operator()(
const std::vector<double> &
v)
const override {
return fFunc.operator()(&
v[0]); }
44 double Up()
const override {
return fUp; }
46 std::vector<double>
Gradient(
const std::vector<double> &
v)
const override
51 os <<
"gradient in FCNAdapter = {";
52 for (
unsigned int i = 0; i <
fGrad.size(); ++i)
53 os <<
fGrad[i] << (i ==
fGrad.size() - 1 ?
'}' :
'\t');
58 double *previous_gstep)
const override
60 fFunc.GradientWithPrevResult(&
v[0], &
fGrad[0], previous_grad, previous_g2, previous_gstep);
63 os <<
"gradient in FCNAdapter = {";
64 for (
unsigned int i = 0; i <
fGrad.size(); ++i)
65 os <<
fGrad[i] << (i ==
fGrad.size() - 1 ?
'}' :
'\t');
74 if (
fFunc.returnsInMinuit2ParameterSpace()) {
84 mutable std::vector<double>
fGrad;
Double_t(* Function)(Double_t)
template wrapped class for adapting to FCNBase signature a IGradFunction
double Up() const override
Error definition of the function.
FCNGradAdapter(const Function &f, double up=1.)
GradientParameterSpace gradParameterSpace() const override
double operator()(const double *v) const
std::vector< double > Gradient(const std::vector< double > &v) const override
bool CheckGradient() const override
std::vector< double > GradientWithPrevResult(const std::vector< double > &v, double *previous_grad, double *previous_g2, double *previous_gstep) const override
double operator()(const std::vector< double > &v) const override
The meaning of the vector of parameters is of course defined by the user, who uses the values of thos...
std::vector< double > fGrad
void Debug(const Ts &... args)
GradientParameterSpace
Extension of the FCNBase for providing the analytical Gradient of the function.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...