* ************************************************************************ subroutine gathr0( n, x, incx, bigvec, cplist ) * ************************************************************************ * Purpose : * --------- * This routine accumulates the components of the double * precision vector BIGVEC specified by the component list * CPLIST into X(i) for i=1+(j-1)*INCX, j=1, ...,N. * Parameters : * ------------ * n ( int ) * input : number of components of BIGVEC to accumulate in X. * output : unmodified. * x ( dble ) * input : a vector in which one wishes to accumulate certain * components of the vector BIGVEC. * output : identical to the input value, except for the * components for the components 1+(i-1)*INCX * (i=1, ..., N) that are set to the components * BIGVEC(CPLIST(i)) (i=1, ...,N) respectively. * incx ( int ) * input : increment to consider between two successive * components of X. * If INCX is negative, then its absolute value * is considered. * output : unmodifed. * bigvec ( dble ) * input : a vector from which one wishes to extract cetain * components that are to be accumulated in X. * output : unmodified. * cplist ( int ) * input : a vector containing the list of components of * BIGVEC that one wishes to accumulate in X. * output : unmodified. * Routines used : * --------------- * None. * Programming : * ------------- * Ph.L. Toint * Remarks : * --------- * This routine does not verify that the integers contained in * CPLIST(i) (i=1,...,N) are adequate for indexing the vector BIGVEC. * ======================================================================== * Routine parameters integer cplist(*), n, incx double precision x(*), bigvec(*) * Internal variables integer ix, nx, i if( incx.ne.1 ) then ix = abs(incx) nx = 1 do 100 i = 1 , n x(nx) = bigvec(cplist(i)) nx = nx + ix 100 continue else do 200 i = 1 , n x(i) = bigvec(cplist(i)) 200 continue endif return end