Previous Next Contents Generated Index Doc Set Home



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

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

Calling Sequence

CALL DPTCON 
(N, DDIAG, DOFFD, DANORM, DRCOND, DWORK, INFO)
CALL SPTCON 
(N, SDIAG, SOFFD, SANORM, SRCOND, SWORK, INFO)
CALL ZPTCON 
(N, DDIAG, ZOFFD, DANORM, DRCOND, DWORK, INFO)
CALL CPTCON 
(N, SDIAG, COFFD, SANORM, SRCOND, SWORK, INFO)






void dptcon 
(int n, double *ddiag, double *doffd, double danorm, 
double *drcond, int *info)
void sptcon 
(int n, float *sdiag, float *soffd, float sanorm, float 
*srcond, int *info)
void zptcon 
(int n, double *ddiag, doublecomplex *zoffd, double 
danorm, double *drcond, int *info)
void cptcon 
(int n, float *sdiag, complex *zoffd, float sanorm, 
float *srcond, int *info)

Arguments

N

Order of the matrix A. N 0.

xDIAG

The N diagonal elements of the diagonal matrix D from the factorization of A, as computed by xPTTRF.

xOFFD

The N-1 off-diagonal elements of the unit bidiagonal factor U or L from the UDU or LDL factorization of A, as computed by xPTTRF.

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 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           LDB, LDWORK, N, NRHS
      PARAMETER        (N = 4)
      PARAMETER        (LDB = N)
      PARAMETER        (LDWORK = N)
      PARAMETER        (NRHS = 1)
C
      DOUBLE PRECISION  ANORM, DIAG(N), DLOWER(N-1), RCOND
      DOUBLE PRECISION  WORK(LDWORK)
      INTEGER           ICOL, INFO, IROW
C
      EXTERNAL          DPTCON, DPTTRF
      INTRINSIC         ABS
C
C     Initialize the arrays DIAG and DLOWER to store the diagonal
C     and first off diagonal of the matrix A shown below.
C
C          2  -1
C         -1   2  -1
C     A =     -1   2  -1
C                  1   2  -1
C
      DATA DIAG / 2.0D0, 2.0D0, 2.0D0, 2.0D0 /
      DATA DLOWER / -1.0D0, -1.0D0, -1.0D0 /
C
C     Print the initial value of the arrays.
C
      PRINT 1000
      DO 100, IROW = 1, N
        PRINT 1010, (0.0D0, ICOL = 1, IROW - 2),
     $        (DLOWER(ICOL + 1), ICOL = ABS(IROW - 2), IROW - 2),
     $        DIAG(IROW),
     $        (DLOWER(IROW), ICOL = 1, MIN(1, N - IROW)),
     $        (0.0D0, ICOL = IROW + 2, N)
  100 CONTINUE
C
C     LDL factor A.
C
      CALL DPTTRF (N, DIAG, DLOWER, INFO)
      IF (INFO .NE. 0) THEN
        PRINT 1020, INFO
        STOP 1
      END IF
C
C     Estimate and print the condition number of A.
C
      ANORM = 4.0D0
      CALL DPTCON (N, DIAG, DLOWER, ANORM, RCOND, WORK, 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 (5(3X, F5.2))
 1020 FORMAT (1X, 'Error factoring A, INFO = ', I5)
 1030 FORMAT (1X, 'Illegal argument to DPTCON, argument #', I2)
 1040 FORMAT (/1X, 'Estimated condition number of A: ', F6.2)
C
      END
 

Sample Output

 
 A:
    2.00   -1.00    0.00    0.00
   -1.00    2.00   -1.00    0.00
    0.00   -1.00    2.00   -1.00
    0.00    0.00   -1.00    2.00



 Estimated condition number of A:  12.00






Previous Next Contents Generated Index Doc Set Home