CXML
sdoti, ddoti, cdotui, zdotui, cdotci, zdotci
Inner product of a vector
and a sparse vector
FORMAT
{S,D}DOTI ( nz, x, indx, y )
{C,Z}DOT{U,C}I ( nz, x, indx, y )
Function Value
dotpr real*4 | real*8 | complex*8 | complex*16
The inner product of the sparse vector x and the full
vector y.
Arguments
nz integer*4
On entry, the number of elements in the vector in the
compressed form.
On exit, nz is unchanged.
x real*4 | real*8 | complex*8 | complex*16
On entry, an array of the elements of vector x in
compressed form.
On exit, x is unchanged.
indx integer*4
On entry, an array containing the indices of the
compressed form.
On exit, indx is unchanged.
y real*4 | real*8 | complex*8 | complex*16
On entry, an array of the elements of vector y stored
in full form.
On exit, y is unchanged. Only the elements in the
vector y corresponding to the indices in the INDX array
are accessed.
Description
These routines compute the vector inner product of a sparse vector x stored
in compressed form with a vector y stored in full form. If nz <=0, dotpr
is set equal to zero.
SDOTI and DDOTI multiply a real vector by a sparse vector of real values
stored in compressed form. CDOTUI and ZDOTUI multiply a complex vector by
an unconjugated sparse vector of complex values stored in compressed form.
CDOTCI and ZDOTCI multiply a complex vector by a conjugated sparse vector
of complex values stored in compressed form.
CDOTUI and ZDOTUI operate on the vector x in the unconjugated form; CDOTCI
and ZDOTCI operate on the vector x in conjugated form.
(Unconjugated form:)
dotpr = SUM(i=1...nz,x(i) * y(indx(i))
(Conjugated form:)
dotpr = SUM(i=1...nz,conjugate(x(i)) * y(indx(i))
The order of operations for the evaluation of dotpr may be different from
the sequential order of operations. The results obtained from these two
evaluations may not be identical.
Example
INTEGER NZ, INDX(15)
COMPLEX*8 Y(50), X(15)
NZ = 10
CINNER = CDOTUI(NZ, X, INDX, Y)
This FORTRAN code produces the inner product of two vectors, x and y. y is
stored in full form and x is stored in compressed form. The elements of
vector x are used in unconjugated form.
CXML Home Page Index of CXML Routines