SDOTI, DDOTI, CDOTUI, and ZDOTUI compute the dot product of sparse vector x, stored in compressed-vector storage mode, and full vector y, stored in full-vector storage mode.
CDOTCI and ZDOTCI compute the dot product of the complex conjugate of
sparse vector x, stored in compressed-vector storage mode, and full
vector y, stored in full-vector storage mode.
x, y, Result | Subprogram |
Short-precision real | SDOTI |
Long-precision real | DDOTI |
Short-precision complex | CDOTUI |
Long-precision complex | ZDOTUI |
Short-precision complex | CDOTCI |
Long-precision complex | ZDOTCI |
Fortran | SDOTI | DDOTI | CDOTUI | ZDOTUI | CDOTCI | ZDOTCI (nz, x, indx, y) |
C and C++ | sdoti | ddoti | cdotui | zdotui | cdotci | zdotci (nz, x, indx, y); |
PL/I | SDOTI | DDOTI | CDOTUI | ZDOTUI | CDOTCI | ZDOTCI (nz, x, indx, y); |
Specified as: a one-dimensional array of (at least) length nz, containing fullword integers.
Returned as: a number of the data type indicated in Table 61.
For SDOTI, DDOTI, CDOTUI, and ZDOTUI, the dot product computation is expressed as follows:
For CDOTCI and ZDOTCI, the dot product computation is expressed as follows:
where:
x is a sparse vector, stored in compressed-vector storage mode.
INDX is the indices array for sparse vector x.
y is a sparse vector, stored in full-vector storage mode.
See reference [29]. The result is returned as the function value. If nz is 0, then zero is returned as the value of the function.
For SDOTI, CDOTUI, and CDOTCI, intermediate results are accumulated in long-precision.
None
nz < 0
This example shows how to use SDOTI to compute a dot product using a sparse vector x of length 5, where the elements of array INDX are in ascending order.
NZ X INDX Y | | | | DOTT = SDOTI( 5 , X , INDX , Y ) X = (1.0, 2.0, 3.0, 4.0, 5.0) INDX = (1, 3, 4, 7, 10) Y = (1.0, 5.0, 4.0, 3.0, 6.0, 10.0, -2.0, 8.0, 9.0, 0.0)
DOTT = (1.0 + 8.0 + 9.0 -8.0 + 0.0) = 10.0
This example shows how to use SDOTI to compute a dot product using a sparse vector x of length 5, where the elements of array INDX are in random order.
NZ X INDX Y | | | | DOTT = SDOTI( 5 , X , INDX , Y ) X = (1.0, 2.0, 3.0, 4.0, 5.0) INDX = (4, 3, 1, 10, 7) Y = (1.0, 5.0, 4.0, 3.0, 6.0, 10.0, -2.0, 8.0, 9.0, 0.0)
DOTT = (3.0 + 8.0 + 3.0 + 0.0 -10.0) = 4.0
This example shows how to use CDOTUI to compute a dot product using a sparse vector x of length 3, where the elements of array INDX are in ascending order.
NZ X INDX Y | | | | DOTT = CDOTUI( 3 , X , INDX , Y ) X = ((1.0, 2.0), (3.0, 4.0), (5.0, 6.0)) INDX = (1, 3, 4) Y = ((6.0, 5.0), (-2.0, 3.0), (15.0, 4.0), (9.0, 0.0))
DOTT = (70.0, 143.0)
This example shows how to use CDOTCI to compute a dot product using the complex conjugate of a sparse vector x of length 3, where the elements of array INDX are in random order.
NZ X INDX Y | | | | DOTT = CDOTCI( 3 , X , INDX , Y ) X = ((1.0, 2.0), (3.0, 4.0), (5.0, 6.0)) INDX = (4, 1, 3) Y = ((6.0, 5.0), (-2.0, 3.0), (15.0, 4.0), (9.0, 0.0))
DOTT = (146.0, -97.0)