Debian Codegraph @

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

raw
1 /* ./src_f77/cswap.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 cswap_(integer *n, realcomplex *cx, integer *incx, realcomplex *
9 cy, integer *incy)
10 {
11 /* System generated locals */
12 integer i__1, i__2, i__3;
13
14 /* Local variables */
15 static integer i__, ix, iy;
16 static realcomplex ctemp;
17
18
19 /* interchanges two vectors. */
20 /* jack dongarra, linpack, 3/11/78. */
21 /* modified 12/3/93, array(1) declarations changed to array(*) */
22
23
24 /* Parameter adjustments */
25 --cy;
26 --cx;
27
28 /* Function Body */
29 if (*n <= 0) {
30 return 0;
31 }
32 if (*incx == 1 && *incy == 1) {
33 goto L20;
34 }
35
36 /* code for unequal increments or equal increments not equal */
37 /* to 1 */
38
39 ix = 1;
40 iy = 1;
41 if (*incx < 0) {
42 ix = (-(*n) + 1) * *incx + 1;
43 }
44 if (*incy < 0) {
45 iy = (-(*n) + 1) * *incy + 1;
46 }
47 i__1 = *n;
48 for (i__ = 1; i__ <= i__1; ++i__) {
49 i__2 = ix;
50 ctemp.r = cx[i__2].r, ctemp.i = cx[i__2].i;
51 i__2 = ix;
52 i__3 = iy;
53 cx[i__2].r = cy[i__3].r, cx[i__2].i = cy[i__3].i;
54 i__2 = iy;
55 cy[i__2].r = ctemp.r, cy[i__2].i = ctemp.i;
56 ix += *incx;
57 iy += *incy;
58 /* L10: */
59 }
60 return 0;
61
62 /* code for both increments equal to 1 */
63 L20:
64 i__1 = *n;
65 for (i__ = 1; i__ <= i__1; ++i__) {
66 i__2 = i__;
67 ctemp.r = cx[i__2].r, ctemp.i = cx[i__2].i;
68 i__2 = i__;
69 i__3 = i__;
70 cx[i__2].r = cy[i__3].r, cx[i__2].i = cy[i__3].i;
71 i__2 = i__;
72 cy[i__2].r = ctemp.r, cy[i__2].i = ctemp.i;
73 /* L30: */
74 }
75 return 0;
76 } /* cswap_ */
77