L-BFGS-B  3.0
Large-scale Bound-constrained Optimization
mainlb.f
Go to the documentation of this file.
1 c> \file mainlb.f
2 
3 c> \brief This subroutine solves bound constrained optimization problems by
4 c> using the compact formula of the limited memory BFGS updates.
5 c>
6 c> This subroutine solves bound constrained optimization problems by
7 c> using the compact formula of the limited memory BFGS updates.
8 c>
9 c> @param n On entry n is the number of variables.<br/>
10 c> On exit n is unchanged.
11 c>
12 c> @param m On entry m is the maximum number of variable metric
13 c> corrections allowed in the limited memory matrix.<br/>
14 c> On exit m is unchanged.
15 c>
16 c> @param x On entry x is an approximation to the solution.<br/>
17 c> On exit x is the current approximation.
18 c>
19 c> @param l On entry l is the lower bound of x.<br/>
20 c> On exit l is unchanged.
21 c>
22 c> @param u On entry u is the upper bound of x.<br/>
23 c> On exit u is unchanged.
24 c>
25 c> @param nbd On entry nbd represents the type of bounds imposed on the
26 c> variables, and must be specified as follows:
27 c> nbd(i)=<ul><li>0 if x(i) is unbounded,</li>
28 c> <li>1 if x(i) has only a lower bound,</li>
29 c> <li>2 if x(i) has both lower and upper bounds,</li>
30 c> <li>3 if x(i) has only an upper bound.</li></ul>
31 c> On exit nbd is unchanged.
32 c>
33 c> @param f On first entry f is unspecified.<br/>
34 c> On final exit f is the value of the function at x.
35 c>
36 c> @param g On first entry g is unspecified.<br/>
37 c> On final exit g is the value of the gradient at x.
38 c>
39 c> @param factr On entry factr >= 0 is specified by the user. The iteration
40 c> will stop when<br/>
41 c> (f^k - f^{k+1})/max{|f^k|,|f^{k+1}|,1} <= factr*epsmch<br/>
42 c> where epsmch is the machine precision, which is automatically
43 c> generated by the code.<br/>
44 c> On exit factr is unchanged.
45 c>
46 c> @param pgtol On entry pgtol >= 0 is specified by the user. The iteration
47 c> will stop when<br/>
48 c> max{|proj g_i | i = 1, ..., n} <= pgtol<br/>
49 c> where pg_i is the ith component of the projected gradient.<br/>
50 c> On exit pgtol is unchanged.
51 c>
52 c> @param ws On entry this stores S, a set of s-vectors, that defines the
53 c> limited memory BFGS matrix.<br/>
54 c> On exit this array is unchanged.
55 c>
56 c> @param wy On entry this stores Y, a set of y-vectors, that defines the
57 c> limited memory BFGS matrix.<br/>
58 c> On exit this array is unchanged.
59 c>
60 c> @param sy On entry this stores S'Y, that defines the
61 c> limited memory BFGS matrix.<br/>
62 c> On exit this array is unchanged.
63 c>
64 c> @param ss On entry this stores S'S, that defines the
65 c> limited memory BFGS matrix.<br/>
66 c> On exit this array is unchanged.
67 c>
68 c> @param wt On entry this stores the
69 c> Cholesky factorization of (theta*S'S+LD^(-1)L'), that defines the
70 c> limited memory BFGS matrix. See eq. (2.26) in [3].<br/>
71 c> On exit this array is unchanged.
72 c>
73 c> @param wn working array used to store the LEL^T factorization of the indefinite matrix
74 c> K = [-D -Y'ZZ'Y/theta L_a'-R_z' ]
75 c> [L_a -R_z theta*S'AA'S ]<br/>
76 c> where E = [-I 0]
77 c> [ 0 I]
78 c>
79 c> @param snd working array used to store the lower triangular part of
80 c> N = [Y' ZZ'Y L_a'+R_z']
81 c> [L_a +R_z S'AA'S ]
82 c>
83 c> @param z working array used at different times to store the Cauchy point and
84 c> the Newton point.
85 c> @param r working array
86 c> @param d working array
87 c> @param t working array
88 c> @param xp working array used to safeguard the projected Newton direction
89 c> @param wa working array
90 c>
91 c> @param index In subroutine freev, index is used to store the free and fixed
92 c> variables at the Generalized Cauchy Point (GCP).
93 c>
94 c> @param iwhere working array used to record
95 c> the status of the vector x for GCP computation.<br/>
96 c> iwhere(i)=<ul><li>0 or -3 if x(i) is free and has bounds,</li>
97 c> <li> 1 if x(i) is fixed at l(i), and l(i) .ne. u(i)</li>
98 c> <li> 2 if x(i) is fixed at u(i), and u(i) .ne. l(i)</li>
99 c> <li> 3 if x(i) is always fixed, i.e., u(i)=x(i)=l(i)</li>
100 c> <li>-1 if x(i) is always free, i.e., no bounds on it.</li></ul>
101 c>
102 c> @param indx2 working array<br/>
103 c> Within subroutine cauchy, indx2 corresponds to the array iorder.<br/>
104 c> In subroutine freev, a list of variables entering and leaving
105 c> the free set is stored in indx2, and it is passed on to
106 c> subroutine formk with this information.
107 c>
108 c> @param task working string indicating
109 c> the current job when entering and leaving this subroutine.
110 c>
111 c> @param iprint It controls the frequency and type of output generated:<ul>
112 c> <li>iprint<0 no output is generated;</li>
113 c> <li>iprint=0 print only one line at the last iteration;</li>
114 c> <li>0<iprint<99 print also f and |proj g| every iprint iterations;</li>
115 c> <li>iprint=99 print details of every iteration except n-vectors;</li>
116 c> <li>iprint=100 print also the changes of active set and final x;</li>
117 c> <li>iprint>100 print details of every iteration including x and g;</li></ul>
118 c> When iprint > 0, the file iterate.dat will be created to
119 c> summarize the iteration.
120 c>
121 c> @param csave working string
122 c>
123 c> @param lsave working array
124 c>
125 c> @param isave working array
126 c>
127 c> @param dsave working array
128  subroutine mainlb(n, m, x, l, u, nbd, f, g, factr, pgtol, ws, wy,
129  + sy, ss, wt, wn, snd, z, r, d, t, xp, wa,
130  + index, iwhere, indx2, task,
131  + iprint, csave, lsave, isave, dsave)
132  implicit none
133  character*60 task, csave
134  logical lsave(4)
135  integer n, m, iprint, nbd(n), index(n),
136  + iwhere(n), indx2(n), isave(23)
137  double precision f, factr, pgtol,
138  + x(n), l(n), u(n), g(n), z(n), r(n), d(n), t(n),
139 c-jlm-jn
140  + xp(n),
141  + wa(8*m),
142  + ws(n, m), wy(n, m), sy(m, m), ss(m, m),
143  + wt(m, m), wn(2*m, 2*m), snd(2*m, 2*m), dsave(29)
144 c
145 c References:
146 c
147 c [1] R. H. Byrd, P. Lu, J. Nocedal and C. Zhu, ``A limited
148 c memory algorithm for bound constrained optimization'',
149 c SIAM J. Scientific Computing 16 (1995), no. 5, pp. 1190--1208.
150 c
151 c [2] C. Zhu, R.H. Byrd, P. Lu, J. Nocedal, ``L-BFGS-B: FORTRAN
152 c Subroutines for Large Scale Bound Constrained Optimization''
153 c Tech. Report, NAM-11, EECS Department, Northwestern University,
154 c 1994.
155 c
156 c [3] R. Byrd, J. Nocedal and R. Schnabel "Representations of
157 c Quasi-Newton Matrices and their use in Limited Memory Methods'',
158 c Mathematical Programming 63 (1994), no. 4, pp. 129-156.
159 c
160 c (Postscript files of these papers are available via anonymous
161 c ftp to eecs.nwu.edu in the directory pub/lbfgs/lbfgs_bcm.)
162 c
163 c * * *
164 c
165 c NEOS, November 1994. (Latest revision June 1996.)
166 c Optimization Technology Center.
167 c Argonne National Laboratory and Northwestern University.
168 c Written by
169 c Ciyou Zhu
170 c in collaboration with R.H. Byrd, P. Lu-Chen and J. Nocedal.
171 c
172 c
173 c ************
174 
175  logical prjctd,cnstnd,boxed,updatd,wrk
176  character*3 word
177  integer i,k,nintol,itfile,iback,nskip,
178  + head,col,iter,itail,iupdat,
179  + nseg,nfgv,info,ifun,
180  + iword,nfree,nact,ileave,nenter
181  double precision theta,fold,ddot,dr,rr,tol,
182  + xstep,sbgnrm,ddum,dnorm,dtd,epsmch,
183  + cpu1,cpu2,cachyt,sbtime,lnscht,time1,time2,
184  + gd,gdold,stp,stpmx,time
185  double precision one,zero
186  parameter (one=1.0d0,zero=0.0d0)
187 
188  if (task .eq. 'START') then
189 
190  epsmch = epsilon(one)
191 
192  call timer(time1)
193 
194 c Initialize counters and scalars when task='START'.
195 
196 c for the limited memory BFGS matrices:
197  col = 0
198  head = 1
199  theta = one
200  iupdat = 0
201  updatd = .false.
202  iback = 0
203  itail = 0
204  iword = 0
205  nact = 0
206  ileave = 0
207  nenter = 0
208  fold = zero
209  dnorm = zero
210  cpu1 = zero
211  gd = zero
212  stpmx = zero
213  sbgnrm = zero
214  stp = zero
215  gdold = zero
216  dtd = zero
217 
218 c for operation counts:
219  iter = 0
220  nfgv = 0
221  nseg = 0
222  nintol = 0
223  nskip = 0
224  nfree = n
225  ifun = 0
226 c for stopping tolerance:
227  tol = factr*epsmch
228 
229 c for measuring running time:
230  cachyt = 0
231  sbtime = 0
232  lnscht = 0
233 
234 c 'word' records the status of subspace solutions.
235  word = '---'
236 
237 c 'info' records the termination information.
238  info = 0
239 
240  itfile = 8
241  if (iprint .ge. 1) then
242 c open a summary file 'iterate.dat'
243  open (itfile, file = 'iterate.dat', status = 'unknown')
244  endif
245 
246 c Check the input arguments for errors.
247 
248  call errclb(n,m,factr,l,u,nbd,task,info,k)
249  if (task(1:5) .eq. 'ERROR') then
250  call prn3lb(n,x,f,task,iprint,info,itfile,
251  + iter,nfgv,nintol,nskip,nact,sbgnrm,
252  + zero,nseg,word,iback,stp,xstep,k,
253  + cachyt,sbtime,lnscht)
254  return
255  endif
256 
257  call prn1lb(n,m,l,u,x,iprint,itfile,epsmch)
258 
259 c Initialize iwhere & project x onto the feasible set.
260 
261  call active(n,l,u,nbd,x,iwhere,iprint,prjctd,cnstnd,boxed)
262 
263 c The end of the initialization.
264 
265  else
266 c restore local variables.
267 
268  prjctd = lsave(1)
269  cnstnd = lsave(2)
270  boxed = lsave(3)
271  updatd = lsave(4)
272 
273  nintol = isave(1)
274  itfile = isave(3)
275  iback = isave(4)
276  nskip = isave(5)
277  head = isave(6)
278  col = isave(7)
279  itail = isave(8)
280  iter = isave(9)
281  iupdat = isave(10)
282  nseg = isave(12)
283  nfgv = isave(13)
284  info = isave(14)
285  ifun = isave(15)
286  iword = isave(16)
287  nfree = isave(17)
288  nact = isave(18)
289  ileave = isave(19)
290  nenter = isave(20)
291 
292  theta = dsave(1)
293  fold = dsave(2)
294  tol = dsave(3)
295  dnorm = dsave(4)
296  epsmch = dsave(5)
297  cpu1 = dsave(6)
298  cachyt = dsave(7)
299  sbtime = dsave(8)
300  lnscht = dsave(9)
301  time1 = dsave(10)
302  gd = dsave(11)
303  stpmx = dsave(12)
304  sbgnrm = dsave(13)
305  stp = dsave(14)
306  gdold = dsave(15)
307  dtd = dsave(16)
308 
309 c After returning from the driver go to the point where execution
310 c is to resume.
311 
312  if (task(1:5) .eq. 'FG_LN') goto 666
313  if (task(1:5) .eq. 'NEW_X') goto 777
314  if (task(1:5) .eq. 'FG_ST') goto 111
315  if (task(1:4) .eq. 'STOP') then
316  if (task(7:9) .eq. 'CPU') then
317 c restore the previous iterate.
318  call dcopy(n,t,1,x,1)
319  call dcopy(n,r,1,g,1)
320  f = fold
321  endif
322  goto 999
323  endif
324  endif
325 
326 c Compute f0 and g0.
327 
328  task = 'FG_START'
329 c return to the driver to calculate f and g; reenter at 111.
330  goto 1000
331  111 continue
332  nfgv = 1
333 
334 c Compute the infinity norm of the (-) projected gradient.
335 
336  call projgr(n,l,u,nbd,x,g,sbgnrm)
337 
338  if (iprint .ge. 1) then
339  write (6,1002) iter,f,sbgnrm
340  write (itfile,1003) iter,nfgv,sbgnrm,f
341  endif
342  if (sbgnrm .le. pgtol) then
343 c terminate the algorithm.
344  task = 'CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL'
345  goto 999
346  endif
347 
348 c ----------------- the beginning of the loop --------------------------
349 
350  222 continue
351  if (iprint .ge. 99) write (6,1001) iter + 1
352  iword = -1
353 c
354  if (.not. cnstnd .and. col .gt. 0) then
355 c skip the search for GCP.
356  call dcopy(n,x,1,z,1)
357  wrk = updatd
358  nseg = 0
359  goto 333
360  endif
361 
362 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
363 c
364 c Compute the Generalized Cauchy Point (GCP).
365 c
366 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
367 
368  call timer(cpu1)
369  call cauchy(n,x,l,u,nbd,g,indx2,iwhere,t,d,z,
370  + m,wy,ws,sy,wt,theta,col,head,
371  + wa(1),wa(2*m+1),wa(4*m+1),wa(6*m+1),nseg,
372  + iprint, sbgnrm, info, epsmch)
373  if (info .ne. 0) then
374 c singular triangular system detected; refresh the lbfgs memory.
375  if(iprint .ge. 1) write (6, 1005)
376  info = 0
377  col = 0
378  head = 1
379  theta = one
380  iupdat = 0
381  updatd = .false.
382  call timer(cpu2)
383  cachyt = cachyt + cpu2 - cpu1
384  goto 222
385  endif
386  call timer(cpu2)
387  cachyt = cachyt + cpu2 - cpu1
388  nintol = nintol + nseg
389 
390 c Count the entering and leaving variables for iter > 0;
391 c find the index set of free and active variables at the GCP.
392 
393  call freev(n,nfree,index,nenter,ileave,indx2,
394  + iwhere,wrk,updatd,cnstnd,iprint,iter)
395  nact = n - nfree
396 
397  333 continue
398 
399 c If there are no free variables or B=theta*I, then
400 c skip the subspace minimization.
401 
402  if (nfree .eq. 0 .or. col .eq. 0) goto 555
403 
404 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
405 c
406 c Subspace minimization.
407 c
408 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
409 
410  call timer(cpu1)
411 
412 c Form the LEL^T factorization of the indefinite
413 c matrix K = [-D -Y'ZZ'Y/theta L_a'-R_z' ]
414 c [L_a -R_z theta*S'AA'S ]
415 c where E = [-I 0]
416 c [ 0 I]
417 
418  if (wrk) call formk(n,nfree,index,nenter,ileave,indx2,iupdat,
419  + updatd,wn,snd,m,ws,wy,sy,theta,col,head,info)
420  if (info .ne. 0) then
421 c nonpositive definiteness in Cholesky factorization;
422 c refresh the lbfgs memory and restart the iteration.
423  if(iprint .ge. 1) write (6, 1006)
424  info = 0
425  col = 0
426  head = 1
427  theta = one
428  iupdat = 0
429  updatd = .false.
430  call timer(cpu2)
431  sbtime = sbtime + cpu2 - cpu1
432  goto 222
433  endif
434 
435 c compute r=-Z'B(xcp-xk)-Z'g (using wa(2m+1)=W'(xcp-x)
436 c from 'cauchy').
437  call cmprlb(n,m,x,g,ws,wy,sy,wt,z,r,wa,index,
438  + theta,col,head,nfree,cnstnd,info)
439  if (info .ne. 0) goto 444
440 
441 c-jlm-jn call the direct method.
442 
443  call subsm( n, m, nfree, index, l, u, nbd, z, r, xp, ws, wy,
444  + theta, x, g, col, head, iword, wa, wn, iprint, info)
445  444 continue
446  if (info .ne. 0) then
447 c singular triangular system detected;
448 c refresh the lbfgs memory and restart the iteration.
449  if(iprint .ge. 1) write (6, 1005)
450  info = 0
451  col = 0
452  head = 1
453  theta = one
454  iupdat = 0
455  updatd = .false.
456  call timer(cpu2)
457  sbtime = sbtime + cpu2 - cpu1
458  goto 222
459  endif
460 
461  call timer(cpu2)
462  sbtime = sbtime + cpu2 - cpu1
463  555 continue
464 
465 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
466 c
467 c Line search and optimality tests.
468 c
469 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
470 
471 c Generate the search direction d:=z-x.
472 
473  do 40 i = 1, n
474  d(i) = z(i) - x(i)
475  40 continue
476  call timer(cpu1)
477  666 continue
478  call lnsrlb(n,l,u,nbd,x,f,fold,gd,gdold,g,d,r,t,z,stp,dnorm,
479  + dtd,xstep,stpmx,iter,ifun,iback,nfgv,info,task,
480  + boxed,cnstnd,csave,isave(22),dsave(17))
481  if (info .ne. 0 .or. iback .ge. 20) then
482 c restore the previous iterate.
483  call dcopy(n,t,1,x,1)
484  call dcopy(n,r,1,g,1)
485  f = fold
486  if (col .eq. 0) then
487 c abnormal termination.
488  if (info .eq. 0) then
489  info = -9
490 c restore the actual number of f and g evaluations etc.
491  nfgv = nfgv - 1
492  ifun = ifun - 1
493  iback = iback - 1
494  endif
495  task = 'ABNORMAL_TERMINATION_IN_LNSRCH'
496  iter = iter + 1
497  goto 999
498  else
499 c refresh the lbfgs memory and restart the iteration.
500  if(iprint .ge. 1) write (6, 1008)
501  if (info .eq. 0) nfgv = nfgv - 1
502  info = 0
503  col = 0
504  head = 1
505  theta = one
506  iupdat = 0
507  updatd = .false.
508  task = 'RESTART_FROM_LNSRCH'
509  call timer(cpu2)
510  lnscht = lnscht + cpu2 - cpu1
511  goto 222
512  endif
513  else if (task(1:5) .eq. 'FG_LN') then
514 c return to the driver for calculating f and g; reenter at 666.
515  goto 1000
516  else
517 c calculate and print out the quantities related to the new X.
518  call timer(cpu2)
519  lnscht = lnscht + cpu2 - cpu1
520  iter = iter + 1
521 
522 c Compute the infinity norm of the projected (-)gradient.
523 
524  call projgr(n,l,u,nbd,x,g,sbgnrm)
525 
526 c Print iteration information.
527 
528  call prn2lb(n,x,f,g,iprint,itfile,iter,nfgv,nact,
529  + sbgnrm,nseg,word,iword,iback,stp,xstep)
530  goto 1000
531  endif
532  777 continue
533 
534 c Test for termination.
535 
536  if (sbgnrm .le. pgtol) then
537 c terminate the algorithm.
538  task = 'CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL'
539  goto 999
540  endif
541 
542  ddum = max(abs(fold), abs(f), one)
543  if ((fold - f) .le. tol*ddum) then
544 c terminate the algorithm.
545  task = 'CONVERGENCE: REL_REDUCTION_OF_F_<=_FACTR*EPSMCH'
546  if (iback .ge. 10) info = -5
547 c i.e., to issue a warning if iback>10 in the line search.
548  goto 999
549  endif
550 
551 c Compute d=newx-oldx, r=newg-oldg, rr=y'y and dr=y's.
552 
553  do 42 i = 1, n
554  r(i) = g(i) - r(i)
555  42 continue
556  rr = ddot(n,r,1,r,1)
557  if (stp .eq. one) then
558  dr = gd - gdold
559  ddum = -gdold
560  else
561  dr = (gd - gdold)*stp
562  call dscal(n,stp,d,1)
563  ddum = -gdold*stp
564  endif
565 
566  if (dr .le. epsmch*ddum) then
567 c skip the L-BFGS update.
568  nskip = nskip + 1
569  updatd = .false.
570  if (iprint .ge. 1) write (6,1004) dr, ddum
571  goto 888
572  endif
573 
574 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
575 c
576 c Update the L-BFGS matrix.
577 c
578 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
579 
580  updatd = .true.
581  iupdat = iupdat + 1
582 
583 c Update matrices WS and WY and form the middle matrix in B.
584 
585  call matupd(n,m,ws,wy,sy,ss,d,r,itail,
586  + iupdat,col,head,theta,rr,dr,stp,dtd)
587 
588 c Form the upper half of the pds T = theta*SS + L*D^(-1)*L';
589 c Store T in the upper triangular of the array wt;
590 c Cholesky factorize T to J*J' with
591 c J' stored in the upper triangular of wt.
592 
593  call formt(m,wt,sy,ss,col,theta,info)
594 
595  if (info .ne. 0) then
596 c nonpositive definiteness in Cholesky factorization;
597 c refresh the lbfgs memory and restart the iteration.
598  if(iprint .ge. 1) write (6, 1007)
599  info = 0
600  col = 0
601  head = 1
602  theta = one
603  iupdat = 0
604  updatd = .false.
605  goto 222
606  endif
607 
608 c Now the inverse of the middle matrix in B is
609 
610 c [ D^(1/2) O ] [ -D^(1/2) D^(-1/2)*L' ]
611 c [ -L*D^(-1/2) J ] [ 0 J' ]
612 
613  888 continue
614 
615 c -------------------- the end of the loop -----------------------------
616 
617  goto 222
618  999 continue
619  call timer(time2)
620  time = time2 - time1
621  call prn3lb(n,x,f,task,iprint,info,itfile,
622  + iter,nfgv,nintol,nskip,nact,sbgnrm,
623  + time,nseg,word,iback,stp,xstep,k,
624  + cachyt,sbtime,lnscht)
625  1000 continue
626 
627 c Save local variables.
628 
629  lsave(1) = prjctd
630  lsave(2) = cnstnd
631  lsave(3) = boxed
632  lsave(4) = updatd
633 
634  isave(1) = nintol
635  isave(3) = itfile
636  isave(4) = iback
637  isave(5) = nskip
638  isave(6) = head
639  isave(7) = col
640  isave(8) = itail
641  isave(9) = iter
642  isave(10) = iupdat
643  isave(12) = nseg
644  isave(13) = nfgv
645  isave(14) = info
646  isave(15) = ifun
647  isave(16) = iword
648  isave(17) = nfree
649  isave(18) = nact
650  isave(19) = ileave
651  isave(20) = nenter
652 
653  dsave(1) = theta
654  dsave(2) = fold
655  dsave(3) = tol
656  dsave(4) = dnorm
657  dsave(5) = epsmch
658  dsave(6) = cpu1
659  dsave(7) = cachyt
660  dsave(8) = sbtime
661  dsave(9) = lnscht
662  dsave(10) = time1
663  dsave(11) = gd
664  dsave(12) = stpmx
665  dsave(13) = sbgnrm
666  dsave(14) = stp
667  dsave(15) = gdold
668  dsave(16) = dtd
669 
670  1001 format (//,'ITERATION ',i5)
671  1002 format
672  + (/,'At iterate',i5,4x,'f= ',1p,d12.5,4x,'|proj g|= ',1p,d12.5)
673  1003 format (2(1x,i4),5x,'-',5x,'-',3x,'-',5x,'-',5x,'-',8x,'-',3x,
674  + 1p,2(1x,d10.3))
675  1004 format (' ys=',1p,e10.3,' -gs=',1p,e10.3,' BFGS update SKIPPED')
676  1005 format (/,
677  +' Singular triangular system detected;',/,
678  +' refresh the lbfgs memory and restart the iteration.')
679  1006 format (/,
680  +' Nonpositive definiteness in Cholesky factorization in formk;',/,
681  +' refresh the lbfgs memory and restart the iteration.')
682  1007 format (/,
683  +' Nonpositive definiteness in Cholesky factorization in formt;',/,
684  +' refresh the lbfgs memory and restart the iteration.')
685  1008 format (/,
686  +' Bad direction in the line search;',/,
687  +' refresh the lbfgs memory and restart the iteration.')
688 
689  return
690 
691  end
subroutine active(n, l, u, nbd, x, iwhere, iprint, prjctd, cnstnd, boxed)
This subroutine initializes iwhere and projects the initial x to the feasible set if necessary.
Definition: active.f:34
subroutine cauchy(n, x, l, u, nbd, g, iorder, iwhere, t, d, xcp, m, wy, ws, sy, wt, theta, col, head, p, c, wbp, v, nseg, iprint, sbgnrm, info, epsmch)
Compute the Generalized Cauchy Point along the projected gradient direction.
Definition: cauchy.f:133
subroutine cmprlb(n, m, x, g, ws, wy, sy, wt, z, r, wa, index, theta, col, head, nfree, cnstnd, info)
This subroutine computes r=-Z'B(xcp-xk)-Z'g by using wa(2m+1)=W'(xcp-x) from subroutine cauchy.
Definition: cmprlb.f:29
subroutine errclb(n, m, factr, l, u, nbd, task, info, k)
This subroutine checks the validity of the input data.
Definition: errclb.f:17
subroutine formk(n, nsub, ind, nenter, ileave, indx2, iupdat, updatd, wn, wn1, m, ws, wy, sy, theta, col, head, info)
Forms the LEL^T factorization of the indefinite matrix K.
Definition: formk.f:92
subroutine formt(m, wt, sy, ss, col, theta, info)
Forms the upper half of the pos. def. and symm. T.
Definition: formt.f:22
subroutine freev(n, nfree, index, nenter, ileave, indx2, iwhere, wrk, updatd, cnstnd, iprint, iter)
This subroutine counts the entering and leaving variables when iter > 0, and finds the index set of f...
Definition: freev.f:34
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....
Definition: lnsrlb.f:47
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 li...
Definition: mainlb.f:132
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.
Definition: matupd.f:51
subroutine prn1lb(n, m, l, u, x, iprint, itfile, epsmch)
This subroutine prints the input data, initial point, upper and lower bounds of each variable,...
Definition: prn1lb.f:40
subroutine prn2lb(n, x, f, g, iprint, itfile, iter, nfgv, nact, sbgnrm, nseg, word, iword, iback, stp, xstep)
This subroutine prints out new information after a successful line search.
Definition: prn2lb.f:45
subroutine prn3lb(n, x, f, task, iprint, info, itfile, iter, nfgv, nintol, nskip, nact, sbgnrm, time, nseg, word, iback, stp, xstep, k, cachyt, sbtime, lnscht)
This subroutine prints out information when either a built-in convergence test is satisfied or when a...
Definition: prn3lb.f:45
subroutine projgr(n, l, u, nbd, x, g, sbgnrm)
This subroutine computes the infinity norm of the projected gradient.
Definition: projgr.f:34
subroutine subsm(n, m, nsub, ind, l, u, nbd, x, d, xp, ws, wy, theta, xx, gg, col, head, iword, wv, wn, iprint, info)
Performs the subspace minimization.
Definition: subsm.f:127
subroutine timer(ttime)
This routine computes cpu time in double precision.
Definition: timer.f:11