# Pack

Copies elements of an array with specified indexing to a vector with unit increment.

## Syntax

Fortran:

call vsPackI( n, a, inca, y )

call vsPackV( n, a, ia, y )

call vsPackM( n, a, ma, y )

call vdPackI( n, a, inca, y )

call vdPackV( n, a, ia, y )

call vdPackM( n, a, ma, y )

C:

vsPackI( n, a, inca, y );

vsPackV( n, a, ia, y );

vsPackM( n, a, ma, y );

vdPackI( n, a, inca, y );

vdPackV( n, a, ia, y );

vdPackM( n, a, ma, y );

## Input Parameters

Name | Type | Description
--- | --- | ---
n | FORTRAN: INTEGER, INTENT(IN). C: int. | Specifies the number of elements to be calculated.
a | FORTRAN: REAL, INTENT(IN) for vspacki, vspackv, vspackm DOUBLE PRECISION, INTENT(IN) for vdpacki, vdpackv, vdpackm. C: const float* for vsPackI, vsPackV, vsPackM const double* for vdPackI, vdPackV, vdPackM | FORTRAN: Array, DIMENSION at least`(1 + (n-1)*inca)` for vspacki/vdpacki, Array, DIMENSION at least `max( n,max(ia[j]) ), j=0, …, n-1` for vspackv/vdpackv , Array, DIMENSION at least n for vspackm/vdpackm. Specifies the input vector a. C: Specifies pointer to an array that contains the input vector a. Size of the array must be: at least`(1 + (n-1)*inca)` for vsPackI/vdPackI, at least `max( n,max(ia[j]) ), j=0, …, n-1` for vsPackV/vdPackV , at least n for vsPackM/vdPackM.
inca | FORTRAN: INTEGER, INTENT(IN) for vspacki, vdpacki. C: int for vsPackI, vdPackI. | Specifies the increment for the elements of a.
ia | FORTRAN: INTEGER, INTENT(IN) for vspackv, vdpackv. C: const int* for vsPackV, vdPackV. | FORTRAN: Array, DIMENSION at least n. Specifies the index vector for the elements of a. C: Specifies the pointer to an array of size at least n that contains the index vector for the elements of a.
ma | FORTRAN: INTEGER, INTENT(IN) for vspackm, vdpackm. C: const int* for vsPackM, vdPackM. | FORTRAN: Array, DIMENSION at least n, Specifies the mask vector for the elements of a. C: Specifies the pointer to an array of size at least n that contains the mask vector for the elements of a.

## Output Parameters

Name | Type | Description
--- | --- | ---
y | FORTRAN: REAL for vspacki, vspackv, vspackm DOUBLE PRECISION for vdpacki, vdpackv, vdpackm. C: float* for vsPackI, vsPackV, vsPackM double* for vdPackI, vdPackV, vdPackM | FORTRAN: Array, DIMENSION at least n. Specifies the output vector y. C: Pointer to an array of size at least n that contains the output vector y.

Parent topic: VML Pack/Unpack Functions