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

Go to the source code of this file.

Functions/Subroutines

subroutine matupd (n, m, ws, wy, sy, ss, d, r, itail, iupdat, col, head, theta, rr, dr, stp, dtd)
 This subroutine updates matrices WS and WY, and forms the middle matrix in B. More...
 

Function/Subroutine Documentation

◆ matupd()

subroutine matupd ( integer  n,
integer  m,
double precision, dimension(n, m)  ws,
double precision, dimension(n, m)  wy,
double precision, dimension(m, m)  sy,
double precision, dimension(m, m)  ss,
double precision, dimension(n)  d,
double precision, dimension(n)  r,
integer  itail,
integer  iupdat,
integer  col,
integer  head,
double precision  theta,
double precision  rr,
double precision  dr,
double precision  stp,
double precision  dtd 
)

This subroutine updates matrices WS and WY, and forms the middle matrix in B.

Parameters
nOn entry n is the number of variables.
On exit n is unchanged.
mOn entry m is the maximum number of variable metric corrections allowed in the limited memory matrix.
On exit m is unchanged.
wsOn entry this stores S, a set of s-vectors, that defines the limited memory BFGS matrix.
On exit this array is unchanged.
wyOn entry this stores Y, a set of y-vectors, that defines the limited memory BFGS matrix.
On exit this array is unchanged.
syOn entry this stores S'Y, that defines the limited memory BFGS matrix.
On exit this array is unchanged.
ssOn entry this stores S'S, that defines the limited memory BFGS matrix.
On exit this array is unchanged.
dSearch direction at the current iteration. After the line search, the new s-vector is stp*d; matupd stores it as a column of WS (writing d directly, since the stp scaling is folded into the stored ss diagonal entry below).
rThe accepted gradient difference y = g_{k+1} - g_k. Stored as a column of WY.
itailOn entry the column index in WS/WY that the previous update wrote. On exit the column index this update wrote; advances cyclically modulo m.
iupdatTotal number of L-BFGS updates performed so far (incremented by mainlb before each matupd call). When iupdat <= m, col simply grows; when iupdat > m, the history wraps and the oldest column is discarded.
colOn entry col is the actual number of variable metric corrections stored so far.
On exit col is unchanged.
headOn entry head is the location of the first s-vector (or y-vector) in S (or Y).
On exit col is unchanged.
thetaOn entry theta is the scaling factor specifying B_0 = theta I.
On exit theta is unchanged.
rrSquared 2-norm of r (i.e. ||y||^2 = y'y). Used to set theta := rr/dr = y'y / (s'y), the standard initial Hessian scaling for the next L-BFGS update.
drInner product d'r = s'y / stp (the curvature condition; must be positive for the update to be safely accepted – mainlb checks this and skips matupd if dr <= eps*rr).
stpLine-search step length. Used to recover the s-vector from d (s = stp*d) when computing ss(col,col) = stp^2 * d'd.
dtdSquared 2-norm of d (i.e. d'd). Combined with stp to form ss(col,col) = stp^2 * dtd = ||s||^2 for the new column.

Definition at line 64 of file matupd.f.

Referenced by mainlb().

Here is the caller graph for this function: