Previous Next Contents Generated Index Doc Set Home



Reciprocal Condition Number of an LU-Factored General Matrix in Banded Storage

The subroutines described in this section estimate the reciprocal condition number, in either the 1-norm or the -norm, of a general matrix A in banded storage, which has been LU-factored by xGBTRF.

Calling Sequence

CALL DGBCON 
(NORM, N, NSUB, NSUPER, DA, LDA, IPIVOT, DANORM, 
DRCOND, DWORK, IWORK2, INFO)
CALL SGBCON 
(NORM, N, NSUB, NSUPER, SA, LDA, IPIVOT, SANORM, 
SRCOND, SWORK, IWORK2, INFO)
CALL ZGBCON 
(NORM, N, NSUB, NSUPER, ZA, LDA, IPIVOT, DANORM, 
DRCOND, ZWORK, DWORK2, INFO)
CALL CGBCON 
(NORM, N, NSUB, NSUPER, CA, LDA, IPIVOT, SANORM, 
SRCOND, CWORK, SWORK2, INFO)






void dgbcon
(char norm, int n, int nsub, int nsuper, double *da, 
int lda, int *ipivot, double danorm, double *drcond, 
int *info)
void sgbcon
(char norm, int n, int nsub, int nsuper, float *sa, int 
lda, int *ipivot, float sanorm, float *srcond, int 
*info)
void zgbcon
(char norm, int n, int nsub, int nsuper, doublecomplex 
*za, int lda, int *ipivot, double danorm, double 
*drcond, int *info)
void cgbcon
(char norm, int n, int nsub, int nsuper, complex *ca, 
int lda, int *ipivot, float sanorm, float *srcond, int 
*info)

Arguments

NORM

Indicates whether the 1-norm condition number or the -norm condition number is required. The legal values for NORM are listed below. Any values not listed below are illegal.

'O', 'o', or '1'

1-norm condition number is required.

'I' or 'i'

-norm condition number is required.

N

Order of the 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.

xA

LU factorization of the matrix A, as computed by xGBTRF.

LDA

Leading dimension of the array A as specified in a dimension or type statement. LDA 2 × NSUB + NSUPER + 1.

IPIVOT

Pivot indices as computed by xGBTRF.

xANORM

On entry, if NORM = 'O', 'o', or '1', then ANORM contains the 1-norm of the original matrix A; if NORM = 'I' or 'i,' then ANORM contains the -norm of the original matrix A.

xRCOND

On exit, the estimated reciprocal of the condition number of the matrix A where the reciprocal condition number of A is defined to be 1 / (ANORM × ||A-1||). The reciprocal of the condition number is estimated instead of the condition number itself to avoid overflow or division by zero. If RCOND is less than machine precision (in particular, if RCOND = 0) then A is singular to working precision.

xWORK

Scratch array with a dimension of 3 × N for real subroutines or 2 × N for complex subroutines.

xWORK2

Scratch array with a dimension of N.

INFO

On exit:

INFO = 0

Subroutine completed normally.

INFO < 0

The ith argument, where i = |INFO|, had an illegal value

Sample Program




      PROGRAM TEST
      IMPLICIT NONE
C
      INTEGER           LDA, LDWORK, N, NSUB, NSUPER
      PARAMETER        (N = 5)
      PARAMETER        (NSUB = 4)
      PARAMETER        (NSUPER = 0)
      PARAMETER        (LDA = 2*NSUB + 1 + NSUPER)
      PARAMETER        (LDWORK = 3 * N)
C
      DOUBLE PRECISION  A(LDA,N), ANORM, RCOND, WORK(LDWORK)
      INTEGER           ICOL, INFO, IPIVOT(N), IROW, IWORK(N)
C
      EXTERNAL          DGBCON, DGBTRF
      INTRINSIC         ABS
C
C     Initialize the array A to store in banded form the 5x5
C     matrix A with four subdiagonals and no superdiagonals 
C     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 / NSUB*8D8, 5*1.0D0,
     $         NSUB*8D8, -1.0D0, -2.0D0, -3.0D0, -4.0D0, 8D8,
     $         NSUB*8D8, 1.0D0, 3.0D0, 6.0D0, 2*8D8,
     $         NSUB*8D8, -1.0D0, 4.0D0, 3*8D8,
     $         NSUB*8D8, 1.0D0, 4*8D8 /
C
C     Print the initial values of the arrays.
C
      PRINT 1000
      DO 100, IROW = NSUB + 1, LDA
        PRINT 1010,
     $     (A(IROW - ICOL + 1, ICOL), ICOL = 1, IROW - NSUB),
     $     (0.0D0, ICOL = 1, N - IROW)
  100 CONTINUE
      PRINT 1020
      PRINT 1010, ((A(IROW,ICOL), ICOL = 1, N), IROW = 1, LDA)
C
C     LU factor A.
C
      CALL DGBTRF (N, N, NSUB, NSUPER, A, LDA, IPIVOT, INFO)
      IF (INFO .NE. 0) THEN
        PRINT 1030, INFO
        STOP 1
      END IF
C
C     Compute and print the condition number of A.
C
      ANORM = 1.0D1
      CALL DGBCON ('ONE NORM', N, NSUB, NSUPER, A, LDA, IPIVOT,
     $             ANORM, RCOND, WORK, IWORK, INFO)
      IF (INFO .NE. 0) THEN
        PRINT 1040, ABS(INFO)
        STOP 2
      END IF
      PRINT 1050, 1.0D0 / RCOND
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, 'Error factoring A, INFO = ', I5)
 1040 FORMAT (1X, 'Illegal argument to DGBCON, argument #', I2)
 1050 FORMAT (/1X, 'Estimated condition number of A = ', F8.4)
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   ****   ****   ****   ****



 Estimated condition number of A = 260.0000






Previous Next Contents Generated Index Doc Set Home