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