Purpose ======= LA_GESV computes the solution to a real or complex linear system of equations A*X = B, where A is a square matrix and X and B are rectangular matrices or vectors. Gaussian elimination with row interchanges is used to factor A as A = P*L*U , where P is a permutation matrix, L is unit lower triangular, and U is upper triangular. The factored form of A is then used to solve the above system. ========= SUBROUTINE LA_GESV( A, B, IPIV=ipiv, INFO=info ) (), INTENT(INOUT) :: A(:,:), INTEGER, INTENT(OUT), OPTIONAL :: IPIV(:) INTEGER, INTENT(OUT), OPTIONAL :: INFO where ::= REAL | COMPLEX ::= KIND(1.0) | KIND(1.0D0) ::= B(:,:) | B(:) Arguments ========= A (input/output) REAL or COMPLEX square array, shape (:,:). On entry, the matrix A. On exit, the factors L and U from the factorization A = P*L*U; the unit diagonal elements of L are not stored. B (input/output) REAL or COMPLEX array, shape (:,:) with size(B,1) = size(A,1) or shape (:) with size(B) = size(A,1). On entry, the matrix B. On exit, the solution matrix X . IPIV Optional (output) INTEGER array, shape (:) with size(IPIV) = size(A,1). The pivot indices that define the permutation matrix P; row i of the matrix was interchanged with row IPIV(i). INFO Optional (output) INTEGER = 0 : successful exit. < 0 : if INFO = -i, the i-th argument has an illegal value. > 0 : if INFO = i, then U(i,i) = 0. The factorization has been completed, but the factor U is 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.