Release for liblbfgs 1.6.

git-svn-id: file:///home/svnrepos/software/liblbfgs/trunk@25 ecf4c44f-38d1-4fa4-9757-a0b4dd0349fc
This commit is contained in:
naoaki
2008-11-02 04:50:00 +00:00
parent 8eab247760
commit 2eef3e89c1
5 changed files with 154 additions and 10 deletions

View File

@@ -49,6 +49,7 @@ int main(int argc, char *argv)
int i, ret = 0;
lbfgsfloatval_t fx;
lbfgsfloatval_t *x = lbfgs_malloc(N);
lbfgs_parameter_t param;
if (x == NULL) {
printf("ERROR: Failed to allocate a memory block for variables.\n");
@@ -61,11 +62,15 @@ int main(int argc, char *argv)
x[i+1] = 1.0;
}
/* Initialize the parameters for the L-BFGS optimization. */
lbfgs_parameter_init(&param);
/* param.linesearch = LBFGS_LINESEARCH_BACKTRACKING; */
/*
Start the L-BFGS optimization; this will invoke the callback functions
evaluate() and progress() when necessary.
*/
ret = lbfgs(N, x, &fx, evaluate, progress, NULL, NULL);
ret = lbfgs(N, x, &fx, evaluate, progress, NULL, &param);
/* Report the result. */
printf("L-BFGS optimization terminated with status code = %d\n", ret);