You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

dzasumf.f 795 B

12345678910111213141516171819202122232425262728293031323334
  1. double precision function dzasumf(n,zx,incx)
  2. c
  3. c takes the sum of the absolute values.
  4. c jack dongarra, 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(*)
  7. c
  8. double complex zx(*)
  9. double precision stemp,dcabs1
  10. integer i,incx,ix,n
  11. c
  12. dzasumf = 0.0d0
  13. stemp = 0.0d0
  14. if( n.le.0 .or. incx.le.0 )return
  15. if(incx.eq.1)go to 20
  16. c
  17. c code for increment not equal to 1
  18. c
  19. ix = 1
  20. do 10 i = 1,n
  21. stemp = stemp + dcabs1(zx(ix))
  22. ix = ix + incx
  23. 10 continue
  24. dzasumf = stemp
  25. return
  26. c
  27. c code for increment equal to 1
  28. c
  29. 20 do 30 i = 1,n
  30. stemp = stemp + dcabs1(zx(i))
  31. 30 continue
  32. dzasumf = stemp
  33. return
  34. end