Previous Next Contents Generated Index Doc Set Home



Reciprocal Condition Number of a UDU- or LDL-Factored Symmetric Matrix

The subroutines described in this section estimate the reciprocal condition number of a symmetric matrix A, which has been UDU-factored or LDL-factored by xSYTRF.

Calling Sequence

CALL DSYCON 
(UPLO, N, DA, LDA, IPIVOT, DANORM, DRCOND, DWORK, 
IWORK2, INFO)
CALL SSYCON 
(UPLO, N, SA, LDA, IPIVOT, SANORM, SRCOND, SWORK, 
IWORK2, INFO)
CALL ZSYCON 
(UPLO, N, ZA, LDA, IPIVOT, DANORM, DRCOND, ZWORK, INFO)
CALL CSYCON 
(UPLO, N, CA, LDA, IPIVOT, SANORM, SRCOND, CWORK, INFO)






void dsycon 
(char uplo, int n, double *da, int lda, int *ipivot, 
double danorm, double *drcond, int *info)
void ssycon 
(char uplo, int n, float *sa, int lda, int *ipivot, 
float sanorm, float *srcond, int *info)
void zsycon 
(char uplo, int n, doublecomplex *za, int lda, int 
*ipivot, double danorm, double *drcond, int *info)
void csycon 
(char uplo, int n, complex *ca, int lda, int *ipivot, 
float sanorm, float *srcond, int *info)

Arguments

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.

N

Order of the matrix A. N 0.

xA

UDU or LDL factorization of the matrix A as computed by xSYTRF.

LDA

Leading dimension of the array A as specified in a dimension or type statement. LDA max(1, N).

IPIVOT

Pivot indices as computed by xSYTRF.

xANORM

The 1-norm or -norm of 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 2 × N.

IWORK2

Scratch array with a dimension of N for real subroutines.

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
      PARAMETER        (N = 3)
      PARAMETER        (LDA = N)
      PARAMETER        (LDIWRK = N)
      PARAMETER        (LDWORK = 2 * N)
C
      DOUBLE PRECISION  A(LDA,N), ANORM, RCOND, WORK(LDWORK)
      INTEGER           ICOL, INFO, IROW, IPIVOT(N), IWORK(LDIWRK)
C
      EXTERNAL          DSYCON, DSYTRF
C
C     Initialize the array A to store the coefficient matrix A
C     shown below.
C
C         1  2  2
C     A = 2  1  2
C         2  2  1
C
      DATA A / 1.0D0, 2*8D8, 2.0D0, 1.0D0, 8D8, 2.0D0, 2.0D0,
     $         1.0D0 /
C
      PRINT 1000
      DO 100, IROW = 1, N
        PRINT 1010, (0.0D0, ICOL = 1, IROW - 1),
     $              (A(IROW, ICOL), ICOL = IROW, N)
  100 CONTINUE
      PRINT 1020
      DO 110, IROW = 1, LDA
        PRINT 1010, (A(IROW,ICOL), ICOL = 1, N)
  110 CONTINUE
C
      CALL DSYTRF ('UPPER TRIANGULAR A', N, A, LDA, IPIVOT,
     $             WORK, LDWORK, INFO)
      IF (INFO .EQ. 0) THEN
        ANORM = 5.0D0
        CALL DSYCON ('UPPER TRIANGULAR A', N, A, LDA, IPIVOT,
     $               ANORM, RCOND, WORK, IWORK, INFO)
        IF (INFO .EQ. 0) THEN
          PRINT 1030, 1.0D0 / RCOND
        ELSE
          PRINT 1040, INFO
        END IF
      ELSE
        PRINT 1050, INFO
      END IF
C
 1000 FORMAT (1X, 'A in full form:')
 1010 FORMAT (3(3X, F4.1))
 1020 FORMAT (/1X, 'A in symmetric form:  (* in unused elements)')
 1030 FORMAT (/1X, 'Estimated condition number: ', F6.2)
 1040 FORMAT (1X, 'Error computing condition number, INFO = ', I6)
 1050 FORMAT (1X, 'Factorization failed with INFO = ', I6)
C
      END
 

Sample Output

 
 A in full form:
    1.0    2.0    2.0
    0.0    1.0    2.0
    0.0    0.0    1.0



 A in symmetric form:  (* in unused elements)
    1.0    2.0    2.0
   ****    1.0    2.0
   ****   ****    1.0



 Estimated condition number:   7.00






Previous Next Contents Generated Index Doc Set Home