From bc7898c01855458b31f62d4582cb1456ee94c129 Mon Sep 17 00:00:00 2001 From: Davis King Date: Fri, 7 May 2010 21:13:16 +0000 Subject: [PATCH] Added a missing check for division by zero. --HG-- extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403578 --- dlib/svm/svm_c_linear_trainer.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlib/svm/svm_c_linear_trainer.h b/dlib/svm/svm_c_linear_trainer.h index fb729430f..e98b0082b 100644 --- a/dlib/svm/svm_c_linear_trainer.h +++ b/dlib/svm/svm_c_linear_trainer.h @@ -125,6 +125,9 @@ namespace dlib cout << endl; } + if (current_objective_value == 0) + return true; + if (current_error_gap/current_objective_value < eps) return true;