LAPACK 3.3.0

zdotc.f

Go to the documentation of this file.
00001       DOUBLE COMPLEX FUNCTION ZDOTC(N,ZX,INCX,ZY,INCY)
00002 *     .. Scalar Arguments ..
00003       INTEGER INCX,INCY,N
00004 *     ..
00005 *     .. Array Arguments ..
00006       DOUBLE COMPLEX ZX(*),ZY(*)
00007 *     ..
00008 *
00009 *  Purpose
00010 *  =======
00011 *
00012 *  ZDOTC forms the dot product of a vector.
00013 *
00014 *  Further Details
00015 *  ===============
00016 *
00017 *     jack dongarra, 3/11/78.
00018 *     modified 12/3/93, array(1) declarations changed to array(*)
00019 *
00020 *  =====================================================================
00021 *
00022 *     .. Local Scalars ..
00023       DOUBLE COMPLEX ZTEMP
00024       INTEGER I,IX,IY
00025 *     ..
00026 *     .. Intrinsic Functions ..
00027       INTRINSIC DCONJG
00028 *     ..
00029       ZTEMP = (0.0d0,0.0d0)
00030       ZDOTC = (0.0d0,0.0d0)
00031       IF (N.LE.0) 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           ZTEMP = ZTEMP + DCONJG(ZX(IX))*ZY(IY)
00043           IX = IX + INCX
00044           IY = IY + INCY
00045    10 CONTINUE
00046       ZDOTC = ZTEMP
00047       RETURN
00048 *
00049 *        code for both increments equal to 1
00050 *
00051    20 DO 30 I = 1,N
00052           ZTEMP = ZTEMP + DCONJG(ZX(I))*ZY(I)
00053    30 CONTINUE
00054       ZDOTC = ZTEMP
00055       RETURN
00056       END
 All Files Functions