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.

cdotcf.f 945 B

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