|
L-BFGS-B
3.0
Large-scale Bound-constrained Optimization
|
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... | |
| 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.
| n | On entry n is the number of variables. On exit n is unchanged. |
| m | On entry m is the maximum number of variable metric corrections allowed in the limited memory matrix. On exit m is unchanged. |
| ws | On entry this stores S, a set of s-vectors, that defines the limited memory BFGS matrix. On exit this array is unchanged. |
| wy | On entry this stores Y, a set of y-vectors, that defines the limited memory BFGS matrix. On exit this array is unchanged. |
| sy | On entry this stores S'Y, that defines the limited memory BFGS matrix. On exit this array is unchanged. |
| ss | On entry this stores S'S, that defines the limited memory BFGS matrix. On exit this array is unchanged. |
| d | Search 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). |
| r | The accepted gradient difference y = g_{k+1} - g_k. Stored as a column of WY. |
| itail | On entry the column index in WS/WY that the previous update wrote. On exit the column index this update wrote; advances cyclically modulo m. |
| iupdat | Total 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. |
| col | On entry col is the actual number of variable metric corrections stored so far. On exit col is unchanged. |
| head | On entry head is the location of the first s-vector (or y-vector) in S (or Y). On exit col is unchanged. |
| theta | On entry theta is the scaling factor specifying B_0 = theta I. On exit theta is unchanged. |
| rr | Squared 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. |
| dr | Inner 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). |
| stp | Line-search step length. Used to recover the s-vector from d (s = stp*d) when computing ss(col,col) = stp^2 * d'd. |
| dtd | Squared 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().