34 return (*
this)(par, gra);
41 std::pair<FunctionGradient, MnAlgebraicVector> mypair =
DeltaGradient(par, Gradient);
58std::pair<FunctionGradient, MnAlgebraicVector>
64 MnPrint print(
"HessianGradientCalculator");
73 double fcnmin = par.
Fval();
78 unsigned int n =
x.size();
86 for (
unsigned int i = startElementIndex; i < endElementIndex; i++) {
90 double optstp = sqrt(dfmin / (fabs(g2(i)) + epspri));
91 double d = 0.2 * fabs(gstep(i));
96 double chgold = 10000.;
100 for (
unsigned int j = 0; j <
Ncycle(); j++) {
102 double fs1 =
Fcn()(
x);
104 double fs2 =
Fcn()(
x);
110 grdnew = (fs1 - fs2) / (2. *
d);
111 dgmin =
Precision().
Eps() * (std::fabs(fs1) + std::fabs(fs2)) /
d;
115 double change = fabs((grdold - grdnew) / grdnew);
116 if (change > chgold && j > 1)
125 if (fabs(grdold - grdnew) < dgmin)
132 dgrd(i) = std::max(dgmin, std::fabs(grdold - grdnew));
134 print.
Debug(
"HGC Param :", i,
"\t new g1 =", grd(i),
"gstep =",
d,
"dgrd =", dgrd(i));
141 return std::pair<FunctionGradient, MnAlgebraicVector>(
FunctionGradient(grd, g2, gstep), dgrd);
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void gc
const MnAlgebraicVector & Gstep() const
const MnAlgebraicVector & Grad() const
const MnAlgebraicVector & G2() const
unsigned int Ncycle() const
const MnFcn & Fcn() const
const MnUserTransformation & fTransformation
FunctionGradient operator()(const MinimumParameters &) const override
std::pair< FunctionGradient, MnAlgebraicVector > DeltaGradient(const MinimumParameters &, const FunctionGradient &) const
const MnStrategy & Strategy() const
const MnMachinePrecision & Precision() const
Class to calculate an initial estimate of the gradient.
bool SyncVector(ROOT::Minuit2::MnAlgebraicVector &mnvector)
unsigned int StartElementIndex() const
unsigned int EndElementIndex() const
const MnAlgebraicVector & Vec() const
Sets the relative floating point (double) arithmetic precision.
double Eps() const
eps returns the smallest possible number so that 1.+eps > 1.
double Eps2() const
eps2 returns 2*sqrt(eps)
void Debug(const Ts &... args)
unsigned int HessianGradientNCycles() const
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...