HP MLIB User's Guide Vol. 1 7th Ed.
Chapter 2 Basic Vector Operations 187
Permute vector F_SPERMUTE/F_DPERMUTE/F_CPERMUTE/F_ZPERMUTE
Name F_SPERMUTE/F_DPERMUTE/F_CPERMUTE/F_ZPERMUTE
Permute vector
Purpose F_xPERMUTE permutes the entries of a vector x according to the permutation
vector p. If n is less than or equal to zero, the routine returns immediately.
An n-by-n permutation matrix P is represented as a product of at most
n interchange permutations. An interchange permutation E is a permutation
obtained by swapping two rows of the identity matrix. An efficient way to
represent a general permutation matrix P is with an integer vector p of
length n. In other words, P = E
n
...E
1
and each E
i
is the identity with rows i and
p
i
interchanged:
For i = n to 1 and incp < 0,
For i = 1 to n and incp > 0,
Usage VECLIB:
INTEGER*4 INCP, INCX, N
INTEGER P( * )
REAL*4 X( * )
SUBROUTINE F_SPERMUTE (N, P, INCP, X, INCX)
INTEGER*4 INCP, INCX, N
INTEGER P( * )
REAL*8 X( * )
SUBROUTINE F_DPERMUTE (N, P, INCP, X, INCX)
INTEGER*4 INCP, INCX, N
INTEGER P( * )
COMPLEX*8 X( * )
SUBROUTINE F_CPERMUTE (N, P, INCP, X, INCX)
INTEGER*4 INCP, INCX, N
INTEGER P( * )
COMPLEX*16 X( * )
SUBROUTINE F_ZPERMUTE (N, P, INCP, X, INCX)
VECLIB8:
INTEGER*8 INCP, INCX, N
INTEGER P( * )
REAL*4 X( * )
SUBROUTINE F_SPERMUTE (N, P, INCP, X, INCX)
xi() xpi()()↔
xi() xpi()()↔