!----------------------------------------------------------------- ! ! Purpose ! ======= ! ! LA_GTSV solves the equation A*X = B, where A is a tridiagonal matrix, ! by Gaussian elimination with partial pivoting. ! Note that the equation A'*X = B may be solved by interchanging the ! order of the arguments DU and DL. ! ! Arguments ! ========= ! ! SUBROUTINE LA_GTSV( DL, D, DU, B, INFO ) ! (), INTENT(INOUT) :: DL(:), D(:), DU(:), ! INTEGER, INTENT(OUT), OPTIONAL :: INFO ! ::= REAL | COMPLEX ! ::= KIND(1.0) | KIND(1.0D0) ! ::= B(:,:) | B(:) ! ! ===================== ! ! DL (input/output) either REAL or COMPLEX array, shape (:), where ! SIZE(DL) == SIZE(D) -1. ! On entry, DL must contain the (n-1) subdiagonal elements of A. ! On exit, DL is overwritten by the (n-2) elements of the ! second superdiagonal of the upper triangular matrix U from ! the LU factorization of A, in DL(1), ..., DL(n-2). ! ! D (input/output) either REAL or COMPLEX array, shape (:), where ! SIZE(D) indicates the matrix rank (n). ! On entry, D must contain the diagonal elements of A. ! On exit, D is overwritten by the n diagonal elements of U. ! ! DU (input/output) either REAL or COMPLEX array, shape (:), where ! SIZE(DL) == SIZE(D) -1. ! On entry, DU must contain the (n-1) superdiagonal elements of A. ! On exit, DU is overwritten by the (n-1) elements of the first ! superdiagonal of U. ! ! B (input/output) either REAL or COMPLEX rectangular array, ! shape either (:,:) or (:), size(B,1) or size(B) == size(D). ! 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. ! ! 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. ! !------------------------------------- .