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:
@@ -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(¶m);
|
||||
/* 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, ¶m);
|
||||
|
||||
/* Report the result. */
|
||||
printf("L-BFGS optimization terminated with status code = %d\n", ret);
|
||||
|
||||
Reference in New Issue
Block a user