version 1.1, 2010/01/26 15:22:45
|
version 1.8, 2011/11/21 20:37:09
|
Line 1
|
Line 1
|
|
*> \brief \b ZSWAP |
|
* |
|
* =========== DOCUMENTATION =========== |
|
* |
|
* Online html documentation available at |
|
* http://www.netlib.org/lapack/explore-html/ |
|
* |
|
* Definition: |
|
* =========== |
|
* |
|
* SUBROUTINE ZSWAP(N,ZX,INCX,ZY,INCY) |
|
* |
|
* .. Scalar Arguments .. |
|
* INTEGER INCX,INCY,N |
|
* .. |
|
* .. Array Arguments .. |
|
* COMPLEX*16 ZX(*),ZY(*) |
|
* .. |
|
* |
|
* |
|
*> \par Purpose: |
|
* ============= |
|
*> |
|
*> \verbatim |
|
*> |
|
*> ZSWAP interchanges two vectors. |
|
*> \endverbatim |
|
* |
|
* Authors: |
|
* ======== |
|
* |
|
*> \author Univ. of Tennessee |
|
*> \author Univ. of California Berkeley |
|
*> \author Univ. of Colorado Denver |
|
*> \author NAG Ltd. |
|
* |
|
*> \date November 2011 |
|
* |
|
*> \ingroup complex16_blas_level1 |
|
* |
|
*> \par Further Details: |
|
* ===================== |
|
*> |
|
*> \verbatim |
|
*> |
|
*> jack dongarra, 3/11/78. |
|
*> modified 12/3/93, array(1) declarations changed to array(*) |
|
*> \endverbatim |
|
*> |
|
* ===================================================================== |
SUBROUTINE ZSWAP(N,ZX,INCX,ZY,INCY) |
SUBROUTINE ZSWAP(N,ZX,INCX,ZY,INCY) |
|
* |
|
* -- Reference BLAS level1 routine (version 3.4.0) -- |
|
* -- Reference BLAS is a software package provided by Univ. of Tennessee, -- |
|
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- |
|
* November 2011 |
|
* |
* .. Scalar Arguments .. |
* .. Scalar Arguments .. |
INTEGER INCX,INCY,N |
INTEGER INCX,INCY,N |
* .. |
* .. |
* .. Array Arguments .. |
* .. Array Arguments .. |
DOUBLE COMPLEX ZX(*),ZY(*) |
COMPLEX*16 ZX(*),ZY(*) |
* .. |
* .. |
* |
* |
* Purpose |
|
* ======= |
|
* |
|
* ZSWAP interchanges two vectors. |
|
* |
|
* Further Details |
|
* =============== |
|
* |
|
* jack dongarra, 3/11/78. |
|
* modified 12/3/93, array(1) declarations changed to array(*) |
|
* |
|
* ===================================================================== |
* ===================================================================== |
* |
* |
* .. Local Scalars .. |
* .. Local Scalars .. |
DOUBLE COMPLEX ZTEMP |
COMPLEX*16 ZTEMP |
INTEGER I,IX,IY |
INTEGER I,IX,IY |
* .. |
* .. |
IF (N.LE.0) RETURN |
IF (N.LE.0) RETURN |
IF (INCX.EQ.1 .AND. INCY.EQ.1) GO TO 20 |
IF (INCX.EQ.1 .AND. INCY.EQ.1) THEN |
|
* |
|
* code for both increments equal to 1 |
|
DO I = 1,N |
|
ZTEMP = ZX(I) |
|
ZX(I) = ZY(I) |
|
ZY(I) = ZTEMP |
|
END DO |
|
ELSE |
* |
* |
* code for unequal increments or equal increments not equal |
* code for unequal increments or equal increments not equal |
* to 1 |
* to 1 |
* |
* |
IX = 1 |
IX = 1 |
IY = 1 |
IY = 1 |
IF (INCX.LT.0) IX = (-N+1)*INCX + 1 |
IF (INCX.LT.0) IX = (-N+1)*INCX + 1 |
IF (INCY.LT.0) IY = (-N+1)*INCY + 1 |
IF (INCY.LT.0) IY = (-N+1)*INCY + 1 |
DO 10 I = 1,N |
DO I = 1,N |
ZTEMP = ZX(IX) |
ZTEMP = ZX(IX) |
ZX(IX) = ZY(IY) |
ZX(IX) = ZY(IY) |
ZY(IY) = ZTEMP |
ZY(IY) = ZTEMP |
IX = IX + INCX |
IX = IX + INCX |
IY = IY + INCY |
IY = IY + INCY |
10 CONTINUE |
END DO |
RETURN |
END IF |
* |
|
* code for both increments equal to 1 |
|
20 DO 30 I = 1,N |
|
ZTEMP = ZX(I) |
|
ZX(I) = ZY(I) |
|
ZY(I) = ZTEMP |
|
30 CONTINUE |
|
RETURN |
RETURN |
END |
END |