root / src / blas / zdrot.f @ 4
Historique | Voir | Annoter | Télécharger (2,63 ko)
1 | 1 | pfleura2 | SUBROUTINE ZDROT( N, CX, INCX, CY, INCY, C, S ) |
---|---|---|---|
2 | 1 | pfleura2 | * |
3 | 1 | pfleura2 | * .. Scalar Arguments .. |
4 | 1 | pfleura2 | INTEGER INCX, INCY, N |
5 | 1 | pfleura2 | DOUBLE PRECISION C, S |
6 | 1 | pfleura2 | * .. |
7 | 1 | pfleura2 | * .. Array Arguments .. |
8 | 1 | pfleura2 | COMPLEX*16 CX( * ), CY( * ) |
9 | 1 | pfleura2 | * .. |
10 | 1 | pfleura2 | * |
11 | 1 | pfleura2 | * Purpose |
12 | 1 | pfleura2 | * ======= |
13 | 1 | pfleura2 | * |
14 | 1 | pfleura2 | * Applies a plane rotation, where the cos and sin (c and s) are real |
15 | 1 | pfleura2 | * and the vectors cx and cy are complex. |
16 | 1 | pfleura2 | * jack dongarra, linpack, 3/11/78. |
17 | 1 | pfleura2 | * |
18 | 1 | pfleura2 | * Arguments |
19 | 1 | pfleura2 | * ========== |
20 | 1 | pfleura2 | * |
21 | 1 | pfleura2 | * N (input) INTEGER |
22 | 1 | pfleura2 | * On entry, N specifies the order of the vectors cx and cy. |
23 | 1 | pfleura2 | * N must be at least zero. |
24 | 1 | pfleura2 | * Unchanged on exit. |
25 | 1 | pfleura2 | * |
26 | 1 | pfleura2 | * CX (input) COMPLEX*16 array, dimension at least |
27 | 1 | pfleura2 | * ( 1 + ( N - 1 )*abs( INCX ) ). |
28 | 1 | pfleura2 | * Before entry, the incremented array CX must contain the n |
29 | 1 | pfleura2 | * element vector cx. On exit, CX is overwritten by the updated |
30 | 1 | pfleura2 | * vector cx. |
31 | 1 | pfleura2 | * |
32 | 1 | pfleura2 | * INCX (input) INTEGER |
33 | 1 | pfleura2 | * On entry, INCX specifies the increment for the elements of |
34 | 1 | pfleura2 | * CX. INCX must not be zero. |
35 | 1 | pfleura2 | * Unchanged on exit. |
36 | 1 | pfleura2 | * |
37 | 1 | pfleura2 | * CY (input) COMPLEX*16 array, dimension at least |
38 | 1 | pfleura2 | * ( 1 + ( N - 1 )*abs( INCY ) ). |
39 | 1 | pfleura2 | * Before entry, the incremented array CY must contain the n |
40 | 1 | pfleura2 | * element vector cy. On exit, CY is overwritten by the updated |
41 | 1 | pfleura2 | * vector cy. |
42 | 1 | pfleura2 | * |
43 | 1 | pfleura2 | * INCY (input) INTEGER |
44 | 1 | pfleura2 | * On entry, INCY specifies the increment for the elements of |
45 | 1 | pfleura2 | * CY. INCY must not be zero. |
46 | 1 | pfleura2 | * Unchanged on exit. |
47 | 1 | pfleura2 | * |
48 | 1 | pfleura2 | * C (input) DOUBLE PRECISION |
49 | 1 | pfleura2 | * On entry, C specifies the cosine, cos. |
50 | 1 | pfleura2 | * Unchanged on exit. |
51 | 1 | pfleura2 | * |
52 | 1 | pfleura2 | * S (input) DOUBLE PRECISION |
53 | 1 | pfleura2 | * On entry, S specifies the sine, sin. |
54 | 1 | pfleura2 | * Unchanged on exit. |
55 | 1 | pfleura2 | * |
56 | 1 | pfleura2 | * ===================================================================== |
57 | 1 | pfleura2 | * |
58 | 1 | pfleura2 | * .. Local Scalars .. |
59 | 1 | pfleura2 | INTEGER I, IX, IY |
60 | 1 | pfleura2 | COMPLEX*16 CTEMP |
61 | 1 | pfleura2 | * .. |
62 | 1 | pfleura2 | * .. Executable Statements .. |
63 | 1 | pfleura2 | * |
64 | 1 | pfleura2 | IF( N.LE.0 ) |
65 | 1 | pfleura2 | $ RETURN |
66 | 1 | pfleura2 | IF( INCX.EQ.1 .AND. INCY.EQ.1 ) |
67 | 1 | pfleura2 | $ GO TO 20 |
68 | 1 | pfleura2 | * |
69 | 1 | pfleura2 | * code for unequal increments or equal increments not equal |
70 | 1 | pfleura2 | * to 1 |
71 | 1 | pfleura2 | * |
72 | 1 | pfleura2 | IX = 1 |
73 | 1 | pfleura2 | IY = 1 |
74 | 1 | pfleura2 | IF( INCX.LT.0 ) |
75 | 1 | pfleura2 | $ IX = ( -N+1 )*INCX + 1 |
76 | 1 | pfleura2 | IF( INCY.LT.0 ) |
77 | 1 | pfleura2 | $ IY = ( -N+1 )*INCY + 1 |
78 | 1 | pfleura2 | DO 10 I = 1, N |
79 | 1 | pfleura2 | CTEMP = C*CX( IX ) + S*CY( IY ) |
80 | 1 | pfleura2 | CY( IY ) = C*CY( IY ) - S*CX( IX ) |
81 | 1 | pfleura2 | CX( IX ) = CTEMP |
82 | 1 | pfleura2 | IX = IX + INCX |
83 | 1 | pfleura2 | IY = IY + INCY |
84 | 1 | pfleura2 | 10 CONTINUE |
85 | 1 | pfleura2 | RETURN |
86 | 1 | pfleura2 | * |
87 | 1 | pfleura2 | * code for both increments equal to 1 |
88 | 1 | pfleura2 | * |
89 | 1 | pfleura2 | 20 CONTINUE |
90 | 1 | pfleura2 | DO 30 I = 1, N |
91 | 1 | pfleura2 | CTEMP = C*CX( I ) + S*CY( I ) |
92 | 1 | pfleura2 | CY( I ) = C*CY( I ) - S*CX( I ) |
93 | 1 | pfleura2 | CX( I ) = CTEMP |
94 | 1 | pfleura2 | 30 CONTINUE |
95 | 1 | pfleura2 | RETURN |
96 | 1 | pfleura2 | END |