* ************************************************************************* subroutine intprt( deb, what, ipdevc, freq, tprt, tdeac, + itmin, minit, itmaj, itcg, cgdim, ip, + nba, nsu, nefval, negval, nehval, fx, x, + rgnor, rgmax, ergmax, nqa, nbfgs, nrk1, + noupd, pivot, npiv, alpha, alphab, + alphas, trial, difval ) * ************************************************************************* * Purpose : * --------- * This routine prints out informations about the current * iteration. If TPRT = .false., then no output is produced. * Otherwise, the amount of output is determined by the * value of the variable WHAT. * Parameters : * ------------ * deb ( log ) * input : .true. if we are at the begin of the * minor iteration. * .false. if we are at the end of the * minor iteration. * output : unmodified. * what ( int ) * input : < 2, no output is produced. * = 2, only one line of informations is printed. * = 3, more informations are printed. * = 4, same as the previous case, but the * current is also printed. * output : unmodified. * ipdevc ( int ) * input : output device unit number for printing messages. * output : unmodified. * freq ( int ) * input : frequency of iterations output is generated. * output : unmodified. * tprt ( log ) * input : meaningless. * output : .true. if output is generated this iteration. * .false. if no output is generated this iteration. * tdeac ( log ) * input : .true. if the current minor iteration is * preceeded by a de-activation phase. * .false. otherwise. * output : when TDEAC=.true., it is reset to .false. * before the next iteration. * itmin ( int ) * input : the minor iteration number. * output : unmodified. * minit ( int ) * input : the minor iteration number in the * current major iteration. * output : unmodified. * itmaj ( int ) * input : the major iteration number. * output : unmodified. * itcg ( int ) * input : the number of conjugate gradient iterations. * output : unmodified. * cgdim ( int ) * input : the dimension of the linear system solved * by the conjugate gradient method. * output : at the begin of a minor iteration, it * is set to the number of superbasic * variables in the independent set. * ip ( int ) * input : the indice of the current independent * superbasic set. * output : unmodified. * nba ( int ) * input : the number of basic variables in the * current independent set. * output : unmodified. * nsu ( int ) * input : the number of superbasic variables in * the current independent set. * output : unmodified. * nefval ( int ) * input : the number of element function evaluations. * output : unmodified. * negval ( int ) * input : the number of element gradient evaluations. * output : unmodified. * nehval ( int ) * input : the number of element Hessian evaluations. * output : unmodified. * fx ( dble ) * input : the value of the objective function at the * current iterate X. * output : unmodified. * x ( dble ) * input : the current iterate vector. * output : unmodified. * rgnor ( dble ) * input : the euclidean norm of the reduced gradient vector. * output : unmodified. * rgmax ( dble ) * input : the infinity norm of the reduced gradient vector. * output : unmodified. * ergmax ( dble ) * input : accuracy required before a de-activation phase * is done and a new major iteration is started. * output : unmodified. * nqa ( int ) * input : the number of superbasic variables that are * quasi-active. * output : unmodified. * nbfgs ( int ) * input : the number of element Hessian that are updated * by the BFGS formula. * output : unmodified. * nrk1 ( int ) * input : the number of element Hessian that are updated * by the rank-one formula. * output : unmodified. * noupd ( int ) * input : the number of element Hessian that needed no * update. * output : unmodified. * pivot ( log ) * input : .true. if a pivoting has been done during * the current iteration. * .false. otherwise. * output : unmodified. * npiv ( int ) * input : the number of iterations including a pivoting. * output : unmodified. * alpha ( dble ) * input : the steplength found by the linesearch procedure. * output : unmodified. * alphab ( dble ) * input : the maximal steplength allowed for keeping * basic feasibility. * output : unmodified. * alphas ( dble ) * input : the maximal steplength allowed for keeping * superbasic feasibility. * output : unmodified. * trial ( int ) * input : the number of trials done by the linesearch * procedure. * output : unmodified. * difval ( dble ) * input : the function decrease at the current iteration. * output : unmodified. * Routine used : * -------------- * None. * Programming : * ------------- * D. Tuyttens * ========================================================================= * Routine parameters integer what, ipdevc, freq, itmin, minit, itmaj, + itcg, cgdim, ip, nba, nsu, nefval, negval, + nehval, nqa, nbfgs, nrk1, noupd, npiv, trial logical deb, tprt, pivot, tdeac double precision fx, rgnor, rgmax, ergmax, alpha, alphab, alphas, + difval, x(*) * Internal variable integer i * common specifications integer arcs, nodes, elem common / prbdim / arcs, nodes, elem * * Test if we are in a situation where * no output needs to be generated. * if( what.lt.2 ) return tprt = minit.eq.1 .or. mod(minit,freq).eq.0 if( .not.tprt ) return * * The output is splitted in two parts : * 1. at the begin of a minor iteration. * 2. at the end of a minor iteration. * if( deb ) then * * Output at the begin of a minor iteration. * cgdim = nsu * * Amount of output when WHAT>=3. * if( what.ge.3 ) then write(ipdevc,1000) itmin, fx, rgnor,rgmax,ergmax, + float(nefval)/float(elem), + float(negval)/float(elem), + float(nehval)/float(elem), + itmaj, minit, ip, nba, nsu if( nqa.ne.0 ) then write(ipdevc,1001) nqa endif * else if( minit.eq.1 .and. tdeac ) then * * Only one line of informations is printed. * tdeac = .false. write(ipdevc,1007) write(ipdevc,1008) fx, rgmax, rgnor, + float(nefval)/float(elem), + float(negval)/float(elem), + float(nehval)/float(elem), + cgdim endif else * * Output at the end of a minor iteration. * if( what.ge.3 ) then * * Amount of output for WHAT>=3. * write(ipdevc,1002) alpha,alphab,alphas,trial,difval if( what.eq.4 ) then write(ipdevc,1020) write(ipdevc,1021) (x(i),i=1,arcs) endif if( nbfgs.ne.0 .or. nrk1.ne.0 ) then write(ipdevc,1004) nbfgs,nrk1,noupd endif if( pivot ) write(ipdevc,1003) npiv write(ipdevc,1005) rgnor,rgmax else * * Only one line of informations is printed. * if( pivot ) then write(ipdevc,1006) itmin, minit, npiv, fx, rgmax, rgnor, + float(nefval)/float(elem), + float(negval)/float(elem), + float(nehval)/float(elem), + itcg, cgdim else write(ipdevc,1009) itmin, minit, fx, rgmax, rgnor, + float(nefval)/float(elem), + float(negval)/float(elem), + float(nehval)/float(elem), + itcg, cgdim endif endif * endif * * Formats of the different outputs. * 1000 format(/,' **************************** Iteration ',i3, + ' **************************** ',///, + ' Objective function = ',d15.8,9x, + 'Reduced gradient = ',d12.5,/, + 46x,' Red. grad. inf. = ',d12.5,/, + 46x,' Red. grad. max. = ',d12.5,//, + ' After ',f9.2,' function, ',f9.2,' gradient and ', + f9.2,' Hessian calls.',///, + ' Subspace ',i3,' : ',' Iteration ',i3, + 3x,' In-set ',i3,4x,'[ #B = ',i4,' ; ', + ' #S = ',i4,' ]') 1001 format(/,' Number of quasi-active variables is ',i3) 1002 format(/' Linesearch : Steplength = ',d12.5, + 5x,'Basic bound ',d12.5,/, + 50x,'Super-basic bound ',d12.5,/, + 20x,'After ',i3,' trial(s)',2x, + 'function decrease = ',d12.5) 1003 format(/' Pivoting step',i3) 1004 format(/,' Hessian Update : ', + ' BFGS = ',i3,' RK1 = ',i3,' NO-UPD = ',i3) 1005 format(/,' Norms updating :',7x,'Reduced gradient', + 10x, '(eucl norm)',2x,d12.5,/, + 51x, '(inf norm)',2x,d12.5) 1006 format(3(1x,i3),1x,d12.5,2(1x,d10.3),3(1x,f6.1),2(1x,i4)) 1007 format(/,' min it piv fx rgmax rgnor ', + ' #f #g #h cgit #su ',/,78('-')) 1008 format(1x,3(1x,' - '),d12.5,2(1x,d10.3),3(1x,f6.1),4x,'-'1x,i4) 1009 format(2(1x,i3),1x,' -',1x,d12.5,2(1x,d10.3),3(1x,f6.1),2(1x,i4)) 1020 format(/,' Current iterate X : ',/) 1021 format(5(2x,d12.5)) * return end