HP MLIB User's Guide Vol. 1 7th Ed.
88 HP MLIB User’s Guide
SDOTI/DDOTI/CDOTCI/CDOTUI/ZDOTCI/ZDOTUI Sparse dot product
Name SDOTI/DDOTI/CDOTCI/CDOTUI/ZDOTCI/ZDOTUI
Sparse dot product
Purpose Given a real or complex sparse vector x stored in compact form via an index
vector and a dense vector y stored in full storage form, these subprograms
compute the sparse dot products
where is the complex conjugate of x.
More precisely, let x be a sparse n-vector with m ≤ n interesting (usually
nonzero) elements, let {k
1
, k
2
, ..., k
m
} be the indices of these elements. (While
some interesting elements of x can be zero, all uninteresting elements are
assumed to be zero.) Let y be an ordinary n-vector. If x is represented by arrays
x and indx such that indx(i)=k
i
and x(i)=x
k
i
, then these subprograms
compute
Usage VECLIB:
INTEGER*4 m, indx(m)
REAL*4 s, SDOTI, x(m), y(n)
s = SDOTI(m, x, indx, y)
INTEGER*4 m, indx(m)
REAL*8 s, DDOTI, x(m), y(n)
s = DDOTI(m, x, indx, y)
INTEGER*4 m, indx(m)
COMPLEX*8 s, CDOTCI, x(m), y(n)
s = CDOTCI(m, x, indx, y)
INTEGER*4 m, indx(m)
COMPLEX*8 s, CDOTUI, x(m), y(n)
s = CDOTUI(m, x, indx, y)
INTEGER*4 m, indx(m)
COMPLEX*16 s, ZDOTCI, x(m), y(n)
s = ZDOTCI(m, x, indx, y)
sx
i
y
i
i 1=
n
∑
= and sx
i
y
i
i 1=
n
∑
=
x
sx
i
y
k
i
i 1=
m
∑
= and sx
i
y
k
i
i 1=
m
∑
=