Line | |
---|
1 | SUBROUTINE DROT(N,DX,INCX,DY,INCY,C,S) |
---|
2 | * .. Scalar Arguments .. |
---|
3 | DOUBLE PRECISION C,S |
---|
4 | INTEGER INCX,INCY,N |
---|
5 | * .. |
---|
6 | * .. Array Arguments .. |
---|
7 | DOUBLE PRECISION DX(*),DY(*) |
---|
8 | * .. |
---|
9 | * |
---|
10 | * Purpose |
---|
11 | * ======= |
---|
12 | * |
---|
13 | * applies a plane rotation. |
---|
14 | * jack dongarra, linpack, 3/11/78. |
---|
15 | * modified 12/3/93, array(1) declarations changed to array(*) |
---|
16 | * |
---|
17 | * |
---|
18 | * .. Local Scalars .. |
---|
19 | DOUBLE PRECISION DTEMP |
---|
20 | INTEGER I,IX,IY |
---|
21 | * .. |
---|
22 | IF (N.LE.0) RETURN |
---|
23 | IF (INCX.EQ.1 .AND. INCY.EQ.1) GO TO 20 |
---|
24 | * |
---|
25 | * code for unequal increments or equal increments not equal |
---|
26 | * to 1 |
---|
27 | * |
---|
28 | IX = 1 |
---|
29 | IY = 1 |
---|
30 | IF (INCX.LT.0) IX = (-N+1)*INCX + 1 |
---|
31 | IF (INCY.LT.0) IY = (-N+1)*INCY + 1 |
---|
32 | DO 10 I = 1,N |
---|
33 | DTEMP = C*DX(IX) + S*DY(IY) |
---|
34 | DY(IY) = C*DY(IY) - S*DX(IX) |
---|
35 | DX(IX) = DTEMP |
---|
36 | IX = IX + INCX |
---|
37 | IY = IY + INCY |
---|
38 | 10 CONTINUE |
---|
39 | RETURN |
---|
40 | * |
---|
41 | * code for both increments equal to 1 |
---|
42 | * |
---|
43 | 20 DO 30 I = 1,N |
---|
44 | DTEMP = C*DX(I) + S*DY(I) |
---|
45 | DY(I) = C*DY(I) - S*DX(I) |
---|
46 | DX(I) = DTEMP |
---|
47 | 30 CONTINUE |
---|
48 | RETURN |
---|
49 | END |
---|
Note: See
TracBrowser
for help on using the repository browser.