Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer | :: | N | ||||
integer | :: | ZX(*) | ||||
integer | :: | INCX | ||||
integer | :: | ZY(*) | ||||
integer | :: | INCY |
subroutine my_ICOPY(N, ZX, INCX, ZY, INCY)
! .. Scalar Arguments ..
integer INCX, INCY, N
! ..
! .. Array Arguments ..
integer ZX(*), ZY(*)
! ..
!
! Purpose
! =======
!
! copies a vector, x, to a vector, y.
! jack dongarra, linpack, 4/11/78.
! modified 12/3/93, array(1) declarations changed to array(*)
!
!
! .. Local Scalars ..
integer I, IX, IY
! ..
if (N .le. 0) return
if (INCX .eq. 1 .and. INCY .eq. 1) GO TO 20
!
! code for unequal increments or equal increments
! not equal to 1
!
IX = 1
IY = 1
if (INCX .lt. 0) IX = (-N + 1)*INCX + 1
if (INCY .lt. 0) IY = (-N + 1)*INCY + 1
do I = 1, N
ZY(IY) = ZX(IX)
IX = IX + INCX
IY = IY + INCY
end do
return
!
! code for both increments equal to 1
!
20 do I = 1, N
ZY(I) = ZX(I)
end do
return
end subroutine my_ICOPY