LFTCB
Computes the LU factorization of a complex matrix in band storage mode.
Required Arguments
A — Complex NLCA + NUCA + 1 by N array containing the N by N matrix in band storage mode to be factored. (Input)
NLCA — Number of lower codiagonals of A. (Input)
NUCA — Number of upper codiagonals of A. (Input)
FACT — Complex 2 * NLCA + NUCA + 1 by N array containing the LU factorization of the matrix A. (Output)
If A is not needed, A can share the first (NLCA + NUCA + 1) * N locations with FACT.
IPVT — Integer vector of length N containing the pivoting information for the LU factorization. (Output)
Optional Arguments
N — Order of the matrix. (Input)
Default: N = size (A,2).
LDA — Leading dimension of A exactly as specified in the dimension statement of the calling program. (Input)
Default: LDA = size (A,1).
LDFACT — Leading dimension of FACT exactly as specified in the dimension statement of the calling program. (Input)
Default: LDFACT = size (FACT,1).
FORTRAN 90 Interface
Generic: CALL LFTCB (A, NLCA, NUCA, FACT, IPVT [, …])
Specific: The specific interface names are S_LFTCB and D_LFTCB.
FORTRAN 77 Interface
Single: CALL LFTCB (N, A, LDA, NLCA, NUCA, FACT, LDFACT, IPVT)
Double: The double precision name is DLFTCB.
Description
Routine LFTCB performs an LU factorization of a complex banded coefficient matrix. The LU factorization is done using scaled partial pivoting. Scaled partial pivoting differs from partial pivoting in that the pivoting strategy is the same as if each row were scaled to have the same ∞-norm.
LFTCB fails if U, the upper triangular part of the factorization, has a zero diagonal element. This can occur only if A is singular or very close to a singular matrix.
The
LU factors are returned in a form that is compatible with routines
LFICB,
LFSCB and
LFDCB. To solve systems of equations with multiple right-hand-side vectors, use
LFTCB followed by either
LFICB or
LFSCB called once for each right-hand side. The routine
LFDCB can be called to compute the determinant of the coefficient matrix after
LFTCB has performed the factorization.
Let F be the matrix FACT, let ml = NLCA and let mu = NUCA. The first ml + mu + 1 rows of F contain the triangular matrix U in band storage form. The lower ml rows of F contain the multipliers needed to reconstruct L-1. LFTCB is based on the LINPACK routine CGBFA; see Dongarra et al. (1979). CGBFA uses unscaled partial pivoting.
Comments
1. Workspace may be explicitly provided, if desired, by use of L2TCB/DL2TCB The reference is:
CALL L2TCB (N, A, LDA, NLCA, NUCA, FACT, LDFACT, IPVT, WK)
The additional argument is:
WK — Complex work vector of length N used for scaling.
2. Informational error
Type | Code | Description |
---|
4 | 2 | The input matrix is singular. |
Example
A linear system with multiple right-hand sides is solved.
LFTCB is called to factor the coefficient matrix.
LFSCB is called to compute the two solutions for the two right-hand sides. In this case the coefficient matrix is assumed to be well-conditioned and correctly scaled. Otherwise, it would be better to call
LFCCB to perform the factorization, and
LFICB to compute the solutions.
USE LFTCB_INT
USE LFSCB_INT
USE WRCRN_INT
! Declare variables
INTEGER LDA, LDFACT, N, NLCA, NUCA
PARAMETER (LDA=3, LDFACT=4, N=4, NLCA=1, NUCA=1)
INTEGER IPVT(N)
COMPLEX A(LDA,N), B(N,2), FACT(LDFACT,N), X(N,2)
!
! Set values for A in band form, and B
!
! A = ( 0.0+0.0i 4.0+0.0i -2.0+2.0i -4.0-1.0i )
! ( 0.0-3.0i -0.5+3.0i 3.0-3.0i 1.0-1.0i )
! ( 6.0+1.0i 4.0+1.0i 0.0+2.0i 0.0+0.0i )
!
! B = ( -4.0-5.0i 16.0-4.0i )
! ( 9.5+5.5i -9.5+19.5i )
! ( 9.0-9.0i 12.0+12.0i )
! ( 0.0+8.0i -8.0-2.0i )
!
DATA A/(0.0,0.0), (0.0,-3.0), (6.0,1.0), (4.0,0.0), (-0.5,3.0),&
(4.0,1.0), (-2.0,2.0), (3.0,-3.0), (0.0,2.0), (-4.0,-1.0),&
(1.0,-1.0), (0.0,0.0)/
DATA B/(-4.0,-5.0), (9.5,5.5), (9.0,-9.0), (0.0,8.0),&
(16.0,-4.0), (-9.5,19.5), (12.0,12.0), (-8.0,-2.0)/
!
CALL LFTCB (A, NLCA, NUCA, FACT, IPVT)
! Solve for the two right-hand sides
DO 10 J=1, 2
CALL LFSCB (FACT, NLCA, NUCA, IPVT, B(:,J), X(:,J))
10 CONTINUE
! Print results
CALL WRCRN (’X’, X)
!
END
Output
X
1 2
1 ( 3.000, 0.000) ( 0.000, 4.000)
2 (-1.000, 1.000) ( 1.000,-1.000)
3 ( 3.000, 0.000) ( 0.000, 4.000)
4 (-1.000, 1.000) ( 1.000,-1.000)