Previous Next Contents Generated Index Doc Set Home



Reciprocal Condition Number of a Cholesky-Factored Symmetric Positive Definite Matrix

The subroutines described in this section estimate the reciprocal condition number of a real symmetric (or Hermitian) positive definite matrix A, which has been Cholesky-factored by xPOTRF.

Calling Sequence

CALL DPOCON 
(UPLO, N, DA, LDA, DANORM, DRCOND, DWORK, IWORK2, INFO)
CALL SPOCON 
(UPLO, N, SA, LDA, SANORM, SRCOND, SWORK, IWORK2, INFO)
CALL ZPOCON 
(UPLO, N, ZA, LDA, DANORM, DRCOND, ZWORK, DWORK2, INFO)
CALL CPOCON 
(UPLO, N, CA, LDA, SANORM, SRCOND, CWORK, SWORK2, INFO)






void dpocon 
(char uplo, int n, double *da, int lda, double danorm, 
double *drcond, int *info)
void spocon 
(char uplo, int n, float *sa, int lda, float sanorm, 
float *srcond, int *info)
void zpocon 
(char uplo, int n, doublecomplex *za, int lda, double 
danorm, double *drcond, int *info)
void cpocon 
(char uplo, int n, complex *ca, int lda, 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

Cholesky factorization of the matrix A as computed by xPOTRF.

LDA

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

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 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
      PARAMETER        (N = 4)
      PARAMETER        (LDA = N)
      PARAMETER        (LDIWRK = N)
      PARAMETER        (LDWORK = 3 * N)
C
      DOUBLE PRECISION  A(LDA,N), ANORM, RCOND, WORK(LDWORK)
      INTEGER           ICOL, INFO, IROW, IWORK(LDIWRK)
C
      EXTERNAL          DPOCON, DPOTRF
      INTRINSIC         ABS
C
C     Initialize the array A to store in symmetric form the 4x4
C     symmetric positive definite matrix A shown below.
C
C          2  -1   0   0
C     A = -1   2  -1   0
C          0  -1   2  -1
C          0   0  -1   2
C
      DATA A /  2.0D0, 3*8D8, -1.0D0, 2.0D0, 2*8D8, 0.0D0, -1.0D0,
     $          2.0D0, 8D8, 0.0D0, 0.0D0, -1.0D0, 2.0D0 /
C
C     Print the initial values of the arrays.
C
      PRINT 1000
      DO 100, IROW = 1, N
        PRINT 1010, (A(ICOL,IROW), ICOL = 1, IROW - 1),
     $              (A(IROW,ICOL), ICOL = IROW, N)
  100 CONTINUE
      PRINT 1020
      PRINT 1010, ((A(IROW,ICOL), ICOL = 1, N), IROW = 1, LDA)
C
C     Cholesky factor A.
C
      CALL DPOTRF ('UPPER TRIANGLE OF A STORED', N, A, LDA, 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 = 3.0D0
      CALL DPOCON ('UPPER TRIANGLE FACTOR STORED', N, A, LDA,
     $             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 (4(3X, F6.3))
 1020 FORMAT (/1X, 'A in symmetric form:  (* in unused elements)')
 1030 FORMAT (1X, 'Error factoring A, INFO = ', I5)
 1040 FORMAT (1X, 'Illegal argument to DPOCON, argument #', I2)
 1050 FORMAT (/1X, 'Estimated condition number of A = ', F8.4)
C
      END
 

Sample Output

 
 A in full form:
    2.000   -1.000    0.000    0.000
   -1.000    2.000   -1.000    0.000
    0.000   -1.000    2.000   -1.000
    0.000    0.000   -1.000    2.000



 A in symmetric form:  (* in unused elements)
    2.000   -1.000    0.000    0.000
   ******    2.000   -1.000    0.000
   ******   ******    2.000   -1.000
   ******   ******   ******    2.000



 Estimated condition number of A =   9.0000






Previous Next Contents Generated Index Doc Set Home