Weighted dot product | SWDOT/DWDOT/CWDOTC/CWDOTU/ZWDOTC/ZWDOTU |
Example 1 Compute the REAL*8 weighted dot product | |
| 10 |
s = | ∑ wi xi yi, |
| i = 1 |
where w, x, and y are vectors 10 elements long stored in
INTEGER*4 N,INCW,INCX,INCY
REAL*8 | S,DWDOT,W(20),X(20),Y(20) |
N = 10 |
|
INCW = 1 |
|
INCX = 1
INCY = 1
S = DWDOT (N,W,INCW,X,INCX,Y,INCY)
Example 2 Compute the REAL*8 weighted dot product
10
s = ∑ wi xi yi,
i = 1
where w and y are vectors 10 elements long stored in
INTEGER*4 | N | |
REAL*8 | S,DWDOT,W(20),X(20,21),Y(20) | |
N = | 10 |
|
S = | DWDOT (N,W,1,X(I,1),20,Y,1) |
Chapter 2 Basic Vector Operations 149