172 SUBROUTINE cdrvgb( DOTYPE, NN, NVAL, NRHS, THRESH, TSTERR, A, LA,
173 $ AFB, LAFB, ASAV, B, BSAV, X, XACT, S, WORK,
174 $ RWORK, IWORK, NOUT )
182 INTEGER LA, LAFB, NN, NOUT, NRHS
187 INTEGER IWORK( * ), NVAL( * )
188 REAL RWORK( * ), S( * )
189 COMPLEX A( * ), AFB( * ), ASAV( * ), B( * ), BSAV( * ),
190 $ work( * ), x( * ), xact( * )
197 PARAMETER ( ONE = 1.0e+0, zero = 0.0e+0 )
199 parameter( ntypes = 8 )
201 parameter( ntests = 7 )
203 parameter( ntran = 3 )
206 LOGICAL EQUIL, NOFACT, PREFAC, TRFCON, ZEROT
207 CHARACTER DIST, EQUED, FACT, TRANS,
TYPE, XTYPE
209 INTEGER I, I1, I2, IEQUED, IFACT, IKL, IKU, IMAT, IN,
210 $ info, ioff, itran, izero, j, k, k1, kl, ku,
211 $ lda, ldafb, ldb, mode, n, nb, nbmin, nerrs,
212 $ nfact, nfail, nimat, nkl, nku, nrun, nt,
214 REAL AINVNM, AMAX, ANORM, ANORMI, ANORMO, ANRMPV,
215 $ CNDNUM, COLCND, RCOND, RCONDC, RCONDI, RCONDO,
216 $ roldc, roldi, roldo, rowcnd, rpvgrw,
220 CHARACTER EQUEDS( 4 ), FACTS( 3 ), TRANSS( NTRAN )
221 INTEGER ISEED( 4 ), ISEEDY( 4 )
222 REAL RDUM( 1 ), RESULT( NTESTS ), BERR( NRHS ),
223 $ errbnds_n( nrhs,3 ), errbnds_c( nrhs, 3 )
227 REAL CLANGB, CLANGE, CLANTB, SGET06, SLAMCH,
229 EXTERNAL lsame, clangb, clange, clantb, sget06, slamch,
239 INTRINSIC abs, cmplx, max, min
247 COMMON / infoc / infot, nunit, ok, lerr
248 COMMON / srnamc / srnamt
251 DATA iseedy / 1988, 1989, 1990, 1991 /
252 DATA transs /
'N',
'T',
'C' /
253 DATA facts /
'F',
'N',
'E' /
254 DATA equeds /
'N',
'R',
'C',
'B' /
260 path( 1: 1 ) =
'Complex precision'
266 iseed( i ) = iseedy( i )
272 $
CALL cerrvx( path, nout )
291 nkl = max( 1, min( n, 4 ) )
306 ELSE IF( ikl.EQ.2 )
THEN
308 ELSE IF( ikl.EQ.3 )
THEN
310 ELSE IF( ikl.EQ.4 )
THEN
321 ELSE IF( iku.EQ.2 )
THEN
323 ELSE IF( iku.EQ.3 )
THEN
325 ELSE IF( iku.EQ.4 )
THEN
333 ldafb = 2*kl + ku + 1
334 IF( lda*n.GT.la .OR. ldafb*n.GT.lafb )
THEN
335 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
336 $
CALL aladhd( nout, path )
337 IF( lda*n.GT.la )
THEN
338 WRITE( nout, fmt = 9999 )la, n, kl, ku,
342 IF( ldafb*n.GT.lafb )
THEN
343 WRITE( nout, fmt = 9998 )lafb, n, kl, ku,
350 DO 120 imat = 1, nimat
354 IF( .NOT.dotype( imat ) )
359 zerot = imat.GE.2 .AND. imat.LE.4
360 IF( zerot .AND. n.LT.imat-1 )
366 CALL clatb4( path, imat, n, n,
TYPE, kl, ku, anorm,
367 $ mode, cndnum, dist )
368 rcondc = one / cndnum
371 CALL clatms( n, n, dist, iseed,
TYPE, rwork, mode,
372 $ cndnum, anorm, kl, ku,
'Z', a, lda, work,
378 CALL alaerh( path,
'CLATMS', info, 0,
' ', n, n,
379 $ kl, ku, -1, imat, nfail, nerrs, nout )
390 ELSE IF( imat.EQ.3 )
THEN
395 ioff = ( izero-1 )*lda
397 i1 = max( 1, ku+2-izero )
398 i2 = min( kl+ku+1, ku+1+( n-izero ) )
404 DO 30 i = max( 1, ku+2-j ),
405 $ min( kl+ku+1, ku+1+( n-j ) )
415 CALL clacpy(
'Full', kl+ku+1, n, a, lda, asav, lda )
418 equed = equeds( iequed )
419 IF( iequed.EQ.1 )
THEN
425 DO 100 ifact = 1, nfact
426 fact = facts( ifact )
427 prefac = lsame( fact,
'F' )
428 nofact = lsame( fact,
'N' )
429 equil = lsame( fact,
'E' )
437 ELSE IF( .NOT.nofact )
THEN
444 CALL clacpy(
'Full', kl+ku+1, n, asav, lda,
445 $ afb( kl+1 ), ldafb )
446 IF( equil .OR. iequed.GT.1 )
THEN
451 CALL cgbequ( n, n, kl, ku, afb( kl+1 ),
452 $ ldafb, s, s( n+1 ), rowcnd,
453 $ colcnd, amax, info )
454 IF( info.EQ.0 .AND. n.GT.0 )
THEN
455 IF( lsame( equed,
'R' ) )
THEN
458 ELSE IF( lsame( equed,
'C' ) )
THEN
461 ELSE IF( lsame( equed,
'B' ) )
THEN
468 CALL claqgb( n, n, kl, ku, afb( kl+1 ),
469 $ ldafb, s, s( n+1 ),
470 $ rowcnd, colcnd, amax,
485 anormo = clangb(
'1', n, kl, ku, afb( kl+1 ),
487 anormi = clangb(
'I', n, kl, ku, afb( kl+1 ),
492 CALL cgbtrf( n, n, kl, ku, afb, ldafb, iwork,
497 CALL claset(
'Full', n, n, cmplx( zero ),
498 $ cmplx( one ), work, ldb )
500 CALL cgbtrs(
'No transpose', n, kl, ku, n,
501 $ afb, ldafb, iwork, work, ldb,
506 ainvnm = clange(
'1', n, n, work, ldb,
508 IF( anormo.LE.zero .OR. ainvnm.LE.zero )
THEN
511 rcondo = ( one / anormo ) / ainvnm
517 ainvnm = clange(
'I', n, n, work, ldb,
519 IF( anormi.LE.zero .OR. ainvnm.LE.zero )
THEN
522 rcondi = ( one / anormi ) / ainvnm
526 DO 90 itran = 1, ntran
530 trans = transs( itran )
531 IF( itran.EQ.1 )
THEN
539 CALL clacpy(
'Full', kl+ku+1, n, asav, lda,
546 CALL clarhs( path, xtype,
'Full', trans, n,
547 $ n, kl, ku, nrhs, a, lda, xact,
548 $ ldb, b, ldb, iseed, info )
550 CALL clacpy(
'Full', n, nrhs, b, ldb, bsav,
553 IF( nofact .AND. itran.EQ.1 )
THEN
560 CALL clacpy(
'Full', kl+ku+1, n, a, lda,
561 $ afb( kl+1 ), ldafb )
562 CALL clacpy(
'Full', n, nrhs, b, ldb, x,
566 CALL cgbsv( n, kl, ku, nrhs, afb, ldafb,
567 $ iwork, x, ldb, info )
572 $
CALL alaerh( path,
'CGBSV ', info,
573 $ izero,
' ', n, n, kl, ku,
574 $ nrhs, imat, nfail, nerrs,
580 CALL cgbt01( n, n, kl, ku, a, lda, afb,
581 $ ldafb, iwork, work,
584 IF( izero.EQ.0 )
THEN
589 CALL clacpy(
'Full', n, nrhs, b, ldb,
591 CALL cgbt02(
'No transpose', n, n, kl,
592 $ ku, nrhs, a, lda, x, ldb,
599 CALL cget04( n, nrhs, x, ldb, xact,
600 $ ldb, rcondc, result( 3 ) )
608 IF( result( k ).GE.thresh )
THEN
609 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
610 $
CALL aladhd( nout, path )
611 WRITE( nout, fmt = 9997 )
'CGBSV ',
612 $ n, kl, ku, imat, k, result( k )
622 $
CALL claset(
'Full', 2*kl+ku+1, n,
623 $ cmplx( zero ), cmplx( zero ),
625 CALL claset(
'Full', n, nrhs, cmplx( zero ),
626 $ cmplx( zero ), x, ldb )
627 IF( iequed.GT.1 .AND. n.GT.0 )
THEN
632 CALL claqgb( n, n, kl, ku, a, lda, s,
633 $ s( n+1 ), rowcnd, colcnd,
641 CALL cgbsvx( fact, trans, n, kl, ku, nrhs, a,
642 $ lda, afb, ldafb, iwork, equed,
643 $ s, s( ldb+1 ), b, ldb, x, ldb,
644 $ rcond, rwork, rwork( nrhs+1 ),
645 $ work, rwork( 2*nrhs+1 ), info )
650 $
CALL alaerh( path,
'CGBSVX', info, izero,
651 $ fact // trans, n, n, kl, ku,
652 $ nrhs, imat, nfail, nerrs,
661 DO 60 i = max( ku+2-j, 1 ),
662 $ min( n+ku+1-j, kl+ku+1 )
663 anrmpv = max( anrmpv,
664 $ abs( a( i+( j-1 )*lda ) ) )
667 rpvgrw = clantb(
'M',
'U',
'N', info,
668 $ min( info-1, kl+ku ),
669 $ afb( max( 1, kl+ku+2-info ) ),
671 IF( rpvgrw.EQ.zero )
THEN
674 rpvgrw = anrmpv / rpvgrw
677 rpvgrw = clantb(
'M',
'U',
'N', n, kl+ku,
679 IF( rpvgrw.EQ.zero )
THEN
682 rpvgrw = clangb(
'M', n, kl, ku, a,
683 $ lda, rdum ) / rpvgrw
686 result( 7 ) = abs( rpvgrw-rwork( 2*nrhs+1 ) )
687 $ / max( rwork( 2*nrhs+1 ),
688 $ rpvgrw ) / slamch(
'E' )
690 IF( .NOT.prefac )
THEN
695 CALL cgbt01( n, n, kl, ku, a, lda, afb,
696 $ ldafb, iwork, work,
708 CALL clacpy(
'Full', n, nrhs, bsav, ldb,
710 CALL cgbt02( trans, n, n, kl, ku, nrhs,
711 $ asav, lda, x, ldb, work, ldb,
718 IF( nofact .OR. ( prefac .AND.
719 $ lsame( equed,
'N' ) ) )
THEN
720 CALL cget04( n, nrhs, x, ldb, xact,
721 $ ldb, rcondc, result( 3 ) )
723 IF( itran.EQ.1 )
THEN
728 CALL cget04( n, nrhs, x, ldb, xact,
729 $ ldb, roldc, result( 3 ) )
735 CALL cgbt05( trans, n, kl, ku, nrhs, asav,
736 $ lda, bsav, ldb, x, ldb, xact,
737 $ ldb, rwork, rwork( nrhs+1 ),
746 result( 6 ) = sget06( rcond, rcondc )
751 IF( .NOT.trfcon )
THEN
753 IF( result( k ).GE.thresh )
THEN
754 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
755 $
CALL aladhd( nout, path )
757 WRITE( nout, fmt = 9995 )
758 $
'CGBSVX', fact, trans, n, kl,
759 $ ku, equed, imat, k,
762 WRITE( nout, fmt = 9996 )
763 $
'CGBSVX', fact, trans, n, kl,
764 $ ku, imat, k, result( k )
771 IF( result( 1 ).GE.thresh .AND. .NOT.
773 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
774 $
CALL aladhd( nout, path )
776 WRITE( nout, fmt = 9995 )
'CGBSVX',
777 $ fact, trans, n, kl, ku, equed,
778 $ imat, 1, result( 1 )
780 WRITE( nout, fmt = 9996 )
'CGBSVX',
781 $ fact, trans, n, kl, ku, imat, 1,
787 IF( result( 6 ).GE.thresh )
THEN
788 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
789 $
CALL aladhd( nout, path )
791 WRITE( nout, fmt = 9995 )
'CGBSVX',
792 $ fact, trans, n, kl, ku, equed,
793 $ imat, 6, result( 6 )
795 WRITE( nout, fmt = 9996 )
'CGBSVX',
796 $ fact, trans, n, kl, ku, imat, 6,
802 IF( result( 7 ).GE.thresh )
THEN
803 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
804 $
CALL aladhd( nout, path )
806 WRITE( nout, fmt = 9995 )
'CGBSVX',
807 $ fact, trans, n, kl, ku, equed,
808 $ imat, 7, result( 7 )
810 WRITE( nout, fmt = 9996 )
'CGBSVX',
811 $ fact, trans, n, kl, ku, imat, 7,
825 CALL clacpy(
'Full', kl+ku+1, n, asav, lda, a,
827 CALL clacpy(
'Full', n, nrhs, bsav, ldb, b, ldb )
830 $
CALL claset(
'Full', 2*kl+ku+1, n,
831 $ cmplx( zero ), cmplx( zero ),
833 CALL claset(
'Full', n, nrhs,
834 $ cmplx( zero ), cmplx( zero ),
836 IF( iequed.GT.1 .AND. n.GT.0 )
THEN
841 CALL claqgb( n, n, kl, ku, a, lda, s,
842 $ s( n+1 ), rowcnd, colcnd, amax, equed )
850 CALL cgbsvxx( fact, trans, n, kl, ku, nrhs, a, lda,
851 $ afb, ldafb, iwork, equed, s, s( n+1 ), b, ldb,
852 $ x, ldb, rcond, rpvgrw_svxx, berr, n_err_bnds,
853 $ errbnds_n, errbnds_c, 0, zero, work,
858 IF( info.EQ.n+1 )
GOTO 90
859 IF( info.NE.izero )
THEN
860 CALL alaerh( path,
'CGBSVXX', info, izero,
861 $ fact // trans, n, n, -1, -1, nrhs,
862 $ imat, nfail, nerrs, nout )
870 IF ( info .GT. 0 .AND. info .LT. n+1 )
THEN
878 result( 7 ) = abs( rpvgrw-rpvgrw_svxx ) /
879 $ max( rpvgrw_svxx, rpvgrw ) /
882 IF( .NOT.prefac )
THEN
887 CALL cgbt01( n, n, kl, ku, a, lda, afb, ldafb,
888 $ iwork, work( 2*nrhs+1 ), result( 1 ) )
899 CALL clacpy(
'Full', n, nrhs, bsav, ldb, work,
901 CALL cgbt02( trans, n, n, kl, ku, nrhs, asav,
902 $ lda, x, ldb, work, ldb, rwork,
907 IF( nofact .OR. ( prefac .AND. lsame( equed,
909 CALL cget04( n, nrhs, x, ldb, xact, ldb,
910 $ rcondc, result( 3 ) )
912 IF( itran.EQ.1 )
THEN
917 CALL cget04( n, nrhs, x, ldb, xact, ldb,
918 $ roldc, result( 3 ) )
927 result( 6 ) = sget06( rcond, rcondc )
932 IF( .NOT.trfcon )
THEN
934 IF( result( k ).GE.thresh )
THEN
935 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
936 $
CALL aladhd( nout, path )
938 WRITE( nout, fmt = 9995 )
'CGBSVXX',
939 $ fact, trans, n, kl, ku, equed,
940 $ imat, k, result( k )
942 WRITE( nout, fmt = 9996 )
'CGBSVXX',
943 $ fact, trans, n, kl, ku, imat, k,
951 IF( result( 1 ).GE.thresh .AND. .NOT.prefac )
953 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
954 $
CALL aladhd( nout, path )
956 WRITE( nout, fmt = 9995 )
'CGBSVXX', fact,
957 $ trans, n, kl, ku, equed, imat, 1,
960 WRITE( nout, fmt = 9996 )
'CGBSVXX', fact,
961 $ trans, n, kl, ku, imat, 1,
967 IF( result( 6 ).GE.thresh )
THEN
968 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
969 $
CALL aladhd( nout, path )
971 WRITE( nout, fmt = 9995 )
'CGBSVXX', fact,
972 $ trans, n, kl, ku, equed, imat, 6,
975 WRITE( nout, fmt = 9996 )
'CGBSVXX', fact,
976 $ trans, n, kl, ku, imat, 6,
982 IF( result( 7 ).GE.thresh )
THEN
983 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
984 $
CALL aladhd( nout, path )
986 WRITE( nout, fmt = 9995 )
'CGBSVXX', fact,
987 $ trans, n, kl, ku, equed, imat, 7,
990 WRITE( nout, fmt = 9996 )
'CGBSVXX', fact,
991 $ trans, n, kl, ku, imat, 7,
1010 CALL alasvm( path, nout, nfail, nrun, nerrs )
1017 9999
FORMAT(
' *** In CDRVGB, LA=', i5,
' is too small for N=', i5,
1018 $
', KU=', i5,
', KL=', i5, /
' ==> Increase LA to at least ',
1020 9998
FORMAT(
' *** In CDRVGB, LAFB=', i5,
' is too small for N=', i5,
1021 $
', KU=', i5,
', KL=', i5, /
1022 $
' ==> Increase LAFB to at least ', i5 )
1023 9997
FORMAT( 1x, a,
', N=', i5,
', KL=', i5,
', KU=', i5,
', type ',
1024 $ i1,
', test(', i1,
')=', g12.5 )
1025 9996
FORMAT( 1x, a,
'( ''', a1,
''',''', a1,
''',', i5,
',', i5,
',',
1026 $ i5,
',...), type ', i1,
', test(', i1,
')=', g12.5 )
1027 9995
FORMAT( 1x, a,
'( ''', a1,
''',''', a1,
''',', i5,
',', i5,
',',
1028 $ i5,
',...), EQUED=''', a1,
''', type ', i1,
', test(', i1,
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 cdrvgb(dotype, nn, nval, nrhs, thresh, tsterr, a, la, afb, lafb, asav, b, bsav, x, xact, s, work, rwork, iwork, nout)
CDRVGB
subroutine cebchvxx(thresh, path)
CEBCHVXX
subroutine cerrvx(path, nunit)
CERRVX
subroutine cgbt01(m, n, kl, ku, a, lda, afac, ldafac, ipiv, work, resid)
CGBT01
subroutine cgbt02(trans, m, n, kl, ku, nrhs, a, lda, x, ldx, b, ldb, rwork, resid)
CGBT02
subroutine cgbt05(trans, n, kl, ku, nrhs, ab, ldab, b, ldb, x, ldx, xact, ldxact, ferr, berr, reslts)
CGBT05
subroutine cget04(n, nrhs, x, ldx, xact, ldxact, rcond, resid)
CGET04
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 cgbequ(m, n, kl, ku, ab, ldab, r, c, rowcnd, colcnd, amax, info)
CGBEQU
subroutine cgbsv(n, kl, ku, nrhs, ab, ldab, ipiv, b, ldb, info)
CGBSV computes the solution to system of linear equations A * X = B for GB matrices (simple driver)
subroutine cgbsvx(fact, trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, equed, r, c, b, ldb, x, ldx, rcond, ferr, berr, work, rwork, info)
CGBSVX computes the solution to system of linear equations A * X = B for GB matrices
subroutine cgbsvxx(fact, trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb, 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)
CGBSVXX computes the solution to system of linear equations A * X = B for GB matrices
subroutine cgbtrf(m, n, kl, ku, ab, ldab, ipiv, info)
CGBTRF
subroutine cgbtrs(trans, n, kl, ku, nrhs, ab, ldab, ipiv, b, ldb, info)
CGBTRS
real function cla_gbrpvgrw(n, kl, ku, ncols, ab, ldab, afb, ldafb)
CLA_GBRPVGRW computes the reciprocal pivot growth factor norm(A)/norm(U) for a general banded matrix.
subroutine clacpy(uplo, m, n, a, lda, b, ldb)
CLACPY copies all or part of one two-dimensional array to another.
subroutine claqgb(m, n, kl, ku, ab, ldab, r, c, rowcnd, colcnd, amax, equed)
CLAQGB scales a general band matrix, using row and column scaling factors computed by sgbequ.
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.