LINRT
Computes the inverse of a real triangular matrix.
Required Arguments
A — N by N matrix containing the triangular matrix to be inverted. (Input)
For a lower triangular matrix, only the lower triangular part and diagonal of A are referenced. For an upper triangular matrix, only the upper triangular part and diagonal of A are referenced.
AINV — N by N matrix containing the inverse of A. (Output)
If A is lower triangular, AINV is also lower triangular. If A is upper triangular, AINV is also upper triangular. If A is not needed, A and AINV can share the same storage locations.
Optional Arguments
N — Number of equations. (Input)
Default: N = size (A,2).
LDA — Leading dimension of A exactly as specified in the dimension statement of the calling program. (Input)
Default: LDA = size (A,1).
IPATH — Path indicator. (Input)
IPATH = 1 means A is lower triangular. IPATH = 2 means A is upper triangular.
Default: IPATH = 1.
LDAINV — Leading dimension of AINV exactly as specified in the dimension statement of the calling program. (Input)
Default: LDAINV = size (AINV,1).
FORTRAN 90 Interface
Generic: CALL LINRT (A, AINV [, …])
Specific: The specific interface names are S_LINRT and D_LINRT.
FORTRAN 77 Interface
Single: CALL LINRT (N, A, LDA, IPATH, AINV, LDAINV)
Double: The double precision name is DLINRT.
Description
Routine LINRT computes the inverse of a real triangular matrix. It fails if A has a zero diagonal element.
Example
The inverse is computed for a 3 × 3 lower triangular matrix.
USE LINRT_INT
USE WRRRN_INT
! Declare variables
PARAMETER (LDA=3)
REAL A(LDA,LDA), AINV(LDA,LDA)
! Set values for A
! A = ( 2.0 )
! ( 2.0 -1.0 )
! ( -4.0 2.0 5.0)
!
DATA A/2.0, 2.0, -4.0, 0.0, -1.0, 2.0, 0.0, 0.0, 5.0/
!
! Compute the inverse of A
CALL LINRT (A, AINV)
! Print results
CALL WRRRN (’AINV’, AINV)
END
AINV
1 2 3
1 0.500 0.000 0.000
2 1.000 -1.000 0.000
3 0.000 0.400 0.200