LAPACK 3.3.1
Linear Algebra PACKage

dzasum.f

Go to the documentation of this file.
00001       DOUBLE PRECISION FUNCTION DZASUM(N,ZX,INCX)
00002 *     .. Scalar Arguments ..
00003       INTEGER INCX,N
00004 *     ..
00005 *     .. Array Arguments ..
00006       DOUBLE COMPLEX ZX(*)
00007 *     ..
00008 *
00009 *  Purpose
00010 *  =======
00011 *
00012 *     DZASUM takes the sum of the absolute values.
00013 *
00014 *  Further Details
00015 *  ===============
00016 *
00017 *     jack dongarra, 3/11/78.
00018 *     modified 3/93 to return if incx .le. 0.
00019 *     modified 12/3/93, array(1) declarations changed to array(*)
00020 *
00021 *  =====================================================================
00022 *
00023 *     .. Local Scalars ..
00024       DOUBLE PRECISION STEMP
00025       INTEGER I,NINCX
00026 *     ..
00027 *     .. External Functions ..
00028       DOUBLE PRECISION DCABS1
00029       EXTERNAL DCABS1
00030 *     ..
00031       DZASUM = 0.0d0
00032       STEMP = 0.0d0
00033       IF (N.LE.0 .OR. INCX.LE.0) RETURN
00034       IF (INCX.EQ.1) THEN
00035 *
00036 *        code for increment equal to 1
00037 *
00038          DO I = 1,N
00039             STEMP = STEMP + DCABS1(ZX(I))
00040          END DO
00041       ELSE
00042 *
00043 *        code for increment not equal to 1
00044 *
00045          NINCX = N*INCX
00046          DO I = 1,NINCX,INCX
00047             STEMP = STEMP + DCABS1(ZX(I))
00048          END DO
00049       END IF
00050       DZASUM = STEMP
00051       RETURN
00052       END
 All Files Functions