LFDDS
Computes the determinant of a real symmetric positive definite matrix given the RTR Cholesky factorization of the matrix .
Required Arguments
FACT — N by N matrix containing the RT R factorization of the coefficient matrix A as output from routine LFCDS/DLFCDS or LFTDS/DLFTDS. (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 LFDDS (FACT, DET1, DET2 [, …])
Specific: The specific interface names are S_LFDDS and D_LFDDS.
FORTRAN 77 Interface
Single: CALL LFDDS (N, FACT, LDFACT, DET1, DET2)
Double: The double precision name is DLFDDS.
Description
Routine LFDDS computes the determinant of a real symmetric positive definite coefficient matrix. To compute the determinant, the coefficient matrix must first undergo an RTR factorization. This may be done by calling either LFCDS or LFTDS. The formula det A = det RT det R = (det R)2 is used to compute the determinant. Since the determinant of a triangular matrix is the product of the diagonal elements,
(The matrix R is stored in the upper triangle of FACT.)
LFDDS is based on the LINPACK routine SPODI; see Dongarra et al. (1979).
Example
The determinant is computed for a real positive definite 3 × 3 matrix.
USE LFDDS_INT
USE LFTDS_INT
USE UMACH_INT
! Declare variables
INTEGER LDA, LDFACT, NOUT
PARAMETER (LDA=3, LDFACT=3)
REAL A(LDA,LDA), DET1, DET2, FACT(LDFACT,LDFACT)
!
! Set values for A
! A = ( 1.0 -3.0 2.0)
! ( -3.0 20.0 -5.0)
! ( 2.0 -5.0 6.0)
!
DATA A/1.0, -3.0, 2.0, -3.0, 20.0, -5.0, 2.0, -5.0, 6.0/
! Factor the matrix
CALL LFTDS (A, FACT)
! Compute the determinant
CALL LFDDS (FACT, DET1, DET2)
! Print 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.100 * 10**1.