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

Chapter 12 VMATH 829
Pack (gather) a vector with specified indexing into a contiguous vector vsPackI, vsPackV, vsPackM, vdPackI,
vdPackV, vdPackM
Name vsPackI, vsPackV, vsPackM, vdPackI, vdPackV, vdPackM
Pack (gather) a vector with specified indexing into a contiguous vector
Purpose vsPackI and vdPackI pack the vector of n elements stored (forward) with
increment inca in array a into a contiguous vector in array y:
y[i] = a[i*inca], for i = 0 to n-1
vsPackV and vdPackV pack the vector of elements in array a, with index vector
in array ia, into a contiguous vector in array y:
y[i] = a[ia[i]], for i = 0 to n-1
vsPackM and vdPackM pack the vector of elements in array a, specified by the
mask vector of n elements stored in array ma, into a contiguous vector in array
y:
initialize j = 0
if (m[i])
then y[j] = a[i] and j = j+1, for i = 0 to n-1
Usage VMATH:
#include <vmath.h>
void vsPackI (int n, const float a[ ], int inca, float y [ ] ) ;
void vsPackV (int n, const float a[ ], const int ia[ ], float y [ ] );
void vsPackM (int n, const float a[ ], const int ma[ ], float y [ ] );
void vdPackI (int n, const double a[ ], int inca, double y [ ] ) ;
void vdPackV (int n, const double a[ ], const int ia[ ], double y [ ] );
void vdPackM (int n, const double a[ ], const int ma[ ], double y [ ] );
VMATH8:
#include <vmath8.h>
void vsPackI (long long n, const float a[ ], long long inca, float y [ ] ) ;
void vsPackV (long long n, const float a[ ], const int ia[ ], float y [ ] );
void vsPackM (long long n, const float a[ ], const int ma[ ], float y [ ] );
void vdPackI (long long n, const double a[ ], long long inca, double
y [ ] ) ;
void vdPackV (long long n, const double a[ ], const long long ia[ ], double
y [ ] );
void vdPackM (long long n, const double a[ ], const long long ma[ ], dou-
ble
y [ ] );
Input n Number of elements to be calculated.
a Array containing the vector to be packed. Length of a is
at least: