46 print.
Warn(
"No variable parameters are defined! - Return current function value ");
52 print.
Debug(
"initial edm is ", edm);
58 print.
Error(
"Initial matrix not positive defined, edm = ",edm,
"\nExit minimization ");
62 std::vector<MinimumState>
result;
89 print.
Warn(
"FunctionMinimum is invalid");
98 print.
Debug(
"Approximate Edm", edm,
"npass",
ipass);
103 print.
Debug(
"FumiliBuilder will verify convergence and Error matrix; "
105 min.Error().Dcovar());
116 print.
Info(
"After Hessian");
123 print.
Debug(
"Edm", edm,
"State",
st);
128 print.
Warn(
"Stop iterations, no improvements after Hesse; current Edm", edm,
"previous value",
edmprev);
132 print.
Debug(
"Tolerance not sufficient, continue minimization; Edm", edm,
"Requested",
edmval);
136 if (min.IsAboveMaxEdm()) {
201 MnPrint print(
"FumiliBuilder");
223 double delta = 0.3 * std::max(1.0 ,
normX0);
224 const double eta = 0.1;
231 print.
Info(
"Using Fumili with a line search algorithm");
245 step = -1. *
s0.Error().InvHessian() *
s0.Gradient().Vec();
247 print.
Debug(
"Iteration -",
result.size(),
"\n Fval",
s0.Fval(),
"numOfCall",
fcn.NumOfCalls(),
248 "\n Internal Parameter values",
s0.Vec(),
"\n Newton step", step);
253 print.
Warn(
"Matrix not pos.def, gdel =",
gdel,
" > 0");
257 step = -1. *
s0.Error().InvHessian() *
s0.Gradient().Vec();
260 print.
Warn(
"After correction, gdel =",
gdel);
278 print.
Debug(
"Do a line search",
fcn.NumOfCalls());
282 if (std::fabs(pp.
Y() -
s0.Fval()) <
prec.Eps()) {
287 print.
Debug(
"New point after Line Search :",
"\n FVAL ",
p.Fval(),
"\n Parameter",
p.Vec());
290 auto &
H =
s0.Error().Hessian();
291 unsigned int n = (
scaleTR) ?
H.Nrow() : 0;
298 for (
unsigned int i = 0; i <
n; i++){
299 double d = std::sqrt(
H(i,i));
310 print.
Debug(
"scaling Trust region with diagonal matrix D ",D);
328 print.
Debug(
"Accept full Newton step - it is inside TR ",delta);
336 auto gScaled = Dinv *
s0.Gradient().Grad();
340 for (
unsigned int i = 0; i <
n; i++) {
341 for (
unsigned int j = 0;
j <=i;
j++) {
357 step = - (delta/
normGrad) *
s0.Gradient().Grad();
359 print.
Debug(
"Use as new point the Cauchy point - along gradient with norm=delta ", delta);
369 print.
Debug(
"Use as new point the Cauchy point - along gradient with tau ", tau,
"delta = ", delta);
381 print.
Debug(
" dogleg equation",
a,
b,
c);
387 print.
Warn(
"a is equal to zero! a = ",
a);
388 print.
Info(
" delta ", delta,
" tau ", tau,
" gHg ",
gHg,
" normgrad2 ",
normGrad2);
391 double t1 = (-
b + sqrt(
b *
b - 4. *
a *
c)) / (2.0 *
a);
392 double t2 = (-
b - sqrt(
b *
b - 4. *
a *
c)) / (2.0 *
a);
394 print.
Debug(
" solution dogleg equation",
t1,
t2);
395 if (
t1 >= 0 &&
t1 <= 1.)
402 print.
Debug(
"New dogleg point is t = ", t);
404 print.
Debug(
"New accepted step is ",step);
421 if (rho > 0.75 &&
norm == delta) {
425 print.
Debug(
"New point after Trust region :",
"norm tr ",
norm,
" rho ", rho,
" delta ", delta,
426 " FVAL ",
p.Fval(),
"\n Parameter",
p.Vec());
433 print.
Debug(
"Trust region: accept new point p = x + step since rho is larger than eta");
437 print.
Debug(
"Trust region reject new point and repeat since rho is smaller than eta");
447 print.
Debug(
"Before Gradient - NCalls = ",
fcn.NumOfCalls());
451 print.
Debug(
"After Gradient - NCalls = ",
fcn.NumOfCalls());
462 print.
Debug(
"Updated new point:",
"\n FVAL ",
p.Fval(),
"\n Parameter",
p.Vec(),
"\n Gradient",
g.Vec(),
463 "\n InvHessian",
e.InvHessian(),
"\n Hessian",
e.Hessian(),
"\n Edm", edm);
466 print.
Warn(
"Matrix not pos.def., Edm < 0");
481 if (
p.Fval() <
s0.Fval())
492 print.
Debug(
"finish iteration -",
result.size(),
"lambda =", lambda,
"f1 =",
p.Fval(),
"f0 =",
s0.Fval(),
493 "num of calls =",
fcn.NumOfCalls(),
"edm =", edm);
501 edm *= (1. + 3. *
e.Dcovar());
515 if (edm < std::fabs(
prec.Eps2() *
result.back().Fval())) {
516 print.
Warn(
"Machine accuracy limits further improvement");
519 }
else if (edm < 10 *
edmval) {
523 print.
Warn(
"No convergence; Edm", edm,
"is above tolerance", 10 *
edmval);
529 print.
Debug(
"Exiting successfully",
"Ncalls",
fcn.NumOfCalls(),
"FCN",
result.back().Fval(),
"Edm", edm,
"Requested",
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void gc
FunctionMinimum Minimum(const MnFcn &fMnFcn, const GradientCalculator &fGradienCalculator, const MinimumSeed &fMinimumSeed, const MnStrategy &fMnStrategy, unsigned int maxfcn, double edmval) const override
Class the member function calculating the Minimum and verifies the result depending on the strategy.
FumiliMethodType fMethodType
const FumiliErrorUpdator & ErrorUpdator() const
Accessor to the Error updator of the builder.
const VariableMetricEDMEstimator & Estimator() const
Accessor to the EDM (expected vertical distance to the Minimum) estimator.
class holding the full result of the minimization; both internal and external (MnUserParameterState) ...
interface class for gradient calculators
Class describing a symmetric matrix of size n.
unsigned int size() const
void TraceIteration(int iter, const MinimumState &state) const
MinimumError keeps the inv.
const FunctionGradient & Gradient() const
const MinimumError & Error() const
const MinimumParameters & Parameters() const
const MnMachinePrecision & Precision() const
const MinimumState & State() const
MinimumState keeps the information (position, Gradient, 2nd deriv, etc) after one minimization step (...
Wrapper class to FCNBase interface used internally by Minuit.
API class for calculating the numerical covariance matrix (== 2x Inverse Hessian == 2x Inverse 2nd de...
Implements a 1-dimensional minimization along a given direction (i.e.
Sets the relative floating point (double) arithmetic precision.
double Y() const
Accessor to the y (second) coordinate.
double X() const
Accessor to the x (first) coordinate.
Force the covariance matrix to be positive defined by adding extra terms in the diagonal.
void Debug(const Ts &... args)
void Error(const Ts &... args)
void Info(const Ts &... args)
void Warn(const Ts &... args)
API class for defining four levels of strategies: low (0), medium (1), high (2), very high (>=3); act...
double similarity(const LAVector &, const LASymMatrix &)
double inner_product(const LAVector &, const LAVector &)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...