These subprograms multiply sparse vector x, stored in
compressed-vector storage mode, by scalar alpha, add it to sparse vector
y, stored in full-vector storage mode, and store the result in
vector y.
| alpha, x, y | Subprogram |
| Short-precision real | SAXPYI |
| Long-precision real | DAXPYI |
| Short-precision complex | CAXPYI |
| Long-precision complex | ZAXPYI |
| Fortran | CALL SAXPYI | DAXPYI | CAXPYI | ZAXPYI (nz, alpha, x, indx, y) |
| C and C++ | saxpyi | daxpyi | caxpyi | zaxpyi (nz, alpha, x, indx, y); |
| PL/I | CALL SAXPYI | DAXPYI | CAXPYI | ZAXPYI (nz, alpha, x, indx, y); |
Specified as: a one-dimensional array of (at least) length nz, containing fullword integers.
Returned as: a one-dimensional array, containing numbers of the data type indicated in Table 60.
The computation is expressed as follows:
where:
See reference [29]. If alpha or nz is zero, no computation is performed. For SAXPYI and CAXPYI, intermediate results are accumulated in long-precision.
None
nz < 0
This example shows how to use SAXPYI to perform a computation using a sparse vector x of length 5, where the elements of array INDX are in ascending order.
NZ ALPHA X INDX Y
| | | | |
CALL SAXPYI( 5 , 2.0 , 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)
Y = (3.0, 5.0, 8.0, 9.0, 6.0, 10.0, 6.0, 8.0, 9.0, 10.0)
This example shows how to use SAXPYI to perform a computation using a sparse vector x of length 5, where the elements of array INDX are in random order.
NZ ALPHA X INDX Y
| | | | |
CALL SAXPYI( 5 , 2.0 , 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)
Y = (7.0, 5.0, 8.0, 5.0, 6.0, 10.0, 8.0, 8.0, 9.0, 8.0)
This example shows how to use CAXPYI to perform a computation using a sparse vector x of length 3, where the elements of array INDX are in random order.
NZ ALPHA X INDX Y
| | | | |
CALL CAXPYI( 3 , ALPHA , X , INDX , Y )
ALPHA = (2.0, 3.0)
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))
Y = ((0.0, 22.0), (-2.0, 3.0), (7.0, 31.0), (5.0, 7.0))