Previous Next Contents Generated Index Doc Set Home



Reciprocal Condition Number of a Triangular 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 triangular matrix A in banded storage.

Calling Sequence

CALL DTBCON 
(NORM, UPLO, DIAG, N, NDIAG, DA, LDA, DRCOND, DWORK, 
IWORK2, INFO)
CALL STBCON 
(NORM, UPLO, DIAG, N, NDIAG, SA, LDA, SRCOND, SWORK, 
IWORK2, INFO)
CALL ZTBCON 
(NORM, UPLO, DIAG, N, NDIAG, ZA, LDA, DRCOND, ZWORK, 
DWORK2, INFO)
CALL CTBCON 
(NORM, UPLO, DIAG, N, NDIAG, CA, LDA, SRCOND, CWORK, 
SWORK2, INFO)






void dtbcon 
(char norm, char uplo, char diag, int n, int ndiag, 
double *da, int lda, double *drcond, int *info)
void stbcon 
(char norm, char uplo, char diag, int n, int ndiag, 
float *sa, int lda, float *srcond, int *info)
void ztbcon 
(char norm, char uplo, char diag, int n, int ndiag, 
doublecomplex *za, int lda, double *drcond, int *info)
void ctbcon 
(char norm, char uplo, char diag, int n, int ndiag, 
complex *ca, int lda, 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.

UPLO

Indicates whether xA contains the upper or lower triangle of the matrix. The legal values for UPLO are listed below. Any values not listed below are illegal.

'U' or 'u'

xA contains the upper triangle.

'L' or 'l'

xA contains the lower triangle.

DIAG

Indicates whether or not A is unit triangular. The legal values for DIAG are listed below. Any values not listed below are illegal.

'N' or 'n'

A is not unit triangular.

'U' or 'u'

A is unit triangular.

N

Order of the matrix A. N 0.

NDIAG

Number of superdiagonals or subdiagonals of the triangular matrix A. N-1 NDIAG 0 but if N = 0 then NDIAG = 0.

xA

Upper or lower triangular matrix A. If DIAG = 'U' or 'u', the diagonal elements of A are assumed to be 1 and are not used.

LDA

Leading dimension of the array A as specified in a dimension or type statement. LDA NDIAG + 1.

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 / (||A|| × ||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, LDIWRK, LDWORK, N, NSUB
      PARAMETER        (N = 5)
      PARAMETER        (NSUB = 2)
      PARAMETER        (LDA = 2*NSUB + 1)
      PARAMETER        (LDIWRK = N)
      PARAMETER        (LDWORK = 3 * N)
C
      DOUBLE PRECISION  A(LDA,N), RCOND, WORK(LDWORK)
      INTEGER           ICOL, INFO, IROW, IWORK(LDIWRK)
C
      EXTERNAL          DTBCON
      INTRINSIC         ABS, MAX
C
C     Initialize the array A to store in banded form the 5x5
C     matrix A with two subdiagonals and no superdiagonals
C     shown below.
C
C         1
C         1  -1
C     A = 1  -2  1
C            -3  3  -1
C                6  -4  1
C
      DATA A / NSUB*8D8, 1.0D0, 1.0D0, 1.0D0,
     $         NSUB*8D8, -1.0D0, -2.0D0, -3.0D0,
     $         NSUB*8D8, 1.0D0, 3.0D0, 6.0D0,
     $         NSUB*8D8, -1.0D0, 4.0D0, 8D8,
     $         NSUB*8D8, 1.0D0, 8D8, 8D8 /
C
C     Print the initial values of the arrays.
C
      PRINT 1000
      DO 100, IROW = 1, N
        PRINT 1010, (0.0D0, ICOL = 1, IROW - NSUB - 1),
     $              (A(NSUB + 1 + IROW - ICOL, ICOL),
     $               ICOL = MAX(1,IROW - NSUB), IROW),
     $              (0.0D0, ICOL = IROW + 1, N)
  100 CONTINUE
      PRINT 1020
      PRINT 1010, ((A(IROW,ICOL), ICOL = 1, N), IROW = 1, LDA)
C
C     Compute and print the condition number of A.
C
      CALL DTBCON ('ONE-NORM', 'LOWER TRIANGULAR A',
     $             'NOT UNIT DIAGONAL A', N, NSUB, A, LDA, RCOND,
     $             WORK, IWORK, INFO)
      IF (INFO .NE. 0) THEN
        PRINT 1030, ABS(INFO)
        STOP 1
      END IF
      PRINT 1040, 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, 'Illegal argument to DTBCON, argument #', I2)
 1040 FORMAT (/1X, 'Estimated condition number of A = ', F8.4)
C
      END
 

Sample Output

 
 A in full form:
    1.0    0.0    0.0    0.0    0.0
    1.0   -1.0    0.0    0.0    0.0
    1.0   -2.0    1.0    0.0    0.0
    0.0   -3.0    3.0   -1.0    0.0
    0.0    0.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   ****   ****



 Estimated condition number of A =   5.3333






Previous Next Contents Generated Index Doc Set Home