ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/OOPSEMinimizer.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/OOPSEMinimizer.cpp (file contents):
Revision 1064 by tim, Tue Feb 24 15:44:45 2004 UTC vs.
Revision 1074 by tim, Mon Mar 1 20:01:50 2004 UTC

# Line 18 | Line 18 | OOPSEMinimizer::OOPSEMinimizer( SimInfo *theInfo, Forc
18    curX = getCoor();
19    curG.resize(ndim);
20  
21 +  preMove();
22   }
23  
24   OOPSEMinimizer::~OOPSEMinimizer(){
# Line 517 | Line 518 | int OOPSEMinimizer::doLineSearch(vector<double>& direc
518    double mu;
519    double eta;
520    double ftol;  
521 +  double lsTol;
522  
523    xa.resize(ndim);
524    xb.resize(ndim);
# Line 532 | Line 534 | int OOPSEMinimizer::doLineSearch(vector<double>& direc
534    ga = curG;
535    c = a + stepSize;
536    ftol = paramSet->getFTol();
537 +  lsTol = paramSet->getLineSearchTol();
538          
539    //calculate the derivative at a = 0
540    for (size_t i = 0; i < ndim; i++)
# Line 598 | Line 601 | int OOPSEMinimizer::doLineSearch(vector<double>& direc
601        eta = 3 *(fa -fc) /(c - a) + slopeA + slopeC;
602        mu = sqrt(eta * eta - slopeA * slopeC);      
603        b = a + (c - a) * (1 - (slopeC + mu - eta) /(slopeC - slopeA + 2 * mu));      
604 +
605 +      if (b < lsTol){
606 +        if (bVerbose)
607 +          cout << "stepSize is less than line search tolerance" << endl;
608 +        break;        
609 +      }
610      //}
611  
612      // Take a trial step to this new point - new coords in xb

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines