190 SUBROUTINE cherfs( UPLO, N, NRHS, A, LDA, AF, LDAF, IPIV, B, LDB,
191 $ X, LDX, FERR, BERR, WORK, RWORK, INFO )
199 INTEGER INFO, LDA, LDAF, LDB, LDX, N, NRHS
203 REAL BERR( * ), FERR( * ), RWORK( * )
204 COMPLEX A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
205 $ work( * ), x( ldx, * )
212 parameter( itmax = 5 )
214 parameter( zero = 0.0e+0 )
216 parameter( one = ( 1.0e+0, 0.0e+0 ) )
218 parameter( two = 2.0e+0 )
220 parameter( three = 3.0e+0 )
224 INTEGER COUNT, I, J, K, KASE, NZ
225 REAL EPS, LSTRES, S, SAFE1, SAFE2, SAFMIN, XK
235 INTRINSIC abs, aimag, max, real
240 EXTERNAL lsame, slamch
246 cabs1( zdum ) = abs( real( zdum ) ) + abs( aimag( zdum ) )
253 upper = lsame( uplo,
'U' )
254 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
256 ELSE IF( n.LT.0 )
THEN
258 ELSE IF( nrhs.LT.0 )
THEN
260 ELSE IF( lda.LT.max( 1, n ) )
THEN
262 ELSE IF( ldaf.LT.max( 1, n ) )
THEN
264 ELSE IF( ldb.LT.max( 1, n ) )
THEN
266 ELSE IF( ldx.LT.max( 1, n ) )
THEN
270 CALL xerbla(
'CHERFS', -info )
276 IF( n.EQ.0 .OR. nrhs.EQ.0 )
THEN
287 eps = slamch(
'Epsilon' )
288 safmin = slamch(
'Safe minimum' )
304 CALL ccopy( n, b( 1, j ), 1, work, 1 )
305 CALL chemv( uplo, n, -one, a, lda, x( 1, j ), 1, one, work, 1 )
317 rwork( i ) = cabs1( b( i, j ) )
325 xk = cabs1( x( k, j ) )
327 rwork( i ) = rwork( i ) + cabs1( a( i, k ) )*xk
328 s = s + cabs1( a( i, k ) )*cabs1( x( i, j ) )
330 rwork( k ) = rwork( k ) + abs( real( a( k, k ) ) )*xk + s
335 xk = cabs1( x( k, j ) )
336 rwork( k ) = rwork( k ) + abs( real( a( k, k ) ) )*xk
338 rwork( i ) = rwork( i ) + cabs1( a( i, k ) )*xk
339 s = s + cabs1( a( i, k ) )*cabs1( x( i, j ) )
341 rwork( k ) = rwork( k ) + s
346 IF( rwork( i ).GT.safe2 )
THEN
347 s = max( s, cabs1( work( i ) ) / rwork( i ) )
349 s = max( s, ( cabs1( work( i ) )+safe1 ) /
350 $ ( rwork( i )+safe1 ) )
361 IF( berr( j ).GT.eps .AND. two*berr( j ).LE.lstres .AND.
362 $ count.LE.itmax )
THEN
366 CALL chetrs( uplo, n, 1, af, ldaf, ipiv, work, n, info )
367 CALL caxpy( n, one, work, 1, x( 1, j ), 1 )
396 IF( rwork( i ).GT.safe2 )
THEN
397 rwork( i ) = cabs1( work( i ) ) + nz*eps*rwork( i )
399 rwork( i ) = cabs1( work( i ) ) + nz*eps*rwork( i ) +
406 CALL clacn2( n, work( n+1 ), work, ferr( j ), kase, isave )
412 CALL chetrs( uplo, n, 1, af, ldaf, ipiv, work, n, info )
414 work( i ) = rwork( i )*work( i )
416 ELSE IF( kase.EQ.2 )
THEN
421 work( i ) = rwork( i )*work( i )
423 CALL chetrs( uplo, n, 1, af, ldaf, ipiv, work, n, info )
432 lstres = max( lstres, cabs1( x( i, j ) ) )
435 $ ferr( j ) = ferr( j ) / lstres
subroutine xerbla(srname, info)
subroutine caxpy(n, ca, cx, incx, cy, incy)
CAXPY
subroutine ccopy(n, cx, incx, cy, incy)
CCOPY
subroutine chemv(uplo, n, alpha, a, lda, x, incx, beta, y, incy)
CHEMV
subroutine cherfs(uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, ferr, berr, work, rwork, info)
CHERFS
subroutine chetrs(uplo, n, nrhs, a, lda, ipiv, b, ldb, info)
CHETRS
subroutine clacn2(n, v, x, est, kase, isave)
CLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...