Developer Reference for Intel® oneAPI Math Kernel Library for C
?gthrz
Gathers a sparse vector’s elements into compressed form, replacing them by zeros.
Syntax
void cblas_sgthrz ( const MKL_INT nz,
float *y,
float *x,
const MKL_INT *indx );
void cblas_sgthrz ( const MKL_INT nz,
double *y,
double *x,
const MKL_INT *indx );
void cblas_cgthrz ( const MKL_INT nz,
void *y,
void *x,
const MKL_INT *indx );
void cblas_zgthrz ( const MKL_INT nz,
void *y,
void *x,
const MKL_INT *indx );
Include Files
mkl.h
Description
The ?gthrz routines gather the elements with indices specified by the array indx from a full-storage vector y into compressed form ( nz, x, indx ) and overwrite the gathered elements of y by zeros. Other elements of y are not referenced or modified (see also ?gthr (which gathers a full-storage sparse vector’s elements into compressed form but does apply zeros to y.) ).
\[x[i] = y[indx[i]]; y[indx[i]] = 0 \text{, for } i=0,1,\dots,nz-1\]
Input Parameters
nz
The number of elements in x and indx and the number of elements to be gathered from y.
indx
Specifies the indices for the elements of x to be gathered from y. Array, size at least nz .
y
Array, size at least \(\max(\text{indx}[i]) + 1\).
Output Parameters
x
Array, size at least nz . Contains the vector converted to the compressed form.
- y
-
The updated vector y.
BLAS 95 Interface Notes
There exist FORTRAN 77 and FORTRAN 95 interfaces for this routine. See the Intel® oneMKL Fortran Developer Reference for details.