sgbdi(3P)
NAME
sgbdi - compute the determinant of a general matrix A in banded storage, which has been LU-factored by xGBCO or xGBFA.
SYNOPSIS
SUBROUTINE DGBDI (DA, LDA, N, NSUB, NSUPER, IPIVOT, DDET)
SUBROUTINE SGBDI (SA, LDA, N, NSUB, NSUPER, IPIVOT, SDET)
SUBROUTINE ZGBDI (ZA, LDA, N, NSUB, NSUPER, IPIVOT, ZDET)
SUBROUTINE CGBDI (CA, LDA, N, NSUB, NSUPER, IPIVOT, CDET)
#include <sunperf.h>
void dgbdi(double ∗abd, int lda, int n, int ml, int mu, int ∗ipivot, double ∗det) ;
void sgbdi(float ∗abd, int lda, int n, int ml, int mu, int ∗ipivot, float ∗det) ;
void zgbdi(doublecomplex ∗abd, int lda, int n, int ml, int mu, int ∗ipivot, doublecomplex ∗det) ;
void cgbdi(complex ∗abd, int lda, int n, int ml, int mu, int ∗ipivot, complex ∗det) ;
ARGUMENTS
xA LU factorization of the matrix A, as computed by xGBCO or xGBFA.
LDA Leading dimension of the array A as specified in a dimension or type statement. LDA >= 2 ∗ NSUB + NSUPER + 1.
N Order of the original matrix A. N >= 0.
NSUB Number of subdiagonals of A. N-1 >= NSUB >= 0 but if N = 0 then NSUB = 0.
NSUPER Number of superdiagonals of A. N-1 >= NSUPER >= 0 but if N = 0 then NSUPER = 0.
IPIVOT Pivot vector as computed by xGBCO or xGBFA.
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, NSUB, NSUPER
PARAMETER (N = 5)
PARAMETER (NSUB = 4)
PARAMETER (NSUPER = 0)
PARAMETER (NDIAG = NSUB + 1 + NSUPER)
PARAMETER (LDA = NSUB + NDIAG)
C
DOUBLE PRECISION A(LDA,N), DET(2)
INTEGER ICOL, INFO, IPIVOT(N), IROW
C
EXTERNAL DGBDI, DGBFA
C
C Initialize the array A to store the 5x5 matrix A with four
C subdiagonals and no superdiagonals shown below.
C
C 1
C 1 -1
C A = 1 -2 1
C 1 -3 3 -1
C 1 -4 6 -4 1
C
DATA A / 4∗8D8, 5∗1.0D0, 4∗8D8, -1.0D0, -2.0D0, -3.0D0, -4.0D0,
$ 5∗8D8,1.0D0, 3.0D0, 6.0D0, 6∗8D8, -1.0D0, -4.0D0,
$ 7∗8D8, 1.0D0, 4∗8D8 /
C
C Print the initial values of the arrays.
C
PRINT 1000
PRINT 1010, A(5,1)
PRINT 1010, A(6,1), A(5,2)
PRINT 1010, A(7,1), A(6,2), A(5,3)
PRINT 1010, A(8,1), A(7,2), A(6,3), A(5,4)
PRINT 1010, A(9,1), A(8,2), A(7,3), A(6,4), A(5,5)
PRINT 1020
PRINT 1010, ((A(IROW,ICOL), ICOL = 1, N),
$ IROW = 1, 2 ∗ NSUB + 1 + NSUPER)
C
C Factor the matrix in banded form.
C
CALL DGBFA (A, LDA, N, NSUB, NSUPER, IPIVOT, INFO)
IF (INFO .EQ. 0) THEN
CALL DGBDI (A, LDA, N, NSUB, NSUPER, IPIVOT, DET)
PRINT 1030, DET(1) ∗ (1.0D1 ∗∗ DET(2))
ELSE
PRINT 1040, INFO
END IF
C
1000 FORMAT (1X, ’A in full form:’)
1010 FORMAT (5(3X, F4.1))
1020 FORMAT (/1X, ’A in banded form: (∗ in unused elements)’)
1030 FORMAT (/1X, ’det(A) = ’, F4.1)
1040 FORMAT (/1X, ’A appears singular at ’, I2)
C
END
SAMPLE OUTPUT
A in full form:
1.0
1.0 -1.0
1.0 -2.0 1.0
1.0 -3.0 3.0 -1.0
1.0 -4.0 6.0 -4.0 1.0
A in banded form: (∗ in unused elements)
∗∗∗∗ ∗∗∗∗ ∗∗∗∗ ∗∗∗∗ ∗∗∗∗
∗∗∗∗ ∗∗∗∗ ∗∗∗∗ ∗∗∗∗ ∗∗∗∗
∗∗∗∗ ∗∗∗∗ ∗∗∗∗ ∗∗∗∗ ∗∗∗∗
∗∗∗∗ ∗∗∗∗ ∗∗∗∗ ∗∗∗∗ ∗∗∗∗
1.0 -1.0 1.0 -1.0 1.0
1.0 -2.0 3.0 -4.0 ∗∗∗∗
1.0 -3.0 6.0 ∗∗∗∗ ∗∗∗∗
1.0 -4.0 ∗∗∗∗ ∗∗∗∗ ∗∗∗∗
1.0 ∗∗∗∗ ∗∗∗∗ ∗∗∗∗ ∗∗∗∗
det(A) = 1.0
SunOS 5.0 — Last change: 10 Dec 1998