* ************************************************************************* subroutine normrg( rgmax, rgnor, rgra, su, nsu ) * ************************************************************************* * Purpose : * --------- * This routine computes the infinity and the euclidean * norm of the reduced gradient vector RGRA. * Only the components of indices SU(i) for i=1 up to * i=NSU are considered. This set of indices corresponds * to the indices of the superbasic variables. * Parameters : * ------------ * rgmax ( dble ) * input : meaningless. * output : the infinity norm of the reduced gradient * vector RGRA. * rgnor ( dble ) * input : meaningless. * output : the euclidean norm of the reduced gradient * vector RGRA. * rgra ( dble ) * input : the reduced gradient vector. * output : unmodified. * su ( int ) * input : array of length NSU, containing the indices * of the components of RGRA that are considered. * It corresponds to the indices of the superbasic * variables. * output : unmodified. * nsu ( int ) * input : number of components of RGRA that are considered. * It is also the number of superbasic variables. * output : unmodified. * Routines used : * --------------- * Abs, sqrt, max. * Programming : * ------------- * D. Tuyttens * ======================================================================== * Routine parameters integer su(*), nsu double precision rgmax, rgnor, rgra(*) * Internal variables integer ik double precision aux double precision zero, one, two, three, half, tenm1, tenm2, tenm4 common / prbcst / zero, one, two, three, half, tenm1, tenm2, tenm4 * * Find the biggest absolute value of the superbasic * components of the reduced gradient vector RGRA. * rgmax = zero do 10 ik = 1 , nsu rgmax = max( rgmax , abs(rgra(su(ik))) ) 10 continue * * Compute the euclidean norm of the reduced * gradient vector RGRA. * rgnor = zero do 20 ik = 1 , nsu aux = rgra(su(ik)) if( abs(aux) .ne. rgmax ) then aux = aux / rgmax rgnor = rgnor + aux*aux endif 20 continue rgnor = rgmax * sqrt( one + rgnor ) * return end