22 #if defined(DEBUG) || defined(WARNINGMSG)
42 std::cout <<
"Initial gradient calculator - params " << par.
Vec() << std::endl;
47 for(
unsigned int i = 0; i <
n; i++) {
50 double var = par.
Vec()(i);
53 double sav2 = sav + werr;
54 if(
Trafo().Parameter(exOfIn).HasLimits()) {
55 if(
Trafo().Parameter(exOfIn).HasUpperLimit() &&
56 sav2 >
Trafo().Parameter(exOfIn).UpperLimit())
60 double vplu = var2 - var;
62 if(
Trafo().Parameter(exOfIn).HasLimits()) {
63 if(
Trafo().Parameter(exOfIn).HasLowerLimit() &&
64 sav2 <
Trafo().Parameter(exOfIn).LowerLimit())
68 double vmin = var2 - var;
73 double gstep =
std::max(gsmin, 0.1*dirin);
74 double grd = g2*dirin;
75 if(
Trafo().Parameter(exOfIn).HasLimits()) {
76 if(gstep > 0.5) gstep = 0.5;
83 std::cout <<
"computing initial gradient for parameter " <<
Trafo().
Name(exOfIn) <<
" value = " << var
84 <<
" [ " << vmin <<
" , " << vplu <<
" ] " <<
"dirin " << dirin <<
" grd " << grd <<
" g2 " << g2 << std::endl;
unsigned int GradientNCycles() const
unsigned int size() const
unsigned int Ncycle() const
virtual FunctionGradient operator()(const MinimumParameters &) const
double GradientStepTolerance() const
const MnUserTransformation & Trafo() const
determines the relative floating point arithmetic precision.
double LowerLimit() const
const MnAlgebraicVector & Vec() const
double UpperLimit() const
double GradientTolerance() const
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
double Eps2() const
eps2 returns 2*sqrt(eps)
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
double GradTolerance() const
const MnUserTransformation & fTransformation
double StepTolerance() const
const MnMachinePrecision & Precision() const
const MnStrategy & Strategy() const