LAPACK 3.3.0

zcopy.f

Go to the documentation of this file.
00001       SUBROUTINE ZCOPY(N,ZX,INCX,ZY,INCY)
00002 *     .. Scalar Arguments ..
00003       INTEGER INCX,INCY,N
00004 *     ..
00005 *     .. Array Arguments ..
00006       DOUBLE COMPLEX ZX(*),ZY(*)
00007 *     ..
00008 *
00009 *  Purpose
00010 *  =======
00011 *
00012 *     ZCOPY copies a vector, x, to a vector, y.
00013 *
00014 *  Further Details
00015 *  ===============
00016 *
00017 *     jack dongarra, linpack, 4/11/78.
00018 *     modified 12/3/93, array(1) declarations changed to array(*)
00019 *
00020 *  =====================================================================
00021 *
00022 *     .. Local Scalars ..
00023       INTEGER I,IX,IY
00024 *     ..
00025       IF (N.LE.0) RETURN
00026       IF (INCX.EQ.1 .AND. INCY.EQ.1) GO TO 20
00027 *
00028 *        code for unequal increments or equal increments
00029 *          not equal to 1
00030 *
00031       IX = 1
00032       IY = 1
00033       IF (INCX.LT.0) IX = (-N+1)*INCX + 1
00034       IF (INCY.LT.0) IY = (-N+1)*INCY + 1
00035       DO 10 I = 1,N
00036           ZY(IY) = ZX(IX)
00037           IX = IX + INCX
00038           IY = IY + INCY
00039    10 CONTINUE
00040       RETURN
00041 *
00042 *        code for both increments equal to 1
00043 *
00044    20 DO 30 I = 1,N
00045           ZY(I) = ZX(I)
00046    30 CONTINUE
00047       RETURN
00048       END
 All Files Functions