      SUBROUTINE WSWAP (N, XR, XI, INCX, YR, YI, INCY)
      IMPLICIT NONE
C
      INTEGER N, INCX, INCY
      DOUBLE PRECISION XR(*), XI(*), YR(*), YI(*)
C
      INTEGER I, IX, IY
      DOUBLE PRECISION T
C
C
      IF (N.LE.0) RETURN
      IX = 1
      IY = 1
      IF (INCX.LT.0) IX = (-N+1)*INCX+1
      IF (INCY.LT.0) IY = (-N+1)*INCY+1
      DO 10 I = 1, N
        T = XR(IX)
        XR(IX) = YR(IY)
        YR(IY) = T
        T = XI(IX)
        XI(IX) = YI(IY)
        YI(IY) = T
        IX = IX+INCX
        IY = IY+INCY
10    CONTINUE
C
      RETURN
      END
