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;
132 dgrd(i) = std::max(dgmin,
fabs(grdold-grdnew));
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 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
double StepTolerance() const
std::pair< FunctionGradient, MnAlgebraicVector > DeltaGradient(const MinimumParameters &, const FunctionGradient &) const
virtual FunctionGradient operator()(const MinimumParameters &) 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
determines the relative floating point arithmetic precision.
double Eps() const
eps returns the smallest possible number so that 1.+eps > 1.
double Eps2() const
eps2 returns 2*sqrt(eps)
unsigned int HessianGradientNCycles() const
double GradientStepTolerance() const
double GradientTolerance() const
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
Namespace for new ROOT classes and functions.