NAME cpbdi - compute the determinant of a symmetric positive definite matrix A in banded storage, which has been Cholesky-factored by xPBCO or xPBFA. SYNOPSIS SUBROUTINE DPBDI (DA, LDA, N, NDIAG, DDET) SUBROUTINE SPBDI (SA, LDA, N, NDIAG, SDET) SUBROUTINE ZPBDI (ZA, LDA, N, NDIAG, DDET) SUBROUTINE CPBDI (CA, LDA, N, NDIAG, SDET) #include <sunperf.h> void dpbdi(double *abd, int lda, int n, int m, double *det); void spbdi(float *abd, int lda, int n, int m, float *det); void zpbdi(doublecomplex *abd, int lda, int n, int m, double *det); void cpbdi(complex *abd, int lda, int n, int m, float *det); ARGUMENTS xA Cholesky factorization of the matrix A, as com- puted by xPBCO or xPBFA. LDA Leading dimension of the array A as specified in a dimension or type statement. LDA >= NDIAG + 1. N Order of the original matrix A. N >= 0. NDIAG Number of diagonals. N-1 >= NDIAG >= 0 but if N = 0 then NDIAG = 0. xDET On exit, the determinant of the matrix A. The determinant is stored as b * (10 ** expon) where b is stored in DET(1) and expon is stored in DET(2). 1.0 <= |DET(1)| <= 10.0 or DET(1) = 0.0. SAMPLE PROGRAM PROGRAM TEST IMPLICIT NONE C INTEGER LDA, N, NDIAG PARAMETER (N = 4) PARAMETER (NDIAG = 1) PARAMETER (LDA = NDIAG + 1) C DOUBLE PRECISION A(LDA,N), DET(2) INTEGER ICOL, INFO, IROW, NDIAG EXTERNAL DPBDI, DPBFA C C Initialize the array A to store in banded storage mode C the matrix A shown below. C C 2 -1 0 0 C A = -1 2 -1 0 C 0 -1 2 -1 C 0 0 -1 2 C DATA A / 8D8, 2.0D0, -1.0D0, 2.0D0, -1.0D0, 2.0D0, -1.0D0, 2.0D0 / C PRINT 1000 PRINT 1010, A(2,1), A(1,2) PRINT 1010, A(3,1), A(2,2), A(1,3) PRINT 1020, A(3,2), A(2,3), A(1,4) PRINT 1030, A(3,3), A(2,4) PRINT 1040 PRINT 1010, ((A(IROW,ICOL), ICOL = 1, N), IROW = 1, LDA) CALL DPBFA (A, LDA, N, NDIAG, INFO) IF (INFO .EQ. 0) THEN CALL DPBDI (A, LDA, N, NDIAG, DET) PRINT 1050, DET(1) * (10.0D0 ** DET(2)) ELSE PRINT 1060 END IF C 1000 FORMAT (1X, 'A in full form:') 1010 FORMAT (4(3X, F5.1)) 1020 FORMAT (8X, 3(3X, F5.1)) 1030 FORMAT (16X, 3(3X, F5.1)) 1040 FORMAT (/1X, 'A in banded form: (* in unused entries)') 1050 FORMAT (/1X, 'The determinant of A is ', F5.1) 1060 FORMAT (/1X, 'A is not positive definite.') C END SAMPLE OUTPUT A in full form: 2.0 -1.0 -1.0 2.0 -1.0 -1.0 2.0 -1.0 -1.0 2.0 A in banded form: (* in unused entries) ***** -1.0 -1.0 -1.0 2.0 2.0 2.0 2.0 The determinant of A is 5.0
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |