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:
parent
83a802b87c
commit
6a1b860ea3
10
lib/lbfgs.c
10
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,
|
||||
|
Loading…
Reference in New Issue
Block a user