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;
71 double dirin = std::max(0.5*(
fabs(vplu) +
fabs(vmin)), gsmin );
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;
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
const MnAlgebraicVector & Vec() const
double GradientTolerance() const
double LowerLimit() const
unsigned int GradientNCycles() const
determines the relative floating point arithmetic precision.
double GradientStepTolerance() const
virtual FunctionGradient operator()(const MinimumParameters &) const
double StepTolerance() const
double UpperLimit() const
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
unsigned int size() const
double GradTolerance() const
double Eps2() const
eps2 returns 2*sqrt(eps)
const MnMachinePrecision & Precision() const
unsigned int Ncycle() const
const MnUserTransformation & fTransformation
const MnStrategy & Strategy() const
const MnUserTransformation & Trafo() const