These subprograms gather specified elements of sparse vector y,
stored in full-vector storage mode, into sparse vector x, stored in
compressed-vector storage mode, and zero the same specified elements of vector
y.
x, y | Subprogram |
Short-precision real | SGTHRZ |
Long-precision real | DGTHRZ |
Short-precision complex | CGTHRZ |
Long-precision complex | ZGTHRZ |
Fortran | CALL SGTHRZ | DGTHRZ | CGTHRZ | ZGTHRZ (nz, y, x, indx) |
C and C++ | sgthrz | dgthrz | cgthrz | zgthrz (nz, y, x, indx); |
PL/I | CALL SGTHRZ | DGTHRZ | CGTHRZ | ZGTHRZ (nz, y, x, indx); |
Specified as: a one-dimensional array of (at least) length max(INDX(i)) for i = 1, nz, containing numbers of the data type indicated in Table 59.
Specified as: a one-dimensional array of (at least) length nz, containing fullword integers.
Returned as: a one-dimensional array, containing numbers of the data type indicated in Table 59.
Returned as: a one-dimensional array of (at least) length nz, containing numbers of the data type indicated in Table 59.
The copy is expressed as follows:
where:
See reference [29]. If nz is 0, no computation is performed.
None
nz < 0
This example shows how to use SGTHRZ to copy specified elements of a vector y into a sparse vector x of length 5, where the elements of array INDX are in ascending order.
NZ Y X INDX | | | | CALL SGTHRZ( 5 , Y , X , INDX ) Y = (6.0, 2.0, 4.0, 7.0, 6.0, 10.0, -2.0, 8.0, 9.0, 0.0) INDX = (1, 3, 4, 7, 9)
Y = (0.0, 2.0, 0.0, 0.0, 6.0, 10.0, 0.0, 8.0, 0.0, 0.0) X = (6.0, 4.0, 7.0, -2.0, 9.0)
This example shows how to use SGTHRZ to copy specified elements of a vector y into a sparse vector x of length 5, where the elements of array INDX are in random order. (Note that the element 0.0 occurs in output vector x. This does not produce an error.)
NZ Y X INDX | | | | CALL SGTHRZ( 5 , Y , X , INDX ) Y = (6.0, 2.0, 4.0, 7.0, 6.0, 10.0, -2.0, 8.0, 9.0, 0.0) INDX = (4, 3, 1, 10, 7)
Y = (0.0, 2.0, 0.0, 0.0, 6.0, 10.0, 0.0, 8.0, 9.0, 0.0) X = (7.0, 4.0, 6.0, 0.0, -2.0)
This example shows how to use CGTHRZ to copy specified elements of a vector y into a sparse vector x of length 3, where the elements of array INDX are in random order.
NZ Y X INDX | | | | CALL CGTHRZ( 3 , Y , X , INDX ) Y = ((6.0, 5.0), (-2.0, 3.0), (15.0, 4.0), (9.0, 0.0)) INDX = (4, 1, 3)
Y = ((0.0, 0.0), (-2.0, 3.0), (0.0, 0.0), (0.0, 0.0)) X = ((9.0, 0.0), (6.0, 5.0), (15.0, 4.0))