1: DOUBLE PRECISION FUNCTION DZASUM(N,ZX,INCX)
2: * .. Scalar Arguments ..
3: INTEGER INCX,N
4: * ..
5: * .. Array Arguments ..
6: DOUBLE COMPLEX ZX(*)
7: * ..
8: *
9: * Purpose
10: * =======
11: *
12: * DZASUM takes the sum of the absolute values.
13: *
14: * Further Details
15: * ===============
16: *
17: * jack dongarra, 3/11/78.
18: * modified 3/93 to return if incx .le. 0.
19: * modified 12/3/93, array(1) declarations changed to array(*)
20: *
21: * =====================================================================
22: *
23: * .. Local Scalars ..
24: DOUBLE PRECISION STEMP
25: INTEGER I,NINCX
26: * ..
27: * .. External Functions ..
28: DOUBLE PRECISION DCABS1
29: EXTERNAL DCABS1
30: * ..
31: DZASUM = 0.0d0
32: STEMP = 0.0d0
33: IF (N.LE.0 .OR. INCX.LE.0) RETURN
34: IF (INCX.EQ.1) THEN
35: *
36: * code for increment equal to 1
37: *
38: DO I = 1,N
39: STEMP = STEMP + DCABS1(ZX(I))
40: END DO
41: ELSE
42: *
43: * code for increment not equal to 1
44: *
45: NINCX = N*INCX
46: DO I = 1,NINCX,INCX
47: STEMP = STEMP + DCABS1(ZX(I))
48: END DO
49: END IF
50: DZASUM = STEMP
51: RETURN
52: END
CVSweb interface <joel.bertrand@systella.fr>