HP MLIB User's Guide Vol. 2 7th Ed.
862 HP MLIB User’s Guide
vspacki, vspackv, vspackm, vdpacki, vdpackv, vdpackm Pack (gather) a vector with specified indexing into a
contiguous vector
SUBROUTINE vdpacki(n, a, inca, y)
INTEGER, INTENT(IN) :: n, inca
REAL (KIND=8), DIMENSION(n), INTENT(IN) :: a
REAL (KIND=8), DIMENSION(n), INTENT(OUT):: y
SUBROUTINE vdpackv(n, a, ia, y)
INTEGER, INTENT(IN) :: n
REAL (KIND=8), DIMENSION(n), INTENT(IN) :: a
INTEGER, DIMENSION(n), INTENT(IN) :: ia
REAL (KIND=8), DIMENSION(n), INTENT(OUT):: y
SUBROUTINE vdpackm(n, a, ma, y)
INTEGER, INTENT(IN) :: n
REAL (KIND=8), DIMENSION(n), INTENT(IN) :: a
INTEGER, DIMENSION(n), INTENT(IN) :: ma
REAL (KIND=8), DIMENSION(n), INTENT(OUT):: y
Input n Number of elements to be calculated.
a Array containing the vector to be packed. Length of a is
at least:
1+(n-1)*inca
for vspacki and vdpacki;
1 + the maximum index ia(i) (i=1 to n)
for vspackv and vdpackv;
n
for vspackm and vdpackm.
inca Index increment for vspacki and vdpacki.
ia Array containing the index vector for vspackv and
vdpackv. Length of ia is at least n.
ma Array containing the mask vector for vspackm and
vdpackm. Length of ma is at least n.
Output y Array receiving the contiguous output vector. Length of
y is at least n for vspacki, vdpacki, vspackv, and
vdpackv; and at least the number (at most n) of
non-zero elements in the mask array ma for vspackm
and vdpackm.