178 SUBROUTINE zsprfs( UPLO, N, NRHS, AP, AFP, IPIV, B, LDB, X, LDX,
179 $ FERR, BERR, WORK, RWORK, INFO )
187 INTEGER INFO, LDB, LDX, N, NRHS
191 DOUBLE PRECISION BERR( * ), FERR( * ), RWORK( * )
192 COMPLEX*16 AFP( * ), AP( * ), B( LDB, * ), WORK( * ),
200 parameter( itmax = 5 )
201 DOUBLE PRECISION ZERO
202 parameter( zero = 0.0d+0 )
204 parameter( one = ( 1.0d+0, 0.0d+0 ) )
206 parameter( two = 2.0d+0 )
207 DOUBLE PRECISION THREE
208 parameter( three = 3.0d+0 )
212 INTEGER COUNT, I, IK, J, K, KASE, KK, NZ
213 DOUBLE PRECISION EPS, LSTRES, S, SAFE1, SAFE2, SAFMIN, XK
223 INTRINSIC abs, dble, dimag, max
227 DOUBLE PRECISION DLAMCH
228 EXTERNAL lsame, dlamch
231 DOUBLE PRECISION CABS1
234 cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
241 upper = lsame( uplo,
'U' )
242 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
244 ELSE IF( n.LT.0 )
THEN
246 ELSE IF( nrhs.LT.0 )
THEN
248 ELSE IF( ldb.LT.max( 1, n ) )
THEN
250 ELSE IF( ldx.LT.max( 1, n ) )
THEN
254 CALL xerbla(
'ZSPRFS', -info )
260 IF( n.EQ.0 .OR. nrhs.EQ.0 )
THEN
271 eps = dlamch(
'Epsilon' )
272 safmin = dlamch(
'Safe minimum' )
288 CALL zcopy( n, b( 1, j ), 1, work, 1 )
289 CALL zspmv( uplo, n, -one, ap, x( 1, j ), 1, one, work, 1 )
301 rwork( i ) = cabs1( b( i, j ) )
310 xk = cabs1( x( k, j ) )
313 rwork( i ) = rwork( i ) + cabs1( ap( ik ) )*xk
314 s = s + cabs1( ap( ik ) )*cabs1( x( i, j ) )
317 rwork( k ) = rwork( k ) + cabs1( ap( kk+k-1 ) )*xk + s
323 xk = cabs1( x( k, j ) )
324 rwork( k ) = rwork( k ) + cabs1( ap( kk ) )*xk
327 rwork( i ) = rwork( i ) + cabs1( ap( ik ) )*xk
328 s = s + cabs1( ap( ik ) )*cabs1( x( i, j ) )
331 rwork( k ) = rwork( k ) + s
337 IF( rwork( i ).GT.safe2 )
THEN
338 s = max( s, cabs1( work( i ) ) / rwork( i ) )
340 s = max( s, ( cabs1( work( i ) )+safe1 ) /
341 $ ( rwork( i )+safe1 ) )
352 IF( berr( j ).GT.eps .AND. two*berr( j ).LE.lstres .AND.
353 $ count.LE.itmax )
THEN
357 CALL zsptrs( uplo, n, 1, afp, ipiv, work, n, info )
358 CALL zaxpy( n, one, work, 1, x( 1, j ), 1 )
387 IF( rwork( i ).GT.safe2 )
THEN
388 rwork( i ) = cabs1( work( i ) ) + nz*eps*rwork( i )
390 rwork( i ) = cabs1( work( i ) ) + nz*eps*rwork( i ) +
397 CALL zlacn2( n, work( n+1 ), work, ferr( j ), kase, isave )
403 CALL zsptrs( uplo, n, 1, afp, ipiv, work, n, info )
405 work( i ) = rwork( i )*work( i )
407 ELSE IF( kase.EQ.2 )
THEN
412 work( i ) = rwork( i )*work( i )
414 CALL zsptrs( uplo, n, 1, afp, ipiv, work, n, info )
423 lstres = max( lstres, cabs1( x( i, j ) ) )
426 $ ferr( j ) = ferr( j ) / lstres
subroutine xerbla(srname, info)
subroutine zaxpy(n, za, zx, incx, zy, incy)
ZAXPY
subroutine zcopy(n, zx, incx, zy, incy)
ZCOPY
subroutine zspmv(uplo, n, alpha, ap, x, incx, beta, y, incy)
ZSPMV computes a matrix-vector product for complex vectors using a complex symmetric packed matrix
subroutine zsprfs(uplo, n, nrhs, ap, afp, ipiv, b, ldb, x, ldx, ferr, berr, work, rwork, info)
ZSPRFS
subroutine zsptrs(uplo, n, nrhs, ap, ipiv, b, ldb, info)
ZSPTRS
subroutine zlacn2(n, v, x, est, kase, isave)
ZLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...