23 #if defined(DEBUG) || defined(WARNINGMSG)
39 return (*
this)(
par, gra);
44 std::pair<FunctionGradient, MnAlgebraicVector> mypair =
DeltaGradient(par, Gradient);
80 double fcnmin = par.
Fval();
85 unsigned int n = x.size();
93 for(
unsigned int i = startElementIndex; i < endElementIndex; i++) {
97 double optstp =
sqrt(dfmin/(
fabs(
g2(i))+epspri));
98 double d = 0.2*
fabs(gstep(i));
99 if(d > optstp) d = optstp;
100 if(d < dmin) d = dmin;
101 double chgold = 10000.;
105 for(
unsigned int j = 0; j <
Ncycle(); j++) {
107 double fs1 =
Fcn()(
x);
109 double fs2 =
Fcn()(
x);
115 grdnew = (fs1-fs2)/(2.*d);
118 if (grdnew == 0)
break;
119 double change =
fabs((grdold-grdnew)/grdnew);
120 if(change > chgold && j > 1)
break;
126 if(change < 0.05)
break;
127 if(
fabs(grdold-grdnew) < dgmin)
break;
135 std::cout <<
"HGC Param : " << i <<
"\t new g1 = " << grd(i) <<
" gstep = " << d <<
" dgrd = " << dgrd(i) << std::endl;
144 return std::pair<FunctionGradient, MnAlgebraicVector>(
FunctionGradient(grd, g2, gstep), dgrd);
const MnStrategy & Strategy() const
bool SyncVector(ROOT::Minuit2::MnAlgebraicVector &mnvector)
double StepTolerance() const
double GradientStepTolerance() const
determines the relative floating point arithmetic precision.
std::pair< FunctionGradient, MnAlgebraicVector > DeltaGradient(const MinimumParameters &, const FunctionGradient &) const
unsigned int StartElementIndex() const
virtual FunctionGradient operator()(const MinimumParameters &) const
const MnAlgebraicVector & Vec() const
const MnUserTransformation & fTransformation
double GradientTolerance() const
const MnMachinePrecision & Precision() const
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
unsigned int Ncycle() const
double Eps2() const
eps2 returns 2*sqrt(eps)
const MnStrategy & fStrategy
Class to calculate an initial estimate of the gradient.
const MnAlgebraicVector & Gstep() const
const MnFcn & Fcn() const
double Eps() const
eps returns the smallest possible number so that 1.+eps > 1.
const MnAlgebraicVector & Grad() const
unsigned int EndElementIndex() const
double GradTolerance() const
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
unsigned int HessianGradientNCycles() const
const MnAlgebraicVector & G2() const