prn2lb Subroutine

private 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.

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
real(kind=wp) :: g(n)
integer :: Iprint
integer :: Itfile
integer :: Iter
integer :: Nfgv
integer :: Nact
real(kind=wp) :: Sbgnrm
integer :: Nseg
character(len=3), intent(out) :: Word

records the status of subspace solutions.

integer :: Iword
integer :: Iback
real(kind=wp) :: Stp
real(kind=wp) :: Xstep

Called by

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

Source Code

      subroutine prn2lb(n,x,f,g,Iprint,Itfile,Iter,Nfgv,Nact,Sbgnrm, &
                        Nseg,Word,Iword,Iback,Stp,Xstep)
      implicit none

      character(len=3),intent(out) :: Word !! records the status of subspace solutions.
      integer :: n , Iprint , Itfile , Iter , Nfgv , Nact , Nseg , Iword , Iback
      real(wp) :: f , Sbgnrm , Stp , Xstep , x(n) , g(n)

      integer :: i , imod

      select case (Iword)
      case ( 0 );   Word = 'con' ! the subspace minimization converged.
      case ( 1 );   Word = 'bnd' ! the subspace minimization stopped at a bound.
      case ( 5 );   Word = 'TNT' ! the truncated Newton step has been used.
      case default; Word = '---'
      end select

      if ( Iprint>=99 ) then
         write (output_unit,*) 'LINE SEARCH' , Iback , ' times; norm of step = ' , Xstep
         write (output_unit,'(/,a,i5,4x,a,1p,d12.5,4x,a,1p,d12.5)') &
            'At iterate', Iter , 'f= ', f , '|proj g|= ', Sbgnrm
         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)
            write (output_unit,'(/,a4,1p,6(1x,d11.4),/,(4x,1p,6(1x,d11.4)))') 'G =' , (g(i),i=1,n)
         endif
      else if ( Iprint>0 ) then
         imod = mod(Iter,Iprint)
         if ( imod==0 ) write (output_unit,'(/,a,i5,4x,a,1p,d12.5,4x,a,1p,d12.5)') &
            'At iterate', Iter , 'f= ', f , '|proj g|= ', Sbgnrm
      endif
      if ( Iprint>=1 ) write (Itfile,'(2(1x,i4),2(1x,i5),2x,a3,1x,i4,1p,2(2x,d7.1),1p,2(1x,d10.3))') &
                              Iter , Nfgv , Nseg , Nact , Word , Iback , Stp , Xstep , Sbgnrm , f

      end subroutine prn2lb