Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

SAXPYI(3DXML)  —  Subroutines

Digital

Name

saxpyi, daxpyi, caxpyi, zaxpyi − Vector plus the product of a scalar and a sparse vector

FORMAT

{S,D,C,Z}AXPYI ( nz, alpha, x, indx, y )

Arguments

nzinteger∗4
On entry, the number of elements in the vector in the compressed form.
On exit, nz is unchanged. 

alphareal∗4 | real∗8 | complex∗8 | complex∗16
On entry, the scalar multiplier for the elements of vector x.
On exit, alpha is unchanged. 

xreal∗4 | real∗8 | complex∗8 | complex∗16
On entry, an array of the elements of vector x in compressed form.
On exit, x is unchanged. 

indxinteger∗4
On entry, an array containing the indices of the compressed form.  The values in the INDX array must be distinct for consistent vector or parallel execution.
On exit, indx is unchanged. 

yreal∗4 | real∗8 | complex∗8 | complex∗16
On entry, an array of the elements of vector y stored in full form.
On exit, if nz <= 0 or if alpha = 0, y is unchanged. If nz > 0, the elements in the vector y corresponding to the indices in the INDX array are overwritten. 

Description

The _AXPYI subprograms compute the product of a scalar alpha and a sparse vector x stored in compressed form.  The product is then added to a vector y and the result is stored as an updated vector y in full form.  Only the elements of vector y whose indices are listed in INDX are updated. For i =1, ..., nz:

    y(indx(i)) =  y(indx(i)) + alpha ∗ x(i)

If nz <= 0 or alpha = 0.0, y is unchanged. 

SAXPYI and DAXPYI compute the product of a real scalar and a real sparse vector stored in compressed form, and  add the product to a real vector in full form.  CAXPYI and ZAXPYI compute the product of a complex scalar and a complex sparse vector stored in compressed form, and add the product to a complex vector stored in full form. 

Example

INTEGER NZ, INDX(10)
REAL∗4 Y(40), X(10), ALPHA
NZ = 10
ALPHA = 2.0
CALL SAXPYI(NZ, ALPHA, X, INDX, Y)

This FORTRAN code shows how the nz elements in y, corresponding to the  indices  in the INDX array, are updated  by the addition of a scalar multiple of the corresponding element of the compressed vector, x.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026