75 |
|
if (lineSearch_->succeed()) |
76 |
|
{ |
77 |
|
// Updates |
78 |
– |
|
78 |
|
// New point |
79 |
|
x_ = lineSearch_->lastX(); |
80 |
|
// New function value |
92 |
|
lineSearch_->searchDirection() = direction; |
93 |
|
// Now compute accuracy and check end criteria |
94 |
|
// Numerical Recipes exit strategy on fx (see NR in C++, p.423) |
95 |
+ |
|
96 |
|
fnew = P.functionValue(); |
97 |
|
fdiff = 2.0*std::fabs(fnew-fold) / |
98 |
|
(std::fabs(fnew) + std::fabs(fold) + NumericConstant::epsilon); |
99 |
+ |
|
100 |
|
if (fdiff < ftol || |
101 |
|
endCriteria.checkMaxIterations(iterationNumber_, ecType)) { |
102 |
|
endCriteria.checkStationaryFunctionValue(0.0, 0.0, |
104 |
|
endCriteria.checkMaxIterations(iterationNumber_, ecType); |
105 |
|
return ecType; |
106 |
|
} |
107 |
+ |
|
108 |
|
P.setCurrentValue(x_); // update problem current value |
109 |
|
++iterationNumber_; // Increase iteration number |
110 |
|
first_time = false; |