280 SUBROUTINE csysvx( FACT, UPLO, N, NRHS, A, LDA, AF, LDAF, IPIV,
282 $ LDB, X, LDX, RCOND, FERR, BERR, WORK, LWORK,
291 INTEGER INFO, LDA, LDAF, LDB, LDX, LWORK, N, NRHS
296 REAL BERR( * ), FERR( * ), RWORK( * )
297 COMPLEX A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
298 $ work( * ), x( ldx, * )
305 PARAMETER ( ZERO = 0.0e+0 )
308 LOGICAL LQUERY, NOFACT
315 REAL CLANSY, SLAMCH, SROUNDUP_LWORK
316 EXTERNAL ilaenv, lsame, clansy, slamch,
331 nofact = lsame( fact,
'N' )
332 lquery = ( lwork.EQ.-1 )
333 IF( .NOT.nofact .AND. .NOT.lsame( fact,
'F' ) )
THEN
335 ELSE IF( .NOT.lsame( uplo,
'U' ) .AND.
336 $ .NOT.lsame( uplo,
'L' ) )
339 ELSE IF( n.LT.0 )
THEN
341 ELSE IF( nrhs.LT.0 )
THEN
343 ELSE IF( lda.LT.max( 1, n ) )
THEN
345 ELSE IF( ldaf.LT.max( 1, n ) )
THEN
347 ELSE IF( ldb.LT.max( 1, n ) )
THEN
349 ELSE IF( ldx.LT.max( 1, n ) )
THEN
351 ELSE IF( lwork.LT.max( 1, 2*n ) .AND. .NOT.lquery )
THEN
356 lwkopt = max( 1, 2*n )
358 nb = ilaenv( 1,
'CSYTRF', uplo, n, -1, -1, -1 )
359 lwkopt = max( lwkopt, n*nb )
361 work( 1 ) = sroundup_lwork(lwkopt)
365 CALL xerbla(
'CSYSVX', -info )
367 ELSE IF( lquery )
THEN
375 CALL clacpy( uplo, n, n, a, lda, af, ldaf )
376 CALL csytrf( uplo, n, af, ldaf, ipiv, work, lwork, info )
388 anorm = clansy(
'I', uplo, n, a, lda, rwork )
392 CALL csycon( uplo, n, af, ldaf, ipiv, anorm, rcond, work,
397 CALL clacpy(
'Full', n, nrhs, b, ldb, x, ldx )
398 CALL csytrs( uplo, n, nrhs, af, ldaf, ipiv, x, ldx, info )
403 CALL csyrfs( uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x,
404 $ ldx, ferr, berr, work, rwork, info )
408 IF( rcond.LT.slamch(
'Epsilon' ) )
411 work( 1 ) = sroundup_lwork(lwkopt)
subroutine csyrfs(uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, ferr, berr, work, rwork, info)
CSYRFS
subroutine csysvx(fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, rcond, ferr, berr, work, lwork, rwork, info)
CSYSVX computes the solution to system of linear equations A * X = B for SY matrices