ccopy.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /* ccopy.f -- translated by f2c (version 20061008).
  2. You must link the resulting object file with libf2c:
  3. on Microsoft Windows system, link with libf2c.lib;
  4. on Linux or Unix systems, link with .../path/to/libf2c.a -lm
  5. or, if you install libf2c.a in a standard place, with -lf2c -lm
  6. -- in that order, at the end of the command line, as in
  7. cc *.o -lf2c -lm
  8. Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
  9. http://www.netlib.org/f2c/libf2c.zip
  10. */
  11. #include "f2c.h"
  12. #include "blaswrap.h"
  13. /* Subroutine */ int ccopy_(integer *n, complex *cx, integer *incx, complex *
  14. cy, integer *incy)
  15. {
  16. /* System generated locals */
  17. integer i__1, i__2, i__3;
  18. /* Local variables */
  19. integer i__, ix, iy;
  20. /* .. Scalar Arguments .. */
  21. /* .. */
  22. /* .. Array Arguments .. */
  23. /* .. */
  24. /* Purpose */
  25. /* ======= */
  26. /* CCOPY copies a vector x to a vector y. */
  27. /* Further Details */
  28. /* =============== */
  29. /* jack dongarra, linpack, 3/11/78. */
  30. /* modified 12/3/93, array(1) declarations changed to array(*) */
  31. /* .. Local Scalars .. */
  32. /* .. */
  33. /* Parameter adjustments */
  34. --cy;
  35. --cx;
  36. /* Function Body */
  37. if (*n <= 0) {
  38. return 0;
  39. }
  40. if (*incx == 1 && *incy == 1) {
  41. goto L20;
  42. }
  43. /* code for unequal increments or equal increments */
  44. /* not equal to 1 */
  45. ix = 1;
  46. iy = 1;
  47. if (*incx < 0) {
  48. ix = (-(*n) + 1) * *incx + 1;
  49. }
  50. if (*incy < 0) {
  51. iy = (-(*n) + 1) * *incy + 1;
  52. }
  53. i__1 = *n;
  54. for (i__ = 1; i__ <= i__1; ++i__) {
  55. i__2 = iy;
  56. i__3 = ix;
  57. cy[i__2].r = cx[i__3].r, cy[i__2].i = cx[i__3].i;
  58. ix += *incx;
  59. iy += *incy;
  60. /* L10: */
  61. }
  62. return 0;
  63. /* code for both increments equal to 1 */
  64. L20:
  65. i__1 = *n;
  66. for (i__ = 1; i__ <= i__1; ++i__) {
  67. i__2 = i__;
  68. i__3 = i__;
  69. cy[i__2].r = cx[i__3].r, cy[i__2].i = cx[i__3].i;
  70. /* L30: */
  71. }
  72. return 0;
  73. } /* ccopy_ */