--- trunk/OOPSE/libmdtools/OOPSEMinimizer.cpp 2004/02/24 15:44:45 1064 +++ trunk/OOPSE/libmdtools/OOPSEMinimizer.cpp 2004/03/01 20:01:50 1074 @@ -18,6 +18,7 @@ OOPSEMinimizer::OOPSEMinimizer( SimInfo *theInfo, Forc curX = getCoor(); curG.resize(ndim); + preMove(); } OOPSEMinimizer::~OOPSEMinimizer(){ @@ -517,6 +518,7 @@ int OOPSEMinimizer::doLineSearch(vector& direc double mu; double eta; double ftol; + double lsTol; xa.resize(ndim); xb.resize(ndim); @@ -532,6 +534,7 @@ int OOPSEMinimizer::doLineSearch(vector& direc ga = curG; c = a + stepSize; ftol = paramSet->getFTol(); + lsTol = paramSet->getLineSearchTol(); //calculate the derivative at a = 0 for (size_t i = 0; i < ndim; i++) @@ -598,6 +601,12 @@ int OOPSEMinimizer::doLineSearch(vector& direc eta = 3 *(fa -fc) /(c - a) + slopeA + slopeC; mu = sqrt(eta * eta - slopeA * slopeC); b = a + (c - a) * (1 - (slopeC + mu - eta) /(slopeC - slopeA + 2 * mu)); + + if (b < lsTol){ + if (bVerbose) + cout << "stepSize is less than line search tolerance" << endl; + break; + } //} // Take a trial step to this new point - new coords in xb