Previous Next Contents Generated Index Doc Set Home



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

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

Calling Sequence

CALL DPPCON 
(UPLO, N, DA, DANORM, DRCOND, DWORK, IWORK2, INFO)
CALL SPPCON 
(UPLO, N, SA, SANORM, SRCOND, SWORK, IWORK2, INFO)
CALL ZPPCON 
(UPLO, N, ZA, DANORM, DRCOND, ZWORK, DWORK2, INFO)
CALL CPPCON 
(UPLO, N, CA, SANORM, SRCOND, CWORK, SWORK2, INFO)






void dppcon 
(char uplo, int n, double *da, double danorm, double 
*drcond, int *info)
void sppcon 
(char uplo, int n, float *sa, float sanorm, float 
*srcond, int *info)
void zppcon 
(char uplo, int n, doublecomplex *za, double danorm, 
double *drcond, int *info)
void cppcon 
(char uplo, int n, complex *ca, 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 xPPTRF. The dimension of xA is (N × N + N) / 2.

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 * (N + 1)) / 2)
      PARAMETER        (LDIWRK = N)
      PARAMETER        (LDWORK = 3 * N)
C
      DOUBLE PRECISION  A(LDA), ANORM, RCOND, WORK(LDWORK)
      INTEGER           INFO, IWORK(LDIWRK)
C
      EXTERNAL          DPPCON, DPPTRF
      INTRINSIC         ABS
C
C     Initialize the array A to store in packed symmetric form the
C     4x4 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, -1.0D0, 2.0D0, 0.0D0, -1.0D0, 2.0D0,
     $         0.0D0, 0.0D0, -1.0D0, 2.0D0 /
C
C     Print the initial values of the arrays.
C
      PRINT 1000
      PRINT 1010, A(1), A(2), A(4), A(7)
      PRINT 1010, A(2), A(3), A(5), A(8)
      PRINT 1010, A(4), A(5), A(6), A(9)
      PRINT 1010, A(7), A(8), A(9), A(10)
C
C     Cholesky factor A.
C
      CALL DPPTRF ('UPPER TRIANGLE OF A STORED', N, A, INFO)
      IF (INFO .NE. 0) THEN
        PRINT 1020, INFO
        STOP 1
      END IF
C
C     Compute and print the condition number of A.
C
      ANORM = 4.0D0
      CALL DPPCON ('UPPER TRIANGLE FACTOR STORED', N, A,
     $             ANORM, RCOND, WORK, IWORK, INFO)
      IF (INFO .NE. 0) THEN
        PRINT 1030, ABS(INFO)
        STOP 2
      END IF
      PRINT 1040, 1.0D0 / RCOND
C
 1000 FORMAT (1X, 'A:')
 1010 FORMAT (4(3X, F6.3))
 1020 FORMAT (1X, 'Error factoring A, INFO = ', I5)
 1030 FORMAT (1X, 'Illegal argument to DPPCON, argument #', I2)
 1040 FORMAT (/1X, 'Estimated condition number of A = ', F8.4)
C
      END
 

Sample Output

 
 A:
    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



 Estimated condition number of A =  12.0000






Previous Next Contents Generated Index Doc Set Home