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.);
187 state = ng2ls(fcn, state, ngc, prec);
#define MN_INFO_VAL2(loc, x)
#define MN_ERROR_MSG(str)
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.
MinimumSeed contains the starting values for the minimization produced by the SeedGenerator.
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...
determines the relative floating point arithmetic precision.
double Eps2() const
eps2 returns 2*sqrt(eps)
static void PrintState(std::ostream &os, const MinimumState &state, const char *msg, int iter=-1)
static void PrintFcn(std::ostream &os, double value, bool endline=true)
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
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)