LFICB
Uses iterative refinement to improve the solution of a complex system of linear equations in band storage mode.
Required Arguments
A — Complex NLCA + NUCA + 1 by N array containing the N by N coefficient matrix in band storage mode. (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 as output from routine LFCCB/DLFCCB or LFTCB/DLFTCB. (Input)
IPVT — Vector of length N containing the pivoting information for the LU factorization of A as output from routine LFCCB/DLFCCB or LFTCB/DLFTCB. (Input)
B — Complex vector of length N containing the right-hand side of the linear system. (Input)
X — Complex vector of length N containing the solution. (Output)
RES — Complex vector of length N containing the residual vector at the improved solution. (Output)
Optional Arguments
N — Number of equations. (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).
IPATH — Path indicator. (Input)
IPATH = 1 means the system AX = B is solved.
IPATH = 2 means the system AHX = B is solved.
Default: IPATH = 1.
FORTRAN 90 Interface
Generic: CALL LFICB (A, NLCA, NUCA, FACT, IPVT, B, X, RES [, …])
Specific: The specific interface names are S_LFICB and D_LFICB.
FORTRAN 77 Interface
Single: CALL LFICB (N, A, LDA, NLCA, NUCA, FACT, LDFACT, IPVT, B, IPATH, X, RES)
Double: The double precision name is DLFICB.
Description
Routine LFICB computes the solution of a system of linear algebraic equations having a complex banded coefficient matrix. Iterative refinement is performed on the solution vector to improve the accuracy. Usually almost all of the digits in the solution are accurate, even if the matrix is somewhat ill-conditioned.
To compute the solution, the coefficient matrix must first undergo an LU factorization. This may be done by calling either LFCCB or LFTCB.
Iterative refinement fails only if the matrix is very ill-conditioned.
LFICB and LFSCB both solve a linear system given its LU factorization. LFICB generally takes more time and produces a more accurate answer than LFSCB. Each iteration of the iterative refinement algorithm used by LFICB calls LFSCB.
Comments
Informational error
Type
Code
Description
3
3
The input matrix is too ill-conditioned for iterative refinement be effective.
Example
A set of linear systems is solved successively. The right-hand-side vector is perturbed after solving the system each of the first two times by adding (1 + i)/2 to the second element.
 
USE LFICB_INT
USE LFCCB_INT
USE WRCRN_INT
USE UMACH_INT
! Declare variables
INTEGER LDA, LDFACT, N, NLCA, NUCA, NOUT
PARAMETER (LDA=3, LDFACT=4, N=4, NLCA=1, NUCA=1)
INTEGER IPVT(N)
REAL RCOND
COMPLEX A(LDA,N), B(N), FACT(LDFACT,N), RES(N), X(N)
!
! 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 )
! ( -2.0-3.0i -0.5+3.0i 3.0-3.0i 1.0-1.0i )
! ( 6.0+1.0i 1.0+1.0i 0.0+2.0i 0.0+0.0i )
!
! B = ( -10.0-5.0i 9.5+5.5i 12.0-12.0i 0.0+8.0i )
!
DATA A/(0.0,0.0), (-2.0,-3.0), (6.0,1.0), (4.0,0.0), (-0.5,3.0),&
(1.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/(-10.0,-5.0), (9.5,5.5), (12.0,-12.0), (0.0,8.0)/
!
CALL LFCCB (A, NLCA, NUCA, FACT, IPVT, RCOND)
! Print the reciprocal condition number
CALL UMACH (2, NOUT)
WRITE (NOUT,99998) RCOND, 1.0E0/RCOND
! Solve the three systems
DO 10 J=1, 3
CALL LFICB (A, NLCA, NUCA, FACT, IPVT, B, X, RES)
! Print results
WRITE (NOUT, 99999) J
CALL WRCRN (’X’, X, 1, N, 1)
CALL WRCRN (’RES’, RES, 1, N, 1)
! Perturb B by adding 0.5+0.5i to B(2)
B(2) = B(2) + (0.5E0,0.5E0)
10 CONTINUE
!
99998 FORMAT (’ RCOND = ’,F5.3,/,’ L1 Condition number = ’,F6.3)
99999 FORMAT (//,’ For system ’,I1)
END
Output
 
RCOND = 0.014
L1 Condition number = 72.414
 
For system 1
X
1 2 3 4
( 3.000, 0.000) (-1.000, 1.000) ( 3.000, 0.000) (-1.000, 1.000)
 
RES
1 2 3
( 0.000E+00, 0.000E+00) ( 0.000E+00, 0.000E+00) ( 0.000E+00, 5.684E-14)
4
( 3.494E-22,-6.698E-22)
 
For system 2
X
1 2 3 4
( 3.235, 0.141) (-0.988, 1.247) ( 2.882, 0.129) (-0.988, 1.247)
 
RES
1 2 3
(-1.402E-08, 6.486E-09) (-7.012E-10, 4.488E-08) (-1.122E-07, 7.188E-09)
4
(-7.012E-10, 4.488E-08)
 
 
For system 3
X
1 2 3 4
( 3.471, 0.282) (-0.976, 1.494) ( 2.765, 0.259) (-0.976, 1.494)
 
RES
1 2 3
(-2.805E-08, 1.297E-08) (-1.402E-09,-2.945E-08) ( 1.402E-08, 1.438E-08)
4
(-1.402E-09,-2.945E-08)
Published date: 03/19/2020
Last modified date: 03/19/2020