REAL*8 FUNCTION DTLGPD(N,A,LDA) C This function returns the log determinant of a positive definite C matrix A. C Inputs: C N Order of matrix C A Matrix C LDA Leading dimension of matrix C Output: C DTLGPD Log determinant of matrix IMPLICIT REAL*8 (A-H,O-Z) PARAMETER(LD=100) COMMON/SCRA/V1(LD),V2(LD),A1(LD,LD),A2(LD,LD) DIMENSION A(LDA,N) CALL DPDCK(A,LDA,N,INFO) IF(INFO.NE.0)GO TO 110 call dlftds(n,a,lda,a1,ld) AA=0.0D0 DO 10 I=1,N 10 AA=AA+DLOG(A1(I,I)) DTLGPD=2.0D0*AA RETURN 110 WRITE(6,115) 115 FORMAT(/,' *** NON-P.D. MATRIX IN DTLGPD',/,' PROGRAM STOPS.') STOP END