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

n

 

n

s = xi yi

and

s =

x

i yi

i = 1

 

i = 1

where x is the complex conjugate of x.

More precisely, let x be a sparse n-vector with m n interesting (usually nonzero) elements, let {k1, k2, ..., km} 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) = ki and x(i) = xki , then these subprograms compute

 

m

 

m

 

s = xi yki

and

s =

x

i yki

 

i = 1

 

i = 1

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)

88HP MLIB User’s Guide