prn3lb Subroutine

private 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 an error message is generated.

Credits

  • NEOS, November 1994. (Latest revision June 1996.) Optimization Technology Center. Argonne National Laboratory and Northwestern University. Written by Ciyou Zhu in collaboration with R.H. Byrd, P. Lu-Chen and J. Nocedal.

Arguments

Type IntentOptional Attributes Name
integer :: n
real(kind=wp) :: x(n)
real(kind=wp) :: f
character(len=60) :: Task
integer :: Iprint
integer :: Info
integer :: Itfile
integer :: Iter
integer :: Nfgv
integer :: Nintol
integer :: Nskip
integer :: Nact
real(kind=wp) :: Sbgnrm
real(kind=wp) :: Time
integer :: Nseg
character(len=3) :: Word
integer :: Iback
real(kind=wp) :: Stp
real(kind=wp) :: Xstep
integer :: k
real(kind=wp) :: Cachyt
real(kind=wp) :: Sbtime
real(kind=wp) :: Lnscht

Called by

proc~~prn3lb~~CalledByGraph proc~prn3lb lbfgsb_module::prn3lb proc~mainlb lbfgsb_module::mainlb proc~mainlb->proc~prn3lb proc~setulb lbfgsb_module::setulb proc~setulb->proc~mainlb

Source Code

      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)
      implicit none

      character(len=60) :: Task
      character(len=3) :: Word
      integer :: n , Iprint , Info , Itfile , Iter , Nfgv , Nintol , &
                 Nskip , Nact , Nseg , Iback , k
      real(wp) :: f , Sbgnrm , Time , Stp , Xstep , Cachyt , &
                  Sbtime , Lnscht , x(n)

      integer :: i

      if ( Task(1:5)/='ERROR' ) then

         if ( Iprint>=0 ) then
            write (output_unit,'(/,a,/,/,a,/,a,/,a,a,/,a,/,a,a,/,a,/,a,/,/,a)')    &
                  '           * * *',                                    &
                  'Tit   = total number of iterations',                  &
                  'Tnf   = total number of function evaluations',        &
                  'Tnint = total number of segments explored during',    &
                  ' Cauchy searches',                                    &
                  'Skip  = number of BFGS updates skipped',              &
                  'Nact  = number of active bounds at final generalized',&
                  ' Cauchy point',                                       &
                  'Projg = norm of the final projected gradient',        &
                  'F     = final function value',                        &
                  '           * * *'
            write (output_unit,'(/,3x,a,4x,a,5x,a,2x,a,2x,a,2x,a,5x,a,8x,a)') &
                  'N','Tit','Tnf','Tnint','Skip','Nact','Projg','F'
            write (output_unit,'(i5,2(1x,i6),(1x,i6),(2x,i4),(1x,i5),1p,2(2x,d10.3))') &
                  n , Iter , Nfgv , Nintol , Nskip , Nact , Sbgnrm , f
            if ( Iprint>=100 ) then
               write (output_unit,'(/,a4,1p,6(1x,d11.4),/,(4x,1p,6(1x,d11.4)))') &
                  'X =' , (x(i),i=1,n)
            endif
            if ( Iprint>=1 ) write (output_unit,*) ' F =' , f
         endif

      end if

      if ( Iprint>=0 ) then
         write (output_unit,'(/,a60)') Task
         select case (Info)
            case ( -1 ); write (output_unit,'(/,a)') ' Matrix in 1st Cholesky factorization in formk is not Pos. Def.'
            case ( -2 ); write (output_unit,'(/,a)') ' Matrix in 2st Cholesky factorization in formk is not Pos. Def.'
            case ( -3 ); write (output_unit,'(/,a)') ' Matrix in the Cholesky factorization in formt is not Pos. Def.'
            case ( -4 ); write (output_unit,'(/,a,/,a,/,a,/,a)') &
                                    ' Derivative >= 0, backtracking line search impossible.',&
                                    '   Previous x, f and g restored.',&
                                    ' Possible causes: 1 error in function or gradient evaluation;',&
                                    '                  2 rounding errors dominate computation.'
            case ( -5 ); write (output_unit,'(/,a,/,a,/,a)') &
                                    ' Warning:  more than 10 function and gradient', &
                                    '   evaluations in the last line search.  Termination', &
                                    '   may possibly be caused by a bad search direction.'
            case ( -6 ); write (output_unit,*) ' Input nbd(' , k , ') is invalid.'
            case ( -7 ); write (output_unit,*) ' l(' , k , ') > u(' , k , ').  No feasible solution.'
            case ( -8 ); write (output_unit,'(/,a)') ' The triangular system is singular.'
            case ( -9 ); write (output_unit,'(/,a,/,a,/,a,/,a)') &
                                    ' Line search cannot locate an adequate point after 20 function',&
                                    '  and gradient evaluations.  Previous x, f and g restored.',&
                                    ' Possible causes: 1 error in function or gradient evaluation;',&
                                    '                  2 rounding error dominate computation.'
         end select
         if ( Iprint>=1 ) write (output_unit,'(/,a,1p,e10.3,a,/a,1p,e10.3,a,/a,1p,e10.3,a)') &
                                    ' Cauchy                time',Cachyt,' seconds.', &
                                    ' Subspace minimization time',Sbtime,' seconds.', &
                                    ' Line search           time',Lnscht,' seconds.'
         write (output_unit,'(/,a,1p,e10.3,a,/)') ' Total User time', Time,' seconds.'
         if ( Iprint>=1 ) then
            if ( Info==-4 .or. Info==-9 ) then
               write (Itfile,'(2(1x,i4),2(1x,i5),2x,a3,1x,i4,1p,2(2x,d7.1),6x,a,10x,a)') &
                              Iter , Nfgv , Nseg , Nact , Word , Iback , Stp , Xstep, '-', '-'
            endif
            write (Itfile,'(/,a60)') Task
            select case (Info)
            case ( -1 ); write (Itfile,'(/,a)') ' Matrix in 1st Cholesky factorization in formk is not Pos. Def.'
            case ( -2 ); write (Itfile,'(/,a)') ' Matrix in 2st Cholesky factorization in formk is not Pos. Def.'
            case ( -3 ); write (Itfile,'(/,a)') ' Matrix in the Cholesky factorization in formt is not Pos. Def.'
            case ( -4 ); write (output_unit,'(/,a,/,a,/,a,/,a)') &
                                    ' Derivative >= 0, backtracking line search impossible.',&
                                    '   Previous x, f and g restored.',&
                                    ' Possible causes: 1 error in function or gradient evaluation;',&
                                    '                  2 rounding errors dominate computation.'
            case ( -5 ); write (Itfile,'(/,a,/,a,/,a)') &
                                    ' Warning:  more than 10 function and gradient', &
                                    '   evaluations in the last line search.  Termination', &
                                    '   may possibly be caused by a bad search direction.'
            case ( -8 ); write (Itfile,'(/,a)') ' The triangular system is singular.'
            case ( -9 ); write (Itfile,'(/,a,/,a,/,a,/,a)') &
                                    ' Line search cannot locate an adequate point after 20 function',&
                                    '  and gradient evaluations.  Previous x, f and g restored.',&
                                    ' Possible causes: 1 error in function or gradient evaluation;',&
                                    '                  2 rounding error dominate computation.'
            end select
            write (Itfile,'(/,a,1p,e10.3,a,/)') ' Total User time', Time,' seconds.'
         endif
      endif

      end subroutine prn3lb