LAPACK 3.3.0

zaxpy.f

Go to the documentation of this file.
00001       SUBROUTINE ZAXPY(N,ZA,ZX,INCX,ZY,INCY)
00002 *     .. Scalar Arguments ..
00003       DOUBLE COMPLEX ZA
00004       INTEGER INCX,INCY,N
00005 *     ..
00006 *     .. Array Arguments ..
00007       DOUBLE COMPLEX ZX(*),ZY(*)
00008 *     ..
00009 *
00010 *  Purpose
00011 *  =======
00012 *
00013 *     ZAXPY constant times a vector plus a vector.
00014 *
00015 *  Further Details
00016 *  ===============
00017 *
00018 *     jack dongarra, 3/11/78.
00019 *     modified 12/3/93, array(1) declarations changed to array(*)
00020 *
00021 *  =====================================================================
00022 *
00023 *     .. Local Scalars ..
00024       INTEGER I,IX,IY
00025 *     ..
00026 *     .. External Functions ..
00027       DOUBLE PRECISION DCABS1
00028       EXTERNAL DCABS1
00029 *     ..
00030       IF (N.LE.0) RETURN
00031       IF (DCABS1(ZA).EQ.0.0d0) RETURN
00032       IF (INCX.EQ.1 .AND. INCY.EQ.1) GO TO 20
00033 *
00034 *        code for unequal increments or equal increments
00035 *          not equal to 1
00036 *
00037       IX = 1
00038       IY = 1
00039       IF (INCX.LT.0) IX = (-N+1)*INCX + 1
00040       IF (INCY.LT.0) IY = (-N+1)*INCY + 1
00041       DO 10 I = 1,N
00042           ZY(IY) = ZY(IY) + ZA*ZX(IX)
00043           IX = IX + INCX
00044           IY = IY + INCY
00045    10 CONTINUE
00046       RETURN
00047 *
00048 *        code for both increments equal to 1
00049 *
00050    20 DO 30 I = 1,N
00051           ZY(I) = ZY(I) + ZA*ZX(I)
00052    30 CONTINUE
00053       RETURN
00054       END
 All Files Functions