110 SUBROUTINE zspt03( UPLO, N, A, AINV, WORK, LDW, RWORK, RCOND,
121 DOUBLE PRECISION RCOND, RESID
124 DOUBLE PRECISION RWORK( * )
125 COMPLEX*16 A( * ), AINV( * ), WORK( ldw, * )
131 DOUBLE PRECISION ZERO, ONE
132 parameter ( zero = 0.0d+0, one = 1.0d+0 )
135 INTEGER I, ICOL, J, JCOL, K, KCOL, NALL
136 DOUBLE PRECISION AINVNM, ANORM, EPS
141 DOUBLE PRECISION DLAMCH, ZLANGE, ZLANSP
143 EXTERNAL lsame, dlamch, zlange, zlansp, zdotu
160 eps = dlamch(
'Epsilon' )
161 anorm = zlansp(
'1', uplo, n, a, rwork )
162 ainvnm = zlansp(
'1', uplo, n, ainv, rwork )
163 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
168 rcond = ( one / anorm ) / ainvnm
174 IF( lsame( uplo,
'U' ) )
THEN
176 icol = ( ( i-1 )*i ) / 2 + 1
181 jcol = ( ( j-1 )*j ) / 2 + 1
182 t = zdotu( j, a( icol ), 1, ainv( jcol ), 1 )
183 jcol = jcol + 2*j - 1
186 t = t + a( kcol+k )*ainv( jcol )
191 t = t + a( kcol )*ainv( jcol )
201 jcol = ( ( j-1 )*j ) / 2 + 1
202 t = zdotu( i, a( icol ), 1, ainv( jcol ), 1 )
204 kcol = icol + 2*i - 1
206 t = t + a( kcol )*ainv( jcol+k )
211 t = t + a( kcol )*ainv( jcol )
222 nall = ( n*( n+1 ) ) / 2
227 icol = nall - ( ( n-i+1 )*( n-i+2 ) ) / 2 + 1
229 jcol = nall - ( ( n-j )*( n-j+1 ) ) / 2 - ( n-i )
230 t = zdotu( n-i+1, a( icol ), 1, ainv( jcol ), 1 )
234 t = t + a( kcol )*ainv( jcol )
240 t = t + a( kcol )*ainv( jcol+k )
248 icol = nall - ( ( n-i )*( n-i+1 ) ) / 2
250 jcol = nall - ( ( n-j+1 )*( n-j+2 ) ) / 2 + 1
251 t = zdotu( n-j+1, a( icol-n+j ), 1, ainv( jcol ), 1 )
255 t = t + a( kcol )*ainv( jcol )
261 t = t + a( kcol+k )*ainv( jcol )
272 work( i, i ) = work( i, i ) + one
277 resid = zlange(
'1', n, n, work, ldw, rwork )
279 resid = ( ( resid*rcond ) / eps ) / dble( n )
subroutine zspt03(UPLO, N, A, AINV, WORK, LDW, RWORK, RCOND, RESID)
ZSPT03