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.

caxpycf.f 898 B

1234567891011121314151617181920212223242526272829303132333435
  1. subroutine caxpycf(n,ca,cx,incx,cy,incy)
  2. c
  3. c constant times a vector plus a vector.
  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(*),ca
  8. integer i,incx,incy,ix,iy,n
  9. INTRINSIC conjg
  10. c
  11. if(n.le.0)return
  12. if (abs(real(ca)) + abs(aimag(ca)) .eq. 0.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. cy(iy) = cy(iy) + ca*conjg(cx(ix))
  24. ix = ix + incx
  25. iy = iy + incy
  26. 10 continue
  27. return
  28. c
  29. c code for both increments equal to 1
  30. c
  31. 20 do 30 i = 1,n
  32. cy(i) = cy(i) + ca*conjg(cx(i))
  33. 30 continue
  34. return
  35. end