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);
Namespace for new ROOT classes and functions.
const MnAlgebraicVector & Vec() const
double GradientTolerance() const
double Eps() const
eps returns the smallest possible number so that 1.+eps > 1.
bool SyncVector(ROOT::Minuit2::MnAlgebraicVector &mnvector)
const MnStrategy & Strategy() const
unsigned int EndElementIndex() const
determines the relative floating point arithmetic precision.
const MnMachinePrecision & Precision() const
double GradientStepTolerance() const
virtual FunctionGradient operator()(const MinimumParameters &) const
unsigned int StartElementIndex() const
const MnAlgebraicVector & G2() const
double StepTolerance() const
const MnUserTransformation & fTransformation
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
const MnFcn & Fcn() const
const MnAlgebraicVector & Gstep() const
const MnStrategy & fStrategy
Class to calculate an initial estimate of the gradient.
* x
Deprecated and error prone model selection interface.
const MnAlgebraicVector & Grad() const
double Eps2() const
eps2 returns 2*sqrt(eps)
double GradTolerance() const
unsigned int HessianGradientNCycles() const
unsigned int Ncycle() const
std::pair< FunctionGradient, MnAlgebraicVector > DeltaGradient(const MinimumParameters &, const FunctionGradient &) const