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

Go to the source code of this file.

Functions/Subroutines

subroutine mainlb (n, m, x, l, u, nbd, f, g, factr, pgtol, ws, wy, sy, ss, wt, wn, snd, z, r, d, t, xp, wa, index, iwhere, indx2, task, iprint, csave, lsave, isave, dsave)
 This subroutine solves bound constrained optimization problems by using the compact formula of the limited memory BFGS updates. More...
 

Function/Subroutine Documentation

◆ mainlb()

subroutine mainlb ( integer  n,
integer  m,
double precision, dimension(n)  x,
double precision, dimension(n)  l,
double precision, dimension(n)  u,
integer, dimension(n)  nbd,
double precision  f,
double precision, dimension(n)  g,
double precision  factr,
double precision  pgtol,
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(m, m)  wt,
double precision, dimension(2*m, 2*m)  wn,
double precision, dimension(2*m, 2*m)  snd,
double precision, dimension(n)  z,
double precision, dimension(n)  r,
double precision, dimension(n)  d,
double precision, dimension(n)  t,
double precision, dimension(n)  xp,
double precision, dimension(8*m)  wa,
integer, dimension(n)  index,
integer, dimension(n)  iwhere,
integer, dimension(n)  indx2,
character*60  task,
integer  iprint,
character*60  csave,
logical, dimension(4)  lsave,
integer, dimension(23)  isave,
double precision, dimension(29)  dsave 
)

This subroutine solves bound constrained optimization problems by using the compact formula of the limited memory BFGS updates.

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.
xOn entry x is an approximation to the solution.
On exit x is the current approximation.
lOn entry l is the lower bound of x.
On exit l is unchanged.
uOn entry u is the upper bound of x.
On exit u is unchanged.
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,
  • 3 if x(i) has only an upper bound.
On exit nbd is unchanged.
fOn first entry f is unspecified.
On final exit f is the value of the function at x.
gOn first entry g is unspecified.
On final exit g is the value of the gradient at x.
factrOn entry factr >= 0 is specified by the user. The iteration will stop when
(f^k - f^{k+1})/max{|f^k|,|f^{k+1}|,1} <= factr*epsmch
where epsmch is the machine precision, which is automatically generated by the code.
On exit factr is unchanged.
pgtolOn entry pgtol >= 0 is specified by the user. The iteration will stop when
max{|proj g_i | i = 1, ..., n} <= pgtol
where pg_i is the ith component of the projected gradient.
On exit pgtol 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.
wtOn entry this stores the Cholesky factorization of (theta*S'S+LD^(-1)L'), that defines the limited memory BFGS matrix. See eq. (2.26) in [3].
On exit this array is unchanged.
wnworking array used to store the LEL^T factorization of the indefinite matrix K = [-D -Y'ZZ'Y/theta L_a'-R_z' ] [L_a -R_z theta*S'AA'S ]
where E = [-I 0] [ 0 I]
sndworking array used to store the lower triangular part of N = [Y' ZZ'Y L_a'+R_z'] [L_a +R_z S'AA'S ]
zworking array used at different times to store the Cauchy point and the Newton point.
rworking array
dworking array
tworking array
xpworking array used to safeguard the projected Newton direction
waworking array
indexIn subroutine freev, index is used to store the free and fixed variables at the Generalized Cauchy Point (GCP).
iwhereworking array used to record the status of the vector x for GCP computation.
iwhere(i)=
  • 0 or -3 if x(i) is free and has bounds,
  • 1 if x(i) is fixed at l(i), and l(i) .ne. u(i)
  • 2 if x(i) is fixed at u(i), and u(i) .ne. l(i)
  • 3 if x(i) is always fixed, i.e., u(i)=x(i)=l(i)
  • -1 if x(i) is always free, i.e., no bounds on it.
indx2working array
Within subroutine cauchy, indx2 corresponds to the array iorder.
In subroutine freev, a list of variables entering and leaving the free set is stored in indx2, and it is passed on to subroutine formk with this information.
taskworking string indicating the current job when entering and leaving this subroutine.
iprintIt controls the frequency and type of output generated:
  • iprint<0 no output is generated;
  • iprint=0 print only one line at the last iteration;
  • 0<iprint<99 print also f and |proj g| every iprint iterations;
  • iprint=99 print details of every iteration except n-vectors;
  • iprint=100 print also the changes of active set and final x;
  • iprint>100 print details of every iteration including x and g;
When iprint > 0, the file iterate.dat will be created to summarize the iteration.
csaveworking string
lsaveworking array
isaveworking array
dsaveworking array

Definition at line 128 of file mainlb.f.

References active(), cauchy(), cmprlb(), errclb(), formk(), formt(), freev(), lnsrlb(), matupd(), prn1lb(), prn2lb(), prn3lb(), projgr(), subsm(), and timer().

Referenced by setulb().

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