SSPMV, DSPMV, CHPMV, ZHPMV, SSYMV, DSYMV, CHEMV, and ZHEMV compute the matrix-vector product for either a real symmetric matrix or a complex Hermitian matrix, using the scalars alpha and beta, matrix A, and vectors x and y:
SSLMX and DSLMX compute the matrix-vector product for a real symmetric matrix, using the scalar alpha, matrix A, and vectors x and y:
The following storage modes are used:
alpha, beta, A, x, y | Subprogram |
Short-precision real | SSPMV, SSYMV, and SSLMX |
Long-precision real | DSPMV, DSYMV, and DSLMX |
Short-precision complex | CHPMV and CHEMV |
Long-precision complex | ZHPMV and ZHEMV |
Fortran | CALL SSPMV | DSPMV | CHPMV | ZHPMV (uplo, n,
alpha, ap, x, incx, beta,
y, incy)
CALL SSYMV | DSYMV | CHEMV | ZHEMV (uplo, n, alpha, a, lda, x, incx, beta, y, incy) CALL SSLMX | DSLMX (n, alpha, ap, x, incx, y, incy) |
C and C++ | sspmv | dspmv | chpmv | zhpmv (uplo, n, alpha,
ap, x, incx, beta, y,
incy);
ssymv | dsymv | chemv | zhemv (uplo, n, alpha, a, lda, x, incx, beta, y, incy); sslmx | dslmx (n, alpha, ap, x, incx, y, incy); |
PL/I | CALL SSPMV | DSPMV | CHPMV | ZHPMV (uplo, n,
alpha, ap, x, incx, beta,
y, incy);
CALL SSYMV | DSYMV | CHEMV | ZHEMV (uplo, n, alpha, a, lda, x, incx, beta, y, incy); CALL SSLMX | DSLMX (n, alpha, ap, x, incx, y, incy); |
If uplo = 'U', A is stored in upper-packed or upper storage mode.
If uplo = 'L', A is stored in lower-packed or lower storage mode.
Specified as: a single character. It must be 'U' or 'L'.
For SSPMV and DSPMV, ap is the real symmetric matrix A of order n, stored in upper- or lower-packed storage mode.
For CHPMV and ZHPMV, ap is the complex Hermitian matrix A of order n, stored in upper- or lower-packed storage mode.
For SSLMX and DSLMX, ap is the real symmetric matrix A of order n, stored in lower-packed storage mode.
Specified as: a one-dimensional array of (at least) length n(n+1)/2, containing numbers of the data type indicated in Table 64.
For SSYMV and DSYMV, a is the real symmetric matrix A of order n, stored in upper or lower storage mode.
For CHEMV and ZHEMV, a is the complex Hermitian matrix A of order n, stored in upper or lower storage mode.
Specified as: an lda by (at least) n array, containing numbers of the data type indicated in Table 64.
For SSPMV, DSPMV, CHPMV, ZHPMV, SSYMV, DSYMV, CHEMV, and ZHEMV, incx < 0 or incx > 0.
For SSLMX and DSLMX, incx can have any value.
These subroutines perform the computations described in the two sections below. See references [34], [35], and [79]. For SSPMV, DSPMV, CHPMV, ZHPMV, SSYMV, DSYMV, CHEMV, and ZHEMV, if n is zero or if alpha is zero and beta is one, no computation is performed. For SSLMX and DSLMX, if n or alpha is zero, no computation is performed.
For SSLMX, SSPMV, SSYMV, CHPMV, and CHEMV, intermediate results are accumulated in long precision. However, several intermediate stores may occur for each element of the vector y.
These subroutines compute the matrix-vector product for either a real symmetric matrix or a complex Hermitian matrix:
where:
It is expressed as follows:
These subroutines compute the matrix-vector product for a real symmetric matrix stored in lower-packed storage mode:
where:
It is expressed as follows:
None
This example shows vectors x and y with positive strides and a real symmetric matrix A of order 3, stored in lower-packed storage mode. Matrix A is:
* * | 8.0 4.0 2.0 | | 4.0 6.0 7.0 | | 2.0 7.0 3.0 | * *
UPLO N ALPHA AP X INCX BETA Y INCY | | | | | | | | | CALL SSPMV( 'L' , 3 , 1.0 , AP , X , 1 , 1.0 , Y , 2 ) AP = (8.0, 4.0, 2.0, 6.0, 7.0, 3.0) X = (3.0, 2.0, 1.0) Y = (5.0, . , 3.0, . , 2.0)
Y = (39.0, . , 34.0, . , 25.0)
This example shows vector x and y having strides of opposite signs. For x, which has negative stride, processing begins at element X(5), which is 1.0. The real symmetric matrix A of order 3 is stored in upper-packed storage mode. It uses the same input matrix A as in Example 1.
UPLO N ALPHA AP X INCX BETA Y INCY | | | | | | | | | CALL SSPMV( 'U' , 3 , 1.0 , AP , X , -2 , 2.0 , Y , 1 ) AP = (8.0, 4.0, 6.0, 2.0, 7.0, 3.0) X = (4.0, . , 2.0, . , 1.0) Y = (6.0, 5.0, 4.0)
Y = (36.0, 54.0, 36.0)
This example shows vector x and y with positive stride and a complex Hermitian matrix A of order 3, stored in lower-packed storage mode. Matrix A is:
* * | (1.0, 0.0) (3.0, 5.0) (2.0, -3.0) | | (3.0, -5.0) (7.0, 0.0) (4.0, -8.0) | | (2.0, 3.0) (4.0, 8.0) (6.0, 0.0) | * *
UPLO N ALPHA AP X INCX BETA Y INCY | | | | | | | | | CALL CHPMV( 'L' , 3 , ALPHA , AP , X , 1 , BETA , Y , 2 )
ALPHA = (1.0, 0.0) AP = ((1.0, . ), (3.0, -5.0), (2.0, 3.0), (7.0, . ), (4.0, 8.0), (6.0, . )) X = ((1.0, 2.0), (4.0, 0.0), (3.0, 4.0)) BETA = (1.0, 0.0) Y = ((1.0, 0.0), . , (2.0, -1.0), . , (2.0, 1.0))
Y = ((32.0, 21.0), . , (87.0, -8.0), . , (32.0, 64.0))
This example shows vector x and y having strides of opposite signs. For x, which has negative stride, processing begins at element X(5), which is (1.0, 2.0). The complex Hermitian matrix A of order 3 is stored in upper-packed storage mode. It uses the same input matrix A as in Example 3.
UPLO N ALPHA AP X INCX BETA Y INCY | | | | | | | | | CALL CHPMV( 'U' , 3 , ALPHA , AP , X , -2 , BETA , Y , 2 )
Y = ((31.0, 21.0), . , (85.0, -7.0), . , (30.0, 63.0))
This example shows vectors x and y with positive strides and a real symmetric matrix A of order 3, stored in lower storage mode. It uses the same input matrix A as in Example 1.
UPLO N ALPHA A LDA X INCX BETA Y INCY | | | | | | | | | | CALL SSYMV( 'L' , 3 , 1.0 , A , 3 , X , 1 , 1.0 , Y , 2 ) * * | 8.0 . . | A = | 4.0 6.0 . | | 2.0 7.0 3.0 | * * X = (3.0, 2.0, 1.0) Y = (5.0, . , 3.0, . , 2.0)
Y = (39.0, . , 34.0, . , 25.0)
This example shows vector x and y having strides of opposite signs. For x, which has negative stride, processing begins at element X(5), which is 1.0. The real symmetric matrix A of order 3 is stored in upper storage mode. It uses the same input matrix A as in Example 1.
UPLO N ALPHA A LDA X INCX BETA Y INCY | | | | | | | | | | CALL SSYMV( 'U' , 3 , 1.0 , A , 4 , X , -2 , 2.0 , Y , 1 ) * * | 8.0 4.0 2.0 | A = | . 6.0 7.0 | | . . 3.0 | | . . . | * * X = (4.0, . , 2.0, . , 1.0) Y = (6.0, 5.0, 4.0)
A = (36.0, 54.0, 36.0)
This example shows vector x and y with positive stride and a complex Hermitian matrix A of order 3, stored in lower storage mode. It uses the same input matrix A as in Example 3.
UPLO N ALPHA A LDA X INCX BETA Y INCY | | | | | | | | | | CALL CHEMV( 'L' , 3 , ALPHA , A , 3 , X , 1 , BETA , Y , 2 ) ALPHA = (1.0, 0.0) * * | (1.0, . ) . . | A = | (3.0, -5.0) (7.0, . ) . | | (2.0, 3.0) (4.0, 8.0) (6.0, . ) | * * X = ((1.0, 2.0), (4.0, 0.0), (3.0, 4.0)) BETA = (1.0, 0.0) Y = ((1.0, 0.0), . , (2.0, -1.0), . , (2.0, 1.0))
Y = ((32.0, 21.0), . , (87.0, -8.0), . , (32.0, 64.0))
This example shows vector x and y having strides of opposite signs. For x, which has negative stride, processing begins at element X(5), which is (1.0, 2.0). The complex Hermitian matrix A of order 3 is stored in upper storage mode. It uses the same input matrix A as in Example 3.
UPLO N ALPHA A LDA X INCX BETA Y INCY | | | | | | | | | | CALL CHEMV( 'U' , 3 , ALPHA , A , 3 , X , -2 , BETA , Y , 2 ) ALPHA = (1.0, 0.0)
* * | (1.0, . ) (3.0, 5.0) (2.0, -3.0) | A = | . (7.0, . ) (4.0, -8.0) | | . . (6.0, . ) | * *
Y = ((31.0, 21.0), . , (85.0, -7.0), . , (30.0, 63.0))
This example shows vectors x and y with positive strides and a real symmetric matrix A of order 3. Matrix A is:
* * | 8.0 4.0 2.0 | | 4.0 6.0 7.0 | | 2.0 7.0 3.0 | * *
N ALPHA AP X INCX Y INCY | | | | | | | CALL SSLMX( 3 , 1.0 , AP , X , 1 , Y , 2 ) AP = (8.0, 4.0, 2.0, 6.0, 7.0, 3.0) X = (3.0, 2.0, 1.0) Y = (5.0, . , 3.0, . , 2.0)
Y = (39.0, . , 34.0, . , 25.0)