SGTHRZ(3)    SPARSE BLAS routine of NEC Numeric Library Collection   SGTHRZ(3)



NAME
       SGTHRZ - Gather a vector into compressed form

SYNOPSIS
       SUBROUTINE SGTHRZ( NZ, Y, X, INDX )

           INTEGER        NZ, INDX

           REAL           Y, X

PURPOSE
       Gather(copy)  the specified components of a vector stored in full-stor-
       age form into compressed form and zero the gathered components  of  the
       full-form vector. If all nonzero components of Y appear in INDX, a com-
       mon occurence in the use of a single uncompressed scratch vector,  then
       SGTHRZ simultaneously performs

                     x := y
                     y := 0

       This is specified by the following:

                X(I) = Y( INDX(I) )

                Y( INDX(I) ) = 0.0

                for I = 1, ..., NZ.

       In  typical use of full-form temporary vectors, the vector is initially
       set to zero. SSCTR is used to initialize the  interesting  entries  for
       processing. At the completion of processing, SGTHRZ is used to move the
       interesting values back into the sparse data structures and  simultane-
       ously  reset the full-form vector to its initial, zero, state for later
       use.

       The values of INDX must be distinct to allow consistent vector or  par-
       allel  execution  since  otherwise  the  indeterminacy  in the order of
       accessing elements of Y and resetting them to zero makes X ambiguous.


ARGUMENTS
       NZ      (input) INTEGER
               Number of elements in the compressed form.

       INDX    (input) INTEGER
               Array containing the indices of the values to be gathered  into
               compressed form.

       Y       (input and output) REAL
               Array,  on  input,  which contains the vector Y in full storage
               form. The gathered components in Y are set to  zero.  Only  the
               elements corresponding to the indices in INDX will be accessed.

       X       (output) REAL
               Array containing the values gathered into the compressed  form.

FURTHER DETAILS
       Sparse  BLAS  algorithm  is  from  ACM  algorithm  692 by D. Dodson, R.
       Grimes, and J. Lewis.




SPARSE BLAS routine             31 October 2017                      SGTHRZ(3)