zcopy.c
Go to the documentation of this file.
00001 /* zcopy.f -- translated by f2c (version 20061008).
00002    You must link the resulting object file with libf2c:
00003         on Microsoft Windows system, link with libf2c.lib;
00004         on Linux or Unix systems, link with .../path/to/libf2c.a -lm
00005         or, if you install libf2c.a in a standard place, with -lf2c -lm
00006         -- in that order, at the end of the command line, as in
00007                 cc *.o -lf2c -lm
00008         Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
00009 
00010                 http://www.netlib.org/f2c/libf2c.zip
00011 */
00012 
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015 
00016 /* Subroutine */ int zcopy_(integer *n, doublecomplex *zx, integer *incx, 
00017         doublecomplex *zy, integer *incy)
00018 {
00019     /* System generated locals */
00020     integer i__1, i__2, i__3;
00021 
00022     /* Local variables */
00023     integer i__, ix, iy;
00024 
00025 /*     .. Scalar Arguments .. */
00026 /*     .. */
00027 /*     .. Array Arguments .. */
00028 /*     .. */
00029 
00030 /*  Purpose */
00031 /*  ======= */
00032 
00033 /*     copies a vector, x, to a vector, y. */
00034 /*     jack dongarra, linpack, 4/11/78. */
00035 /*     modified 12/3/93, array(1) declarations changed to array(*) */
00036 
00037 
00038 /*     .. Local Scalars .. */
00039 /*     .. */
00040     /* Parameter adjustments */
00041     --zy;
00042     --zx;
00043 
00044     /* Function Body */
00045     if (*n <= 0) {
00046         return 0;
00047     }
00048     if (*incx == 1 && *incy == 1) {
00049         goto L20;
00050     }
00051 
00052 /*        code for unequal increments or equal increments */
00053 /*          not equal to 1 */
00054 
00055     ix = 1;
00056     iy = 1;
00057     if (*incx < 0) {
00058         ix = (-(*n) + 1) * *incx + 1;
00059     }
00060     if (*incy < 0) {
00061         iy = (-(*n) + 1) * *incy + 1;
00062     }
00063     i__1 = *n;
00064     for (i__ = 1; i__ <= i__1; ++i__) {
00065         i__2 = iy;
00066         i__3 = ix;
00067         zy[i__2].r = zx[i__3].r, zy[i__2].i = zx[i__3].i;
00068         ix += *incx;
00069         iy += *incy;
00070 /* L10: */
00071     }
00072     return 0;
00073 
00074 /*        code for both increments equal to 1 */
00075 
00076 L20:
00077     i__1 = *n;
00078     for (i__ = 1; i__ <= i__1; ++i__) {
00079         i__2 = i__;
00080         i__3 = i__;
00081         zy[i__2].r = zx[i__3].r, zy[i__2].i = zx[i__3].i;
00082 /* L30: */
00083     }
00084     return 0;
00085 } /* zcopy_ */


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:56:21