Annotation of rpl/lapack/blas/dasum.f, revision 1.6
1.1 bertrand 1: DOUBLE PRECISION FUNCTION DASUM(N,DX,INCX)
2: * .. Scalar Arguments ..
3: INTEGER INCX,N
4: * ..
5: * .. Array Arguments ..
6: DOUBLE PRECISION DX(*)
7: * ..
8: *
9: * Purpose
10: * =======
11: *
12: * DASUM takes the sum of the absolute values.
13: *
14: * Further Details
15: * ===============
16: *
17: * jack dongarra, linpack, 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 DTEMP
25: INTEGER I,M,MP1,NINCX
26: * ..
27: * .. Intrinsic Functions ..
28: INTRINSIC DABS,MOD
29: * ..
30: DASUM = 0.0d0
31: DTEMP = 0.0d0
32: IF (N.LE.0 .OR. INCX.LE.0) RETURN
33: IF (INCX.EQ.1) GO TO 20
34: *
35: * code for increment not equal to 1
36: *
37: NINCX = N*INCX
38: DO 10 I = 1,NINCX,INCX
39: DTEMP = DTEMP + DABS(DX(I))
40: 10 CONTINUE
41: DASUM = DTEMP
42: RETURN
43: *
44: * code for increment equal to 1
45: *
46: *
47: * clean-up loop
48: *
49: 20 M = MOD(N,6)
50: IF (M.EQ.0) GO TO 40
51: DO 30 I = 1,M
52: DTEMP = DTEMP + DABS(DX(I))
53: 30 CONTINUE
54: IF (N.LT.6) GO TO 60
55: 40 MP1 = M + 1
56: DO 50 I = MP1,N,6
57: DTEMP = DTEMP + DABS(DX(I)) + DABS(DX(I+1)) + DABS(DX(I+2)) +
58: + DABS(DX(I+3)) + DABS(DX(I+4)) + DABS(DX(I+5))
59: 50 CONTINUE
60: 60 DASUM = DTEMP
61: RETURN
62: END
CVSweb interface <joel.bertrand@systella.fr>