* ************************************************************************ subroutine dsetvl( n, x, incx, vl ) * ************************************************************************ * Purpose : * --------- * This subroutine sets the vector X to the double precision * constant VL by increments of INCX, and this is repeated N * times. * Parameters : * ------------ * n ( int ) * input : number of components of X to set to VL. * output : unmodified. * x ( dble ) * input : a vector containing the components to set * to the value VL. * output : identical to the input value, except for the * components for the components 1+i*INCX * (i=0, ..., n-1) that are set to the value VL. * incx ( int ) * input : increment to consider between two successive * components of X to set to the value VL. * If INCX is negative, then its absolute value * is considered. * output : unmodifed. * vl ( dble ) * input : the value to assign to the selected components * of the vector X. * output : unmodified. * Routines used : * --------------- * None. * Programming : * ------------- * Ph.L. Toint * Remarks : * --------- * This routine is written to complete blasd, and its parameter list * is similarly arranged. * ======================================================================== * Routine parameters integer incx, n double precision vl, x(*) * Internal variables integer ix, m, i if( n.le.0 ) return if( incx.ne.1 ) then if( incx.lt.0 ) then ix = (- n + 1)*incx + 1 else ix = 1 endif do 100 i = ix , ix+(n-1)*incx , incx x(i) = vl 100 continue else m = mod(n,5) if( m.ne.0 ) then do 200 i = 1 , m x(i) = vl 200 continue endif if( n.ge.5 ) then ix = m + 1 do 300 i = ix , n , 5 x(i) = vl x(i+1) = vl x(i+2) = vl x(i+3) = vl x(i+4) = vl 300 continue endif endif return end