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.

csscalf.f 712 B

1234567891011121314151617181920212223242526272829
  1. subroutine csscalf(n,sa,cx,incx)
  2. c
  3. c scales a complex vector by a real constant.
  4. c jack dongarra, linpack, 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. complex cx(*)
  9. real sa
  10. integer i,incx,n,nincx
  11. c
  12. if( n.le.0 .or. incx.le.0 )return
  13. if(incx.eq.1)go to 20
  14. c
  15. c code for increment not equal to 1
  16. c
  17. nincx = n*incx
  18. do 10 i = 1,nincx,incx
  19. cx(i) = cmplx(sa*real(cx(i)),sa*aimag(cx(i)))
  20. 10 continue
  21. return
  22. c
  23. c code for increment equal to 1
  24. c
  25. 20 do 30 i = 1,n
  26. cx(i) = cmplx(sa*real(cx(i)),sa*aimag(cx(i)))
  27. 30 continue
  28. return
  29. end