34 return (*
this)(par, gra);
41 std::pair<FunctionGradient, MnAlgebraicVector> mypair =
DeltaGradient(par, Gradient);
70std::pair<FunctionGradient, MnAlgebraicVector>
76 MnPrint print(
"HessianGradientCalculator");
85 double fcnmin = par.
Fval();
90 unsigned int n =
x.size();
98 for (
unsigned int i = startElementIndex; i < endElementIndex; i++) {
102 double optstp = sqrt(dfmin / (fabs(g2(i)) + epspri));
103 double d = 0.2 * fabs(gstep(i));
108 double chgold = 10000.;
112 for (
unsigned int j = 0; j <
Ncycle(); j++) {
114 double fs1 =
Fcn()(
x);
116 double fs2 =
Fcn()(
x);
122 grdnew = (fs1 - fs2) / (2. *
d);
123 dgmin =
Precision().
Eps() * (std::fabs(fs1) + std::fabs(fs2)) /
d;
127 double change = fabs((grdold - grdnew) / grdnew);
128 if (change > chgold && j > 1)
137 if (fabs(grdold - grdnew) < dgmin)
144 dgrd(i) = std::max(dgmin, std::fabs(grdold - grdnew));
146 print.
Debug(
"HGC Param :", i,
"\t new g1 =", grd(i),
"gstep =",
d,
"dgrd =", dgrd(i));
153 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
double GradTolerance() const
unsigned int Ncycle() const
const MnFcn & Fcn() const
const MnStrategy & fStrategy
const MnUserTransformation & fTransformation
FunctionGradient operator()(const MinimumParameters &) const override
double StepTolerance() const
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
double GradientStepTolerance() const
double GradientTolerance() const
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...