1 SUBROUTINE cpot03( UPLO, N, A, LDA, AINV, LDAINV, WORK, LDWORK,
2 $ rwork, rcond, resid )
10 INTEGER lda, ldainv, ldwork, n
15 COMPLEX a( lda, * ), ainv( ldainv, * ),
74 parameter( zero = 0.0e+0, one = 1.0e+0 )
76 parameter( czero = ( 0.0e+0, 0.0e+0 ),
77 $ cone = ( 1.0e+0, 0.0e+0 ) )
81 REAL ainvnm, anorm, eps
85 REAL clange,
clanhe, slamch
86 EXTERNAL lsame, clange,
clanhe, slamch
106 eps = slamch(
'Epsilon' )
108 ainvnm =
clanhe(
'1',
uplo, n, ainv, ldainv, rwork )
109 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
114 rcond = ( one/anorm ) / ainvnm
119 IF( lsame(
uplo,
'U' ) )
THEN
122 ainv( j, i ) = conjg( ainv( i, j ) )
128 ainv( j, i ) = conjg( ainv( i, j ) )
132 CALL chemm(
'Left',
uplo, n, n, -cone, a, lda, ainv, ldainv,
133 $ czero, work, ldwork )
138 work( i, i ) = work( i, i ) + cone
143 resid = clange(
'1', n, n, work, ldwork, rwork )
145 resid = ( ( resid*rcond )/eps ) /
REAL( n )