STRMV, DTRMV, STPMV, and DTPMV compute one of the following matrix-vector products, using the vector x and triangular matrix A or its transpose:
CTRMV, ZTRMV, CTPMV, and ZTPMV compute one of the following matrix-vector products, using the vector x and triangular matrix A, its transpose, or its conjugate transpose:
Matrix A can be either upper or lower triangular, where:
A, x | Subprogram |
Short-precision real | STRMV and STPMV |
Long-precision real | DTRMV and DTPMV |
Short-precision complex | CTRMV and CTPMV |
Long-precision complex | ZTRMV and ZTPMV |
Fortran | CALL STRMV | DTRMV | CTRMV | ZTRMV (uplo, transa,
diag, n, a, lda, x,
incx)
CALL STPMV | DTPMV | CTPMV | ZTPMV (uplo, transa, diag, n, ap, x, incx) |
C and C++ | strmv | dtrmv | ctrmv | ztrmv (uplo, transa,
diag, n, a, lda, x,
incx);
stpmv | dtpmv | ctpmv | ztpmv (uplo, transa, diag, n, ap, x, incx); |
PL/I | CALL STRMV | DTRMV | CTRMV | ZTRMV (uplo, transa,
diag, n, a, lda, x,
incx);
CALL STPMV | DTPMV | CTPMV | ZTPMV (uplo, transa, diag, n, ap, x, incx); |
If uplo = 'U', A is an upper triangular matrix.
If uplo = 'L', A is a lower triangular matrix.
Specified as: a single character. It must be 'U' or 'L'.
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 diag = 'U', A is a unit triangular matrix.
If diag = 'N', A is not a unit triangular matrix.
Specified as: a single character. It must be 'U' or 'N'.
These subroutines can perform the following matrix-vector product computations, using the triangular matrix A, its transpose, or its conjugate transpose, where A can be either upper or lower triangular:
where:
See references [32] and [38]. If n is 0, no computation is performed.
None
This example shows the computation x<--Ax. Matrix A is a real 4 by 4 lower triangular matrix that is unit triangular, stored in lower-triangular storage mode. Vector x is a vector of length 4. Matrix A is:
* * | 1.0 . . . | | 1.0 1.0 . . | | 2.0 3.0 1.0 . | | 3.0 4.0 3.0 1.0 | * *
UPLO TRANSA DIAG N A LDA X INCX | | | | | | | | CALL STRMV( 'L' , 'N' , 'U' , 4 , A , 4 , X , 1 ) * * | . . . . | A = | 1.0 . . . | | 2.0 3.0 . . | | 3.0 4.0 3.0 . | * * X = (1.0, 2.0, 3.0, 4.0)
X = (1.0, 3.0, 11.0, 24.0)
This example shows the computation x<--ATx. Matrix A is a real 4 by 4 upper triangular matrix that is unit triangular, stored in upper-triangular storage mode. Vector x is a vector of length 4. Matrix A is:
* * | 1.0 2.0 3.0 2.0 | | . 1.0 2.0 5.0 | | . . 1.0 3.0 | | . . . 1.0 | * *
UPLO TRANSA DIAG N A LDA X INCX | | | | | | | | CALL STRMV( 'U' , 'T' , 'U' , 4 , A , 4 , X , 1 ) * * | . 2.0 3.0 2.0 | A = | . . 2.0 5.0 | | . . . 3.0 | | . . . . | * * X = (5.0, 4.0, 3.0, 2.0)
X = (5.0, 14.0, 26.0, 41.0)
This example shows the computation x<--AHx. Matrix A is a complex 4 by 4 upper triangular matrix that is unit triangular, stored in upper-triangular storage mode. Vector x is a vector of length 4. Matrix A is:
* * | (1.0, 0.0) (2.0, 2.0) (3.0, 3.0) (2.0, 2.0) | | . (1.0, 0.0) (2.0, 2.0) (5.0, 5.0) | | . . (1.0, 0.0) (3.0, 3.0) | | . . . (1.0, 0.0) | * *
UPLO TRANSA DIAG N A LDA X INCX | | | | | | | | CALL CTRMV( 'U' , 'C' , 'U' , 4 , A , 4 , X , 1 ) * * | . (2.0, 2.0) (3.0, 3.0) (2.0, 2.0) | A = | . . (2.0, 2.0) (5.0, 5.0) | | . . . (3.0, 3.0) | | . . . . | * * X = ((5.0, 5.0), (4.0, 4.0), (3.0, 3.0), (2.0, 2.0))
X = ((5.0, 5.0), (24.0, 4.0), (49.0, 3.0), (80.0, 2.0))
This example shows the computation x<--Ax. Matrix A is a real 4 by 4 lower triangular matrix that is unit triangular, stored in lower-triangular-packed storage mode. Vector x is a vector of length 4. Matrix A is:
* * | 1.0 . . . | | 1.0 1.0 . . | | 2.0 3.0 1.0 . | | 3.0 4.0 3.0 1.0 | * *
UPLO TRANSA DIAG N AP X INCX | | | | | | | CALL STPMV( 'L' , 'N' , 'U' , 4 , AP , X , 1 ) AP = ( . , 1.0, 2.0, 3.0, . , 3.0, 4.0, . , 3.0, . ) X = (1.0, 2.0, 3.0, 4.0)
X = (1.0, 3.0, 11.0, 24.0)
This example shows the computation x<--ATx. Matrix A is a real 4 by 4 upper triangular matrix that is not unit triangular, stored in upper-triangular-packed storage mode. Vector x is a vector of length 4. Matrix A is:
* * | 1.0 2.0 3.0 2.0 | | . 2.0 2.0 5.0 | | . . 3.0 3.0 | | . . . 1.0 | * *
UPLO TRANSA DIAG N AP X INCX | | | | | | | CALL STPMV( 'U' , 'T' , 'N' , 4 , AP , X , 1 ) AP = (1.0, 2.0, 2.0, 3.0, 2.0, 3.0, 2.0, 5.0, 3.0, 1.0) X = (5.0, 4.0, 3.0, 2.0)
X = (5.0, 18.0, 32.0, 41.0)
This example shows the computation x<--AHx. Matrix A is a complex 4 by 4 upper triangular matrix that is unit triangular, stored in upper-triangular-packed storage mode. Vector x is a vector of length 4. Matrix A is:
* * | (1.0, 0.0) (2.0, 2.0) (3.0, 3.0) (2.0, 2.0) | | . (1.0, 0.0) (2.0, 2.0) (5.0, 5.0) | | . . (1.0, 0.0) (3.0, 3.0) | | . . . (1.0, 0.0) | * *
UPLO TRANSA DIAG N AP X INCX | | | | | | | CALL CTPMV( 'U' , 'C' , 'U' , 4 , AP , X , 1 ) AP = ( . , (2.0, 2.0), . , (3.0, 3.0), (2.0, 2.0), . , (2.0, 2.0), (5.0, 5.0), (3.0, 3.0), . ) X = ((5.0, 5.0), (4.0, 4.0), (3.0, 3.0), (2.0, 2.0))
X = ((5.0, 5.0), (24.0, 4.0), (49.0, 3.0), (80.0, 2.0))