1
double precision function dasum(n,dx,incx)
3
c takes the sum of the absolute values.
4
c jack dongarra, linpack, 3/11/78.
5
c modified 3/93 to return if incx .le. 0.
6
c modified 12/3/93, array(1) declarations changed to array(*)
8
double precision dx(*),dtemp
9
integer i,incx,m,mp1,n,nincx
13
if( n.le.0 .or. incx.le.0 )return
16
c code for increment not equal to 1
19
do 10 i = 1,nincx,incx
20
dtemp = dtemp + dabs(dx(i))
25
c code for increment equal to 1
31
if( m .eq. 0 ) go to 40
33
dtemp = dtemp + dabs(dx(i))
35
if( n .lt. 6 ) go to 60
38
dtemp = dtemp + dabs(dx(i)) + dabs(dx(i + 1)) + dabs(dx(i + 2))
39
* + dabs(dx(i + 3)) + dabs(dx(i + 4)) + dabs(dx(i + 5))