Fixed a bug in the backtracking_line_search() function pointed out by

Ping-Chang Shih.  The function ignored the max_iter parameter.
This commit is contained in:
Davis King 2014-03-17 18:24:41 -04:00
parent 5b2f853c01
commit 353e885908

View File

@ -512,7 +512,7 @@ namespace dlib
unsigned long iter = 0; unsigned long iter = 0;
while (true) while (true)
{ {
++max_iter; ++iter;
const double val = f(alpha); const double val = f(alpha);
if (val <= f0 + alpha*rho*d0 || iter >= max_iter) if (val <= f0 + alpha*rho*d0 || iter >= max_iter)
{ {