Code simplification.

git-svn-id: file:///home/svnrepos/software/liblbfgs/trunk@40 ecf4c44f-38d1-4fa4-9757-a0b4dd0349fc
This commit is contained in:
naoaki 2009-02-16 12:11:44 +00:00
parent 14d86ed609
commit 4edf33c84e

View File

@ -668,11 +668,9 @@ static int line_search_backtracking_owlqn(
return LBFGSERR_INVALIDPARAMETERS;
}
/* Choose the orthant for the new point. */
for (i = 0;i < n;++i) {
wp[i] = xp[i];
if (wp[i] == 0.) {
wp[i] = -gp[i];
}
wp[i] = (xp[i] == 0.) ? -gp[i] : wp[i];
}
for (;;) {
@ -1496,6 +1494,7 @@ static void owlqn_direction(
/* Take the left partial derivative. */
d[i] = -g[i] + c;
} else {
/* The gradient is in the range of [-C, C]. */
d[i] = 0.;
}
}