From 6a1b860ea31063a065c2dfb3ea9160b3c735ff00 Mon Sep 17 00:00:00 2001 From: naoaki Date: Mon, 16 Feb 2009 14:02:45 +0000 Subject: [PATCH] A bug fix in OW-LQN. Use xp instead of wa in MoreThunte. git-svn-id: file:///home/svnrepos/software/liblbfgs/trunk@48 ecf4c44f-38d1-4fa4-9757-a0b4dd0349fc --- lib/lbfgs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/lbfgs.c b/lib/lbfgs.c index 21f81b1..e11d316 100644 --- a/lib/lbfgs.c +++ b/lib/lbfgs.c @@ -643,7 +643,7 @@ static int line_search_backtracking_owlqn( /* Choose the orthant for the new point. */ for (i = 0;i < n;++i) { - wp[i] = (xp[i] == 0.) ? -gp[i] : wp[i]; + wp[i] = (xp[i] == 0.) ? -gp[i] : xp[i]; } for (;;) { @@ -823,9 +823,6 @@ static int line_search_morethuente( width = param->max_step - param->min_step; prev_width = 2.0 * width; - /* Copy the value of x to the work area. */ - veccpy(wa, x, n); - /* The variables stx, fx, dgx contain the values of the step, function, and directional derivative at the best step. @@ -868,7 +865,7 @@ static int line_search_morethuente( Compute the current value of x: x <- x + (*stp) * s. */ - veccpy(x, wa, n); + veccpy(x, xp, n); vecadd(x, s, *stp, n); /* Evaluate the function and gradient values. */ @@ -1264,6 +1261,9 @@ static int update_trial_interval( } + + + static lbfgsfloatval_t owlqn_x1norm( const lbfgsfloatval_t* x, const int start,