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