LFCHF

 


   more...

Computes the UDUH factorization of a complex Hermitian matrix and estimate its L1 condition number.

Required Arguments

A — Complex N by N matrix containing the coefficient matrix of the Hermitian linear system. (Input)
Only the upper triangle of A is referenced.

FACT — Complex N by N matrix containing the information about the factorization of the Hermitian matrix A. (Output)
Only the upper triangle of FACT is used. If A is not needed, A and FACT can share the same storage locations.

IPVT — Vector of length N containing the pivoting information for the factorization. (Output)

RCOND — Scalar containing an estimate of the reciprocal of the L1 condition number of A. (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 LFCHF (A, FACT, IPVT, RCOND [])

Specific: The specific interface names are S_LFCHF and D_LFCHF.

FORTRAN 77 Interface

Single: CALL LFCHF (N, A, LDA, FACT, LDFACT, IPVT, RCOND)

Double: The double precision name is DLFCHF.

 

Description

Routine LFCHF performs a U DUH factorization of a complex Hermitian indefinite coefficient matrix. It also estimates the condition number of the matrix. The U DUH factorization is called the diagonal pivoting factorization.

The L1 condition number of the matrix A is defined to be κ(A) = A1A-11. Since it is expensive to compute A-11, the condition number is only estimated. The estimation algorithm is the same as used by LINPACK and is described by Cline et al. (1979).

If the estimated condition number is greater than 1/ɛ (where ɛ is machine precision), a warning error is issued. This indicates that very small changes in A can cause very large changes in the solution x. Iterative refinement can sometimes find the solution to such a system.

LFCHF fails if A is singular or very close to a singular matrix.

The U DUH factors are returned in a form that is compatible with routines LFIHF, LFSHF and LFDHF. To solve systems of equations with multiple right-hand-side vectors, use LFCHF followed by either LFIHF or LFSHF called once for each right-hand side. The routine LFDHF can be called to compute the determinant of the coefficient matrix after LFCHF has performed the factorization.

The underlying code is based on either LINPACK or LAPACK code depending upon which supporting libraries are used during linking. For a detailed explanation see Using ScaLAPACK, LAPACK, LINPACK, and EISPACK in the Introduction section of this manual.

Comments

1. Workspace may be explicitly provided, if desired, by use of L2CHF/DL2CHF. The reference is:

CALL L2CHF (N, A, LDA, FACT, LDFACT, IPVT, RCOND, CWK)

The additional argument is:

CWK — Complex work vector of length N.

2. Informational errors

 

Type

Code

Description

3

1

The input matrix is algorithmically singular.

3

4

The input matrix is not Hermitian. It has a diagonal entry with a small imaginary part.

4

2

The input matrix is singular.

4

4

The input matrix is not Hermitian. It has a diagonal entry with an imaginary part.

Example

The inverse of a 3 × 3 complex Hermitian matrix is computed. LFCHF is called to factor the matrix and to check for singularity or ill-conditioning. LFIHF is called to determine the columns of the inverse.

 

USE LFCHF_INT

USE UMACH_INT

USE LFIHF_INT

USE WRCRN_INT

! Declare variables

INTEGER LDA, N

PARAMETER (LDA=3, N=3)

INTEGER IPVT(N), NOUT

REAL RCOND

COMPLEX A(LDA,LDA), AINV(LDA,N), FACT(LDA,LDA), RJ(N), RES(N)

! Set values for A

!

! A = ( 3.0+0.0i 1.0-1.0i 4.0+0.0i )

! ( 1.0+1.0i 2.0+0.0i -5.0+1.0i )

! ( 4.0+0.0i -5.0-1.0i -2.0+0.0i )

!

DATA A/(3.0,0.0), (1.0,1.0), (4.0,0.0), (1.0,-1.0), (2.0,0.0),&

(-5.0,-1.0), (4.0,0.0), (-5.0,1.0), (-2.0,0.0)/

! Set output unit number

CALL UMACH (2, NOUT)

! Factor A and return the reciprocal

! condition number estimate

CALL LFCHF (A, FACT, IPVT, RCOND)

! Print the estimate of the condition

! number

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

! Set up the columns of the identity

! matrix one at a time in RJ

RJ = (0.0E0,0.0E0)

DO 10 J=1, N

RJ(J) = (1.0E0, 0.0E0)

! RJ is the J-th column of the identity

! matrix so the following LFIHF

! reference places the J-th column of

! the inverse of A in the J-th column

! of AINV

CALL LFIHF (A, FACT, IPVT, RJ, AINV(:,J), RES)

RJ(J) = (0.0E0, 0.0E0)

10 CONTINUE

! Print the inverse

CALL WRCRN (’AINV’, AINV)

!

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

END

Output

 

RCOND < 0.25

L1 Condition number < 6.0

 

AINV

1 2 3

1 ( 0.2000, 0.0000) ( 0.1200, 0.0400) ( 0.0800,-0.0400)

2 ( 0.1200,-0.0400) ( 0.1467, 0.0000) (-0.1267,-0.0067)

3 ( 0.0800, 0.0400) (-0.1267, 0.0067) (-0.0267, 0.0000)