Skip to content

Commit a90e5c3

Browse files
author
Fei Yang
committed
fixcode
1 parent 34ec933 commit a90e5c3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

source/source_relax/bfgs.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ void BFGS::Update(std::vector<double>& pos,
229229
dpos[iat * 3 + 2] = move_ion_dr.z ;
230230
}
231231
}
232-
if(*max_element(dpos.begin(), dpos.end()) < 1e-7)
232+
double threshold=1e-7;
233+
if(*max_element(dpos.begin(), dpos.end()) < threshold)
233234
{
234235
return;
235236
}
@@ -251,7 +252,8 @@ void BFGS::DetermineStep(std::vector<double>& steplength,
251252
{
252253
std::vector<double>::iterator maxsteplength = max_element(steplength.begin(), steplength.end());
253254
double a = *maxsteplength;
254-
assert(a > 1e-10);
255+
double threshold=1e-10;
256+
assert(a > threshold);
255257
if(a >= maxstep)
256258
{
257259
double scale = maxstep / a;

0 commit comments

Comments
 (0)