F06EVF (DGTHRZ) (PDF version)
F06 Chapter Contents
F06 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentF06EVF (DGTHRZ)

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

## 1  Purpose

F06EVF (DGTHRZ) gathers specified (usually nonzero) elements of a real vector $y$ in full storage form into a sparse real vector $x$ in compressed form. The specified elements of $y$ are set to zero.

## 2  Specification

 SUBROUTINE F06EVF ( NZ, Y, X, INDX)
 INTEGER NZ, INDX(*) REAL (KIND=nag_wp) Y(*), X(*)
The routine may be called by its BLAS name dgthrz.

## 3  Description

F06EVF (DGTHRZ) gathers the specified elements of a vector, $y$, in full storage form, into the equivalent sparse vector compressed form. The gathered elements of $y$ are set to zero.
Dodson D S, Grimes R G and Lewis J G (1991) Sparse extensions to the Fortran basic linear algebra subprograms ACM Trans. Math. Software 17 253–263

## 5  Parameters

1:     $\mathrm{NZ}$ – INTEGERInput
On entry: the number of nonzeros in the compressed sparse vector $x$.
2:     $\mathrm{Y}\left(*\right)$ – REAL (KIND=nag_wp) arrayInput/Output
Note: the dimension of the array Y must be at least $\underset{\mathit{k}}{\mathrm{max}}\phantom{\rule{0.25em}{0ex}}\left\{{\mathbf{INDX}}\left(\mathit{k}\right)\right\}$.
On entry: the vector $y$. Only elements corresponding to indices in INDX are accessed.
On exit: the elements of $y$ corresponding to indices in INDX are set to zero.
3:     $\mathrm{X}\left(*\right)$ – REAL (KIND=nag_wp) arrayOutput
Note: the dimension of the array X must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{NZ}}\right)$.
On exit: the compressed vector $x$.
4:     $\mathrm{INDX}\left(*\right)$ – INTEGER arrayInput
Note: the dimension of the array INDX must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{NZ}}\right)$.
On entry: ${\mathbf{INDX}}\left(\mathit{i}\right)$ must contain the index ${\mathbf{Y}}\left(\mathit{i}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{NZ}}$, which is to be gathered into $x$.
Constraint: the indices must be distinct.

None.

Not applicable.

Not applicable.

None.

## 10  Example

None.

F06EVF (DGTHRZ) (PDF version)
F06 Chapter Contents
F06 Chapter Introduction
NAG Library Manual