!----------------------------------------------------------------- ! ! Purpose ! ======= ! ! LA_GETRS solves a system of linear equations ! A X = B, A^T X = B or A^H X = B ! with a general square matrix A using the LU factorization computed ! by LA_GETRF. ! ! Arguments ! ========= ! SUBROUTINE LA_GETRS (A, IPIV, B, TRANS, INFO) ! (), INTENT(IN) :: A(:,:) ! (), INTENT(INOUT) :: ! INTEGER, INTENT(IN) :: IPIV(:) ! CHARACTER(LEN=1), INTENT(IN), OPTIONAL :: TRANS ! INTEGER, INTENT(OUT), OPTIONAL :: INFO ! where ! ::= REAL | COMPLEX ! ::= KIND(1.0) | KIND(1.0D0) ! ::= B(:,:) | B(:) ! ! ===================== ! ! A (input) either REAL or COMPLEX square array, ! shape (:,:), size(A,1) == size(A,2). ! The factors L and U from the factorization A = PLU as computed ! by LA_GETRF. ! ! 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). ! ! B (input/output) either REAL or COMPLEX rectangular array, ! shape either (:,:) or (:), size(B,1) or size(B) == size(A,1). ! On entry, the right hand side vector(s) of matrix B for ! the system of equations AX = B. ! On exit, if there is no error, the matrix of solution ! vector(s) X. ! ! TRANS Optional (input) CHARACTER*1 ! If TRANS is present, it specifies the form of the system ! of equations: ! = 'N': A X = B (No transpose) ! = 'T': A^T X = B (Transpose) ! = 'C': A^H X = B (Conjugate transpose = Transpose) ! otherwise TRANS = 'N' is assumed. ! ! INFO Optional (output) INTEGER. ! If INFO is present ! = 0: successful exit ! < 0: if INFO = -k, the k-th argument had an illegal value ! If INFO is not present and an error occurs, then the program is ! terminated with an error message. !--------------------------------- .