STRSV, DTRSV, STPSV, and DTPSV perform one of the following solves for a
triangular system of equations with a single right-hand side, using the vector
x and triangular matrix A or its transpose:
| Solution | Equation |
|
|---|---|---|
| 1. x<--A-1x | Ax = b |
|
| 2. x<--A-Tx | ATx = b |
|
CTRSV, ZTRSV, CTPSV, and ZTPSV perform one of the following solves for a
triangular system of equations with a single right-hand side, using the vector
x and and triangular matrix A, its transpose, or its
conjugate transpose:
| Solution | Equation |
|
|---|---|---|
| 1. x<--A-1x | Ax = b |
|
| 2. x<--A-Tx | ATx = b |
|
| 3. x<--A-Hx | AHx = b |
|
Matrix A can be either upper or lower triangular, where:
| A, x | Subroutine |
| Short-precision real | STRSV and STPSV |
| Long-precision real | DTRSV and DTPSV |
| Short-precision complex | CTRSV and CTPSV |
| Long-precision complex | ZTRSV and ZTPSV |
| Fortran | CALL STRSV | DTRSV | CTRSV | ZTRSV (uplo, transa,
diag, n, a, lda, x,
incx)
CALL STPSV | DTPSV | CTPSV | ZTPSV (uplo, transa, diag, n, ap, x, incx) |
| C and C++ | strsv | dtrsv | ctrsv | ztrsv (uplo, transa,
diag, n, a, lda, x,
incx);
stpsv | dtpsv | ctpsv | ztpsv (uplo, transa, diag, n, ap, x, incx); |
| PL/I | CALL STRSV | DTRSV | CTRSV | ZTRSV (uplo, transa,
diag, n, a, lda, x,
incx);
CALL STPSV | DTPSV | CTPSV | ZTPSV (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, resulting in solution 1.
If transa = 'T', AT is used, resulting in solution 2.
If transa = 'C', AH is used, resulting in solution 3.
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 solve a triangular system of equations with a single right-hand side. The solution x may be any of the following, where triangular matrix A, its transpose, or its conjugate transpose is used, and where A can be either upper- or lower-triangular:
where:
If n is 0, no computation is performed. See references [32], [36], and [38].
None
This example shows the solution x<--A-1x. Matrix A is a real 4 by 4 lower unit triangular matrix, stored in lower-triangular storage mode. Vector x is a vector of length 4.
UPLO TRANSA DIAG N A LDA X INCX
| | | | | | | |
CALL STRSV( 'L' , 'N' , 'U' , 4 , A , 4 , X , 1 )
* *
| . . . . |
| 1.0 . . . |
A = | 2.0 3.0 . . |
| 3.0 4.0 3.0 . |
* *
X = (1.0, 3.0, 11.0, 24.0)
X = (1.0, 2.0, 3.0, 4.0)
This example shows the solution x<--A-Tx. Matrix A is a real 4 by 4 upper nonunit triangular matrix, stored in upper-triangular storage mode. Vector x is a vector of length 4.
UPLO TRANSA DIAG N A LDA X INCX
| | | | | | | |
CALL STRSV( 'U' , 'T' , 'N' , 4 , A , 4 , X , 1 )
* *
| 1.0 2.0 3.0 2.0 |
A = | . 2.0 2.0 5.0 |
| . . 3.0 3.0 |
| . . . 1.0 |
* *
X = (5.0, 18.0, 32.0, 41.0)
X = (5.0, 4.0, 3.0, 2.0)
This example shows the solution x<--A-Hx. Matrix A is a complex 4 by 4 upper unit triangular matrix, stored in upper-triangular storage mode. Vector x is a vector of length 4.
UPLO TRANSA DIAG N A LDA X INCX
| | | | | | | |
CALL CTRSV( '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), (24.0, 4.0), (49.0, 3.0), (80.0, 2.0))
X = ((5.0, 5.0), (4.0, 4.0), (3.0, 3.0), (2.0, 2.0))
This example shows the solution x<--A-1x. Matrix A is a real 4 by 4 lower unit triangular matrix, 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 STPSV( 'L' , 'N' , 'U' , 4 , AP , X , 1 )
AP = ( . , 1.0, 2.0, 3.0, . , 3.0, 4.0, . , 3.0, . )
X = (1.0, 3.0, 11.0, 24.0)
X = (1.0, 2.0, 3.0, 4.0)
This example shows the solution x<--A-Tx. Matrix A is a real 4 by 4 upper nonunit triangular matrix, 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 STPSV( '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, 18.0, 32.0, 41.0)
X = (5.0, 4.0, 3.0, 2.0)
This example shows the solution x<--A-Hx. Matrix A is a complex 4 by 4 upper unit triangular matrix, 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 CTPSV( '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), (24.0, 4.0), (49.0, 3.0), (80.0, 2.0))
X = ((5.0, 5.0), (4.0, 4.0), (3.0, 3.0), (2.0, 2.0))