58 std::cout <<
"MnSeedGenerator: operator() - var par = " << n <<
" mnfcn pointer " << &fcn << std::endl;
66 double fcnmin = fcn(x);
69 std::cout <<
"MnSeedGenerator: for initial parameters FCN = ";
78 for(
unsigned int i = 0; i < n; i++)
79 for(
unsigned int j = i; j < n; j++) mat(i,j) = st.
IntCovariance()(i,j);
82 for(
unsigned int i = 0; i < n; i++)
83 mat(i,i) = (
fabs(dgrad.
G2()(i)) > prec.
Eps2() ? 1./dgrad.
G2()(i) : 1.);
97 std::cout <<
"MnSeedGenerator: Negative G2 Found: " << std::endl;
98 std::cout << x << std::endl;
99 std::cout << dgrad.
Grad() << std::endl;
100 std::cout << dgrad.
G2() << std::endl;
102 state = ng2ls(fcn, state, gc, prec);
114 std::cout <<
"MnSeedGenerator: calling MnHesse " << std::endl;
137 double fcnmin = fcn(x);
148 std::pair<FunctionGradient, MnAlgebraicVector> hgrd = hgc.
DeltaGradient(pa, dgrad);
149 for(
unsigned int i = 0; i < n; i++) {
150 if(
fabs(hgrd.first.Grad()(i) - grd.
Grad()(i)) > hgrd.second(i)) {
152 MN_INFO_MSG(
"MnSeedGenerator:gradient discrepancy of external Parameter too large");
154 const char * parameter_name = st.
Trafo().
Name(externalParameterIndex);
164 MN_ERROR_MSG(
"Minuit does not accept user specified Gradient. To force acceptance, override 'virtual bool CheckGradient() const' of FCNGradientBase.h in the derived class.");
173 for(
unsigned int i = 0; i < n; i++)
174 for(
unsigned int j = i; j < n; j++) mat(i,j) = st.
IntCovariance()(i,j);
177 for(
unsigned int i = 0; i < n; i++)
178 mat(i,i) = (
fabs(dgrad.G2()(i)) > prec.
Eps2() ? 1./dgrad.G2()(i) : 1.);
185 if(ng2ls.HasNegativeG2(dgrad, prec)) {
187 state = ng2ls(fcn, state, ngc, prec);
#define MN_INFO_VAL2(loc, x)
#define MN_ERROR_MSG(str)
double Estimate(const FunctionGradient &, const MinimumError &) const
Namespace for new ROOT classes and functions.
static void PrintFcn(std::ostream &os, double value, bool endline=true)
bool HasNegativeG2(const FunctionGradient &, const MnMachinePrecision &) const
MinimumSeed contains the starting values for the minimization produced by the SeedGenerator.
Class describing a symmetric matrix of size n.
unsigned int Strategy() const
const std::vector< double > & IntParameters() const
determines the relative floating point arithmetic precision.
unsigned int NumOfCalls() const
unsigned int VariableParameters() const
class performing the numerical gradient calculation
const MnMachinePrecision & Precision() const
virtual bool CheckGradient() const
API class for calculating the numerical covariance matrix (== 2x Inverse Hessian == 2x Inverse 2nd de...
const MnAlgebraicVector & G2() const
static void PrintState(std::ostream &os, const MinimumState &state, const char *msg, int iter=-1)
Wrapper class to FCNBase interface used internally by Minuit.
const MnUserTransformation & Trafo() const
HessianGradientCalculator: class to calculate Gradient for Hessian.
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
class which holds the external user and/or internal Minuit representation of the parameters and error...
Class to calculate an initial estimate of the gradient.
* x
Deprecated and error prone model selection interface.
In case that one of the components of the second derivative g2 calculated by the numerical Gradient c...
virtual MinimumSeed operator()(const MnFcn &, const GradientCalculator &, const MnUserParameterState &, const MnStrategy &) const
const MnAlgebraicVector & Grad() const
double Eps2() const
eps2 returns 2*sqrt(eps)
const MnUserCovariance & IntCovariance() const
MinimumError keeps the inv.
std::pair< FunctionGradient, MnAlgebraicVector > DeltaGradient(const MinimumParameters &, const FunctionGradient &) const
bool HasCovariance() const
MinimumState keeps the information (position, Gradient, 2nd deriv, etc) after one minimization step (...
API class for defining three levels of strategies: low (0), medium (1), high (>=2); acts on: Migrad (...
interface class for gradient calculators