LFDSF
Computes the determinant of a real symmetric matrix given the U DUT factorization of the matrix.
Required Arguments
FACT — N by N matrix containing the factored matrix A as output from subroutine LFTSF/DLFTSF or LFCSF/DLFCSF. (Input)
IPVT — Vector of length N containing the pivoting information for the U DUT factorization as output from routine LFTSF/DLFTSF or LFCSF/DLFCSF. (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 — Order of the matrix. (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 LFDSF (FACT, IPVT, DET1, DET2 [, …])
Specific: The specific interface names are S_LFDSF and D_LFDSF.
FORTRAN 77 Interface
Single: CALL LFDSF (N, FACT, LDFACT, IPVT, DET1, DET2)
Double: The double precision name is DLFDSF.
Description
Routine LFDSF computes the determinant of a real symmetric indefinite coefficient matrix. To compute the determinant, the coefficient matrix must first undergo a U DUT factorization. This may be done by calling either LFCSF or LFTSF. Since det U = ±1, the formula det A = det U det D det UT = det D is used to compute the determinant. Next det D is computed as the product of the determinants of its blocks.
LFDSF is based on the LINPACK routine SSIDI; see Dongarra et al. (1979).
Example
The determinant is computed for a real symmetric 3 × 3 matrix.
USE LFDSF_INT
USE LFTSF_INT
USE UMACH_INT
! Declare variables
PARAMETER (LDA=3, N=3)
INTEGER IPVT(N), NOUT
REAL A(LDA,LDA), FACT(LDA,LDA), DET1, DET2
!
! Set values for A
! A = ( 1.0 -2.0 1.0)
! ( -2.0 3.0 -2.0)
! ( 1.0 -2.0 3.0)
!
DATA A/1.0, -2.0, 1.0, -2.0, 3.0, -2.0, 1.0, -2.0, 3.0/
! Factor A
CALL LFTSF (A, FACT, IPVT)
! Compute the determinant
CALL LFDSF (FACT, IPVT, DET1, DET2)
! Print the results
CALL UMACH (2, NOUT)
WRITE (NOUT,99999) DET1, DET2
99999 FORMAT (’ The determinant of A is ’, F6.3, ’ * 10**’, F2.0)
END
The determinant of A is -2.000 * 10**0.