ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/optimization/LineSearchBasedMethod.cpp
(Generate patch)

Comparing:
branches/development/src/optimization/LineSearchBasedMethod.cpp (file contents), Revision 1750 by gezelter, Thu Jun 7 12:53:46 2012 UTC vs.
trunk/src/optimization/LineSearchBasedMethod.cpp (file contents), Revision 1969 by gezelter, Wed Feb 26 14:14:50 2014 UTC

# Line 75 | Line 75 | namespace QuantLib {
75              if (lineSearch_->succeed())
76              {
77                  // Updates
78
78                  // New point
79                  x_ = lineSearch_->lastX();
80                  // New function value
# Line 93 | Line 92 | namespace QuantLib {
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,
# Line 103 | Line 104 | namespace QuantLib {
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;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines