L-BFGS-B  3.0
Large-scale Bound-constrained Optimization
prn2lb.f
Go to the documentation of this file.
1 c> \file prn2lb.f
2 
3 c> \brief This subroutine prints out new information after a successful
4 c> line search.
5 c>
6 c> This subroutine prints out new information after a successful
7 c> line search.
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 x On entry x is an approximation to the solution.<br/>
13 c> On exit x is the current approximation.
14 c>
15 c> @param f On first entry f is unspecified.<br/>
16 c> On final exit f is the value of the function at x.
17 c>
18 c> @param g On first entry g is unspecified.<br/>
19 c> On final exit g is the value of the gradient at x.
20 c>
21 c> @param iprint It controls the frequency and type of output generated:<ul>
22 c> <li>iprint<0 no output is generated;</li>
23 c> <li>iprint=0 print only one line at the last iteration;</li>
24 c> <li>0<iprint<99 print also f and |proj g| every iprint iterations;</li>
25 c> <li>iprint=99 print details of every iteration except n-vectors;</li>
26 c> <li>iprint=100 print also the changes of active set and final x;</li>
27 c> <li>iprint>100 print details of every iteration including x and g;</li></ul>
28 c> When iprint > 0, the file iterate.dat will be created to
29 c> summarize the iteration.
30 c>
31 c> @param itfile unit number of iterate.dat file
32 c>
33 c> @param iter Current outer iteration number; printed on the per-iterate
34 c> summary line.
35 c> @param nfgv Cumulative number of f/g evaluations across the whole run;
36 c> logged into the iterate.dat record.
37 c> @param nact Number of variables active at their bounds at the current
38 c> iterate.
39 c> @param sbgnrm Infinity norm of the projected gradient at x; the natural
40 c> first-order optimality measure printed alongside f.
41 c> @param nseg Number of breakpoint segments traversed by cauchy at the
42 c> current iteration; printed for diagnostic accounting.
43 c> @param word On exit a 3-character status code summarising the subspace
44 c> solution: 'con' (converged), 'bnd' (hit a bound), 'TNT'
45 c> (truncated-Newton step used), or '---' otherwise. Determined
46 c> from iword.
47 c> @param iword Status code from subsm: 0 = subspace minimisation
48 c> converged, 1 = stopped at a bound, 5 = truncated-Newton
49 c> step used. Maps to word.
50 c> @param iback Number of backtracks the line search performed.
51 c> @param stp Final step length accepted by the line search.
52 c> @param xstep stp * ||d|| -- the actual length of the step in x-space.
53  subroutine prn2lb(n, x, f, g, iprint, itfile, iter, nfgv, nact,
54  + sbgnrm, nseg, word, iword, iback, stp, xstep)
55 
56  character*3 word
57  integer n, iprint, itfile, iter, nfgv, nact, nseg,
58  + iword, iback
59  double precision f, sbgnrm, stp, xstep, x(n), g(n)
60 
61 c ************
62 c
63 c NEOS, November 1994. (Latest revision June 1996.)
64 c Optimization Technology Center.
65 c Argonne National Laboratory and Northwestern University.
66 c Written by
67 c Ciyou Zhu
68 c in collaboration with R.H. Byrd, P. Lu-Chen and J. Nocedal.
69 c
70 c
71 c ************
72 
73  integer i,imod
74 
75 c 'word' records the status of subspace solutions.
76  if (iword .eq. 0) then
77 c the subspace minimization converged.
78  word = 'con'
79  else if (iword .eq. 1) then
80 c the subspace minimization stopped at a bound.
81  word = 'bnd'
82  else if (iword .eq. 5) then
83 c the truncated Newton step has been used.
84  word = 'TNT'
85  else
86  word = '---'
87  endif
88  if (iprint .ge. 99) then
89  write (6,*) 'LINE SEARCH',iback,' times; norm of step = ',xstep
90  write (6,2001) iter,f,sbgnrm
91  if (iprint .gt. 100) then
92  write (6,1004) 'X =',(x(i), i = 1, n)
93  write (6,1004) 'G =',(g(i), i = 1, n)
94  endif
95  else if (iprint .gt. 0) then
96  imod = mod(iter,iprint)
97  if (imod .eq. 0) write (6,2001) iter,f,sbgnrm
98  endif
99  if (iprint .ge. 1) write (itfile,3001)
100  + iter,nfgv,nseg,nact,word,iback,stp,xstep,sbgnrm,f
101 
102  1004 format (/,a4, 1p, 6(1x,d11.4),/,(4x,1p,6(1x,d11.4)))
103  2001 format
104  + (/,'At iterate',i5,4x,'f= ',1p,d12.5,4x,'|proj g|= ',1p,d12.5)
105  3001 format(2(1x,i4),2(1x,i5),2x,a3,1x,i4,1p,2(2x,d7.1),1p,2(1x,d10.3))
106 
107  return
108 
109  end
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