Skip to content

Commit

Permalink
Merge pull request #9 from frjnn/master
Browse files Browse the repository at this point in the history
Move prints behind `iprint` check
  • Loading branch information
stephenbeckr committed Aug 5, 2022
2 parents 9253c1a + 57578ad commit 2197526
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/lbfgsb.c
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ static double c_b7 = 0.;
lnsrlb(n, &l[1], &u[1], &nbd[1], &x[1], f, &fold, &gd, &gdold, &g[1], &
d__[1], &r__[1], &t[1], &z__[1], &stp, &dnorm, &dtd, &xstep, &
stpmx, &iter, &ifun, &iback, &nfgv, &info, task, &boxed, &cnstnd,
csave, &isave[22], &dsave[17]); /* (ftnlen)60, (ftnlen)60); */
csave, &isave[22], iprint, &dsave[17]); /* (ftnlen)60, (ftnlen)60); */
if (info != 0 || iback >= 20) {
/* restore the previous iterate. */
dcopy(n, &t[1], &c__1, &x[1], &c__1);
Expand Down
2 changes: 1 addition & 1 deletion src/lbfgsb.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ extern int lnsrlb(integer *n, double *l, double *u,
double *dnorm, double *dtd, double *xstep, double *
stpmx, integer *iter, integer *ifun, integer *iback, integer *nfgv,
integer *info, integer *task, logical *boxed, logical *cnstnd, integer *
csave, integer *isave, double *dsave); /* ftnlen task_len, ftnlen
csave, integer *isave, integer *iprint, double *dsave); /* ftnlen task_len, ftnlen
csave_len); */
#define projgr FORTRAN_WRAPPER(projgr)
extern int projgr(integer *, double *, double *,
Expand Down
6 changes: 4 additions & 2 deletions src/linesearch.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ static integer c__1 = 1;
double *dnorm, double *dtd, double *xstep, double *
stpmx, integer *iter, integer *ifun, integer *iback, integer *nfgv,
integer *info, integer *task, logical *boxed, logical *cnstnd, integer *
csave, integer *isave, double *dsave) /* ftnlen task_len, ftnlen
csave, integer *isave, integer *iprint, double *dsave) /* ftnlen task_len, ftnlen
csave_len) */
{
/*
Expand Down Expand Up @@ -125,7 +125,9 @@ static integer c__1 = 1;
if (*gd >= 0.) {
/* the directional derivative >=0. */
/* Line search is impossible. */
printf("ascend direction in projection gd = %.2e\n", *gd );
if (*iprint >= 0) {
printf("ascend direction in projection gd = %.2e\n", *gd );
}
*info = -4;
return 0;
}
Expand Down
6 changes: 4 additions & 2 deletions src/subalgorithms.c
Original file line number Diff line number Diff line change
Expand Up @@ -2161,8 +2161,10 @@ static integer c__11 = 11;
}
if (dd_p__ > 0.) {
dcopy(n, &xp[1], &c__1, &x[1], &c__1);
printf("Positive dir derivative in projection \n");
printf("Using the backtracking step\n");
if (*iprint >= 99) {
printf("Positive dir derivative in projection \n");
printf("Using the backtracking step\n");
}
} else {
goto L911;
}
Expand Down

0 comments on commit 2197526

Please sign in to comment.