LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
double precision function dasum ( integer  N,
double precision, dimension(*)  DX,
integer  INCX 
)

DASUM

Purpose:
    DASUM takes the sum of the absolute values.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011
Further Details:
     jack dongarra, linpack, 3/11/78.
     modified 3/93 to return if incx .le. 0.
     modified 12/3/93, array(1) declarations changed to array(*)

Definition at line 53 of file dasum.f.

53 *
54 * -- Reference BLAS level1 routine (version 3.4.0) --
55 * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
56 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
57 * November 2011
58 *
59 * .. Scalar Arguments ..
60  INTEGER incx,n
61 * ..
62 * .. Array Arguments ..
63  DOUBLE PRECISION dx(*)
64 * ..
65 *
66 * =====================================================================
67 *
68 * .. Local Scalars ..
69  DOUBLE PRECISION dtemp
70  INTEGER i,m,mp1,nincx
71 * ..
72 * .. Intrinsic Functions ..
73  INTRINSIC dabs,mod
74 * ..
75  dasum = 0.0d0
76  dtemp = 0.0d0
77  IF (n.LE.0 .OR. incx.LE.0) RETURN
78  IF (incx.EQ.1) THEN
79 * code for increment equal to 1
80 *
81 *
82 * clean-up loop
83 *
84  m = mod(n,6)
85  IF (m.NE.0) THEN
86  DO i = 1,m
87  dtemp = dtemp + dabs(dx(i))
88  END DO
89  IF (n.LT.6) THEN
90  dasum = dtemp
91  RETURN
92  END IF
93  END IF
94  mp1 = m + 1
95  DO i = mp1,n,6
96  dtemp = dtemp + dabs(dx(i)) + dabs(dx(i+1)) +
97  $ dabs(dx(i+2)) + dabs(dx(i+3)) +
98  $ dabs(dx(i+4)) + dabs(dx(i+5))
99  END DO
100  ELSE
101 *
102 * code for increment not equal to 1
103 *
104  nincx = n*incx
105  DO i = 1,nincx,incx
106  dtemp = dtemp + dabs(dx(i))
107  END DO
108  END IF
109  dasum = dtemp
110  RETURN
double precision function dasum(N, DX, INCX)
DASUM
Definition: dasum.f:53

Here is the caller graph for this function: