!----------------------------------------------------------------- ! ! Purpose ! ======= ! ! LA_GETRI computes the inverse of a matrix using the LU factorization ! computed by LA_GETRF. ! ! Arguments ! ========= ! SUBROUTINE LA_GETRI (A, IPIV, INFO) ! (), INTENT(INOUT) :: A(:,:) ! INTEGER, INTENT(IN) :: IPIV(:) ! INTEGER, INTENT(OUT), OPTIONAL :: INFO ! where ! ::= REAL | COMPLEX ! ::= KIND(1.0) | KIND(1.0D0) ! ! ===================== ! ! A (input/output) either REAL or COMPLEX square array, shape (:,:), ! size(A,1) == size(A,2). ! On entry contains the factors L and U from the factorization ! A = PLU as computed by LA_GETRF. ! On exit, if INFO = 0, the inverse of the original matrix A. ! ! IPIV (input) INTEGER array, shape (:), size(IPIV) == size(A,1). ! The pivot indices from LA_GETRF; for 1<=i<=size(A,1), row i of ! the matrix was interchanged with row IPIV(i). ! ! INFO Optional (output) INTEGER. ! If INFO is present ! = 0: successful exit ! < 0: if INFO = -k, the k-th argument had an illegal value ! > 0: if INFO = k, U(k,k) is exactly zero. The matrix is ! singular and its inverse could not be computed. ! If INFO is not present and an error occurs, then the program is ! terminated with an error message. !----------------------------------------------- .