|
L-BFGS-B
3.0
Large-scale Bound-constrained Optimization
|
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... | |
| 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 | ||
| ) |
| n | number of parameters |
| l | lower bounds of parameters |
| u | upper bounds of parameters |
| nbd | On entry nbd represents the type of bounds imposed on the variables, and must be specified as follows: nbd(i)=
|
| x | position |
| f | function value at x |
| fold | Function 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. |
| gd | Directional derivative g'd at the current trial step. Computed on every entry and passed to dcsrch as its g argument. |
| gdold | Directional 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. |
| g | Gradient of f at x. |
| d | Search direction (z - x_current). Length-n vector; the candidate step is t + stp*d. |
| r | Workspace: 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). |
| t | Workspace: copy of x at the start of this line search. |
| z | Pre-projected candidate (cauchy/subsm output). When stp=1 exactly, lnsrlb sets x := z directly; otherwise it computes x := t + stp*d. |
| stp | Current trial step length. On the first entry of a line search lnsrlb initialises stp; subsequent dcsrch calls update it. |
| dnorm | 2-norm of d (||d||). |
| dtd | Squared 2-norm of d (d'd). |
| xstep | On exit stp * ||d||, the actual length of the step in x-space. |
| stpmx | Maximum 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. |
| iter | Outer iteration number from mainlb. |
| ifun | On exit number of f/g evaluations performed in this line search; reset to 0 on each new line search. |
| iback | On exit number of "backtracks" (ifun - 1). mainlb aborts the line search if iback >= 20. |
| nfgv | Cumulative count of f/g evaluations across all iterations; incremented by 1 per evaluation requested. |
| info | On exit 0 on success; -4 if the projected directional derivative gd is non-negative on the first call (no descent possible). |
| task | Reverse-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. |
| csave | working array |
| isave | working array |
| dsave | working array |
Definition at line 70 of file lnsrlb.f.
References dcsrch().
Referenced by mainlb().