45 print.
Warn(
"No variable parameters are defined! - Return current function value ");
51 print.
Debug(
"initial edm is ", edm);
57 print.
Error(
"Initial matrix not positive defined, edm = ",edm,
"\nExit minimization ");
61 std::vector<MinimumState>
result;
88 print.
Warn(
"FunctionMinimum is invalid");
97 print.
Debug(
"Approximate Edm", edm,
"npass",
ipass);
102 print.
Debug(
"FumiliBuilder will verify convergence and Error matrix; "
104 min.Error().Dcovar());
115 print.
Info(
"After Hessian");
122 print.
Debug(
"Edm", edm,
"State",
st);
127 print.
Warn(
"Stop iterations, no improvements after Hesse; current Edm", edm,
"previous value",
edmprev);
131 print.
Debug(
"Tolerance not sufficient, continue minimization; Edm", edm,
"Requested",
edmval);
135 if (min.IsAboveMaxEdm()) {
200 MnPrint print(
"FumiliBuilder");
222 double delta = 0.3 * std::max(1.0 ,
normX0);
223 const double eta = 0.1;
230 print.
Info(
"Using Fumili with a line search algorithm");
246 step = -1. *
s0.Error().InvHessian() *
s0.Gradient().Vec();
248 print.
Debug(
"Iteration -",
result.size(),
"\n Fval",
s0.Fval(),
"numOfCall",
fcn.NumOfCalls(),
249 "\n Internal Parameter values",
s0.Vec(),
"\n Newton step", step);
254 print.
Warn(
"Matrix not pos.def, gdel =",
gdel,
" > 0");
258 step = -1. *
s0.Error().InvHessian() *
s0.Gradient().Vec();
261 print.
Warn(
"After correction, gdel =",
gdel);
279 print.
Debug(
"Do a line search",
fcn.NumOfCalls());
283 if (std::fabs(pp.
Y() -
s0.Fval()) <
prec.Eps()) {
288 print.
Debug(
"New point after Line Search :",
"\n FVAL ",
p.Fval(),
"\n Parameter",
p.Vec());
291 auto &
H =
s0.Error().Hessian();
292 unsigned int n = (
scaleTR) ?
H.Nrow() : 0;
299 for (
unsigned int i = 0; i <
n; i++){
300 double d = std::sqrt(
H(i,i));
311 print.
Debug(
"scaling Trust region with diagonal matrix D ",D);
329 print.
Debug(
"Accept full Newton step - it is inside TR ",delta);
337 auto gScaled = Dinv *
s0.Gradient().Grad();
341 for (
unsigned int i = 0; i <
n; i++) {
342 for (
unsigned int j = 0;
j <=i;
j++) {
358 step = - (delta/
normGrad) *
s0.Gradient().Grad();
360 print.
Debug(
"Use as new point the Cauchy point - along gradient with norm=delta ", delta);
370 print.
Debug(
"Use as new point the Cauchy point - along gradient with tau ", tau,
"delta = ", delta);
382 print.
Debug(
" dogleg equation",
a,
b,
c);
388 print.
Warn(
"a is equal to zero! a = ",
a);
389 print.
Info(
" delta ", delta,
" tau ", tau,
" gHg ",
gHg,
" normgrad2 ",
normGrad2);
392 double t1 = (-
b + sqrt(
b *
b - 4. *
a *
c)) / (2.0 *
a);
393 double t2 = (-
b - sqrt(
b *
b - 4. *
a *
c)) / (2.0 *
a);
395 print.
Debug(
" solution dogleg equation",
t1,
t2);
396 if (
t1 >= 0 &&
t1 <= 1.)
403 print.
Debug(
"New dogleg point is t = ", t);
405 print.
Debug(
"New accepted step is ",step);
422 if (rho > 0.75 &&
norm == delta) {
426 print.
Debug(
"New point after Trust region :",
"norm tr ",
norm,
" rho ", rho,
" delta ", delta,
427 " FVAL ",
p.Fval(),
"\n Parameter",
p.Vec());
434 print.
Debug(
"Trust region: accept new point p = x + step since rho is larger than eta");
438 print.
Debug(
"Trust region reject new point and repeat since rho is smaller than eta");
448 print.
Debug(
"Before Gradient - NCalls = ",
fcn.NumOfCalls());
452 print.
Debug(
"After Gradient - NCalls = ",
fcn.NumOfCalls());
463 print.
Debug(
"Updated new point:",
"\n FVAL ",
p.Fval(),
"\n Parameter",
p.Vec(),
"\n Gradient",
g.Vec(),
464 "\n InvHessian",
e.InvHessian(),
"\n Hessian",
e.Hessian(),
"\n Edm", edm);
467 print.
Warn(
"Matrix not pos.def., Edm < 0");
482 if (
p.Fval() <
s0.Fval())
493 print.
Debug(
"finish iteration -",
result.size(),
"lambda =", lambda,
"f1 =",
p.Fval(),
"f0 =",
s0.Fval(),
494 "num of calls =",
fcn.NumOfCalls(),
"edm =", edm);
502 edm *= (1. + 3. *
e.Dcovar());
516 if (edm < std::fabs(
prec.Eps2() *
result.back().Fval())) {
517 print.
Warn(
"Machine accuracy limits further improvement");
520 }
else if (edm < 10 *
edmval) {
524 print.
Warn(
"No convergence; Edm", edm,
"is above tolerance", 10 *
edmval);
530 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...