LAPACK 3.3.0
|
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,IX 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) GO TO 20 00035 * 00036 * code for increment not equal to 1 00037 * 00038 IX = 1 00039 DO 10 I = 1,N 00040 STEMP = STEMP + DCABS1(ZX(IX)) 00041 IX = IX + INCX 00042 10 CONTINUE 00043 DZASUM = STEMP 00044 RETURN 00045 * 00046 * code for increment equal to 1 00047 * 00048 20 DO 30 I = 1,N 00049 STEMP = STEMP + DCABS1(ZX(I)) 00050 30 CONTINUE 00051 DZASUM = STEMP 00052 RETURN 00053 END