!----------------------------------------------------------------- ! ! Purpose ! ======= ! ! LA_GBSV computes the solution to either a real or complex system of ! linear equations A * X = B, where A is a band matrix and X and B are ! either rectangular matrices or vectors. ! The LU decomposition with partial pivoting and row interchanges is ! used to factor A as A = L * U, where L is a product of permutation ! and unit lower triangular matrices, and U is upper triangular. The ! factored form of A is then used to solve the system of equations ! A * X = B. ! ! Arguments ! ========= ! ! SUBROUTINE LA_GBSV( AB, B, KL, IPIV, INFO ) ! (), INTENT(INOUT) :: AB(:,:), ! INTEGER, INTENT(IN), OPTIONAL :: KL ! INTEGER, INTENT(OUT), OPTIONAL :: IPIV(:) ! INTEGER, INTENT(OUT), OPTIONAL :: INFO ! ::= REAL | COMPLEX ! ::= KIND(1.0) | KIND(1.0D0) ! ::= B(:,:) | B(:) ! ! ===================== ! ! AB (input/output) either REAL or COMPLEX rectangular array, ! shape (:,:). ! On entry, the matrix A in band storage, in rows KL+1 to ! 2*KL+ku+1; rows 1 to KL of the array need not be set. ! The j-th column of A is stored in the j-th column of the ! array AB as follows: ! AB(KL+ku+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(n,j+KL) ! On exit, details of the factorization: U is stored as an ! upper triangular band matrix with KL+KU superdiagonals in ! rows 1 to KL+ku+1, and the multipliers used during the ! factorization are stored in rows KL+ku+2 to 2*KL+ku+1. ! See below for further details. ! Description KL see below, while KU = SIZE(A,1)-2*KL-1 and ! SIZE(A,2) is the order of the banded matrix (n). ! ! B (input/output) either REAL or COMPLEX rectangular array, ! shape either (:,:) or (:), size(B,1) or size(B) == size(A,2). ! 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. ! ! KL Optional (input) INTEGER ! If KL is present it indicates the number of subdiagonals ! within the band of A. KL >= 0. If it is not present the ! system assumes equal numbers of subdiagonals and superdiagonals. ! The number of superdiagonals is SIZE(A,1)-2*KL-1. ! ! IPIV Optional (output) INTEGER array, shape (:), ! size(IPIV) == size(AB,2). If IPIV is present it indices ! define the permutation matrix P; 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 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. ! ! Further Details ! =============== ! ! The band storage scheme is illustrated by the following example, when ! SIZE(A,1) = SIZE(A,2) = 6, KL = 2, KU SIZE(A,1)-2*KL-1 = 1: ! ! On entry: On exit: ! ! * * * + + + * * * u14 u25 u36 ! * * + + + + * * u13 u24 u35 u46 ! * a12 a23 a34 a45 a56 * u12 u23 u34 u45 u56 ! a11 a22 a33 a44 a55 a66 u11 u22 u33 u44 u55 u66 ! a21 a32 a43 a54 a65 * m21 m32 m43 m54 m65 * ! a31 a42 a53 a64 * * m31 m42 m53 m64 * * ! ! Array elements marked * are not used by the routine; elements marked ! + need not be set on entry, but are required by the routine to store ! elements of U because of fill-in resulting from the row interchanges. ! !------------------------------------- .