kusano 7d535a
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
/* Subroutine */ int zaxpy_(integer *n, doublecomplex *za, doublecomplex *zx, 
kusano 7d535a
	integer *incx, doublecomplex *zy, integer *incy)
kusano 7d535a
{
kusano 7d535a
kusano 7d535a
kusano 7d535a
    /* System generated locals */
kusano 7d535a
    integer i__1, i__2, i__3, i__4;
kusano 7d535a
    doublecomplex z__1, z__2;
kusano 7d535a
kusano 7d535a
    /* Local variables */
kusano 7d535a
    static integer i;
kusano 7d535a
    extern doublereal dcabs1_(doublecomplex *);
kusano 7d535a
    static integer ix, iy;
kusano 7d535a
kusano 7d535a
kusano 7d535a
/*     constant times a vector plus a vector.   
kusano 7d535a
       jack dongarra, 3/11/78.   
kusano 7d535a
       modified 12/3/93, array(1) declarations changed to array(*)   
kusano 7d535a
kusano 7d535a
    
kusano 7d535a
   Parameter adjustments   
kusano 7d535a
       Function Body */
kusano 7d535a
#define ZY(I) zy[(I)-1]
kusano 7d535a
#define ZX(I) zx[(I)-1]
kusano 7d535a
kusano 7d535a
kusano 7d535a
    if (*n <= 0) {
kusano 7d535a
	return 0;
kusano 7d535a
    }
kusano 7d535a
    if (dcabs1_(za) == 0.) {
kusano 7d535a
	return 0;
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
	i__2 = iy;
kusano 7d535a
	i__3 = iy;
kusano 7d535a
	i__4 = ix;
kusano 7d535a
	z__2.r = za->r * ZX(ix).r - za->i * ZX(ix).i, z__2.i = za->r * ZX(
kusano 7d535a
		ix).i + za->i * ZX(ix).r;
kusano 7d535a
	z__1.r = ZY(iy).r + z__2.r, z__1.i = ZY(iy).i + z__2.i;
kusano 7d535a
	ZY(iy).r = z__1.r, ZY(iy).i = z__1.i;
kusano 7d535a
	ix += *incx;
kusano 7d535a
	iy += *incy;
kusano 7d535a
/* L10: */
kusano 7d535a
    }
kusano 7d535a
    return 0;
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
	i__2 = i;
kusano 7d535a
	i__3 = i;
kusano 7d535a
	i__4 = i;
kusano 7d535a
	z__2.r = za->r * ZX(i).r - za->i * ZX(i).i, z__2.i = za->r * ZX(
kusano 7d535a
		i).i + za->i * ZX(i).r;
kusano 7d535a
	z__1.r = ZY(i).r + z__2.r, z__1.i = ZY(i).i + z__2.i;
kusano 7d535a
	ZY(i).r = z__1.r, ZY(i).i = z__1.i;
kusano 7d535a
/* L30: */
kusano 7d535a
    }
kusano 7d535a
    return 0;
kusano 7d535a
} /* zaxpy_ */
kusano 7d535a