Revert the previous commit.

git-svn-id: file:///home/svnrepos/software/liblbfgs/trunk@31 ecf4c44f-38d1-4fa4-9757-a0b4dd0349fc
This commit is contained in:
naoaki 2009-02-16 05:59:00 +00:00
parent 51d079e829
commit 3567c3a888

View File

@ -561,6 +561,7 @@ int lbfgs(
vecncpy(d, g, n); vecncpy(d, g, n);
} else { } else {
owlqn_direction(d, x, g, param.orthantwise_c, param.orthantwise_start, param.orthantwise_end); owlqn_direction(d, x, g, param.orthantwise_c, param.orthantwise_start, param.orthantwise_end);
veccpy(w, d, n);
} }
j = end; j = end;
@ -586,6 +587,17 @@ int lbfgs(
j = (j + 1) % m; /* if (++j == m) j = 0; */ j = (j + 1) % m; /* if (++j == m) j = 0; */
} }
/*
Constrain the search direction for orthant-wise updates.
*/
if (param.orthantwise_c != 0.) {
for (i = param.orthantwise_start;i < param.orthantwise_end;++i) {
if (d[i] * w[i] <= 0) {
d[i] = 0;
}
}
}
/* /*
Now the search direction d is ready. We try step = 1 first. Now the search direction d is ready. We try step = 1 first.
*/ */