154 SUBROUTINE cdrvhe( 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, EQUED, FACT,
TYPE, UPLO, XTYPE
189 INTEGER I, I1, I2, IFACT, IMAT, IN, INFO, IOFF, IUPLO,
190 $ izero, j, k, k1, kl, ku, lda, lwork, mode, n,
191 $ nb, nbmin, nerrs, nfail, nimat, nrun, nt,
193 REAL AINVNM, ANORM, CNDNUM, RCOND, RCONDC,
197 CHARACTER FACTS( NFACT ), UPLOS( 2 )
198 INTEGER ISEED( 4 ), ISEEDY( 4 )
199 REAL RESULT( NTESTS ), BERR( NRHS ),
200 $ errbnds_n( nrhs, 3 ), errbnds_c( nrhs, 3 )
204 EXTERNAL CLANHE, SGET06
218 COMMON / infoc / infot, nunit, ok, lerr
219 COMMON / srnamc / srnamt
222 INTRINSIC cmplx, max, min
225 DATA iseedy / 1988, 1989, 1990, 1991 /
226 DATA uplos /
'U',
'L' / , facts /
'F',
'N' /
238 iseed( i ) = iseedy( i )
240 lwork = max( 2*nmax, nmax*nrhs )
245 $
CALL cerrvx( path, nout )
265 DO 170 imat = 1, nimat
269 IF( .NOT.dotype( imat ) )
274 zerot = imat.GE.3 .AND. imat.LE.6
275 IF( zerot .AND. n.LT.imat-2 )
281 uplo = uplos( iuplo )
286 CALL clatb4( path, imat, n, n,
TYPE, kl, ku, anorm, mode,
290 CALL clatms( n, n, dist, iseed,
TYPE, rwork, mode,
291 $ cndnum, anorm, kl, ku, uplo, a, lda, work,
297 CALL alaerh( path,
'CLATMS', info, 0, uplo, n, n, -1,
298 $ -1, -1, imat, nfail, nerrs, nout )
308 ELSE IF( imat.EQ.4 )
THEN
318 IF( iuplo.EQ.1 )
THEN
319 ioff = ( izero-1 )*lda
320 DO 20 i = 1, izero - 1
330 DO 40 i = 1, izero - 1
341 IF( iuplo.EQ.1 )
THEN
371 CALL claipd( n, a, lda+1, 0 )
373 DO 150 ifact = 1, nfact
377 fact = facts( ifact )
387 ELSE IF( ifact.EQ.1 )
THEN
391 anorm = clanhe(
'1', uplo, n, a, lda, rwork )
395 CALL clacpy( uplo, n, n, a, lda, afac, lda )
396 CALL chetrf( uplo, n, afac, lda, iwork, work,
401 CALL clacpy( uplo, n, n, afac, lda, ainv, lda )
402 lwork = (n+nb+1)*(nb+3)
403 CALL chetri2( uplo, n, ainv, lda, iwork, work,
405 ainvnm = clanhe(
'1', uplo, n, ainv, lda, rwork )
409 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
412 rcondc = ( one / anorm ) / ainvnm
419 CALL clarhs( path, xtype, uplo,
' ', n, n, kl, ku,
420 $ nrhs, a, lda, xact, lda, b, lda, iseed,
426 IF( ifact.EQ.2 )
THEN
427 CALL clacpy( uplo, n, n, a, lda, afac, lda )
428 CALL clacpy(
'Full', n, nrhs, b, lda, x, lda )
433 CALL chesv( uplo, n, nrhs, afac, lda, iwork, x,
434 $ lda, work, lwork, info )
442 IF( iwork( k ).LT.0 )
THEN
443 IF( iwork( k ).NE.-k )
THEN
447 ELSE IF( iwork( k ).NE.k )
THEN
456 CALL alaerh( path,
'CHESV ', info, k, uplo, n,
457 $ n, -1, -1, nrhs, imat, nfail,
460 ELSE IF( info.NE.0 )
THEN
467 CALL chet01( uplo, n, a, lda, afac, lda, iwork,
468 $ ainv, lda, rwork, result( 1 ) )
472 CALL clacpy(
'Full', n, nrhs, b, lda, work, lda )
473 CALL cpot02( uplo, n, nrhs, a, lda, x, lda, work,
474 $ lda, rwork, result( 2 ) )
478 CALL cget04( n, nrhs, x, lda, xact, lda, rcondc,
486 IF( result( k ).GE.thresh )
THEN
487 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
488 $
CALL aladhd( nout, path )
489 WRITE( nout, fmt = 9999 )
'CHESV ', uplo, n,
490 $ imat, k, result( k )
501 $
CALL claset( uplo, n, n, cmplx( zero ),
502 $ cmplx( zero ), afac, lda )
503 CALL claset(
'Full', n, nrhs, cmplx( zero ),
504 $ cmplx( zero ), x, lda )
510 CALL chesvx( fact, uplo, n, nrhs, a, lda, afac, lda,
511 $ iwork, b, lda, x, lda, rcond, rwork,
512 $ rwork( nrhs+1 ), work, lwork,
513 $ rwork( 2*nrhs+1 ), info )
521 IF( iwork( k ).LT.0 )
THEN
522 IF( iwork( k ).NE.-k )
THEN
526 ELSE IF( iwork( k ).NE.k )
THEN
535 CALL alaerh( path,
'CHESVX', info, k, fact // uplo,
536 $ n, n, -1, -1, nrhs, imat, nfail,
542 IF( ifact.GE.2 )
THEN
547 CALL chet01( uplo, n, a, lda, afac, lda, iwork,
548 $ ainv, lda, rwork( 2*nrhs+1 ),
557 CALL clacpy(
'Full', n, nrhs, b, lda, work, lda )
558 CALL cpot02( uplo, n, nrhs, a, lda, x, lda, work,
559 $ lda, rwork( 2*nrhs+1 ), result( 2 ) )
563 CALL cget04( n, nrhs, x, lda, xact, lda, rcondc,
568 CALL cpot05( uplo, n, nrhs, a, lda, b, lda, x, lda,
569 $ xact, lda, rwork, rwork( nrhs+1 ),
578 result( 6 ) = sget06( rcond, rcondc )
584 IF( result( k ).GE.thresh )
THEN
585 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
586 $
CALL aladhd( nout, path )
587 WRITE( nout, fmt = 9998 )
'CHESVX', fact, uplo,
588 $ n, imat, k, result( k )
599 $
CALL claset( uplo, n, n, cmplx( zero ),
600 $ cmplx( zero ), afac, lda )
601 CALL claset(
'Full', n, nrhs, cmplx( zero ),
602 $ cmplx( zero ), x, lda )
610 CALL chesvxx( fact, uplo, n, nrhs, a, lda, afac,
611 $ lda, iwork, equed, work( n+1 ), b, lda, x,
612 $ lda, rcond, rpvgrw_svxx, berr, n_err_bnds,
613 $ errbnds_n, errbnds_c, 0, zero, work,
614 $ rwork(2*nrhs+1), info )
622 IF( iwork( k ).LT.0 )
THEN
623 IF( iwork( k ).NE.-k )
THEN
627 ELSE IF( iwork( k ).NE.k )
THEN
635 IF( info.NE.k .AND. info.LE.n )
THEN
636 CALL alaerh( path,
'CHESVXX', info, k,
637 $ fact // uplo, n, n, -1, -1, nrhs, imat, nfail,
643 IF( ifact.GE.2 )
THEN
648 CALL chet01( uplo, n, a, lda, afac, lda, iwork,
649 $ ainv, lda, rwork(2*nrhs+1),
658 CALL clacpy(
'Full', n, nrhs, b, lda, work, lda )
659 CALL cpot02( uplo, n, nrhs, a, lda, x, lda, work,
660 $ lda, rwork( 2*nrhs+1 ), result( 2 ) )
665 CALL cget04( n, nrhs, x, lda, xact, lda, rcondc,
670 CALL cpot05( uplo, n, nrhs, a, lda, b, lda, x, lda,
671 $ xact, lda, rwork, rwork( nrhs+1 ),
680 result( 6 ) = sget06( rcond, rcondc )
686 IF( result( k ).GE.thresh )
THEN
687 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
688 $
CALL aladhd( nout, path )
689 WRITE( nout, fmt = 9998 )
'CHESVXX',
690 $ fact, uplo, n, imat, k,
705 CALL alasvm( path, nout, nfail, nrun, nerrs )
712 9999
FORMAT( 1x, a,
', UPLO=''', a1,
''', N =', i5,
', type ', i2,
713 $
', test ', i2,
', ratio =', g12.5 )
714 9998
FORMAT( 1x, a,
', FACT=''', a1,
''', UPLO=''', a1,
''', N =', i5,
715 $
', 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 cdrvhe(dotype, nn, nval, nrhs, thresh, tsterr, nmax, a, afac, ainv, b, x, xact, work, rwork, iwork, nout)
CDRVHE
subroutine cebchvxx(thresh, path)
CEBCHVXX
subroutine cerrvx(path, nunit)
CERRVX
subroutine cget04(n, nrhs, x, ldx, xact, ldxact, rcond, resid)
CGET04
subroutine chet01(uplo, n, a, lda, afac, ldafac, ipiv, c, ldc, rwork, resid)
CHET01
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 cpot02(uplo, n, nrhs, a, lda, x, ldx, b, ldb, rwork, resid)
CPOT02
subroutine cpot05(uplo, n, nrhs, a, lda, b, ldb, x, ldx, xact, ldxact, ferr, berr, reslts)
CPOT05
subroutine chesv(uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info)
CHESV computes the solution to system of linear equations A * X = B for HE matrices
subroutine chesvx(fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, rcond, ferr, berr, work, lwork, rwork, info)
CHESVX computes the solution to system of linear equations A * X = B for HE matrices
subroutine chesvxx(fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, equed, s, b, ldb, x, ldx, rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, rwork, info)
CHESVXX computes the solution to system of linear equations A * X = B for HE matrices
subroutine chetrf(uplo, n, a, lda, ipiv, work, lwork, info)
CHETRF
subroutine chetri2(uplo, n, a, lda, ipiv, work, lwork, info)
CHETRI2
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.