181 SUBROUTINE cporfs( UPLO, N, NRHS, A, LDA, AF, LDAF, B, LDB, X,
182 $ LDX, FERR, BERR, WORK, RWORK, INFO )
190 INTEGER INFO, LDA, LDAF, LDB, LDX, N, NRHS
193 REAL BERR( * ), FERR( * ), RWORK( * )
194 COMPLEX A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
195 $ work( * ), x( ldx, * )
202 parameter( itmax = 5 )
204 parameter( zero = 0.0e+0 )
206 parameter( one = ( 1.0e+0, 0.0e+0 ) )
208 parameter( two = 2.0e+0 )
210 parameter( three = 3.0e+0 )
214 INTEGER COUNT, I, J, K, KASE, NZ
215 REAL EPS, LSTRES, S, SAFE1, SAFE2, SAFMIN, XK
225 INTRINSIC abs, aimag, max, real
230 EXTERNAL lsame, slamch
236 cabs1( zdum ) = abs( real( zdum ) ) + abs( aimag( zdum ) )
243 upper = lsame( uplo,
'U' )
244 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
246 ELSE IF( n.LT.0 )
THEN
248 ELSE IF( nrhs.LT.0 )
THEN
250 ELSE IF( lda.LT.max( 1, n ) )
THEN
252 ELSE IF( ldaf.LT.max( 1, n ) )
THEN
254 ELSE IF( ldb.LT.max( 1, n ) )
THEN
256 ELSE IF( ldx.LT.max( 1, n ) )
THEN
260 CALL xerbla(
'CPORFS', -info )
266 IF( n.EQ.0 .OR. nrhs.EQ.0 )
THEN
277 eps = slamch(
'Epsilon' )
278 safmin = slamch(
'Safe minimum' )
294 CALL ccopy( n, b( 1, j ), 1, work, 1 )
295 CALL chemv( uplo, n, -one, a, lda, x( 1, j ), 1, one, work, 1 )
307 rwork( i ) = cabs1( b( i, j ) )
315 xk = cabs1( x( k, j ) )
317 rwork( i ) = rwork( i ) + cabs1( a( i, k ) )*xk
318 s = s + cabs1( a( i, k ) )*cabs1( x( i, j ) )
320 rwork( k ) = rwork( k ) + abs( real( a( k, k ) ) )*xk + s
325 xk = cabs1( x( k, j ) )
326 rwork( k ) = rwork( k ) + abs( real( a( k, k ) ) )*xk
328 rwork( i ) = rwork( i ) + cabs1( a( i, k ) )*xk
329 s = s + cabs1( a( i, k ) )*cabs1( x( i, j ) )
331 rwork( k ) = rwork( k ) + s
336 IF( rwork( i ).GT.safe2 )
THEN
337 s = max( s, cabs1( work( i ) ) / rwork( i ) )
339 s = max( s, ( cabs1( work( i ) )+safe1 ) /
340 $ ( rwork( i )+safe1 ) )
351 IF( berr( j ).GT.eps .AND. two*berr( j ).LE.lstres .AND.
352 $ count.LE.itmax )
THEN
356 CALL cpotrs( uplo, n, 1, af, ldaf, work, n, info )
357 CALL caxpy( n, one, work, 1, x( 1, j ), 1 )
386 IF( rwork( i ).GT.safe2 )
THEN
387 rwork( i ) = cabs1( work( i ) ) + nz*eps*rwork( i )
389 rwork( i ) = cabs1( work( i ) ) + nz*eps*rwork( i ) +
396 CALL clacn2( n, work( n+1 ), work, ferr( j ), kase, isave )
402 CALL cpotrs( uplo, n, 1, af, ldaf, work, n, info )
404 work( i ) = rwork( i )*work( i )
406 ELSE IF( kase.EQ.2 )
THEN
411 work( i ) = rwork( i )*work( i )
413 CALL cpotrs( uplo, n, 1, af, ldaf, work, n, info )
422 lstres = max( lstres, cabs1( x( i, j ) ) )
425 $ 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 clacn2(n, v, x, est, kase, isave)
CLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
subroutine cporfs(uplo, n, nrhs, a, lda, af, ldaf, b, ldb, x, ldx, ferr, berr, work, rwork, info)
CPORFS
subroutine cpotrs(uplo, n, nrhs, a, lda, b, ldb, info)
CPOTRS