L-BFGS-B  3.0
Large-scale Bound-constrained Optimization
prn3lb.f
Go to the documentation of this file.
1 c> \file prn3lb.f
2 
3 c> \brief This subroutine prints out information when either a built-in
4 c> convergence test is satisfied or when an error message is
5 c> generated.
6 c>
7 c> This subroutine prints out information when either a built-in
8 c> convergence test is satisfied or when an error message is
9 c> generated.
10 c>
11 c> @param n On entry n is the number of variables.<br/>
12 c> On exit n is unchanged.
13 c>
14 c> @param x On entry x is an approximation to the solution.<br/>
15 c> On exit x is the current approximation.
16 c>
17 c> @param f On first entry f is unspecified.<br/>
18 c> On final exit f is the value of the function at x.
19 c>
20 c> @param task working string indicating
21 c> the current job when entering and leaving this subroutine.
22 c> @param iprint Console output flag; same convention as in setulb.
23 c> Negative suppresses all output. >=0 prints the per-run
24 c> summary. >=1 also writes to iterate.dat. >=100 also
25 c> prints the final x vector.
26 c> @param info Termination status. 0 on normal convergence. Negative
27 c> values map to specific error messages: -1, -2 (Cholesky
28 c> not pos.def. in formk's 1st/2nd factor), -3 (formt's
29 c> Cholesky), -4 (non-descent direction caught by lnsrlb),
30 c> -5 (>10 evals in a line search), -6 (invalid nbd(k)),
31 c> -7 (l(k) > u(k)), -8 (singular triangular system), -9
32 c> (>20 evals in the last line search).
33 c> @param itfile unit number of iterate.dat file
34 c> @param iter Total number of outer iterations.
35 c> @param nfgv Total number of f/g evaluations across the run.
36 c> @param nintol Total number of breakpoint segments traversed by cauchy.
37 c> @param nskip Number of L-BFGS updates that were skipped because the
38 c> curvature condition failed (s'y too small).
39 c> @param nact Number of active bounds at the final generalised Cauchy point.
40 c> @param sbgnrm Final infinity norm of the projected gradient at x.
41 c> @param time Total wall-clock time of the optimisation run, in seconds.
42 c> @param nseg Number of breakpoint segments traversed at the LAST cauchy
43 c> call (used in the iterate.dat record on abnormal exits).
44 c> @param word 3-character status code from prn2lb: 'con', 'bnd', 'TNT',
45 c> or '---' (see prn2lb.f). Logged in iterate.dat on info=-4
46 c> or info=-9 termination.
47 c> @param iback Number of backtracks in the LAST line search.
48 c> @param stp Final step length from the LAST line search.
49 c> @param xstep stp * ||d|| from the LAST line search (i.e. the actual
50 c> step length in x-space).
51 c> @param k Index of the offending parameter when info is -6 (invalid
52 c> nbd) or -7 (infeasible bound). Set by errclb.
53 c> @param cachyt Cumulative wall-clock time spent in cauchy, in seconds.
54 c> @param sbtime Cumulative wall-clock time spent in subsm, in seconds.
55 c> @param lnscht Cumulative wall-clock time spent in lnsrlb, in seconds.
56  subroutine prn3lb(n, x, f, task, iprint, info, itfile,
57  + iter, nfgv, nintol, nskip, nact, sbgnrm,
58  + time, nseg, word, iback, stp, xstep, k,
59  + cachyt, sbtime, lnscht)
60 
61  character*60 task
62  character*3 word
63  integer n, iprint, info, itfile, iter, nfgv, nintol,
64  + nskip, nact, nseg, iback, k
65  double precision f, sbgnrm, time, stp, xstep, cachyt, sbtime,
66  + lnscht, x(n)
67 
68 c ************
69 c
70 c NEOS, November 1994. (Latest revision June 1996.)
71 c Optimization Technology Center.
72 c Argonne National Laboratory and Northwestern University.
73 c Written by
74 c Ciyou Zhu
75 c in collaboration with R.H. Byrd, P. Lu-Chen and J. Nocedal.
76 c
77 c
78 c ************
79 
80  integer i
81 
82  if (task(1:5) .eq. 'ERROR') goto 999
83 
84  if (iprint .ge. 0) then
85  write (6,3003)
86  write (6,3004)
87  write(6,3005) n,iter,nfgv,nintol,nskip,nact,sbgnrm,f
88  if (iprint .ge. 100) then
89  write (6,1004) 'X =',(x(i),i = 1,n)
90  endif
91  if (iprint .ge. 1) write (6,*) ' F =',f
92  endif
93  999 continue
94  if (iprint .ge. 0) then
95  write (6,3009) task
96  if (info .ne. 0) then
97  if (info .eq. -1) write (6,9011)
98  if (info .eq. -2) write (6,9012)
99  if (info .eq. -3) write (6,9013)
100  if (info .eq. -4) write (6,9014)
101  if (info .eq. -5) write (6,9015)
102  if (info .eq. -6) write (6,*)' Input nbd(',k,') is invalid.'
103  if (info .eq. -7)
104  + write (6,*)' l(',k,') > u(',k,'). No feasible solution.'
105  if (info .eq. -8) write (6,9018)
106  if (info .eq. -9) write (6,9019)
107  endif
108  if (iprint .ge. 1) write (6,3007) cachyt,sbtime,lnscht
109  write (6,3008) time
110  if (iprint .ge. 1) then
111  if (info .eq. -4 .or. info .eq. -9) then
112  write (itfile,3002)
113  + iter,nfgv,nseg,nact,word,iback,stp,xstep
114  endif
115  write (itfile,3009) task
116  if (info .ne. 0) then
117  if (info .eq. -1) write (itfile,9011)
118  if (info .eq. -2) write (itfile,9012)
119  if (info .eq. -3) write (itfile,9013)
120  if (info .eq. -4) write (itfile,9014)
121  if (info .eq. -5) write (itfile,9015)
122  if (info .eq. -8) write (itfile,9018)
123  if (info .eq. -9) write (itfile,9019)
124  endif
125  write (itfile,3008) time
126  endif
127  endif
128 
129  1004 format (/,a4, 1p, 6(1x,d11.4),/,(4x,1p,6(1x,d11.4)))
130  3002 format(2(1x,i4),2(1x,i5),2x,a3,1x,i4,1p,2(2x,d7.1),6x,'-',10x,'-')
131  3003 format (/,
132  + ' * * *',/,/,
133  + 'Tit = total number of iterations',/,
134  + 'Tnf = total number of function evaluations',/,
135  + 'Tnint = total number of segments explored during',
136  + ' Cauchy searches',/,
137  + 'Skip = number of BFGS updates skipped',/,
138  + 'Nact = number of active bounds at final generalized',
139  + ' Cauchy point',/,
140  + 'Projg = norm of the final projected gradient',/,
141  + 'F = final function value',/,/,
142  + ' * * *')
143  3004 format (/,3x,'N',4x,'Tit',5x,'Tnf',2x,'Tnint',2x,
144  + 'Skip',2x,'Nact',5x,'Projg',8x,'F')
145  3005 format (i5,2(1x,i6),(1x,i6),(2x,i4),(1x,i5),1p,2(2x,d10.3))
146  3007 format (/,' Cauchy time',1p,e10.3,' seconds.',/
147  + ' Subspace minimization time',1p,e10.3,' seconds.',/
148  + ' Line search time',1p,e10.3,' seconds.')
149  3008 format (/,' Total User time',1p,e10.3,' seconds.',/)
150  3009 format (/,a60)
151  9011 format (/,
152  +' Matrix in 1st Cholesky factorization in formk is not Pos. Def.')
153  9012 format (/,
154  +' Matrix in 2st Cholesky factorization in formk is not Pos. Def.')
155  9013 format (/,
156  +' Matrix in the Cholesky factorization in formt is not Pos. Def.')
157  9014 format (/,
158  +' Derivative >= 0, backtracking line search impossible.',/,
159  +' Previous x, f and g restored.',/,
160  +' Possible causes: 1 error in function or gradient evaluation;',/,
161  +' 2 rounding errors dominate computation.')
162  9015 format (/,
163  +' Warning: more than 10 function and gradient',/,
164  +' evaluations in the last line search. Termination',/,
165  +' may possibly be caused by a bad search direction.')
166  9018 format (/,' The triangular system is singular.')
167  9019 format (/,
168  +' Line search cannot locate an adequate point after 20 function',/
169  +,' and gradient evaluations. Previous x, f and g restored.',/,
170  +' Possible causes: 1 error in function or gradient evaluation;',/,
171  +' 2 rounding errors dominate computation.')
172 
173  return
174 
175  end
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