47 unsigned int iter = 0;
50 for(
unsigned int i = 0; i <
n; i++) {
53 std::cout <<
"negative G2 - iter " << iter <<
" param " << i <<
" " << pa.
Vec()(i) <<
" grad2 " << dgrad.
G2()(i) <<
" grad " << dgrad.
Vec()(i)
54 <<
" grad step " << dgrad.
Gstep()(i) <<
" step size " << pa.
Dirin()(i) << std::endl;
56 if(dgrad.
G2()(i) <= 0) {
66 if ( dgrad.
Vec()(i) < 0)
67 step(i) = dgrad.
Gstep()(i);
69 step(i) = - dgrad.
Gstep()(i);
71 double gdel = step(i)*dgrad.
Vec()(i);
78 std::cout <<
"step(i) " << step(i) <<
" gdel " << gdel << std::endl;
87 std::cout <<
"\nLine search result " << pp.
X() <<
" f(0) " << pa.
Fval() <<
" f(1) " << pp.
Y() << std::endl;
93 dgrad = gc(pa, dgrad);
96 std::cout <<
"Line search - iter" << iter <<
" param " << i <<
" " << pa.
Vec()(i) <<
" step " << step(i) <<
" new grad2 " << dgrad.
G2()(i) <<
" new grad " << dgrad.
Vec()(i) <<
" grad step " << dgrad.
Gstep()(i) << std::endl;
106 for(
unsigned int i = 0; i <
n; i++)
107 mat(i,i) = (
fabs(dgrad.
G2()(i)) > prec.
Eps2() ? 1./dgrad.
G2()(i) : 1.);
122 for(
unsigned int i = 0; i < grad.
Vec().size(); i++)
124 if(grad.
G2()(i) <= 0 ) {
const MnAlgebraicVector & Gstep() const
const MnAlgebraicVector & Vec() const
const MnAlgebraicVector & G2() const
interface class for gradient calculators
Class describing a symmetric matrix of size n.
unsigned int size() const
MinimumError keeps the inv.
const MnAlgebraicVector & Dirin() const
const MnAlgebraicVector & Vec() const
MinimumState keeps the information (position, Gradient, 2nd deriv, etc) after one minimization step (...
const MinimumParameters & Parameters() const
const FunctionGradient & Gradient() const
Wrapper class to FCNBase interface used internally by Minuit.
unsigned int NumOfCalls() const
Implements a 1-dimensional minimization along a given direction (i.e.
determines the relative floating point 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.
bool HasNegativeG2(const FunctionGradient &, const MnMachinePrecision &) const
MinimumState operator()(const MnFcn &, const MinimumState &, const GradientCalculator &, const MnMachinePrecision &) const
double Estimate(const FunctionGradient &, const MinimumError &) const
int iterate(rng_state_t *X)
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)