| 1 |
subroutine zdrot (n,zx,incx,zy,incy,c,s) |
| 2 |
c |
| 3 |
c applies a plane rotation, where the cos and sin (c and s) are |
| 4 |
c double precision and the vectors zx and zy are double complex. |
| 5 |
c jack dongarra, linpack, 3/11/78. |
| 6 |
c |
| 7 |
double complex zx(1),zy(1),ztemp |
| 8 |
double precision c,s |
| 9 |
integer i,incx,incy,ix,iy,n |
| 10 |
c |
| 11 |
if(n.le.0)return |
| 12 |
if(incx.eq.1.and.incy.eq.1)go to 20 |
| 13 |
c |
| 14 |
c code for unequal increments or equal increments not equal |
| 15 |
c to 1 |
| 16 |
c |
| 17 |
ix = 1 |
| 18 |
iy = 1 |
| 19 |
if(incx.lt.0)ix = (-n+1)*incx + 1 |
| 20 |
if(incy.lt.0)iy = (-n+1)*incy + 1 |
| 21 |
do 10 i = 1,n |
| 22 |
ztemp = c*zx(ix) + s*zy(iy) |
| 23 |
zy(iy) = c*zy(iy) - s*zx(ix) |
| 24 |
zx(ix) = ztemp |
| 25 |
ix = ix + incx |
| 26 |
iy = iy + incy |
| 27 |
10 continue |
| 28 |
return |
| 29 |
c |
| 30 |
c code for both increments equal to 1 |
| 31 |
c |
| 32 |
20 do 30 i = 1,n |
| 33 |
ztemp = c*zx(i) + s*zy(i) |
| 34 |
zy(i) = c*zy(i) - s*zx(i) |
| 35 |
zx(i) = ztemp |
| 36 |
30 continue |
| 37 |
return |
| 38 |
end |