zcopy.c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /* zcopy.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 zcopy_(integer *n, doublecomplex *zx, integer *incx,
  14. doublecomplex *zy, 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. /* copies a vector, x, to a vector, y. */
  27. /* jack dongarra, linpack, 4/11/78. */
  28. /* modified 12/3/93, array(1) declarations changed to array(*) */
  29. /* .. Local Scalars .. */
  30. /* .. */
  31. /* Parameter adjustments */
  32. --zy;
  33. --zx;
  34. /* Function Body */
  35. if (*n <= 0) {
  36. return 0;
  37. }
  38. if (*incx == 1 && *incy == 1) {
  39. goto L20;
  40. }
  41. /* code for unequal increments or equal increments */
  42. /* not equal to 1 */
  43. ix = 1;
  44. iy = 1;
  45. if (*incx < 0) {
  46. ix = (-(*n) + 1) * *incx + 1;
  47. }
  48. if (*incy < 0) {
  49. iy = (-(*n) + 1) * *incy + 1;
  50. }
  51. i__1 = *n;
  52. for (i__ = 1; i__ <= i__1; ++i__) {
  53. i__2 = iy;
  54. i__3 = ix;
  55. zy[i__2].r = zx[i__3].r, zy[i__2].i = zx[i__3].i;
  56. ix += *incx;
  57. iy += *incy;
  58. /* L10: */
  59. }
  60. return 0;
  61. /* code for both increments equal to 1 */
  62. L20:
  63. i__1 = *n;
  64. for (i__ = 1; i__ <= i__1; ++i__) {
  65. i__2 = i__;
  66. i__3 = i__;
  67. zy[i__2].r = zx[i__3].r, zy[i__2].i = zx[i__3].i;
  68. /* L30: */
  69. }
  70. return 0;
  71. } /* zcopy_ */