1 SUBROUTINE cposvx( FACT, UPLO, N, NRHS, A, LDA, AF, LDAF, EQUED,
2 $ s, b, ldb, x, ldx, rcond, ferr, berr, work,
12 CHARACTER equed, fact,
uplo
13 INTEGER info, lda, ldaf, ldb, ldx, n, nrhs
17 REAL berr( * ), ferr( * ), rwork( * ), s( * )
18 COMPLEX a( lda, * ), af( ldaf, * ), b( ldb, * ),
19 $ work( * ), x( ldx, * )
215 parameter( zero = 0.0e+0, one = 1.0e+0 )
218 LOGICAL equil, nofact, rcequ
220 REAL amax, anorm, bignum, scond, smax, smin, smlnum
226 EXTERNAL lsame,
clanhe, slamch
238 nofact = lsame( fact,
'N' )
239 equil = lsame( fact,
'E' )
240 IF( nofact .OR. equil )
THEN
244 rcequ = lsame( equed,
'Y' )
245 smlnum = slamch(
'Safe minimum' )
246 bignum = one / smlnum
251 IF( .NOT.nofact .AND. .NOT.equil .AND. .NOT.lsame( fact,
'F' ) )
254 ELSE IF( .NOT.lsame(
uplo,
'U' ) .AND. .NOT.lsame(
uplo,
'L' ) )
257 ELSE IF( n.LT.0 )
THEN
259 ELSE IF( nrhs.LT.0 )
THEN
261 ELSE IF( lda.LT.
max( 1, n ) )
THEN
263 ELSE IF( ldaf.LT.
max( 1, n ) )
THEN
265 ELSE IF( lsame( fact,
'F' ) .AND. .NOT.
266 $ ( rcequ .OR. lsame( equed,
'N' ) ) )
THEN
273 smin =
min( smin, s( j ) )
274 smax =
max( smax, s( j ) )
276 IF( smin.LE.zero )
THEN
278 ELSE IF( n.GT.0 )
THEN
279 scond =
max( smin, smlnum ) /
min( smax, bignum )
285 IF( ldb.LT.
max( 1, n ) )
THEN
287 ELSE IF( ldx.LT.
max( 1, n ) )
THEN
294 CALL
xerbla(
'CPOSVX', -info )
298 IF( lsame(
uplo,
'U' ) )
THEN
299 plasma_uplo = plasmaupper
301 plasma_uplo = plasmalower
308 CALL
cpoequ( n, a, lda, s, scond, amax, infequ )
309 IF( infequ.EQ.0 )
THEN
313 CALL
claqhe(
uplo, n, a, lda, s, scond, amax, equed )
314 rcequ = lsame( equed,
'Y' )
323 b( i, j ) = s( i )*b( i, j )
328 IF( nofact .OR. equil )
THEN
332 CALL clacpy(
uplo, n, n, a, lda, af, ldaf )
349 CALL
cpocon(
uplo, n, af, ldaf, anorm, rcond, work, rwork, info )
353 CALL clacpy(
'Full', n, nrhs, b, ldb, x, ldx )
354 CALL
plasma_cpotrs( plasma_uplo, n, nrhs, af, ldaf, x, ldx, info )
359 CALL
cporfs(
uplo, n, nrhs, a, lda, af, ldaf, b, ldb, x, ldx,
360 $ ferr, berr, work, rwork, info )
368 x( i, j ) = s( i )*x( i, j )
372 ferr( j ) = ferr( j ) / scond
378 IF( rcond.LT.slamch(
'Epsilon' ) )