164 SUBROUTINE zdrvge( DOTYPE, NN, NVAL, NRHS, THRESH, TSTERR, NMAX,
165 $ A, AFAC, ASAV, B, BSAV, X, XACT, S, WORK,
166 $ RWORK, IWORK, NOUT )
174 INTEGER NMAX, NN, NOUT, NRHS
175 DOUBLE PRECISION THRESH
179 INTEGER IWORK( * ), NVAL( * )
180 DOUBLE PRECISION RWORK( * ), S( * )
181 COMPLEX*16 A( * ), AFAC( * ), ASAV( * ), B( * ),
182 $ bsav( * ), work( * ), x( * ), xact( * )
188 DOUBLE PRECISION ONE, ZERO
189 PARAMETER ( ONE = 1.0d+0, zero = 0.0d+0 )
191 parameter( ntypes = 11 )
193 parameter( ntests = 7 )
195 parameter( ntran = 3 )
198 LOGICAL EQUIL, NOFACT, PREFAC, TRFCON, ZEROT
199 CHARACTER DIST, EQUED, FACT, TRANS,
TYPE, XTYPE
201 INTEGER I, IEQUED, IFACT, IMAT, IN, INFO, IOFF, ITRAN,
202 $ izero, k, k1, kl, ku, lda, lwork, mode, n, nb,
203 $ nbmin, nerrs, nfact, nfail, nimat, nrun, nt,
205 DOUBLE PRECISION AINVNM, AMAX, ANORM, ANORMI, ANORMO, CNDNUM,
206 $ COLCND, RCOND, RCONDC, RCONDI, RCONDO, ROLDC,
207 $ roldi, roldo, rowcnd, rpvgrw, rpvgrw_svxx
210 CHARACTER EQUEDS( 4 ), FACTS( 3 ), TRANSS( NTRAN )
211 INTEGER ISEED( 4 ), ISEEDY( 4 )
212 DOUBLE PRECISION RDUM( 1 ), RESULT( NTESTS ), BERR( NRHS ),
213 $ errbnds_n( nrhs, 3 ), errbnds_c( nrhs, 3 )
217 DOUBLE PRECISION DGET06, DLAMCH, ZLANGE, ZLANTR, ZLA_GERPVGRW
218 EXTERNAL lsame, dget06, dlamch, zlange, zlantr,
228 INTRINSIC abs, dcmplx, max, dble, dimag
236 COMMON / infoc / infot, nunit, ok, lerr
237 COMMON / srnamc / srnamt
240 DATA iseedy / 1988, 1989, 1990, 1991 /
241 DATA transs /
'N',
'T',
'C' /
242 DATA facts /
'F',
'N',
'E' /
243 DATA equeds /
'N',
'R',
'C',
'B' /
249 path( 1: 1 ) =
'Zomplex precision'
255 iseed( i ) = iseedy( i )
261 $
CALL zerrvx( path, nout )
281 DO 80 imat = 1, nimat
285 IF( .NOT.dotype( imat ) )
290 zerot = imat.GE.5 .AND. imat.LE.7
291 IF( zerot .AND. n.LT.imat-4 )
297 CALL zlatb4( path, imat, n, n,
TYPE, kl, ku, anorm, mode,
299 rcondc = one / cndnum
302 CALL zlatms( n, n, dist, iseed,
TYPE, rwork, mode, cndnum,
303 $ anorm, kl, ku,
'No packing', a, lda, work,
309 CALL alaerh( path,
'ZLATMS', info, 0,
' ', n, n, -1, -1,
310 $ -1, imat, nfail, nerrs, nout )
320 ELSE IF( imat.EQ.6 )
THEN
325 ioff = ( izero-1 )*lda
331 CALL zlaset(
'Full', n, n-izero+1, dcmplx( zero ),
332 $ dcmplx( zero ), a( ioff+1 ), lda )
340 CALL zlacpy(
'Full', n, n, a, lda, asav, lda )
343 equed = equeds( iequed )
344 IF( iequed.EQ.1 )
THEN
350 DO 60 ifact = 1, nfact
351 fact = facts( ifact )
352 prefac = lsame( fact,
'F' )
353 nofact = lsame( fact,
'N' )
354 equil = lsame( fact,
'E' )
362 ELSE IF( .NOT.nofact )
THEN
369 CALL zlacpy(
'Full', n, n, asav, lda, afac, lda )
370 IF( equil .OR. iequed.GT.1 )
THEN
375 CALL zgeequ( n, n, afac, lda, s, s( n+1 ),
376 $ rowcnd, colcnd, amax, info )
377 IF( info.EQ.0 .AND. n.GT.0 )
THEN
378 IF( lsame( equed,
'R' ) )
THEN
381 ELSE IF( lsame( equed,
'C' ) )
THEN
384 ELSE IF( lsame( equed,
'B' ) )
THEN
391 CALL zlaqge( n, n, afac, lda, s, s( n+1 ),
392 $ rowcnd, colcnd, amax, equed )
406 anormo = zlange(
'1', n, n, afac, lda, rwork )
407 anormi = zlange(
'I', n, n, afac, lda, rwork )
411 CALL zgetrf( n, n, afac, lda, iwork, info )
415 CALL zlacpy(
'Full', n, n, afac, lda, a, lda )
416 lwork = nmax*max( 3, nrhs )
417 CALL zgetri( n, a, lda, iwork, work, lwork, info )
421 ainvnm = zlange(
'1', n, n, a, lda, rwork )
422 IF( anormo.LE.zero .OR. ainvnm.LE.zero )
THEN
425 rcondo = ( one / anormo ) / ainvnm
430 ainvnm = zlange(
'I', n, n, a, lda, rwork )
431 IF( anormi.LE.zero .OR. ainvnm.LE.zero )
THEN
434 rcondi = ( one / anormi ) / ainvnm
438 DO 50 itran = 1, ntran
442 trans = transs( itran )
443 IF( itran.EQ.1 )
THEN
451 CALL zlacpy(
'Full', n, n, asav, lda, a, lda )
456 CALL zlarhs( path, xtype,
'Full', trans, n, n, kl,
457 $ ku, nrhs, a, lda, xact, lda, b, lda,
460 CALL zlacpy(
'Full', n, nrhs, b, lda, bsav, lda )
462 IF( nofact .AND. itran.EQ.1 )
THEN
469 CALL zlacpy(
'Full', n, n, a, lda, afac, lda )
470 CALL zlacpy(
'Full', n, nrhs, b, lda, x, lda )
473 CALL zgesv( n, nrhs, afac, lda, iwork, x, lda,
479 $
CALL alaerh( path,
'ZGESV ', info, izero,
480 $
' ', n, n, -1, -1, nrhs, imat,
481 $ nfail, nerrs, nout )
486 CALL zget01( n, n, a, lda, afac, lda, iwork,
487 $ rwork, result( 1 ) )
489 IF( izero.EQ.0 )
THEN
493 CALL zlacpy(
'Full', n, nrhs, b, lda, work,
495 CALL zget02(
'No transpose', n, n, nrhs, a,
496 $ lda, x, lda, work, lda, rwork,
501 CALL zget04( n, nrhs, x, lda, xact, lda,
502 $ rcondc, result( 3 ) )
510 IF( result( k ).GE.thresh )
THEN
511 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
512 $
CALL aladhd( nout, path )
513 WRITE( nout, fmt = 9999 )
'ZGESV ', n,
514 $ imat, k, result( k )
524 $
CALL zlaset(
'Full', n, n, dcmplx( zero ),
525 $ dcmplx( zero ), afac, lda )
526 CALL zlaset(
'Full', n, nrhs, dcmplx( zero ),
527 $ dcmplx( zero ), x, lda )
528 IF( iequed.GT.1 .AND. n.GT.0 )
THEN
533 CALL zlaqge( n, n, a, lda, s, s( n+1 ), rowcnd,
534 $ colcnd, amax, equed )
541 CALL zgesvx( fact, trans, n, nrhs, a, lda, afac,
542 $ lda, iwork, equed, s, s( n+1 ), b,
543 $ lda, x, lda, rcond, rwork,
544 $ rwork( nrhs+1 ), work,
545 $ rwork( 2*nrhs+1 ), info )
550 $
CALL alaerh( path,
'ZGESVX', info, izero,
551 $ fact // trans, n, n, -1, -1, nrhs,
552 $ imat, nfail, nerrs, nout )
558 rpvgrw = zlantr(
'M',
'U',
'N', info, info,
560 IF( rpvgrw.EQ.zero )
THEN
563 rpvgrw = zlange(
'M', n, info, a, lda,
567 rpvgrw = zlantr(
'M',
'U',
'N', n, n, afac, lda,
569 IF( rpvgrw.EQ.zero )
THEN
572 rpvgrw = zlange(
'M', n, n, a, lda, rdum ) /
576 result( 7 ) = abs( rpvgrw-rwork( 2*nrhs+1 ) ) /
577 $ max( rwork( 2*nrhs+1 ), rpvgrw ) /
580 IF( .NOT.prefac )
THEN
585 CALL zget01( n, n, a, lda, afac, lda, iwork,
586 $ rwork( 2*nrhs+1 ), result( 1 ) )
597 CALL zlacpy(
'Full', n, nrhs, bsav, lda, work,
599 CALL zget02( trans, n, n, nrhs, asav, lda, x,
600 $ lda, work, lda, rwork( 2*nrhs+1 ),
605 IF( nofact .OR. ( prefac .AND. lsame( equed,
607 CALL zget04( n, nrhs, x, lda, xact, lda,
608 $ rcondc, result( 3 ) )
610 IF( itran.EQ.1 )
THEN
615 CALL zget04( n, nrhs, x, lda, xact, lda,
616 $ roldc, result( 3 ) )
622 CALL zget07( trans, n, nrhs, asav, lda, b, lda,
623 $ x, lda, xact, lda, rwork, .true.,
624 $ rwork( nrhs+1 ), result( 4 ) )
632 result( 6 ) = dget06( rcond, rcondc )
637 IF( .NOT.trfcon )
THEN
639 IF( result( k ).GE.thresh )
THEN
640 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
641 $
CALL aladhd( nout, path )
643 WRITE( nout, fmt = 9997 )
'ZGESVX',
644 $ fact, trans, n, equed, imat, k,
647 WRITE( nout, fmt = 9998 )
'ZGESVX',
648 $ fact, trans, n, imat, k, result( k )
655 IF( result( 1 ).GE.thresh .AND. .NOT.prefac )
657 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
658 $
CALL aladhd( nout, path )
660 WRITE( nout, fmt = 9997 )
'ZGESVX', fact,
661 $ trans, n, equed, imat, 1, result( 1 )
663 WRITE( nout, fmt = 9998 )
'ZGESVX', fact,
664 $ trans, n, imat, 1, result( 1 )
669 IF( result( 6 ).GE.thresh )
THEN
670 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
671 $
CALL aladhd( nout, path )
673 WRITE( nout, fmt = 9997 )
'ZGESVX', fact,
674 $ trans, n, equed, imat, 6, result( 6 )
676 WRITE( nout, fmt = 9998 )
'ZGESVX', fact,
677 $ trans, n, imat, 6, result( 6 )
682 IF( result( 7 ).GE.thresh )
THEN
683 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
684 $
CALL aladhd( nout, path )
686 WRITE( nout, fmt = 9997 )
'ZGESVX', fact,
687 $ trans, n, equed, imat, 7, result( 7 )
689 WRITE( nout, fmt = 9998 )
'ZGESVX', fact,
690 $ trans, n, imat, 7, result( 7 )
703 CALL zlacpy(
'Full', n, n, asav, lda, a, lda )
704 CALL zlacpy(
'Full', n, nrhs, bsav, lda, b, lda )
707 $
CALL zlaset(
'Full', n, n, dcmplx( zero ),
708 $ dcmplx( zero ), afac, lda )
709 CALL zlaset(
'Full', n, nrhs, dcmplx( zero ),
710 $ dcmplx( zero ), x, lda )
711 IF( iequed.GT.1 .AND. n.GT.0 )
THEN
716 CALL zlaqge( n, n, a, lda, s, s( n+1 ), rowcnd,
717 $ colcnd, amax, equed )
725 CALL zgesvxx( fact, trans, n, nrhs, a, lda, afac,
726 $ lda, iwork, equed, s, s( n+1 ), b, lda, x,
727 $ lda, rcond, rpvgrw_svxx, berr, n_err_bnds,
728 $ errbnds_n, errbnds_c, 0, zero, work,
733 IF( info.EQ.n+1 )
GOTO 50
734 IF( info.NE.izero )
THEN
735 CALL alaerh( path,
'ZGESVXX', info, izero,
736 $ fact // trans, n, n, -1, -1, nrhs,
737 $ imat, nfail, nerrs, nout )
745 IF ( info .GT. 0 .AND. info .LT. n+1 )
THEN
746 rpvgrw = zla_gerpvgrw
747 $ (n, info, a, lda, afac, lda)
749 rpvgrw = zla_gerpvgrw
750 $ (n, n, a, lda, afac, lda)
753 result( 7 ) = abs( rpvgrw-rpvgrw_svxx ) /
754 $ max( rpvgrw_svxx, rpvgrw ) /
757 IF( .NOT.prefac )
THEN
762 CALL zget01( n, n, a, lda, afac, lda, iwork,
763 $ rwork( 2*nrhs+1 ), result( 1 ) )
774 CALL zlacpy(
'Full', n, nrhs, bsav, lda, work,
776 CALL zget02( trans, n, n, nrhs, asav, lda, x,
777 $ lda, work, lda, rwork( 2*nrhs+1 ),
782 IF( nofact .OR. ( prefac .AND. lsame( equed,
784 CALL zget04( n, nrhs, x, lda, xact, lda,
785 $ rcondc, result( 3 ) )
787 IF( itran.EQ.1 )
THEN
792 CALL zget04( n, nrhs, x, lda, xact, lda,
793 $ roldc, result( 3 ) )
802 result( 6 ) = dget06( rcond, rcondc )
807 IF( .NOT.trfcon )
THEN
809 IF( result( k ).GE.thresh )
THEN
810 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
811 $
CALL aladhd( nout, path )
813 WRITE( nout, fmt = 9997 )
'ZGESVXX',
814 $ fact, trans, n, equed, imat, k,
817 WRITE( nout, fmt = 9998 )
'ZGESVXX',
818 $ fact, trans, n, imat, k, result( k )
825 IF( result( 1 ).GE.thresh .AND. .NOT.prefac )
827 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
828 $
CALL aladhd( nout, path )
830 WRITE( nout, fmt = 9997 )
'ZGESVXX', fact,
831 $ trans, n, equed, imat, 1, result( 1 )
833 WRITE( nout, fmt = 9998 )
'ZGESVXX', fact,
834 $ trans, n, imat, 1, result( 1 )
839 IF( result( 6 ).GE.thresh )
THEN
840 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
841 $
CALL aladhd( nout, path )
843 WRITE( nout, fmt = 9997 )
'ZGESVXX', fact,
844 $ trans, n, equed, imat, 6, result( 6 )
846 WRITE( nout, fmt = 9998 )
'ZGESVXX', fact,
847 $ trans, n, imat, 6, result( 6 )
852 IF( result( 7 ).GE.thresh )
THEN
853 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
854 $
CALL aladhd( nout, path )
856 WRITE( nout, fmt = 9997 )
'ZGESVXX', fact,
857 $ trans, n, equed, imat, 7, result( 7 )
859 WRITE( nout, fmt = 9998 )
'ZGESVXX', fact,
860 $ trans, n, imat, 7, result( 7 )
876 CALL alasvm( path, nout, nfail, nrun, nerrs )
883 9999
FORMAT( 1x, a,
', N =', i5,
', type ', i2,
', test(', i2,
') =',
885 9998
FORMAT( 1x, a,
', FACT=''', a1,
''', TRANS=''', a1,
''', N=', i5,
886 $
', type ', i2,
', test(', i1,
')=', g12.5 )
887 9997
FORMAT( 1x, a,
', FACT=''', a1,
''', TRANS=''', a1,
''', N=', i5,
888 $
', EQUED=''', a1,
''', type ', i2,
', test(', i1,
')=',
subroutine alasvm(type, nout, nfail, nrun, nerrs)
ALASVM
subroutine xlaenv(ispec, nvalue)
XLAENV
subroutine zget02(trans, m, n, nrhs, a, lda, x, ldx, b, ldb, rwork, resid)
ZGET02
subroutine zlarhs(path, xtype, uplo, trans, m, n, kl, ku, nrhs, a, lda, x, ldx, b, ldb, iseed, info)
ZLARHS
subroutine aladhd(iounit, path)
ALADHD
subroutine alaerh(path, subnam, info, infoe, opts, m, n, kl, ku, n5, imat, nfail, nerrs, nout)
ALAERH
subroutine zgeequ(m, n, a, lda, r, c, rowcnd, colcnd, amax, info)
ZGEEQU
subroutine zgesv(n, nrhs, a, lda, ipiv, b, ldb, info)
Download ZGESV + dependencies <a href="http://www.netlib.org/cgi-bin/netlibfiles....
subroutine zgesvx(fact, trans, n, nrhs, a, lda, af, ldaf, ipiv, equed, r, c, b, ldb, x, ldx, rcond, ferr, berr, work, rwork, info)
ZGESVX computes the solution to system of linear equations A * X = B for GE matrices
subroutine zgesvxx(fact, trans, n, nrhs, a, lda, af, ldaf, ipiv, equed, r, c, b, ldb, x, ldx, rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, rwork, info)
ZGESVXX computes the solution to system of linear equations A * X = B for GE matrices
subroutine zgetrf(m, n, a, lda, ipiv, info)
ZGETRF
subroutine zgetri(n, a, lda, ipiv, work, lwork, info)
ZGETRI
subroutine zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.
subroutine zlaqge(m, n, a, lda, r, c, rowcnd, colcnd, amax, equed)
ZLAQGE scales a general rectangular matrix, using row and column scaling factors computed by sgeequ.
subroutine zlaset(uplo, m, n, alpha, beta, a, lda)
ZLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine zdrvge(dotype, nn, nval, nrhs, thresh, tsterr, nmax, a, afac, asav, b, bsav, x, xact, s, work, rwork, iwork, nout)
ZDRVGE
subroutine zebchvxx(thresh, path)
ZEBCHVXX
subroutine zerrvx(path, nunit)
ZERRVX
subroutine zget01(m, n, a, lda, afac, ldafac, ipiv, rwork, resid)
ZGET01
subroutine zget04(n, nrhs, x, ldx, xact, ldxact, rcond, resid)
ZGET04
subroutine zget07(trans, n, nrhs, a, lda, b, ldb, x, ldx, xact, ldxact, ferr, chkferr, berr, reslts)
ZGET07
subroutine zlatb4(path, imat, m, n, type, kl, ku, anorm, mode, cndnum, dist)
ZLATB4
subroutine zlatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
ZLATMS