Experimental code.
git-svn-id: file:///home/svnrepos/software/liblbfgs/trunk@35 ecf4c44f-38d1-4fa4-9757-a0b4dd0349fc
This commit is contained in:
parent
711675ae91
commit
d9711f5b34
10
lib/lbfgs.c
10
lib/lbfgs.c
@ -250,7 +250,7 @@ static void owlqn_project(
|
|||||||
lbfgsfloatval_t* d,
|
lbfgsfloatval_t* d,
|
||||||
const lbfgsfloatval_t* sign,
|
const lbfgsfloatval_t* sign,
|
||||||
const int start,
|
const int start,
|
||||||
const int n
|
const int end
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -605,9 +605,9 @@ int lbfgs(
|
|||||||
|
|
||||||
if (param.orthantwise_c != 0.) {
|
if (param.orthantwise_c != 0.) {
|
||||||
vecdot(&gnorm, d, pg, n);
|
vecdot(&gnorm, d, pg, n);
|
||||||
if (gnorm > 0) {
|
if (gnorm >= 0) {
|
||||||
vecncpy(gp, pg, n);
|
vecncpy(gp, pg, n);
|
||||||
owlqn_project(d, gp, 0, n);
|
owlqn_project(d, gp, param.orthantwise_start, param.orthantwise_end);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1594,12 +1594,12 @@ static void owlqn_project(
|
|||||||
lbfgsfloatval_t* d,
|
lbfgsfloatval_t* d,
|
||||||
const lbfgsfloatval_t* sign,
|
const lbfgsfloatval_t* sign,
|
||||||
const int start,
|
const int start,
|
||||||
const int n
|
const int end
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = start;i < n;++i) {
|
for (i = start;i < end;++i) {
|
||||||
if (d[i] * sign[i] < 0) {
|
if (d[i] * sign[i] < 0) {
|
||||||
d[i] = 0;
|
d[i] = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user