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
This commit is contained in:
naoaki 2009-02-16 14:02:45 +00:00
parent 83a802b87c
commit 6a1b860ea3

View File

@ -643,7 +643,7 @@ static int line_search_backtracking_owlqn(
/* Choose the orthant for the new point. */ /* Choose the orthant for the new point. */
for (i = 0;i < n;++i) { 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 (;;) { for (;;) {
@ -823,9 +823,6 @@ static int line_search_morethuente(
width = param->max_step - param->min_step; width = param->max_step - param->min_step;
prev_width = 2.0 * width; 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, The variables stx, fx, dgx contain the values of the step,
function, and directional derivative at the best step. function, and directional derivative at the best step.
@ -868,7 +865,7 @@ static int line_search_morethuente(
Compute the current value of x: Compute the current value of x:
x <- x + (*stp) * s. x <- x + (*stp) * s.
*/ */
veccpy(x, wa, n); veccpy(x, xp, n);
vecadd(x, s, *stp, n); vecadd(x, s, *stp, n);
/* Evaluate the function and gradient values. */ /* Evaluate the function and gradient values. */
@ -1264,6 +1261,9 @@ static int update_trial_interval(
} }
static lbfgsfloatval_t owlqn_x1norm( static lbfgsfloatval_t owlqn_x1norm(
const lbfgsfloatval_t* x, const lbfgsfloatval_t* x,
const int start, const int start,