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

96 HP MLIB User’s Guide
SGTHRZ/DGTHRZ/IGTHRZ/CGTHRZ/ZGTHRZ Gather and zero sparse vector
Name SGTHRZ/DGTHRZ/IGTHRZ/CGTHRZ/ZGTHRZ
Gather and zero sparse vector
Purpose Given a real, integer, or complex dense vector y stored in full storage form and a
set of indices of interesting elements of y, these subprograms gather those
elements into a sparse vector x stored in compact form via the set of indices and
then reset those elements of y to zero.
More precisely, let {k
1
, k
2
, ..., k
m
} be the indices of the interesting elements. If x
is represented by arrays x and indx such that indx(i)=k
i
and x(i)=x
k
i
, then
these subprograms simultaneously perform the operations
If all nonzero elements of y are listed in indx, then these subprograms
simultaneously perform the vector operations
Usage VECLIB:
INTEGER*4 m, indx(m)
REAL*4 y(n), x(m)
CALL SGTHRZ(m, y, x, indx)
INTEGER*4 m, indx(m)
REAL*8 y(n), x(m)
CALL DGTHRZ(m, y, x, indx)
INTEGER*4 m, indx(m), y(n), x(m)
CALL IGTHRZ(m, y, x, indx)
INTEGER*4 m, indx(m)
COMPLEX*8 y(n), x(m)
CALL CGTHRZ(m, y, x, indx)
INTEGER*4 m, indx(m)
COMPLEX*16 y(n), x(m)
CALL ZGTHRZ(m, y, x, indx)
VECLIB8:
x
i
y
k
i
=
y
k
i
0=
i 12 m,, ,=
xy
y 0