L-BFGS-B  3.0
Large-scale Bound-constrained Optimization
lnsrlb.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine lnsrlb (n, l, u, nbd, x, f, fold, gd, gdold, g, d, r, t, z, stp, dnorm, dtd, xstep, stpmx, iter, ifun, iback, nfgv, info, task, boxed, cnstnd, csave, isave, dsave)
 This subroutine calls subroutine dcsrch from the Minpack2 library to perform the line search. Subroutine dscrch is safeguarded so that all trial points lie within the feasible region. More...
 

Function/Subroutine Documentation

◆ lnsrlb()

subroutine lnsrlb ( integer  n,
double precision, dimension(n)  l,
double precision, dimension(n)  u,
integer, dimension(n)  nbd,
double precision, dimension(n)  x,
double precision  f,
double precision  fold,
double precision  gd,
double precision  gdold,
double precision, dimension(n)  g,
double precision, dimension(n)  d,
double precision, dimension(n)  r,
double precision, dimension(n)  t,
double precision, dimension(n)  z,
double precision  stp,
double precision  dnorm,
double precision  dtd,
double precision  xstep,
double precision  stpmx,
integer  iter,
integer  ifun,
integer  iback,
integer  nfgv,
integer  info,
character*60  task,
logical  boxed,
logical  cnstnd,
character*60  csave,
integer, dimension(2)  isave,
double precision, dimension(13)  dsave 
)
Parameters
nnumber of parameters
llower bounds of parameters
uupper bounds of parameters
nbdOn entry nbd represents the type of bounds imposed on the variables, and must be specified as follows: nbd(i)=
  • 0 if x(i) is unbounded,
  • 1 if x(i) has only a lower bound,
  • 2 if x(i) has both lower and upper bounds, and
  • 3 if x(i) has only an upper bound.
On exit nbd is unchanged.
xposition
ffunction value at x
foldFunction value at the start of this line search (i.e. the accepted value from the previous iteration). Saved at entry so the caller can restore x, g, f if the line search fails.
gdDirectional derivative g'd at the current trial step. Computed on every entry and passed to dcsrch as its g argument.
gdoldDirectional derivative at stp=0 (i.e. the initial g'd before any line-search progress this iteration). Saved on the first call and used by mainlb to test the curvature condition after the line search returns.
gGradient of f at x.
dSearch direction (z - x_current). Length-n vector; the candidate step is t + stp*d.
rWorkspace: copy of g at the start of this line search. Used alongside fold to restore the previous iterate on abnormal line-search termination (mainlb does the restore from r and t).
tWorkspace: copy of x at the start of this line search.
zPre-projected candidate (cauchy/subsm output). When stp=1 exactly, lnsrlb sets x := z directly; otherwise it computes x := t + stp*d.
stpCurrent trial step length. On the first entry of a line search lnsrlb initialises stp; subsequent dcsrch calls update it.
dnorm2-norm of d (||d||).
dtdSquared 2-norm of d (d'd).
xstepOn exit stp * ||d||, the actual length of the step in x-space.
stpmxMaximum allowed step. For unconstrained problems set to a large constant (1e10); for bounded problems lnsrlb scans the active bounds and tightens stpmx so x + stpmx*d stays feasible.
iterOuter iteration number from mainlb.
ifunOn exit number of f/g evaluations performed in this line search; reset to 0 on each new line search.
ibackOn exit number of "backtracks" (ifun - 1). mainlb aborts the line search if iback >= 20.
nfgvCumulative count of f/g evaluations across all iterations; incremented by 1 per evaluation requested.
infoOn exit 0 on success; -4 if the projected directional derivative gd is non-negative on the first call (no descent possible).
taskReverse-comm task. Initial entry: 'START'. While the line search is running, lnsrlb returns 'FG_LNSRCH' (the user evaluates f, g at the new x and re-enters with task starting with 'FG_LN'). On line-search success lnsrlb returns 'NEW_X'.
boxed.true. if every variable has both lower and upper bounds. When true, the initial trial step is unit (stp=1) regardless of d's magnitude.
cnstnd.true. if the problem has at least one bound. Controls the stpmx-from-bounds scan.
csaveworking array
isaveworking array
dsaveworking array

Definition at line 70 of file lnsrlb.f.

References dcsrch().

Referenced by mainlb().

Here is the call graph for this function:
Here is the caller graph for this function: