Previous Next Contents Generated Index Doc Set Home



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

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

Calling Sequence

CALL DSPCON 
(UPLO, N, DA, IPIVOT, DANORM, DRCOND, DWORK, IWORK2, 
INFO)
CALL SSPCON 
(UPLO, N, SA, IPIVOT, SANORM, SRCOND, SWORK, IWORK2, 
INFO)
CALL ZSPCON 
(UPLO, N, ZA, IPIVOT, DANORM, DRCOND, ZWORK, INFO)
CALL CSPCON 
(UPLO, N, CA, IPIVOT, SANORM, SRCOND, CWORK, INFO)






void dspcon 
(char uplo, int n, double *da, int *ipivot, double 
danorm, double *drcond, int *info)
void sspcon 
(char uplo, int n, float *sa, int *ipivot, float 
sanorm, float *srcond, int *info)
void zspcon 
(char uplo, int n, doublecomplex *za, int *ipivot, 
double danorm, double *drcond, int *info)
void cspcon 
(char uplo, int n, complex *ca, 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 xSPTRF. The dimension of xA is (N × N + N) / 2.

IPIVOT

Pivot indices as computed by xSPTRF.

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 = 4)
      PARAMETER        (LDA = (N * (N + 1)) / 2)
      PARAMETER        (LDIWRK = N)
      PARAMETER        (LDWORK = 2 * N)
C
      DOUBLE PRECISION  A(LDA), ANORM, RCOND, WORK(LDWORK)
      INTEGER           INFO, IPIVOT(N), IWORK(LDIWRK)
C
      EXTERNAL          DSPCON, DSPTRF
      INTRINSIC         ABS
C
C     Initialize the array A to store in packed symmetric form the
C     4x4 symmetric 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     LDL factor A.
C
      CALL DSPTRF ('UPPER TRIANGLE OF A STORED', N, A, IPIVOT,
     $             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 DSPCON ('UPPER TRIANGLE FACTOR STORED', N, A, IPIVOT,
     $             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 DSPCON, 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