45 MnPrint print(
"MnSeedGenerator");
51 print.
Debug(
n,
"free parameters, FCN pointer", &fcn);
55 for (
unsigned int i = 0; i <
n; i++)
57 double fcnmin = fcn(
x);
64 for (
unsigned int i = 0; i <
n; i++)
65 for (
unsigned int j = i; j <
n; j++)
69 for (
unsigned int i = 0; i <
n; i++)
70 mat(i, i) = (std::fabs(dgrad.
G2()(i)) > prec.
Eps2() ? 1. / dgrad.
G2()(i) : 1.);
81 print.
Debug(
"Negative G2 Found",
"\n point:",
x,
"\n grad :", dgrad.
Grad(),
"\n g2 :", dgrad.
G2());
83 state = ng2ls(fcn, state, gc, prec);
85 print.
Info(
"Negative G2 found - new state:", state);
91 print.
Debug(
"calling MnHesse");
95 print.
Info(
"run Hesse - new state:", tmp);
106 MnPrint print(
"MnSeedGenerator");
114 for (
unsigned int i = 0; i <
n; i++)
116 double fcnmin = fcn(
x);
127 std::pair<FunctionGradient, MnAlgebraicVector> hgrd = hgc.
DeltaGradient(pa, dgrad);
128 for (
unsigned int i = 0; i <
n; i++) {
129 if (std::fabs(hgrd.first.Grad()(i) - grd.
Grad()(i)) > hgrd.second(i)) {
131 const char *parameter_name = st.
Trafo().
Name(externalParameterIndex);
132 print.
Warn(
"Gradient discrepancy of external Parameter too large:"
134 parameter_name,
"externalParameterIndex =", externalParameterIndex,
"internal =", i);
139 print.
Error(
"Minuit does not accept user specified Gradient. To force acceptance, override 'virtual bool "
140 "CheckGradient() const' of FCNGradientBase.h in the derived class.");
149 for (
unsigned int i = 0; i <
n; i++)
150 for (
unsigned int j = i; j <
n; j++)
154 for (
unsigned int i = 0; i <
n; i++)
155 mat(i, i) = (std::fabs(dgrad.
G2()(i)) > prec.
Eps2() ? 1. / dgrad.
G2()(i) : 1.);
164 state = ng2ls(fcn, state, ngc, prec);
virtual bool CheckGradient() const
const MnAlgebraicVector & Gstep() const
const MnAlgebraicVector & Grad() const
const MnAlgebraicVector & G2() const
interface class for gradient calculators
HessianGradientCalculator: class to calculate Gradient for Hessian.
std::pair< FunctionGradient, MnAlgebraicVector > DeltaGradient(const MinimumParameters &, const FunctionGradient &) const
Class to calculate an initial estimate of the gradient.
Class describing a symmetric matrix of size n.
MinimumError keeps the inv.
MinimumState keeps the information (position, Gradient, 2nd deriv, etc) after one minimization step (...
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...
Sets the relative floating point (double) arithmetic precision.
double Eps2() const
eps2 returns 2*sqrt(eps)
void Debug(const Ts &... args)
void Error(const Ts &... args)
void Info(const Ts &... args)
void Warn(const Ts &... args)
virtual MinimumSeed operator()(const MnFcn &, const GradientCalculator &, const MnUserParameterState &, const MnStrategy &) const
API class for defining three levels of strategies: low (0), medium (1), high (>=2); acts on: Migrad (...
unsigned int Strategy() const
class which holds the external user and/or internal Minuit representation of the parameters and error...
const MnMachinePrecision & Precision() const
unsigned int VariableParameters() const
const std::vector< double > & IntParameters() const
const MnUserTransformation & Trafo() const
const MnUserCovariance & IntCovariance() const
bool HasCovariance() const
In case that one of the components of the second derivative g2 calculated by the numerical Gradient c...
bool HasNegativeG2(const FunctionGradient &, const MnMachinePrecision &) const
class performing the numerical gradient calculation
double Estimate(const FunctionGradient &, const MinimumError &) const
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...