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.

cdotuf.f 894 B

12345678910111213141516171819202122232425262728293031323334353637
  1. complex function cdotuf(n,cx,incx,cy,incy)
  2. c
  3. c forms the dot product of two vectors.
  4. c jack dongarra, linpack, 3/11/78.
  5. c modified 12/3/93, array(1) declarations changed to array(*)
  6. c
  7. complex cx(*),cy(*),ctemp
  8. integer i,incx,incy,ix,iy,n
  9. c
  10. ctemp = (0.0,0.0)
  11. cdotuf = (0.0,0.0)
  12. if(n.le.0)return
  13. if(incx.eq.1.and.incy.eq.1)go to 20
  14. c
  15. c code for unequal increments or equal increments
  16. c not equal to 1
  17. c
  18. ix = 1
  19. iy = 1
  20. if(incx.lt.0)ix = (-n+1)*incx + 1
  21. if(incy.lt.0)iy = (-n+1)*incy + 1
  22. do 10 i = 1,n
  23. ctemp = ctemp + cx(ix)*cy(iy)
  24. ix = ix + incx
  25. iy = iy + incy
  26. 10 continue
  27. cdotuf = ctemp
  28. return
  29. c
  30. c code for both increments equal to 1
  31. c
  32. 20 do 30 i = 1,n
  33. ctemp = ctemp + cx(i)*cy(i)
  34. 30 continue
  35. cdotuf = ctemp
  36. return
  37. end