Code simplification.
git-svn-id: file:///home/svnrepos/software/liblbfgs/trunk@40 ecf4c44f-38d1-4fa4-9757-a0b4dd0349fc
This commit is contained in:
parent
14d86ed609
commit
4edf33c84e
@ -668,11 +668,9 @@ static int line_search_backtracking_owlqn(
|
|||||||
return LBFGSERR_INVALIDPARAMETERS;
|
return LBFGSERR_INVALIDPARAMETERS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Choose the orthant for the new point. */
|
||||||
for (i = 0;i < n;++i) {
|
for (i = 0;i < n;++i) {
|
||||||
wp[i] = xp[i];
|
wp[i] = (xp[i] == 0.) ? -gp[i] : wp[i];
|
||||||
if (wp[i] == 0.) {
|
|
||||||
wp[i] = -gp[i];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
@ -1496,6 +1494,7 @@ static void owlqn_direction(
|
|||||||
/* Take the left partial derivative. */
|
/* Take the left partial derivative. */
|
||||||
d[i] = -g[i] + c;
|
d[i] = -g[i] + c;
|
||||||
} else {
|
} else {
|
||||||
|
/* The gradient is in the range of [-C, C]. */
|
||||||
d[i] = 0.;
|
d[i] = 0.;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user