{S,D,C,Z}GTHR ( nz, y, x, indx )
nz integer*4 On entry, the number of elements to be gathered into the compressed form. On exit, nz is unchanged. y real*4 | real*8 | complex*8 | complex*16 On entry, an array of the elements of vector y stored in full form. On exit, y is unchanged. Only the elements in the vector y corresponding to the indices in the INDX array are accessed. x real*4 | real*8 | complex*8 | complex*16 On entry, an array that receives the specified elements of the vector y. On exit, if nz <= 0, x is unchanged. If nz > 0, array X contains the values gathered into compressed form. indx integer*4 On entry, an array containing the indices of the values to be gathered into compressed form. On exit, indx is unchanged.
The _GTHR subprograms gather specified elements from a vector in full form, y, and store them as a vector x in compressed form. For i = 1, ..., nz: x(i) = y (indx(i)) If nz <= 0, x is unchanged. SGTHR and DGTHR gather the specified elements from a real vector in full form and store them as a real sparse vector in compressed form. CGTHR and ZGTHR gather the specified elements from a complex vector in full form and store them as a complex sparse vector in compressed form.
INTEGER NZ, INDX(10) REAL*4 Y(40), X(10) NZ = 10 CALL SGTHR(NZ, Y, X, INDX) This FORTRAN code shows how the nz elements of the vector y, corresponding to the indices in the INDX array, are gathered in a compressed form into the vector x.