!----------------------------------------------------------------- ! ! Purpose ! ======= ! ! LA_GETRF computes an LU factorization of a general regtangle ! matrix A using partial pivoting with row interchanges. ! ! The factorization has the form A = PLU ! where P is a permutation matrix, L is lower triangular ! with unit diagonal elements (lower trapezoidal if m > n), ! and U is upper triangular (upper trapezoidal if m < n), ! where m=size(A,1) and n=size(A,2). ! ! When A is square (m = n), LA_GETRF optionally estimates the ! reciprocal of the condition number of a general matrix A, in either ! the 1-norm or the infinity-norm. ! An estimate is obtained for norm(inv(A)), and the reciprocal of the ! condition number is computed as RCOND = 1 / (norm(A) * norm(inv(A))). ! ! Arguments ! ========= ! ! SUBROUTINE LA_GETRF ( A, IPIV, RCOND, NORM, INFO ) ! (), INTENT(INOUT) :: A(:,:) ! INTEGER, INTENT( OUT ) :: IPIV( : ) ! REAL(), INTENT( OUT ), OPTIONAL :: RCOND ! CHARACTER(LEN=1), INTENT(IN), OPTIONAL :: NORM ! INTEGER, INTENT(OUT), OPTIONAL :: INFO ! where ! ::= REAL | COMPLEX ! ::= KIND(1.0) | KIND(1.0D0) ! ! ==================== ! ! A (input/output) either REAL or COMPLEX array, shape (:,:). ! On entry, the matrix A. ! On exit, the factors L and U from the factorization A = PLU; ! the unit diagonal elements of L are not stored. ! ! IPIV (output) INTEGER array, shape (:), ! size(IPIV) == min(size(A,1),size(A,2)). ! IPIV indices that define the permutation matrix P; ! row i of the matrix A was interchanged with row IPIV(i). ! ! RCOND Optional (output) REAL ! The reciprocal of the condition number of the matrix A for ! the case m = n, computed as RCOND = 1/(norm(A) * norm(inv(A))). ! RCOND should be present if NORM is present. ! If m /= n then RCOND is returned as zero. ! ! NORM Optional (input) CHARACTER*1 ! Specifies whether the 1-norm condition number or the ! infinity-norm condition number is required: ! = '1', 'O' or 'o': 1-norm; ! = 'I', 'i': infinity-norm. ! If NORM is not present, the 1-norm is used. ! ! 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 factorization ! has been completed, but the factor U is exactly ! singular, so the solution could not be computed. ! If INFO is not present and an error occurs, then the program is ! terminated with an error message. !------------------------------- .