HP MLIB User's Guide Vol. 1 7th Ed.

Chapter 3 Basic Matrix Operations 249
Matrix-vector multiply SSPMV/DSPMV/CHPMV/ZHPMV
Name SSPMV/DSPMV/CHPMV/ZHPMV
Matrix-vector multiply
Purpose These subprograms compute the matrix-vector product Ax, where A is an
n-by-n real symmetric or complex Hermitian matrix stored in packed form as
described in “Matrix Storage,” and x is a real or complex n-vector. The product
can be stored in the result array, or, optionally, be added to or subtracted from
it. This is handled in a convenient, but general, way by two scalar arguments, α
and β, which are used as multipliers of the matrix-vector product and the result
vector. Specifically, these subprograms compute the matrix-vector product of
the form:
The structure of A is indicated by the name of the subprogram used:
Refer to “F_SSPMV/F_DSPMV/F_CSPMV/F_ZSPMV” on page 381 and
“F_CHPMV/F_ZHPMV” on page 348 for a description of the equivalent BLAS
Standard subprograms.
Matrix
Storage
Because either triangle of A can be obtained from the other, you only need to
provide one triangle of A, either the upper or the lower triangle. Compared to
storing the entire matrix, you save memory by supplying that triangle stored
column-by-column in packed form in a 1-dimensional array.
The following examples illustrate the packed storage of symmetric or
Hermitian matrices.
Upper triangular storage
If the upper triangle of A is
then A is packed column-by-column into an array ap as follows:
Upper triangular matrix element a
ij
is stored in array element ap(i+(j×(j1))/2).
SSPMV or DSPMV A is a real symmetric matrix
CHPMV or ZHPMV A is a complex Hermitian matrix
yaAx←βy.+
11 12 13 14
22 23 24
33 34
44
k 12345678910
ap(k) 11122213233314243444