Debian Codegraph @

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

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