From 353e8859083527e17d1f834704027c73a3d653da Mon Sep 17 00:00:00 2001 From: Davis King Date: Mon, 17 Mar 2014 18:24:41 -0400 Subject: [PATCH] Fixed a bug in the backtracking_line_search() function pointed out by Ping-Chang Shih. The function ignored the max_iter parameter. --- dlib/optimization/optimization_line_search.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlib/optimization/optimization_line_search.h b/dlib/optimization/optimization_line_search.h index 7968e4d2c..3a4a4f280 100644 --- a/dlib/optimization/optimization_line_search.h +++ b/dlib/optimization/optimization_line_search.h @@ -512,7 +512,7 @@ namespace dlib unsigned long iter = 0; while (true) { - ++max_iter; + ++iter; const double val = f(alpha); if (val <= f0 + alpha*rho*d0 || iter >= max_iter) {