Computes the LU factorization of a tridiagonal matrix.
FORTRAN 77:
call sgttrf( n, dl, d, du, du2, ipiv, info )
call dgttrf( n, dl, d, du, du2, ipiv, info )
call cgttrf( n, dl, d, du, du2, ipiv, info )
call zgttrf( n, dl, d, du, du2, ipiv, info )
FORTRAN 95:
call gttrf( dl, d, du, du2 [, ipiv] [,info] )
C:
lapack_int LAPACKE_<?>gttrf( lapack_int n, <datatype>* dl, <datatype>* d, <datatype>* du, <datatype>* du2, lapack_int* ipiv );
The routine computes the LU factorization of a real or complex tridiagonal matrix A in the form
A = P*L*U,
where P is a permutation matrix; L is lower bidiagonal with unit diagonal elements; and U is an upper triangular matrix with nonzeroes in only the main diagonal and first two superdiagonals. The routine uses elimination with partial pivoting and row interchanges.
The data types are given for the Fortran interface. A <datatype> placeholder, if present, is used for the C interface data types in the C interface section above. See C Interface Conventions for the C interface principal conventions and type definitions.
n |
INTEGER. The order of the matrix A; n ≥ 0. |
dl, d, du |
REAL for sgttrf DOUBLE PRECISION for dgttrf COMPLEX for cgttrf DOUBLE COMPLEX for zgttrf. Arrays containing elements of A. The array dl of dimension (n - 1) contains the subdiagonal elements of A. The array d of dimension n contains the diagonal elements of A. The array du of dimension (n - 1) contains the superdiagonal elements of A. |
dl |
Overwritten by the (n-1) multipliers that define the matrix L from the LU factorization of A. The matrix L has unit diagonal elements, and the (n-1) elements of dl form the subdiagonal. All other elements of L are zero. |
d |
Overwritten by the n diagonal elements of the upper triangular matrix U from the LU factorization of A. |
du |
Overwritten by the (n-1) elements of the first superdiagonal of U. |
du2 |
REAL for sgttrf DOUBLE PRECISION for dgttrf COMPLEX for cgttrf DOUBLE COMPLEX for zgttrf. Array, dimension (n -2). On exit, du2 contains (n-2) elements of the second superdiagonal of U. |
ipiv |
INTEGER. Array, dimension (n). The pivot indices: for 1 ≤ i ≤ n, row i was interchanged with row ipiv(i). ipiv(i) is always i or i+1; ipiv(i) = i indicates a row interchange was not required. |
info |
INTEGER. If info = 0, the execution is successful. If info = -i, the i-th parameter had an illegal value. If info = i, uii is 0. The factorization has been completed, but U is exactly singular. Division by zero will occur if you use the factor U for solving a system of linear equations. |
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77 counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95 Interface Conventions.
Specific details for the routine gttrf interface are as follows:
dl |
Holds the vector of length (n-1). |
d |
Holds the vector of length n. |
du |
Holds the vector of length (n-1). |
du2 |
Holds the vector of length (n-2). |
ipiv |
Holds the vector of length n. |