HP MLIB User's Guide Vol. 1 7th Ed.

144 HP MLIB User’s Guide
SSWAP/DSWAP/ISWAP/CSWAP/ZSWAP Swap two vectors
Example 1 Interchange REAL*8 vectors x and y, where x and y are vectors 10 elements
long stored in one-dimensional arrays X and Y of dimension 20.
INTEGER*4 N,INCX,INCY
REAL*8 X(20),Y(20)
N = 10
INCX = 1
INCY = 1
CALL DSWAP (N,X,INCX,Y,INCY)
Example 2 Interchange rows 3 and 6 of a 10-by-10 matrix a stored in two-dimensional
array A of dimension 20-by-21.
INTEGER*4 N,INCA
REAL*8 A(20,21)
N = 10
INCA = 20
CALL DSWAP (N,A(3,1),INCA,A(6,1),INCA)