From c2de9780a30dbc5aed19662b8653dde7402172f9 Mon Sep 17 00:00:00 2001 From: Davis King Date: Sun, 28 Feb 2010 01:34:31 +0000 Subject: [PATCH] Just minor improvements. --HG-- extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403503 --- dlib/optimization/optimization_oca.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlib/optimization/optimization_oca.h b/dlib/optimization/optimization_oca.h index c81bc9610..d29b4c250 100644 --- a/dlib/optimization/optimization_oca.h +++ b/dlib/optimization/optimization_oca.h @@ -175,7 +175,8 @@ namespace dlib if (cur_obj < best_obj) { best_obj = cur_obj; - w = w_cur; + // move w_cur into w + w.swap(w_cur); } @@ -200,8 +201,8 @@ namespace dlib // accuracy that is related to how big the error gap is scalar_type eps = std::min(sub_eps, 0.1*(best_obj-cp_obj)) ; // just a sanaty check - if (eps < 1e-7) - eps = 1e-7; + if (eps < 1e-16) + eps = 1e-16; solve_qp_using_smo(K, vector_to_matrix(bs), alpha, eps, sub_max_iter); // construct the w_cur that minimized the subproblem.