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.

dzaminf.f 944 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. REAL*8 function dzaminf(n,zx,incx)
  2. c
  3. c finds the index of element having min. absolute value.
  4. c jack dongarra, 1/15/85.
  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. COMPLEX*16 zx(*)
  9. integer i,incx,ix,n
  10. double precision dcabs1
  11. c
  12. dzaminf = 0.
  13. if( n.lt.1 .or. incx.le.0 )return
  14. dzaminf = dcabs1(zx(1))
  15. if(n.eq.1)return
  16. if(incx.eq.1)go to 20
  17. c
  18. c code for increment not equal to 1
  19. c
  20. ix = 1
  21. dzaminf = dcabs1(zx(1))
  22. ix = ix + incx
  23. do 10 i = 2,n
  24. if(dcabs1(zx(ix)).ge.dzaminf) go to 5
  25. dzaminf = dcabs1(zx(ix))
  26. 5 ix = ix + incx
  27. 10 continue
  28. return
  29. c
  30. c code for increment equal to 1
  31. c
  32. 20 dzaminf = dcabs1(zx(1))
  33. do 30 i = 2,n
  34. if(dcabs1(zx(i)).ge.dzaminf) go to 30
  35. dzaminf = dcabs1(zx(i))
  36. 30 continue
  37. return
  38. end