Mercurial > octave-nkf
annotate libcruft/blas/zdrot.f @ 7575:d20a2f261306
use * instead of 1 for assumed-size fortran arrays
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 10 Mar 2008 13:30:01 -0400 |
parents | 30c606bec7a8 |
children |
rev | line source |
---|---|
2329 | 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 | |
7575
d20a2f261306
use * instead of 1 for assumed-size fortran arrays
John W. Eaton <jwe@octave.org>
parents:
2329
diff
changeset
|
7 double complex zx(*),zy(*),ztemp |
2329 | 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 |