# NAG Library Routine Document

## 1Purpose

f06erf (ddoti) computes the scalar product of a sparse real vector, stored in compressed form, with a real vector.

## 2Specification

Fortran Interface
 Function f06erf ( nz, x, indx, y)
 Real (Kind=nag_wp) :: f06erf Integer, Intent (In) :: nz, indx(*) Real (Kind=nag_wp), Intent (In) :: x(*), y(*)
#include <nagmk26.h>
 double f06erf_ (const Integer *nz, const double x[], const Integer indx[], const double y[])
The routine may be called by its BLAS name ddoti.

## 3Description

f06erf (ddoti) returns, via the function name, the value of the scalar product
 $xTy = x1 × yindx1 + x2 × yindy2 + ⋯ + xnz × yindxnz$
where $x$ is a sparse real vector, stored in compressed form and $y$ is a real vector in full storage format.

## 4References

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

## 5Arguments

1:     $\mathbf{nz}$ – IntegerInput
On entry: the number of nonzeros in the sparse vector $x$.
2:     $\mathbf{x}\left(*\right)$ – Real (Kind=nag_wp) arrayInput
Note: the dimension of the array x must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{nz}}\right)$.
On entry: the nonzero elements of the sparse vector $x$.
3:     $\mathbf{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 of ${\mathbf{x}}\left(\mathit{i}\right)$ in the sparse vector $x$, for $\mathit{i}=1,2,\dots ,{\mathbf{nz}}$.
4:     $\mathbf{y}\left(*\right)$ – Real (Kind=nag_wp) arrayInput
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.

None.

Not applicable.

## 8Parallelism and Performance

f06erf (ddoti) is not threaded in any implementation.