Debian Codegraph @

debian/external_deps/fetk/punc/src/blas/csrot.c

raw
1 /* ./src_f77/csrot.f -- translated by f2c (version 20030320).
2 You must link the resulting object file with the libraries:
3 -lf2c -lm (in that order)
4 */
5
6 #include <punc/vf2c.h>
7
8 /* Subroutine */ int csrot_(integer *n, realcomplex *cx, integer *incx, realcomplex *
9 cy, integer *incy, real *c__, real *s)
10 {
11 /* System generated locals */
12 integer i__1, i__2, i__3, i__4;
13 realcomplex q__1, q__2, q__3;
14
15 /* Local variables */
16 static integer i__, ix, iy;
17 static realcomplex ctemp;
18
19
20 /* applies a plane rotation, where the cos and sin (c and s) are real */
21 /* and the vectors cx and cy are complex. */
22 /* jack dongarra, linpack, 3/11/78. */
23
24
25 /* Parameter adjustments */
26 --cy;
27 --cx;
28
29 /* Function Body */
30 if (*n <= 0) {
31 return 0;
32 }
33 if (*incx == 1 && *incy == 1) {
34 goto L20;
35 }
36
37 /* code for unequal increments or equal increments not equal */
38 /* to 1 */
39
40 ix = 1;
41 iy = 1;
42 if (*incx < 0) {
43 ix = (-(*n) + 1) * *incx + 1;
44 }
45 if (*incy < 0) {
46 iy = (-(*n) + 1) * *incy + 1;
47 }
48 i__1 = *n;
49 for (i__ = 1; i__ <= i__1; ++i__) {
50 i__2 = ix;
51 q__2.r = *c__ * cx[i__2].r, q__2.i = *c__ * cx[i__2].i;
52 i__3 = iy;
53 q__3.r = *s * cy[i__3].r, q__3.i = *s * cy[i__3].i;
54 q__1.r = q__2.r + q__3.r, q__1.i = q__2.i + q__3.i;
55 ctemp.r = q__1.r, ctemp.i = q__1.i;
56 i__2 = iy;
57 i__3 = iy;
58 q__2.r = *c__ * cy[i__3].r, q__2.i = *c__ * cy[i__3].i;
59 i__4 = ix;
60 q__3.r = *s * cx[i__4].r, q__3.i = *s * cx[i__4].i;
61 q__1.r = q__2.r - q__3.r, q__1.i = q__2.i - q__3.i;
62 cy[i__2].r = q__1.r, cy[i__2].i = q__1.i;
63 i__2 = ix;
64 cx[i__2].r = ctemp.r, cx[i__2].i = ctemp.i;
65 ix += *incx;
66 iy += *incy;
67 /* L10: */
68 }
69 return 0;
70
71 /* code for both increments equal to 1 */
72
73 L20:
74 i__1 = *n;
75 for (i__ = 1; i__ <= i__1; ++i__) {
76 i__2 = i__;
77 q__2.r = *c__ * cx[i__2].r, q__2.i = *c__ * cx[i__2].i;
78 i__3 = i__;
79 q__3.r = *s * cy[i__3].r, q__3.i = *s * cy[i__3].i;
80 q__1.r = q__2.r + q__3.r, q__1.i = q__2.i + q__3.i;
81 ctemp.r = q__1.r, ctemp.i = q__1.i;
82 i__2 = i__;
83 i__3 = i__;
84 q__2.r = *c__ * cy[i__3].r, q__2.i = *c__ * cy[i__3].i;
85 i__4 = i__;
86 q__3.r = *s * cx[i__4].r, q__3.i = *s * cx[i__4].i;
87 q__1.r = q__2.r - q__3.r, q__1.i = q__2.i - q__3.i;
88 cy[i__2].r = q__1.r, cy[i__2].i = q__1.i;
89 i__2 = i__;
90 cx[i__2].r = ctemp.r, cx[i__2].i = ctemp.i;
91 /* L30: */
92 }
93 return 0;
94 } /* csrot_ */
95