1 subroutine srot (n,sx,incx,sy,incy,c,s) 2c 3c applies a plane rotation. 4c jack dongarra, linpack, 3/11/78. 5c modified 12/3/93, array(1) declarations changed to array(*) 6c 7 real sx(*),sy(*),stemp,c,s 8 integer i,incx,incy,ix,iy,n 9c 10 if(n.le.0)return 11 if(incx.eq.1.and.incy.eq.1)go to 20 12c 13c code for unequal increments or equal increments not equal 14c to 1 15c 16 ix = 1 17 iy = 1 18 if(incx.lt.0)ix = (-n+1)*incx + 1 19 if(incy.lt.0)iy = (-n+1)*incy + 1 20 do 10 i = 1,n 21 stemp = c*sx(ix) + s*sy(iy) 22 sy(iy) = c*sy(iy) - s*sx(ix) 23 sx(ix) = stemp 24 ix = ix + incx 25 iy = iy + incy 26 10 continue 27 return 28c 29c code for both increments equal to 1 30c 31 20 do 30 i = 1,n 32 stemp = c*sx(i) + s*sy(i) 33 sy(i) = c*sy(i) - s*sx(i) 34 sx(i) = stemp 35 30 continue 36 return 37 end 38