Now OW-LQN method is available only with backtracking linesearch methods.
git-svn-id: file:///home/svnrepos/software/liblbfgs/trunk@46 ecf4c44f-38d1-4fa4-9757-a0b4dd0349fc
This commit is contained in:
parent
1b33e075df
commit
25e895b4e5
34
lib/lbfgs.c
34
lib/lbfgs.c
@ -357,18 +357,30 @@ int lbfgs(
|
||||
if (n < param.orthantwise_end) {
|
||||
return LBFGSERR_INVALID_ORTHANTWISE_END;
|
||||
}
|
||||
switch (param.linesearch) {
|
||||
case LBFGS_LINESEARCH_MORETHUENTE:
|
||||
linesearch = line_search_morethuente;
|
||||
break;
|
||||
case LBFGS_LINESEARCH_BACKTRACKING:
|
||||
case LBFGS_LINESEARCH_BACKTRACKING_STRONG:
|
||||
linesearch = line_search_backtracking;
|
||||
break;
|
||||
default:
|
||||
return LBFGSERR_INVALID_LINESEARCH;
|
||||
if (param.orthantwise_c != 0.) {
|
||||
switch (param.linesearch) {
|
||||
case LBFGS_LINESEARCH_MORETHUENTE:
|
||||
return LBFGSERR_INVALID_LINESEARCH;
|
||||
case LBFGS_LINESEARCH_BACKTRACKING:
|
||||
case LBFGS_LINESEARCH_BACKTRACKING_STRONG:
|
||||
linesearch = line_search_backtracking_owlqn;
|
||||
break;
|
||||
default:
|
||||
return LBFGSERR_INVALID_LINESEARCH;
|
||||
}
|
||||
} else {
|
||||
switch (param.linesearch) {
|
||||
case LBFGS_LINESEARCH_MORETHUENTE:
|
||||
linesearch = line_search_morethuente;
|
||||
break;
|
||||
case LBFGS_LINESEARCH_BACKTRACKING:
|
||||
case LBFGS_LINESEARCH_BACKTRACKING_STRONG:
|
||||
linesearch = line_search_backtracking;
|
||||
break;
|
||||
default:
|
||||
return LBFGSERR_INVALID_LINESEARCH;
|
||||
}
|
||||
}
|
||||
linesearch = line_search_backtracking_owlqn;
|
||||
|
||||
/* Allocate working space. */
|
||||
xp = (lbfgsfloatval_t*)vecalloc(n * sizeof(lbfgsfloatval_t));
|
||||
|
Loading…
Reference in New Issue
Block a user