108 SUBROUTINE zspt03( UPLO, N, A, AINV, WORK, LDW, RWORK, RCOND,
118 DOUBLE PRECISION RCOND, RESID
121 DOUBLE PRECISION RWORK( * )
122 COMPLEX*16 A( * ), AINV( * ), WORK( LDW, * )
128 DOUBLE PRECISION ZERO, ONE
129 parameter( zero = 0.0d+0, one = 1.0d+0 )
132 INTEGER I, ICOL, J, JCOL, K, KCOL, NALL
133 DOUBLE PRECISION AINVNM, ANORM, EPS
138 DOUBLE PRECISION DLAMCH, ZLANGE, ZLANSP
140 EXTERNAL lsame, dlamch, zlange, zlansp, zdotu
157 eps = dlamch(
'Epsilon' )
158 anorm = zlansp(
'1', uplo, n, a, rwork )
159 ainvnm = zlansp(
'1', uplo, n, ainv, rwork )
160 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
165 rcond = ( one / anorm ) / ainvnm
171 IF( lsame( uplo,
'U' ) )
THEN
173 icol = ( ( i-1 )*i ) / 2 + 1
178 jcol = ( ( j-1 )*j ) / 2 + 1
179 t = zdotu( j, a( icol ), 1, ainv( jcol ), 1 )
180 jcol = jcol + 2*j - 1
183 t = t + a( kcol+k )*ainv( jcol )
188 t = t + a( kcol )*ainv( jcol )
198 jcol = ( ( j-1 )*j ) / 2 + 1
199 t = zdotu( i, a( icol ), 1, ainv( jcol ), 1 )
201 kcol = icol + 2*i - 1
203 t = t + a( kcol )*ainv( jcol+k )
208 t = t + a( kcol )*ainv( jcol )
219 nall = ( n*( n+1 ) ) / 2
224 icol = nall - ( ( n-i+1 )*( n-i+2 ) ) / 2 + 1
226 jcol = nall - ( ( n-j )*( n-j+1 ) ) / 2 - ( n-i )
227 t = zdotu( n-i+1, a( icol ), 1, ainv( jcol ), 1 )
231 t = t + a( kcol )*ainv( jcol )
237 t = t + a( kcol )*ainv( jcol+k )
245 icol = nall - ( ( n-i )*( n-i+1 ) ) / 2
247 jcol = nall - ( ( n-j+1 )*( n-j+2 ) ) / 2 + 1
248 t = zdotu( n-j+1, a( icol-n+j ), 1, ainv( jcol ), 1 )
252 t = t + a( kcol )*ainv( jcol )
258 t = t + a( kcol+k )*ainv( jcol )
269 work( i, i ) = work( i, i ) + one
274 resid = zlange(
'1', n, n, work, ldw, rwork )
276 resid = ( ( resid*rcond ) / eps ) / dble( n )
subroutine zspt03(uplo, n, a, ainv, work, ldw, rwork, rcond, resid)
ZSPT03