Debian Codegraph @

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

raw
1 /* ./src_f77/zdotu.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 /* Double Complex */ VOID zdotu_(doublecomplex * ret_val, integer *n,
9 doublecomplex *zx, integer *incx, doublecomplex *zy, integer *incy)
10 {
11 /* System generated locals */
12 integer i__1, i__2, i__3;
13 doublecomplex z__1, z__2;
14
15 /* Local variables */
16 static integer i__, ix, iy;
17 static doublecomplex ztemp;
18
19
20 /* forms the dot product of two vectors. */
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 ztemp.r = 0., ztemp.i = 0.;
30 ret_val->r = 0., ret_val->i = 0.;
31 if (*n <= 0) {
32 return ;
33 }
34 if (*incx == 1 && *incy == 1) {
35 goto L20;
36 }
37
38 /* code for unequal increments or equal increments */
39 /* not equal to 1 */
40
41 ix = 1;
42 iy = 1;
43 if (*incx < 0) {
44 ix = (-(*n) + 1) * *incx + 1;
45 }
46 if (*incy < 0) {
47 iy = (-(*n) + 1) * *incy + 1;
48 }
49 i__1 = *n;
50 for (i__ = 1; i__ <= i__1; ++i__) {
51 i__2 = ix;
52 i__3 = iy;
53 z__2.r = zx[i__2].r * zy[i__3].r - zx[i__2].i * zy[i__3].i, z__2.i =
54 zx[i__2].r * zy[i__3].i + zx[i__2].i * zy[i__3].r;
55 z__1.r = ztemp.r + z__2.r, z__1.i = ztemp.i + z__2.i;
56 ztemp.r = z__1.r, ztemp.i = z__1.i;
57 ix += *incx;
58 iy += *incy;
59 /* L10: */
60 }
61 ret_val->r = ztemp.r, ret_val->i = ztemp.i;
62 return ;
63
64 /* code for both increments equal to 1 */
65
66 L20:
67 i__1 = *n;
68 for (i__ = 1; i__ <= i__1; ++i__) {
69 i__2 = i__;
70 i__3 = i__;
71 z__2.r = zx[i__2].r * zy[i__3].r - zx[i__2].i * zy[i__3].i, z__2.i =
72 zx[i__2].r * zy[i__3].i + zx[i__2].i * zy[i__3].r;
73 z__1.r = ztemp.r + z__2.r, z__1.i = ztemp.i + z__2.i;
74 ztemp.r = z__1.r, ztemp.i = z__1.i;
75 /* L30: */
76 }
77 ret_val->r = ztemp.r, ret_val->i = ztemp.i;
78 return ;
79 } /* zdotu_ */
80