154 SUBROUTINE cdrvhp( DOTYPE, NN, NVAL, NRHS, THRESH, TSTERR, NMAX,
155 $ A, AFAC, AINV, B, X, XACT, WORK, RWORK, IWORK,
164 INTEGER NMAX, NN, NOUT, NRHS
169 INTEGER IWORK( * ), NVAL( * )
171 COMPLEX A( * ), AFAC( * ), AINV( * ), B( * ),
172 $ work( * ), x( * ), xact( * )
179 PARAMETER ( ONE = 1.0e+0, zero = 0.0e+0 )
180 INTEGER NTYPES, NTESTS
181 parameter( ntypes = 10, ntests = 6 )
183 parameter( nfact = 2 )
187 CHARACTER DIST, FACT, PACKIT,
TYPE, UPLO, XTYPE
189 INTEGER I, I1, I2, IFACT, IMAT, IN, INFO, IOFF, IUPLO,
190 $ izero, j, k, k1, kl, ku, lda, mode, n, nb,
191 $ nbmin, nerrs, nfail, nimat, npp, nrun, nt
192 REAL AINVNM, ANORM, CNDNUM, RCOND, RCONDC
195 CHARACTER FACTS( NFACT )
196 INTEGER ISEED( 4 ), ISEEDY( 4 )
197 REAL RESULT( NTESTS )
201 EXTERNAL CLANHP, SGET06
215 COMMON / infoc / infot, nunit, ok, lerr
216 COMMON / srnamc / srnamt
219 INTRINSIC cmplx, max, min
222 DATA iseedy / 1988, 1989, 1990, 1991 /
223 DATA facts /
'F',
'N' /
235 iseed( i ) = iseedy( i )
241 $
CALL cerrvx( path, nout )
262 DO 170 imat = 1, nimat
266 IF( .NOT.dotype( imat ) )
271 zerot = imat.GE.3 .AND. imat.LE.6
272 IF( zerot .AND. n.LT.imat-2 )
278 IF( iuplo.EQ.1 )
THEN
289 CALL clatb4( path, imat, n, n,
TYPE, kl, ku, anorm, mode,
293 CALL clatms( n, n, dist, iseed,
TYPE, rwork, mode,
294 $ cndnum, anorm, kl, ku, packit, a, lda, work,
300 CALL alaerh( path,
'CLATMS', info, 0, uplo, n, n, -1,
301 $ -1, -1, imat, nfail, nerrs, nout )
311 ELSE IF( imat.EQ.4 )
THEN
321 IF( iuplo.EQ.1 )
THEN
322 ioff = ( izero-1 )*izero / 2
323 DO 20 i = 1, izero - 1
333 DO 40 i = 1, izero - 1
344 IF( iuplo.EQ.1 )
THEN
374 IF( iuplo.EQ.1 )
THEN
377 CALL claipd( n, a, n, -1 )
380 DO 150 ifact = 1, nfact
384 fact = facts( ifact )
394 ELSE IF( ifact.EQ.1 )
THEN
398 anorm = clanhp(
'1', uplo, n, a, rwork )
402 CALL ccopy( npp, a, 1, afac, 1 )
403 CALL chptrf( uplo, n, afac, iwork, info )
407 CALL ccopy( npp, afac, 1, ainv, 1 )
408 CALL chptri( uplo, n, ainv, iwork, work, info )
409 ainvnm = clanhp(
'1', uplo, n, ainv, rwork )
413 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
416 rcondc = ( one / anorm ) / ainvnm
423 CALL clarhs( path, xtype, uplo,
' ', n, n, kl, ku,
424 $ nrhs, a, lda, xact, lda, b, lda, iseed,
430 IF( ifact.EQ.2 )
THEN
431 CALL ccopy( npp, a, 1, afac, 1 )
432 CALL clacpy(
'Full', n, nrhs, b, lda, x, lda )
437 CALL chpsv( uplo, n, nrhs, afac, iwork, x, lda,
446 IF( iwork( k ).LT.0 )
THEN
447 IF( iwork( k ).NE.-k )
THEN
451 ELSE IF( iwork( k ).NE.k )
THEN
460 CALL alaerh( path,
'CHPSV ', info, k, uplo, n,
461 $ n, -1, -1, nrhs, imat, nfail,
464 ELSE IF( info.NE.0 )
THEN
471 CALL chpt01( uplo, n, a, afac, iwork, ainv, lda,
472 $ rwork, result( 1 ) )
476 CALL clacpy(
'Full', n, nrhs, b, lda, work, lda )
477 CALL cppt02( uplo, n, nrhs, a, x, lda, work, lda,
478 $ rwork, result( 2 ) )
482 CALL cget04( n, nrhs, x, lda, xact, lda, rcondc,
490 IF( result( k ).GE.thresh )
THEN
491 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
492 $
CALL aladhd( nout, path )
493 WRITE( nout, fmt = 9999 )
'CHPSV ', uplo, n,
494 $ imat, k, result( k )
504 IF( ifact.EQ.2 .AND. npp.GT.0 )
505 $
CALL claset(
'Full', npp, 1, cmplx( zero ),
506 $ cmplx( zero ), afac, npp )
507 CALL claset(
'Full', n, nrhs, cmplx( zero ),
508 $ cmplx( zero ), x, lda )
514 CALL chpsvx( fact, uplo, n, nrhs, a, afac, iwork, b,
515 $ lda, x, lda, rcond, rwork,
516 $ rwork( nrhs+1 ), work, rwork( 2*nrhs+1 ),
525 IF( iwork( k ).LT.0 )
THEN
526 IF( iwork( k ).NE.-k )
THEN
530 ELSE IF( iwork( k ).NE.k )
THEN
539 CALL alaerh( path,
'CHPSVX', info, k, fact // uplo,
540 $ n, n, -1, -1, nrhs, imat, nfail,
546 IF( ifact.GE.2 )
THEN
551 CALL chpt01( uplo, n, a, afac, iwork, ainv, lda,
552 $ rwork( 2*nrhs+1 ), result( 1 ) )
560 CALL clacpy(
'Full', n, nrhs, b, lda, work, lda )
561 CALL cppt02( uplo, n, nrhs, a, x, lda, work, lda,
562 $ rwork( 2*nrhs+1 ), result( 2 ) )
566 CALL cget04( n, nrhs, x, lda, xact, lda, rcondc,
571 CALL cppt05( uplo, n, nrhs, a, b, lda, x, lda,
572 $ xact, lda, rwork, rwork( nrhs+1 ),
581 result( 6 ) = sget06( rcond, rcondc )
587 IF( result( k ).GE.thresh )
THEN
588 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
589 $
CALL aladhd( nout, path )
590 WRITE( nout, fmt = 9998 )
'CHPSVX', fact, uplo,
591 $ n, imat, k, result( k )
605 CALL alasvm( path, nout, nfail, nrun, nerrs )
607 9999
FORMAT( 1x, a,
', UPLO=''', a1,
''', N =', i5,
', type ', i2,
608 $
', test ', i2,
', ratio =', g12.5 )
609 9998
FORMAT( 1x, a,
', FACT=''', a1,
''', UPLO=''', a1,
''', N =', i5,
610 $
', type ', i2,
', test ', i2,
', ratio =', g12.5 )
subroutine alasvm(type, nout, nfail, nrun, nerrs)
ALASVM
subroutine clarhs(path, xtype, uplo, trans, m, n, kl, ku, nrhs, a, lda, x, ldx, b, ldb, iseed, info)
CLARHS
subroutine xlaenv(ispec, nvalue)
XLAENV
subroutine aladhd(iounit, path)
ALADHD
subroutine alaerh(path, subnam, info, infoe, opts, m, n, kl, ku, n5, imat, nfail, nerrs, nout)
ALAERH
subroutine cdrvhp(dotype, nn, nval, nrhs, thresh, tsterr, nmax, a, afac, ainv, b, x, xact, work, rwork, iwork, nout)
CDRVHP
subroutine cerrvx(path, nunit)
CERRVX
subroutine cget04(n, nrhs, x, ldx, xact, ldxact, rcond, resid)
CGET04
subroutine chpt01(uplo, n, a, afac, ipiv, c, ldc, rwork, resid)
CHPT01
subroutine claipd(n, a, inda, vinda)
CLAIPD
subroutine clatb4(path, imat, m, n, type, kl, ku, anorm, mode, cndnum, dist)
CLATB4
subroutine clatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
CLATMS
subroutine cppt02(uplo, n, nrhs, a, x, ldx, b, ldb, rwork, resid)
CPPT02
subroutine cppt05(uplo, n, nrhs, ap, b, ldb, x, ldx, xact, ldxact, ferr, berr, reslts)
CPPT05
subroutine ccopy(n, cx, incx, cy, incy)
CCOPY
subroutine chpsv(uplo, n, nrhs, ap, ipiv, b, ldb, info)
CHPSV computes the solution to system of linear equations A * X = B for OTHER matrices
subroutine chpsvx(fact, uplo, n, nrhs, ap, afp, ipiv, b, ldb, x, ldx, rcond, ferr, berr, work, rwork, info)
CHPSVX computes the solution to system of linear equations A * X = B for OTHER matrices
subroutine chptrf(uplo, n, ap, ipiv, info)
CHPTRF
subroutine chptri(uplo, n, ap, ipiv, work, info)
CHPTRI
subroutine clacpy(uplo, m, n, a, lda, b, ldb)
CLACPY copies all or part of one two-dimensional array to another.
subroutine claset(uplo, m, n, alpha, beta, a, lda)
CLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.