LFISF

Uses iterative refinement to improve the solution of a real symmetric system of linear equations.

Required Arguments

A — N by N matrix containing the coefficient matrix of the symmetric linear system. (Input)

Only the upper triangle of A is referenced

Only the upper triangle of A is referenced

FACT — N by N matrix containing the factorization of the coefficient matrix A as output from routine LFCSF/DLFCSF or LFTSF/DLFTSF. (Input)

Only the upper triangle of FACT is used.

Only the upper triangle of FACT is used.

IPVT — Vector of length N containing the pivoting information for the factorization of A as output from routine LFCSF/DLFCSF or LFTSF/DLFTSF. (Input)

B — Vector of length N containing the right-hand side of the linear system. (Input)

X — Vector of length N containing the solution to the linear system. (Output)

If B is not needed, B and X can share the same storage locations.

If B is not needed, B and X can share the same storage locations.

RES — 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).

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).

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).

Default: LDFACT = size (FACT,1).

FORTRAN 90 Interface

Generic: CALL LFISF (A, FACT, IPVT, B, X, RES [, …])

Specific: The specific interface names are S_LFISF and D_LFISF.

FORTRAN 77 Interface

Single: CALL LFISF (N, A, LDA, FACT, LDFACT, IPVT, B, X, RES)

Double: The double precision name is DLFISF.

Description

Routine LFISF computes the solution of a system of linear algebraic equations having a real symmetric indefinite 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 a U DUT factorization. This may be done by calling either LFCSF or LFTSF.

Iterative refinement fails only if the matrix is very ill-conditioned.

LFISF and LFSSF both solve a linear system given its U DUT factorization. LFISF generally takes more time and produces a more accurate answer than LFSSF. Each iteration of the iterative refinement algorithm used by LFISF calls LFSSF.

Comments

Informational error

Type | Code | Description |
---|---|---|

3 | 2 | The input matrix is too ill-conditioned for iterative refinement to 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 0.2 to the second element.

USE LFISF_INT

USE UMACH_INT

USE LFCSF_INT

USE WRRRN_INT

! Declare variables

PARAMETER (LDA=3, N=3)

INTEGER IPVT(N), NOUT

REAL A(LDA,LDA), B(N), X(N), FACT(LDA,LDA), RES(N), RCOND

!

! Set values for A and B

! A = ( 1.0 -2.0 1.0)

! ( -2.0 3.0 -2.0)

! ( 1.0 -2.0 3.0)

!

! B = ( 4.1 -4.7 6.5)

!

DATA A/1.0, -2.0, 1.0, -2.0, 3.0, -2.0, 1.0, -2.0, 3.0/

DATA B/4.1, -4.7, 6.5/

! Factor A and compute the estimate

! of the reciprocal condition number

CALL LFCSF (A, FACT, IPVT, RCOND)

! Print condition number

CALL UMACH (2, NOUT)

WRITE (NOUT,99999) RCOND, 1.0E0/RCOND

! Solve, then perturb right-hand side

DO 10 I=1, 3

CALL LFISF (A, FACT, IPVT, B, X, RES)

! Print results

CALL WRRRN (’X’, X, 1, N, 1)

CALL WRRRN (’RES’, RES, 1, N, 1)

B(2) = B(2) + .20E0

10 CONTINUE

!

99999 FORMAT (’ RCOND = ’,F5.3,/,’ L1 Condition number = ’,F6.3)

END

Output

RCOND < 0.035

L1 Condition number < 40.0

X

1 2 3

-4.100 -3.500 1.200

RES

1 2 3

-2.384E-07 -2.384E-07 0.000E+00

X

1 2 3

-4.500 -3.700 1.200

RES

1 2 3

-2.384E-07 -2.384E-07 0.000E+00

X

1 2 3

-4.900 -3.900 1.200

RES

1 2 3

-2.384E-07 -2.384E-07 0.000E+00