These subroutines find the inverse of triangular matrix A:
Matrix A can be either upper or lower triangular, where:
A | Subroutine |
Short-precision real | STRI, STPI, STRTRI, and STPTRI |
Long-precision real | DTRI, DTPI, DTRTRI, and DTPTRI |
Fortran | CALL STRI | DTRI (uplo, diag, a, lda,
n)
CALL STPI | DTPI (uplo, diag, ap, n) CALL STRTRI | DTRTRI (uplo, diag, n, a, lda, info) CALL STPTRI | DTPTRI (uplo, diag, n, ap, info) |
C and C++ | stri | dtri (uplo, diag, a, lda,
n);
stpi | dtpi (uplo, diag, ap, n); strtri | dtrtri (uplo, diag, n, a, lda, info); stptri | dtptri (uplo, diag, n, ap, info); |
PL/I | CALL STRI | DTRI (uplo, diag, a, lda,
n);
CALL STPI | DTPI (uplo, diag, ap, n); CALL STRTRI | DTRTRI (uplo, diag, n, a, lda, info); CALL STPTRI | DTPTRI (uplo, diag, n, ap, info); |
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 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'.
|If info = 0, the inverse completed successfully.
|If info > 0, info is set equal to the first |i, where |Aii is zero. Matrix A is singular and |its inverse could not be computed.
|Specified as: a fullword integer; |info >= 0.
These subroutines find the inverse of triangular matrix A, where A is either upper or lower triangular:
where:
If n is 0, no computation is performed. See references [8] and [36].
Unable to allocate internal work area.
Matrix A is singular.
This example shows how the inverse of matrix A is computed, where A is a 5 by 5 upper triangular matrix that is not unit triangular and is stored in upper-triangular storage mode. Matrix A is:
* * | 1.00 3.00 4.00 5.00 6.00 | | 0.00 2.00 8.00 9.00 1.00 | | 0.00 0.00 4.00 8.00 4.00 | | 0.00 0.00 0.00 -2.00 6.00 | | 0.00 0.00 0.00 0.00 -1.00 | * *
and where the following inverse matrix is computed. Matrix A-1 is:
* * | 1.00 -1.50 2.00 3.75 35.00 | | 0.00 0.50 -1.00 -1.75 -14.00 | | 0.00 0.00 0.25 1.00 7.00 | | 0.00 0.00 0.00 -0.50 -3.00 | | 0.00 0.00 0.00 0.00 -1.00 | * *
UPLO DIAG A LDA N | | | | | CALL STRI( 'U' , 'N' , A , 5 , 5)
|or
| UPLO DIAG N A LDA INFO | | | | | | | |CALL STRTRI( 'U' , 'N' , 5 , A, 5, INFO )
* * | 1.00 3.00 4.00 5.00 6.00 | | . 2.00 8.00 9.00 1.00 | A = | . . 4.00 8.00 4.00 | | . . . -2.00 6.00 | | . . . . -1.00 | * *
* * | 1.00 -1.50 2.00 3.75 35.00 | | . 0.50 -1.00 -1.75 -14.00 | A = | . . 0.25 1.00 7.00 | | . . . -0.50 -3.00 | | . . . . -1.00 | * *
|INFO = 0
This example shows how the inverse of matrix A is computed, where A is a 5 by 5 lower triangular matrix that is unit triangular and is stored in lower-triangular storage mode. Matrix A is:
* * | 1.0 0.0 0.0 0.0 0.0 | | 3.0 1.0 0.0 0.0 0.0 | | 4.0 8.0 1.0 0.0 0.0 | | 5.0 9.0 8.0 1.0 0.0 | | 6.0 1.0 4.0 6.0 1.0 | * *
and where the following inverse matrix is computed. Matrix A-1 is:
* * | 1.0 0.0 0.0 0.0 0.0 | | -3.0 1.0 0.0 0.0 0.0 | | 20.0 -8.0 1.0 0.0 0.0 | | -138.0 55.0 -8.0 1.0 0.0 | | 745.0 -299.0 44.0 -6.0 1.0 | * *
UPLO DIAG A LDA N | | | | | CALL STRI( 'L' , 'U' , A , 5 , 5)
|or
| UPLO DIAG N A LDA INFO | | | | | | | |CALL STRTRI( 'L' , 'U' , 5 , A, 5, INFO )
* * | . . . . . | | 3.0 . . . . | A = | 4.0 8.0 . . . | | 5.0 9.0 8.0 . . | | 6.0 1.0 4.0 6.0 . | * *
* * | . . . . . | | -3.0 . . . . | A = | 20.0 -8.0 . . . | | -138.0 55.0 -8.0 . . | | 745.0 -299.0 44.0 -6.0 . | * *
|INFO = 0
This example shows how the inverse of matrix A is computed, where A is the same matrix shown in Example 1 and is stored in upper-triangular-packed storage mode. The inverse matrix computed here is the same as the inverse matrix shown in Example 1 and is stored in upper-triangular-packed storage mode.
UPLO DIAG AP N | | | | CALL STPI( 'U' , 'N' , AP , 5)
|or
| UPLO DIAG N A INFO | | | | | | |CALL STPTRI( 'U' , 'N' , 5 , AP, INFO )
AP = (1.00, 3.00, 2.00, 4.00, 8.00, 4.00, 5.00, 9.00, 8.00, -2.00, 6.00, 1.00, 4.00, 6.00, -1.00)
AP = (1.00, -1.50, 0.50, 2.00, -1.00, 0.25, 3.75, -1.75, 1.00, -0.50, 35.00, -14.00, 7.00, -3.00, -1.00)
|INFO = 0
This example shows how the inverse of matrix A is computed, where A is the same matrix shown in Example 2 and is stored in lower-triangular-packed storage mode. The inverse matrix computed here is the same as the inverse matrix shown in Example 2 and is stored in lower-triangular-packed storage mode.
UPLO DIAG AP N | | | | CALL STPI( 'L' , 'U' , AP , 5)
|or
| UPLO DIAG N A INFO | | | | | | |CALL STPTRI( 'L' , 'U' , N , AP, INFO )
AP = ( . , 3.0, 4.0, 5.0, 6.0, . , 8.0, 9.0, 1.0, . , 8.0, 4.0, . , 6.0, . )
AP = ( . , -3.0, 20.0, -138.0, 745.0, . , -8.0, 55.0, -299.0, . , -8.0, 44.0, . , -6.0, . )
INFO = 0