Previous Next Contents Generated Index Doc Set Home



Reciprocal Condition Number of a Triangular Matrix

The subroutines described in this section estimate the reciprocal condition number, in either the 1-norm or the -norm, of a triangular matrix A.

Calling Sequence

CALL DTRCON 
(NORM, UPLO, DIAG, N, DA, LDA, DRCOND, DWORK, IWORK2, 
INFO)
CALL STRCON 
(NORM, UPLO, DIAG, N, SA, LDA, SRCOND, SWORK, IWORK2, 
INFO)
CALL ZTRCON 
(NORM, UPLO, DIAG, N, ZA, LDA, DRCOND, ZWORK, DWORK2, 
INFO)
CALL CTRCON 
(NORM, UPLO, DIAG, N, CA, LDA, SRCOND, CWORK, SWORK2, 
INFO)






void dtrcon 
(char norm, char uplo, char diag, int n, double *da, 
int lda, double *drcond, int *info)
void strcon 
(char norm, char uplo, char diag, int n, float *sa, int 
lda, float *srcond, int *info)
void ztrcon 
(char norm, char uplo, char diag, int n, doublecomplex 
*za, int lda, double *drcond, int *info)
void ctrcon 
(char norm, char uplo, char diag, int n, 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.

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 max(1, N).

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
      DOUBLE PRECISION  ZERO
      INTEGER           LDA, LDIWRK, LDWORK, N
      PARAMETER        (N = 3)
      PARAMETER        (LDA = N)
      PARAMETER        (LDIWRK = N)
      PARAMETER        (LDWORK = 3 * N)
      PARAMETER        (ZERO = 0.0D0)
C
      DOUBLE PRECISION  A(LDA,N), RCOND, WORK(LDWORK)
      INTEGER           ICOL, INFO, IROW, IWORK(LDIWRK)
C
      EXTERNAL          DTRCON
      INTRINSIC         ABS
C
C     Initialize A to store in triangular form the matrix A
C     shown below.
C
C         1
C     A = 2  2
C         3  3  3
C
      DATA A / 1.0D0, 2.0D0, 3.0D0, 8D8, 2.0D0, 3.0D0, 8D8, 8D8,
     $         3.0D0 /
C
C     Print the initial value of A.
C
      PRINT 1000
      DO 100, IROW = 1, N
        PRINT 1010, (A(IROW, ICOL), ICOL = 1, IROW),
     $              (ZERO, ICOL = IROW + 1, N)
  100 CONTINUE
      PRINT 1020
      DO 110, IROW = 1, LDA
        PRINT 1010, (A(IROW,ICOL), ICOL = 1, N)
  110 CONTINUE
C
      CALL DTRCON ('ONE-NORM OF A', 'LOWER TRIANGULAR A',
     $             'NO UNIT DIAGONAL A', N, 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 ('A in full form:')
 1010 FORMAT (3(3X, F19.16))
 1020 FORMAT (/1X, 'A in triangular form: ',
     $        ' (* in unused positions)')
 1030 FORMAT (1X, 'Illegal argument to DTRCON, argument #', I2)
 1040 FORMAT (/1X, 'Estimated condition number of A: ', F7.4)
C
      END
 

Sample Output

 
A in full form:
    1.0000000000000000    0.0000000000000000    0.0000000000000000
    2.0000000000000000    2.0000000000000000    0.0000000000000000
    3.0000000000000000    3.0000000000000000    3.0000000000000000



 A in triangular form:  (* in unused positions)
    1.0000000000000000   *******************   *******************
    2.0000000000000000    2.0000000000000000   *******************
    3.0000000000000000    3.0000000000000000    3.0000000000000000



 Estimated condition number of A: 12.0000






Previous Next Contents Generated Index Doc Set Home