LFDHF
Computes the determinant of a complex Hermitian matrix given the U DUH factorization of the matrix.
Required Arguments
FACT — Complex N by N matrix containing the factorization of the coefficient matrix A as output from routine LFCHF/DLFCHF or LFTHF/DLFTHF. (Input)
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 LFCHF/DLFCHF or LFTHF/DLFTHF. (Input)
DET1 — Scalar containing the mantissa of the determinant. (Output)
The value DET1 is normalized so that 1.0 ≤ ∣DET1∣ < 10.0 or DET1 = 0.0.
DET2 — Scalar containing the exponent of the determinant. (Output)
The determinant is returned in the form det(A) = DET1 * 10DET2.
Optional Arguments
N — Number of equations. (Input)
Default: N = size (FACT,2).
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 LFDHF (FACT, IPVT, DET1, DET2 [, …])
Specific: The specific interface names are S_LFDHF and D_LFDHF.
FORTRAN 77 Interface
Single: CALL LFDHF (N, FACT, LDFACT, IPVT, DET1, DET2)
Double: The double precision name is DLFDHF.
Description
Routine LFDHF computes the determinant of a complex Hermitian indefinite coefficient matrix. To compute the determinant, the coefficient matrix must first undergo a U DUH factorization. This may be done by calling either LFCHF or LFTHF since det U = ±1, the formula det A = det U det D det UH = det D is used to compute the determinant. det D is computed as the product of the determinants of its blocks.
LFDHF is based on the LINPACK routine CSIDI; see Dongarra et al. (1979).
Example
The determinant is computed for a complex Hermitian 3 × 3 matrix.
USE LFDHF_INT
USE LFTHF_INT
USE UMACH_INT
! Declare variables
INTEGER LDA, N
PARAMETER (LDA=3, N=3)
INTEGER IPVT(N), NOUT
REAL DET1, DET2
COMPLEX A(LDA,LDA), FACT(LDA,LDA)
!
! 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)/
! Factor A
CALL LFTHF (A, FACT, IPVT)
! Compute the determinant
CALL LFDHF (FACT, IPVT, DET1, DET2)
! Print the results
CALL UMACH (2, NOUT)
WRITE (NOUT,99999) DET1, DET2
!
99999 FORMAT (’ The determinant is’, F5.1, ’ * 10**’, F2.0)
END
The determinant is -1.5 * 10**2.