Sparse dot product

SDOTI/DDOTI/CDOTCI/CDOTUI/ZDOTCI/ZDOTUI

Example

Compute the REAL*8 sparse dot product

 

 

10

 

s =

xi yi,

 

 

i = 1

 

where x is a sparse vector with interesting elements x1, x4, x5, and x9 stored in

 

one-dimensional array X, and y is a vector 10 elements long stored in a

 

one-dimensional array Y of dimension 20.

INTEGER*4

M,INDX(4)

REAL*8

S,DDOTI,X(4),Y(20)

DATA

INDX / 1, 4, 5, 9 /

M =

4

 

S =

DDOTI (M,X,INDX,Y)

Chapter 2 Basic Vector Operations 91