SGBMV and DGBMV compute the matrix-vector product for either a real general band matrix or its transpose, where the general band matrix is stored in BLAS-general-band storage mode. It uses the scalars alpha and beta, vectors x and y, and general band matrix A or its transpose:
CGBMV and ZGBMV compute the matrix-vector product for either a complex general band matrix, its transpose, or its conjugate transpose, where the general band matrix is stored in BLAS-general-band storage mode. It uses the scalars alpha and beta, vectors x and y, and general band matrix A, its transpose, or its conjugate transpose:
alpha, beta, x, y, A | Subprogram |
Short-precision real | SGBMV |
Long-precision real | DGBMV |
Short-precision complex | CGBMV |
Long-precision complex | ZGBMV |
Fortran | CALL SGBMV | DGBMV | CGBMV | ZGBMV (transa, m, n, ml, mu, alpha, a, lda, x, incx, beta, y, incy) |
C and C++ | sgbmv | dgbmv | cgbmv | zgbmv (transa, m, n, ml, mu, alpha, a, lda, x, incx, beta, y, incy); |
PL/I | CALL SGBMV | DGBMV | CGBMV | ZGBMV (transa, m, n, ml, mu, alpha, a, lda, x, incx, beta, y, incy); |
If transa = 'N', A is used in the computation.
If transa = 'T', AT is used in the computation.
If transa = 'C', AH is used in the computation.
Specified as: a single character. It must be 'N', 'T', or 'C'.
If transa = 'N', it is the length of vector y.
If transa = 'T' or 'C', it is the length of vector x.
Specified as: a fullword integer; m >= 0.
If transa = 'N', it is the length of vector x.
If transa = 'T' or 'C', it is the length of vector y.
Specified as: a fullword integer; n >= 0.
If transa = 'N', A is used in the computation.
If transa = 'T', AT is used in the computation.
If transa = 'C', AH is used in the computation.
Specified as: an lda by (at least) n array, containing numbers of the data type indicated in Table 67, where lda >= ml+mu+1.
If transa = 'N', it has length n.
If transa = 'T' or 'C', it has length m.
Specified as: a one-dimensional array, containing numbers of the data type indicated in Table 67, where:
If transa = 'N', it must have at least 1+(n-1)|incx| elements.
If transa = 'T' or 'C', it must have at least 1+(m-1)|incx| elements.
If transa = 'N', it has length m.
If transa = 'T' or 'C', it has length n.
Specified as: a one-dimensional array, containing numbers of the data type indicated in Table 67, where:
If transa = 'N', it must have at least 1+(m-1)|incy| elements.
If transa = 'T' or 'C', it must have at least 1+(n-1)|incy| elements.
If transa = 'N', it has length m.
If transa = 'T' or 'C', it has length n.
Returned as: a one-dimensional array, containing numbers of the data type indicated in Table 67.
The possible computations that can be performed by these subroutines are described in the following sections. Varying implementation techniques are used for this computation to improve performance. As a result, accuracy of the computational result may vary for different computations.
In all the computations, general band matrix A is stored in its untransposed form in an array, using BLAS-general-band storage mode.
For SGBMV and CGBMV, intermediate results are accumulated in long precision. Occasionally, for performance reasons, these intermediate results are truncated to short precision and stored.
See references [34], [35], [38], [46], and [79]. No computation is performed if m or n is 0 or if alpha is zero and beta is one.
For SGBMV, DGBMV, CGBMV, and ZGBMV, the matrix-vector product for a general band matrix is expressed as follows:
where:
For SGBMV, DGBMV, CGBMV, and ZGBMV, the matrix-vector product for the transpose of a general band matrix is expressed as:
where:
For CGBMV and ZGBMV, the matrix-vector product for the conjugate transpose of a general band matrix is expressed as follows:
where:
None
This example shows how to use SGBMV to perform the computation y<--betay+alphaAx, where TRANSA is equal to 'N', and the following real general band matrix A is used in the computation. Matrix A is:
* * | 1.0 1.0 1.0 0.0 | | 2.0 2.0 2.0 2.0 | | 3.0 3.0 3.0 3.0 | | 4.0 4.0 4.0 4.0 | | 0.0 5.0 5.0 5.0 | * *
TRANSA M N ML MU ALPHA A LDA X INCX BETA Y INCY | | | | | | | | | | | | | CALL SGBMV( 'N' , 5 , 4 , 3 , 2 , 2.0 , A , 8 , X , 1 , 10.0 , Y , 2 )
* * | . . 1.0 2.0 | | . 1.0 2.0 3.0 | | 1.0 2.0 3.0 4.0 | A = | 2.0 3.0 4.0 5.0 | | 3.0 4.0 5.0 . | | 4.0 5.0 . . | | . . . . | | . . . . | * *
X = (1.0, 2.0, 3.0, 4.0) Y = (1.0, . , 2.0, . , 3.0, . , 4.0, . , 5.0, . )
Y = (22.0, . , 60.0, . , 90.0, . , 120.0, . , 140.0, . )
This example shows how to use SGBMV to perform the computation y <-- betay+alphaATx, where TRANSA is equal to 'T', and the transpose of a real general band matrix A is used in the computation. It uses the same input as Example 1.
TRANSA M N ML MU ALPHA A LDA X INCX BETA Y INCY | | | | | | | | | | | | | CALL SGBMV( 'T' , 5 , 4 , 3 , 2 , 2.0 , A , 8 , X , 1 , 10.0 , Y , 2 )
Y = (70.0, . , 130.0, . , 140.0, . , 148.0, . )
This example shows how to use CGBMV to perform the computation y<--betay+alphaAHx, where TRANSA is equal to 'C', and the complex conjugate of the following general band matrix A is used in the computation. Matrix A is:
* * | (1.0, 1.0) (1.0, 1.0) (1.0, 1.0) (0.0, 0.0) | | (2.0, 2.0) (2.0, 2.0) (2.0, 2.0) (2.0, 2.0) | | (3.0, 3.0) (3.0, 3.0) (3.0, 3.0) (3.0, 3.0) | | (4.0, 4.0) (4.0, 4.0) (4.0, 4.0) (4.0, 4.0) | | (0.0, 0.0) (5.0, 5.0) (5.0, 5.0) (0.0, 0.0) | * *
TRANSA M N ML MU ALPHA A LDA X INCX BETA Y INCY | | | | | | | | | | | | | CALL CGBMV( 'C' , 5 , 4 , 3 , 2 , ALPHA , A , 8 , X , 1 , BETA , Y , 2 )
* * | . . (1.0, 1.0) (2.0, 2.0) | | . (1.0, 1.0) (2.0, 2.0) (3.0, 3.0) | | (1.0, 1.0) (2.0, 2.0) (3.0, 3.0) (4.0, 4.0) | A = | (2.0, 2.0) (3.0, 3.0) (4.0, 4.0) (5.0, 5.0) | | (3.0, 3.0) (4.0, 4.0) (5.0, 5.0) . | | (4.0, 4.0) (5.0, 5.0) . . | | . . . . | | . . . . | * *
X = ((1.0, 2.0), (2.0, 3.0), (3.0, 4.0), (4.0, 5.0), (5.0, 6.0)) ALPHA = (1.0, 1.0) BETA = (10.0, 0.0) Y = ((1.0, 2.0), . , (2.0, 3.0), . , (3.0, 4.0), . , (4.0, 5.0), . )
Y = ((70.0, 100.0), . , (130.0, 170.0), . , (140.0, 180.0), . , (148.0, 186.0), . )
This example shows how to use SGBMV to perform the computation y<--betay+alphaAx, where ml >= m and mu >= n, TRANSA is equal to 'N', and the following real general band matrix A is used in the computation. Matrix A is:
* * | 1.0 1.0 1.0 1.0 1.0 | | 2.0 2.0 2.0 2.0 2.0 | | 3.0 3.0 3.0 3.0 3.0 | | 4.0 4.0 4.0 4.0 4.0 | * *
TRANSA M N ML MU ALPHA A LDA X INCX BETA Y INCY | | | | | | | | | | | | | CALL SGBMV( 'N' , 4 , 5 , 6 , 5 , 2.0 , A , 12 , X , 1 , 10.0 , Y , 2 )
* * | . . . . . | | . . . . 1.0 | | . . . 1.0 2.0 | | . . 1.0 2.0 3.0 | | . 1.0 2.0 3.0 4.0 | A = | 1.0 2.0 3.0 4.0 . | | 2.0 3.0 4.0 . . | | 3.0 4.0 . . . | | 4.0 . . . . | | . . . . . | | . . . . . | | . . . . . | * * X = (1.0, 2.0, 3.0, 4.0, 5.0) Y = (1.0, . , 2.0, . , 3.0, . , 4.0, . )
Y = (40.0, . , 80.0, . , 120.0, . , 160.0, . )