SSBMV and DSBMV compute the matrix-vector product for a real symmetric band matrix. CHBMV and ZHBMV compute the matrix-vector product for a complex Hermitian band matrix. The band matrix A is stored in either upper- or lower-band-packed storage mode. It uses the scalars alpha and beta, vectors x and y, and band matrix A:
alpha, beta, x, y, A | Subprogram |
Short-precision real | SSBMV |
Long-precision real | DSBMV |
Short-precision complex | CHBMV |
Long-precision complex | ZHBMV |
Fortran | CALL SSBMV | DSBMV | CHBMV | ZHBMV (uplo, n, k, alpha, a, lda, x, incx, beta, y, incy) |
C and C++ | ssbmv | dsbmv | chbmv | zhbmv (uplo, n, k, alpha, a, lda, x, incx, beta, y, incy); |
PL/I | CALL SSBMV | DSBMV | CHBMV | ZHBMV (uplo, n, k, alpha, a, lda, x, incx, beta, y, incy); |
If uplo = 'U', A is stored in upper-band-packed storage mode.
If uplo = 'L', A is stored in lower-band-packed storage mode.
Specified as: a single character. It must be 'U' or 'L'.
If uplo = 'U', A is stored in upper-band-packed storage mode.
If uplo = 'L', A is stored in lower-band-packed storage mode.
Specified as: an lda by (at least) n array, containing numbers of the data type indicated in Table 68, where lda >= k+1.
These subroutines perform the following matrix-vector product, using a real symmetric or complex Hermitian band matrix A, stored in either upper- or lower-band-packed storage mode:
where:
For SSBMV and CHBMV, intermediate results are accumulated in long precision. Occasionally, for performance reasons, these intermediate results are truncated to short precision and stored.
See references [34], [38], [46], and [79]. No computation is performed if n is 0 or if alpha is zero and beta is one.
None
This example shows how to use SSBMV to perform the matrix-vector product, where the real symmetric band matrix A of order 7 and half band width of 3 is stored in upper-band-packed storage mode. Matrix A is:
* * | 1.0 1.0 1.0 1.0 0.0 0.0 0.0 | | 1.0 2.0 2.0 2.0 2.0 0.0 0.0 | | 1.0 2.0 3.0 3.0 3.0 3.0 0.0 | | 1.0 2.0 3.0 4.0 4.0 4.0 4.0 | | 0.0 2.0 3.0 4.0 5.0 5.0 5.0 | | 0.0 0.0 3.0 4.0 5.0 6.0 6.0 | | 0.0 0.0 0.0 4.0 5.0 6.0 7.0 | * *
UPLO N K ALPHA A LDA X INCX BETA Y INCY | | | | | | | | | | | CALL SSBMV( 'U' , 7 , 3 , 2.0 , A , 5 , X , 1 , 10.0 , Y , 2 ) * * | . . . 1.0 2.0 3.0 4.0 | | . . 1.0 2.0 3.0 4.0 5.0 | A = | . 1.0 2.0 3.0 4.0 5.0 6.0 | | 1.0 2.0 3.0 4.0 5.0 6.0 7.0 | | . . . . . . . | * * X = (1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0) Y = (1.0, . , 2.0, . , 3.0, . , 4.0, . , 5.0, . , 6.0, . , 7.0)
Y = (30.0, . , 78.0, . , 148.0, . , 244.0, . , 288.0, . , 316.0, . , 322.0)
This example shows how to use CHBMV to perform the matrix-vector product, where the complex Hermitian band matrix A of order 7 and half band width of 3 is stored in lower-band-packed storage mode. Matrix A is:
* * | (1.0, 0.0) (1.0, 1.0) (1.0, 1.0) (1.0, 1.0) (0.0, 0.0) (0.0, 0.0) (0.0, 0.0) | | (1.0, -1.0) (2.0, 0.0) (2.0, 2.0) (2.0, 2.0) (2.0, 2.0) (0.0, 0.0) (0.0, 0.0) | | (1.0, -1.0) (2.0, -2.0) (3.0, 0.0) (3.0, 3.0) (3.0, 3.0) (3.0, 3.0) (0.0, 0.0) | | (1.0, -1.0) (2.0, -2.0) (3.0, -3.0) (4.0, 0.0) (4.0, 4.0) (4.0, 4.0) (4.0, 4.0) | | (0.0, 0.0) (2.0, -2.0) (3.0, -3.0) (4.0, -4.0) (5.0, 0.0) (5.0, 5.0) (5.0, 5.0) | | (0.0, 0.0) (0.0, 0.0) (3.0, -3.0) (4.0, -4.0) (5.0, -5.0) (6.0, 0.0) (6.0, 6.0) | | (0.0, 0.0) (0.0, 0.0) (0.0, 0.0) (4.0, -4.0) (5.0, -5.0) (6.0, -6.0) (7.0, 0.0) | * *
UPLO N K ALPHA A LDA X INCX BETA Y INCY | | | | | | | | | | | CALL CHBMV( 'L' , 7 , 3 , ALPHA , A , 5 , X , 1 , BETA , Y , 2 ) ALPHA = (2.0, 0.0) BETA = (10.0, 0.0)
* * | (1.0, . ) (2.0, . ) (3.0, . ) (4.0, . ) (5.0, . ) (6.0, . ) (7.0, . ) | | (1.0, 1.0) (2.0, 2.0) (3.0, 3.0) (4.0, 4.0) (5.0, 5.0) (6.0, 6.0) . | A = | (1.0, 1.0) (2.0, 2.0) (3.0, 3.0) (4.0, 4.0) (5.0, 5.0) . . | | (1.0, 1.0) (2.0, 2.0) (3.0, 3.0) (4.0, 4.0) . . . | | . . . . . . . | * *
X = ((1.0, 1.0), (2.0, 2.0), (3.0, 3.0), (4.0, 4.0), (5.0, 5.0), (6.0, 6.0), (7.0, 7.0)) Y = ((1.0, 1.0), . , (2.0, 2.0), . , (3.0, 3.0), . , (4.0, 4.0), . , (5.0, 5.0), . , (6.0, 6.0), . , (7.0, 7.0))
Y = ((48.0, 12.0), . , (124.0, 32.0), . , (228.0, 68.0), . , (360.0, 128.0), . , (360.0, 216.0), . , (300.0, 332.0), . , (168.0, 476.0))
This example shows how to use SSBMV to perform the matrix-vector product, where n >= k. Matrix A is a real 5 by 5 symmetric band matrix with a half band width of 5, stored in upper-band-packed storage mode. Matrix A is:
* * | 1.0 1.0 1.0 1.0 1.0 | | 1.0 2.0 2.0 2.0 2.0 | | 1.0 2.0 3.0 3.0 3.0 | | 1.0 2.0 3.0 4.0 4.0 | | 1.0 2.0 3.0 4.0 5.0 | * *
UPLO N K ALPHA A LDA X INCX BETA Y INCY | | | | | | | | | | | CALL SSBMV( 'U' , 5 , 5 , 2.0 , A , 7 , X , 1 , 10.0 , Y , 2 ) * * | . . . . . | | . . . . 1.0 | | . . . 1.0 2.0 | A = | . . 1.0 2.0 3.0 | | . 1.0 2.0 3.0 4.0 | | 1.0 2.0 3.0 4.0 5.0 | | . . . . . | * * X = (1.0, 2.0, 3.0, 4.0, 5.0) Y = (1.0, . , 2.0, . , 3.0, . , 4.0, . , 5.0, . )
Y = (40.0, . , 78.0, . , 112.0, . , 140.0, . , 160.0, . )