SGTHR/DGTHR/IGTHR/CGTHR/ZGTHR

Gather sparse vector

Name SGTHR/DGTHR/IGTHR/CGTHR/ZGTHR

Gather 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.

More precisely, let {k1, k2, ..., km} be the indices of the interesting elements. If x is represented by arrays x and indx such that indx(i) = ki and x(i) = xki, then

xi = yki, i = 1, 2, …, m.

Usage

VECLIB:

 

 

INTEGER*4

m, indx(m)

 

REAL*4

y(n), x(m)

 

CALL SGTHR(m, y, x, indx)

 

INTEGER*4

m, indx(m)

 

REAL*8

y(n), x(m)

 

CALL DGTHR(m, y, x, indx)

 

INTEGER*4

m, indx(m), y(n), x(m)

 

CALL IGTHR(m, y, x, indx)

 

INTEGER*4

m, indx(m)

 

COMPLEX*8

y(n), x(m)

 

CALL CGTHR(m, y, x, indx)

 

INTEGER*4

m, indx(m)

 

COMPLEX*16

y(n), x(m)

CALL ZGTHR(m, y, x, indx)

VECLIB8:

INTEGER*8

m, indx(m)

REAL*4

y(n), x(m)

CALL SGTHR(m, y, x, indx)

INTEGER*8

m, indx(m)

REAL*8

y(n), x(m)

CALL DGTHR(m, y, x, indx)

INTEGER*8

m, indx(m), y(n), x(m)

CALL IGTHR(m, y, x, indx)

94HP MLIB User’s Guide