|
kusano |
7d535a |
/* -- translated by f2c (version 19940927).
|
|
kusano |
7d535a |
You must link the resulting object file with the libraries:
|
|
kusano |
7d535a |
-lf2c -lm (in that order)
|
|
kusano |
7d535a |
*/
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
#include "f2c.h"
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
/* Complex */ VOID cdotc_(complex * ret_val, integer *n, complex *cx, integer
|
|
kusano |
7d535a |
*incx, complex *cy, integer *incy)
|
|
kusano |
7d535a |
{
|
|
kusano |
7d535a |
/* System generated locals */
|
|
kusano |
7d535a |
integer i__1, i__2;
|
|
kusano |
7d535a |
complex q__1, q__2, q__3;
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
/* Builtin functions */
|
|
kusano |
7d535a |
void r_cnjg(complex *, complex *);
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
/* Local variables */
|
|
kusano |
7d535a |
static integer i;
|
|
kusano |
7d535a |
static complex ctemp;
|
|
kusano |
7d535a |
static integer ix, iy;
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
/* forms the dot product of two vectors, conjugating the first
|
|
kusano |
7d535a |
vector.
|
|
kusano |
7d535a |
jack dongarra, linpack, 3/11/78.
|
|
kusano |
7d535a |
modified 12/3/93, array(1) declarations changed to array(*)
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Parameter adjustments */
|
|
kusano |
7d535a |
--cy;
|
|
kusano |
7d535a |
--cx;
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
/* Function Body */
|
|
kusano |
7d535a |
ctemp.r = 0.f, ctemp.i = 0.f;
|
|
kusano |
7d535a |
ret_val->r = 0.f, ret_val->i = 0.f;
|
|
kusano |
7d535a |
if (*n <= 0) {
|
|
kusano |
7d535a |
return ;
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
if (*incx == 1 && *incy == 1) {
|
|
kusano |
7d535a |
goto L20;
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
/* code for unequal increments or equal increments
|
|
kusano |
7d535a |
not equal to 1 */
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
ix = 1;
|
|
kusano |
7d535a |
iy = 1;
|
|
kusano |
7d535a |
if (*incx < 0) {
|
|
kusano |
7d535a |
ix = (-(*n) + 1) * *incx + 1;
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
if (*incy < 0) {
|
|
kusano |
7d535a |
iy = (-(*n) + 1) * *incy + 1;
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
i__1 = *n;
|
|
kusano |
7d535a |
for (i = 1; i <= *n; ++i) {
|
|
kusano |
7d535a |
r_cnjg(&q__3, &cx[ix]);
|
|
kusano |
7d535a |
i__2 = iy;
|
|
kusano |
7d535a |
q__2.r = q__3.r * cy[iy].r - q__3.i * cy[iy].i, q__2.i = q__3.r *
|
|
kusano |
7d535a |
cy[iy].i + q__3.i * cy[iy].r;
|
|
kusano |
7d535a |
q__1.r = ctemp.r + q__2.r, q__1.i = ctemp.i + q__2.i;
|
|
kusano |
7d535a |
ctemp.r = q__1.r, ctemp.i = q__1.i;
|
|
kusano |
7d535a |
ix += *incx;
|
|
kusano |
7d535a |
iy += *incy;
|
|
kusano |
7d535a |
/* L10: */
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
ret_val->r = ctemp.r, ret_val->i = ctemp.i;
|
|
kusano |
7d535a |
return ;
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
/* code for both increments equal to 1 */
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
L20:
|
|
kusano |
7d535a |
i__1 = *n;
|
|
kusano |
7d535a |
for (i = 1; i <= *n; ++i) {
|
|
kusano |
7d535a |
r_cnjg(&q__3, &cx[i]);
|
|
kusano |
7d535a |
i__2 = i;
|
|
kusano |
7d535a |
q__2.r = q__3.r * cy[i].r - q__3.i * cy[i].i, q__2.i = q__3.r *
|
|
kusano |
7d535a |
cy[i].i + q__3.i * cy[i].r;
|
|
kusano |
7d535a |
q__1.r = ctemp.r + q__2.r, q__1.i = ctemp.i + q__2.i;
|
|
kusano |
7d535a |
ctemp.r = q__1.r, ctemp.i = q__1.i;
|
|
kusano |
7d535a |
/* L30: */
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
ret_val->r = ctemp.r, ret_val->i = ctemp.i;
|
|
kusano |
7d535a |
return ;
|
|
kusano |
7d535a |
} /* cdotc_ */
|
|
kusano |
7d535a |
|