37 const MnStrategy &strategy,
unsigned int maxfcn,
double edmval)
const
47 print.
Debug(
"Convergence when edm <", edmval);
59 print.
Warn(
"Initial matrix not pos.def.");
63 std::vector<MinimumState>
result;
78 int maxfcn_eff =
int(0.5 * maxfcn);
90 print.
Warn(
"FunctionMinimum is invalid");
99 print.
Debug(
"Approximate Edm", edm,
"npass", ipass);
103 print.
Debug(
"FumiliBuilder will verify convergence and Error matrix; "
116 print.
Info(
"After Hessian");
123 print.
Debug(
"Edm", edm,
"State", st);
126 if (ipass > 0 && edm >= edmprev) {
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);
152 }
while (edm > edmval);
161 std::vector<MinimumState> &
result,
unsigned int maxfcn,
double edmval)
const
198 double edm = initialState.
Edm();
200 MnPrint print(
"FumiliBuilder");
202 print.
Debug(
"Initial State:",
"\n Parameter", initialState.
Vec(),
"\n Gradient", initialState.
Gradient().
Vec(),
203 "\n Inv Hessian", initialState.
Error().
InvHessian(),
"\n edm", initialState.
Edm(),
"\n maxfcn",
204 maxfcn,
"\n tolerance", edmval);
211 double lambda = 0.001;
218 step = -1. *
s0.Error().InvHessian() *
s0.Gradient().Vec();
221 "\n Internal Parameter values",
s0.Vec(),
"\n Newton step", step);
225 print.
Warn(
"Matrix not pos.def, gdel =", gdel,
" > 0");
229 step = -1. *
s0.Error().InvHessian() *
s0.Gradient().Vec();
232 print.
Warn(
"After correction, gdel =", gdel);
257 if (
p.Fval() >=
s0.Fval()) {
261 if (std::fabs(pp.
Y() -
s0.Fval()) < prec.
Eps()) {
281 print.
Debug(
"Updated new point:",
"\n FVAL ",
p.Fval(),
"\n Parameter",
p.Vec(),
"\n Gradient",
g.Vec(),
282 "\n InvHessian",
e.InvHessian(),
"\n Hessian",
e.Hessian(),
"\n Edm", edm);
285 print.
Warn(
"Matrix not pos.def., Edm < 0");
299 if (
p.Fval() <
s0.Fval())
309 print.
Debug(
"finish iteration -",
result.size(),
"lambda =", lambda,
"f1 =",
p.Fval(),
"f0 =",
s0.Fval(),
310 "num of calls =", fcn.
NumOfCalls(),
"edm =", edm);
318 edm *= (1. + 3. *
e.Dcovar());
320 }
while (edm > edmval && fcn.
NumOfCalls() < maxfcn);
323 print.
Warn(
"Call limit exceeded");
329 if (edm < std::fabs(prec.
Eps2() *
result.back().Fval())) {
330 print.
Warn(
"Machine accuracy limits further improvement");
333 }
else if (edm < 10 * edmval) {
337 print.
Warn(
"No convergence; Edm", edm,
"is above tolerance", 10 * edmval);
344 print.
Debug(
"Exiting successfully",
"Ncalls", fcn.
NumOfCalls(),
"FCN",
result.back().Fval(),
"Edm", edm,
"Requested",
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.
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.
virtual MinimumError Update(const MinimumState &fMinimumState, const MinimumParameters &fMinimumParameters, const GradientCalculator &fGradientCalculator, double lambda) const
Member function that calculates the Error matrix (or the Hessian matrix containing the (approximate) ...
const MnAlgebraicVector & Vec() const
class holding the full result of the minimization; both internal and external (MnUserParameterState) ...
const std::vector< MinimumState > & States() const
void Add(const MinimumState &state, Status status=MnValid)
add latest minimization state (for example add Hesse result after Migrad)
const MinimumError & Error() const
const MinimumState & State() const
bool IsAboveMaxEdm() const
const MinimumSeed & Seed() const
interface class for gradient calculators
unsigned int size() const
void TraceIteration(int iter, const MinimumState &state) const
MinimumError keeps the inv.
const MnAlgebraicSymMatrix & InvHessian() const
const MnAlgebraicVector & Vec() const
const MnUserTransformation & Trafo() 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 (...
const MinimumError & Error() const
const MnAlgebraicVector & Vec() const
const FunctionGradient & Gradient() const
Wrapper class to FCNBase interface used internally by Minuit.
unsigned int NumOfCalls() const
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 Eps() const
eps returns the smallest possible number so that 1.+eps > 1.
double Eps2() const
eps2 returns 2*sqrt(eps)
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 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 Estimate(const FunctionGradient &, const MinimumError &) const
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...