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, epsmch)
373  call timer(cpu2)
374  cachyt = cachyt + cpu2 - cpu1
375  nintol = nintol + nseg
376 
377 c Count the entering and leaving variables for iter > 0;
378 c find the index set of free and active variables at the GCP.
379 
380  call freev(n,nfree,index,nenter,ileave,indx2,
381  + iwhere,wrk,updatd,cnstnd,iprint,iter)
382  nact = n - nfree
383 
384  333 continue
385 
386 c If there are no free variables or B=theta*I, then
387 c skip the subspace minimization.
388 
389  if (nfree .eq. 0 .or. col .eq. 0) goto 555
390 
391 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
392 c
393 c Subspace minimization.
394 c
395 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
396 
397  call timer(cpu1)
398 
399 c Form the LEL^T factorization of the indefinite
400 c matrix K = [-D -Y'ZZ'Y/theta L_a'-R_z' ]
401 c [L_a -R_z theta*S'AA'S ]
402 c where E = [-I 0]
403 c [ 0 I]
404 
405  if (wrk) call formk(n,nfree,index,nenter,ileave,indx2,iupdat,
406  + updatd,wn,snd,m,ws,wy,sy,theta,col,head,info)
407  if (info .ne. 0) then
408 c nonpositive definiteness in Cholesky factorization;
409 c refresh the lbfgs memory and restart the iteration.
410  if(iprint .ge. 1) write (6, 1006)
411  info = 0
412  col = 0
413  head = 1
414  theta = one
415  iupdat = 0
416  updatd = .false.
417  call timer(cpu2)
418  sbtime = sbtime + cpu2 - cpu1
419  goto 222
420  endif
421 
422 c compute r=-Z'B(xcp-xk)-Z'g (using wa(2m+1)=W'(xcp-x)
423 c from 'cauchy').
424  call cmprlb(n,m,x,g,ws,wy,sy,wt,z,r,wa,index,
425  + theta,col,head,nfree,cnstnd)
426 
427 c-jlm-jn call the direct method.
428 
429  call subsm( n, m, nfree, index, l, u, nbd, z, r, xp, ws, wy,
430  + theta, x, g, col, head, iword, wa, wn, iprint)
431 
432  call timer(cpu2)
433  sbtime = sbtime + cpu2 - cpu1
434  555 continue
435 
436 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
437 c
438 c Line search and optimality tests.
439 c
440 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
441 
442 c Generate the search direction d:=z-x.
443 
444  do 40 i = 1, n
445  d(i) = z(i) - x(i)
446  40 continue
447  call timer(cpu1)
448  666 continue
449  call lnsrlb(n,l,u,nbd,x,f,fold,gd,gdold,g,d,r,t,z,stp,dnorm,
450  + dtd,xstep,stpmx,iter,ifun,iback,nfgv,info,task,
451  + boxed,cnstnd,csave,isave(22),dsave(17))
452  if (info .ne. 0 .or. iback .ge. 20) then
453 c restore the previous iterate.
454  call dcopy(n,t,1,x,1)
455  call dcopy(n,r,1,g,1)
456  f = fold
457  if (col .eq. 0) then
458 c abnormal termination.
459  if (info .eq. 0) then
460  info = -9
461 c restore the actual number of f and g evaluations etc.
462  nfgv = nfgv - 1
463  ifun = ifun - 1
464  iback = iback - 1
465  endif
466  task = 'ABNORMAL_TERMINATION_IN_LNSRCH'
467  iter = iter + 1
468  goto 999
469  else
470 c refresh the lbfgs memory and restart the iteration.
471  if(iprint .ge. 1) write (6, 1008)
472  if (info .eq. 0) nfgv = nfgv - 1
473  info = 0
474  col = 0
475  head = 1
476  theta = one
477  iupdat = 0
478  updatd = .false.
479  task = 'RESTART_FROM_LNSRCH'
480  call timer(cpu2)
481  lnscht = lnscht + cpu2 - cpu1
482  goto 222
483  endif
484  else if (task(1:5) .eq. 'FG_LN') then
485 c return to the driver for calculating f and g; reenter at 666.
486  goto 1000
487  else
488 c calculate and print out the quantities related to the new X.
489  call timer(cpu2)
490  lnscht = lnscht + cpu2 - cpu1
491  iter = iter + 1
492 
493 c Compute the infinity norm of the projected (-)gradient.
494 
495  call projgr(n,l,u,nbd,x,g,sbgnrm)
496 
497 c Print iteration information.
498 
499  call prn2lb(n,x,f,g,iprint,itfile,iter,nfgv,nact,
500  + sbgnrm,nseg,word,iword,iback,stp,xstep)
501  goto 1000
502  endif
503  777 continue
504 
505 c Test for termination.
506 
507  if (sbgnrm .le. pgtol) then
508 c terminate the algorithm.
509  task = 'CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL'
510  goto 999
511  endif
512 
513  ddum = max(abs(fold), abs(f), one)
514  if ((fold - f) .le. tol*ddum) then
515 c terminate the algorithm.
516  task = 'CONVERGENCE: REL_REDUCTION_OF_F_<=_FACTR*EPSMCH'
517  if (iback .ge. 10) info = -5
518 c i.e., to issue a warning if iback>10 in the line search.
519  goto 999
520  endif
521 
522 c Compute d=newx-oldx, r=newg-oldg, rr=y'y and dr=y's.
523 
524  do 42 i = 1, n
525  r(i) = g(i) - r(i)
526  42 continue
527  rr = ddot(n,r,1,r,1)
528  if (stp .eq. one) then
529  dr = gd - gdold
530  ddum = -gdold
531  else
532  dr = (gd - gdold)*stp
533  call dscal(n,stp,d,1)
534  ddum = -gdold*stp
535  endif
536 
537  if (dr .le. epsmch*ddum) then
538 c skip the L-BFGS update.
539  nskip = nskip + 1
540  updatd = .false.
541  if (iprint .ge. 1) write (6,1004) dr, ddum
542  goto 888
543  endif
544 
545 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
546 c
547 c Update the L-BFGS matrix.
548 c
549 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
550 
551  updatd = .true.
552  iupdat = iupdat + 1
553 
554 c Update matrices WS and WY and form the middle matrix in B.
555 
556  call matupd(n,m,ws,wy,sy,ss,d,r,itail,
557  + iupdat,col,head,theta,rr,dr,stp,dtd)
558 
559 c Form the upper half of the pds T = theta*SS + L*D^(-1)*L';
560 c Store T in the upper triangular of the array wt;
561 c Cholesky factorize T to J*J' with
562 c J' stored in the upper triangular of wt.
563 
564  call formt(m,wt,sy,ss,col,theta,info)
565 
566  if (info .ne. 0) then
567 c nonpositive definiteness in Cholesky factorization;
568 c refresh the lbfgs memory and restart the iteration.
569  if(iprint .ge. 1) write (6, 1007)
570  info = 0
571  col = 0
572  head = 1
573  theta = one
574  iupdat = 0
575  updatd = .false.
576  goto 222
577  endif
578 
579 c Now the inverse of the middle matrix in B is
580 
581 c [ D^(1/2) O ] [ -D^(1/2) D^(-1/2)*L' ]
582 c [ -L*D^(-1/2) J ] [ 0 J' ]
583 
584  888 continue
585 
586 c -------------------- the end of the loop -----------------------------
587 
588  goto 222
589  999 continue
590  call timer(time2)
591  time = time2 - time1
592  call prn3lb(n,x,f,task,iprint,info,itfile,
593  + iter,nfgv,nintol,nskip,nact,sbgnrm,
594  + time,nseg,word,iback,stp,xstep,k,
595  + cachyt,sbtime,lnscht)
596  1000 continue
597 
598 c Save local variables.
599 
600  lsave(1) = prjctd
601  lsave(2) = cnstnd
602  lsave(3) = boxed
603  lsave(4) = updatd
604 
605  isave(1) = nintol
606  isave(3) = itfile
607  isave(4) = iback
608  isave(5) = nskip
609  isave(6) = head
610  isave(7) = col
611  isave(8) = itail
612  isave(9) = iter
613  isave(10) = iupdat
614  isave(12) = nseg
615  isave(13) = nfgv
616  isave(14) = info
617  isave(15) = ifun
618  isave(16) = iword
619  isave(17) = nfree
620  isave(18) = nact
621  isave(19) = ileave
622  isave(20) = nenter
623 
624  dsave(1) = theta
625  dsave(2) = fold
626  dsave(3) = tol
627  dsave(4) = dnorm
628  dsave(5) = epsmch
629  dsave(6) = cpu1
630  dsave(7) = cachyt
631  dsave(8) = sbtime
632  dsave(9) = lnscht
633  dsave(10) = time1
634  dsave(11) = gd
635  dsave(12) = stpmx
636  dsave(13) = sbgnrm
637  dsave(14) = stp
638  dsave(15) = gdold
639  dsave(16) = dtd
640 
641  1001 format (//,'ITERATION ',i5)
642  1002 format
643  + (/,'At iterate',i5,4x,'f= ',1p,d12.5,4x,'|proj g|= ',1p,d12.5)
644  1003 format (2(1x,i4),5x,'-',5x,'-',3x,'-',5x,'-',5x,'-',8x,'-',3x,
645  + 1p,2(1x,d10.3))
646  1004 format (' ys=',1p,e10.3,' -gs=',1p,e10.3,' BFGS update SKIPPED')
647  1006 format (/,
648  +' Nonpositive definiteness in Cholesky factorization in formk;',/,
649  +' refresh the lbfgs memory and restart the iteration.')
650  1007 format (/,
651  +' Nonpositive definiteness in Cholesky factorization in formt;',/,
652  +' refresh the lbfgs memory and restart the iteration.')
653  1008 format (/,
654  +' Bad direction in the line search;',/,
655  +' refresh the lbfgs memory and restart the iteration.')
656 
657  return
658 
659  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:37
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, epsmch)
Compute the Generalized Cauchy Point along the projected gradient direction.
Definition: cauchy.f:134
subroutine cmprlb(n, m, x, g, ws, wy, sy, wt, z, r, wa, index, theta, col, head, nfree, cnstnd)
This subroutine computes r=-Z'B(xcp-xk)-Z'g by using wa(2m+1)=W'(xcp-x) from subroutine cauchy.
Definition: cmprlb.f:46
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:49
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:74
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:66
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:55
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:60
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)
Performs the subspace minimization.
Definition: subsm.f:129
subroutine timer(ttime)
This routine computes cpu time in double precision.
Definition: timer.f:11