169 SUBROUTINE cdrvgb( DOTYPE, NN, NVAL, NRHS, THRESH, TSTERR, A, LA,
170 $ AFB, LAFB, ASAV, B, BSAV, X, XACT, S, WORK,
171 $ RWORK, IWORK, NOUT )
179 INTEGER LA, LAFB, NN, NOUT, NRHS
184 INTEGER IWORK( * ), NVAL( * )
185 REAL RWORK( * ), S( * )
186 COMPLEX A( * ), AFB( * ), ASAV( * ), B( * ), BSAV( * ),
187 $ work( * ), x( * ), xact( * )
194 PARAMETER ( ONE = 1.0e+0, zero = 0.0e+0 )
196 parameter( ntypes = 8 )
198 parameter( ntests = 7 )
200 parameter( ntran = 3 )
203 LOGICAL EQUIL, NOFACT, PREFAC, TRFCON, ZEROT
204 CHARACTER DIST, EQUED, FACT, TRANS,
TYPE, XTYPE
206 INTEGER I, I1, I2, IEQUED, IFACT, IKL, IKU, IMAT, IN,
207 $ info, ioff, itran, izero, j, k, k1, kl, ku,
208 $ lda, ldafb, ldb, mode, n, nb, nbmin, nerrs,
209 $ nfact, nfail, nimat, nkl, nku, nrun, nt
210 REAL AINVNM, AMAX, ANORM, ANORMI, ANORMO, ANRMPV,
211 $ CNDNUM, COLCND, RCOND, RCONDC, RCONDI, RCONDO,
212 $ roldc, roldi, roldo, rowcnd, rpvgrw
215 CHARACTER EQUEDS( 4 ), FACTS( 3 ), TRANSS( NTRAN )
216 INTEGER ISEED( 4 ), ISEEDY( 4 )
217 REAL RDUM( 1 ), RESULT( NTESTS )
221 REAL CLANGB, CLANGE, CLANTB, SGET06, SLAMCH
222 EXTERNAL lsame, clangb, clange, clantb, sget06, slamch
231 INTRINSIC abs, cmplx, max, min
239 COMMON / infoc / infot, nunit, ok, lerr
240 COMMON / srnamc / srnamt
243 DATA iseedy / 1988, 1989, 1990, 1991 /
244 DATA transs /
'N',
'T',
'C' /
245 DATA facts /
'F',
'N',
'E' /
246 DATA equeds /
'N',
'R',
'C',
'B' /
252 path( 1: 1 ) =
'Complex precision'
258 iseed( i ) = iseedy( i )
264 $
CALL cerrvx( path, nout )
283 nkl = max( 1, min( n, 4 ) )
298 ELSE IF( ikl.EQ.2 )
THEN
300 ELSE IF( ikl.EQ.3 )
THEN
302 ELSE IF( ikl.EQ.4 )
THEN
313 ELSE IF( iku.EQ.2 )
THEN
315 ELSE IF( iku.EQ.3 )
THEN
317 ELSE IF( iku.EQ.4 )
THEN
325 ldafb = 2*kl + ku + 1
326 IF( lda*n.GT.la .OR. ldafb*n.GT.lafb )
THEN
327 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
328 $
CALL aladhd( nout, path )
329 IF( lda*n.GT.la )
THEN
330 WRITE( nout, fmt = 9999 )la, n, kl, ku,
334 IF( ldafb*n.GT.lafb )
THEN
335 WRITE( nout, fmt = 9998 )lafb, n, kl, ku,
342 DO 120 imat = 1, nimat
346 IF( .NOT.dotype( imat ) )
351 zerot = imat.GE.2 .AND. imat.LE.4
352 IF( zerot .AND. n.LT.imat-1 )
358 CALL clatb4( path, imat, n, n,
TYPE, kl, ku, anorm,
359 $ mode, cndnum, dist )
360 rcondc = one / cndnum
363 CALL clatms( n, n, dist, iseed,
TYPE, rwork, mode,
364 $ cndnum, anorm, kl, ku,
'Z', a, lda, work,
370 CALL alaerh( path,
'CLATMS', info, 0,
' ', n, n,
371 $ kl, ku, -1, imat, nfail, nerrs, nout )
382 ELSE IF( imat.EQ.3 )
THEN
387 ioff = ( izero-1 )*lda
389 i1 = max( 1, ku+2-izero )
390 i2 = min( kl+ku+1, ku+1+( n-izero ) )
396 DO 30 i = max( 1, ku+2-j ),
397 $ min( kl+ku+1, ku+1+( n-j ) )
407 CALL clacpy(
'Full', kl+ku+1, n, a, lda, asav, lda )
410 equed = equeds( iequed )
411 IF( iequed.EQ.1 )
THEN
417 DO 100 ifact = 1, nfact
418 fact = facts( ifact )
419 prefac = lsame( fact,
'F' )
420 nofact = lsame( fact,
'N' )
421 equil = lsame( fact,
'E' )
429 ELSE IF( .NOT.nofact )
THEN
436 CALL clacpy(
'Full', kl+ku+1, n, asav, lda,
437 $ afb( kl+1 ), ldafb )
438 IF( equil .OR. iequed.GT.1 )
THEN
443 CALL cgbequ( n, n, kl, ku, afb( kl+1 ),
444 $ ldafb, s, s( n+1 ), rowcnd,
445 $ colcnd, amax, info )
446 IF( info.EQ.0 .AND. n.GT.0 )
THEN
447 IF( lsame( equed,
'R' ) )
THEN
450 ELSE IF( lsame( equed,
'C' ) )
THEN
453 ELSE IF( lsame( equed,
'B' ) )
THEN
460 CALL claqgb( n, n, kl, ku, afb( kl+1 ),
461 $ ldafb, s, s( n+1 ),
462 $ rowcnd, colcnd, amax,
477 anormo = clangb(
'1', n, kl, ku, afb( kl+1 ),
479 anormi = clangb(
'I', n, kl, ku, afb( kl+1 ),
484 CALL cgbtrf( n, n, kl, ku, afb, ldafb, iwork,
489 CALL claset(
'Full', n, n, cmplx( zero ),
490 $ cmplx( one ), work, ldb )
492 CALL cgbtrs(
'No transpose', n, kl, ku, n,
493 $ afb, ldafb, iwork, work, ldb,
498 ainvnm = clange(
'1', n, n, work, ldb,
500 IF( anormo.LE.zero .OR. ainvnm.LE.zero )
THEN
503 rcondo = ( one / anormo ) / ainvnm
509 ainvnm = clange(
'I', n, n, work, ldb,
511 IF( anormi.LE.zero .OR. ainvnm.LE.zero )
THEN
514 rcondi = ( one / anormi ) / ainvnm
518 DO 90 itran = 1, ntran
522 trans = transs( itran )
523 IF( itran.EQ.1 )
THEN
531 CALL clacpy(
'Full', kl+ku+1, n, asav, lda,
538 CALL clarhs( path, xtype,
'Full', trans, n,
539 $ n, kl, ku, nrhs, a, lda, xact,
540 $ ldb, b, ldb, iseed, info )
542 CALL clacpy(
'Full', n, nrhs, b, ldb, bsav,
545 IF( nofact .AND. itran.EQ.1 )
THEN
552 CALL clacpy(
'Full', kl+ku+1, n, a, lda,
553 $ afb( kl+1 ), ldafb )
554 CALL clacpy(
'Full', n, nrhs, b, ldb, x,
558 CALL cgbsv( n, kl, ku, nrhs, afb, ldafb,
559 $ iwork, x, ldb, info )
564 $
CALL alaerh( path,
'CGBSV ', info,
565 $ izero,
' ', n, n, kl, ku,
566 $ nrhs, imat, nfail, nerrs,
572 CALL cgbt01( n, n, kl, ku, a, lda, afb,
573 $ ldafb, iwork, work,
576 IF( izero.EQ.0 )
THEN
581 CALL clacpy(
'Full', n, nrhs, b, ldb,
583 CALL cgbt02(
'No transpose', n, n, kl,
584 $ ku, nrhs, a, lda, x, ldb,
591 CALL cget04( n, nrhs, x, ldb, xact,
592 $ ldb, rcondc, result( 3 ) )
600 IF( result( k ).GE.thresh )
THEN
601 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
602 $
CALL aladhd( nout, path )
603 WRITE( nout, fmt = 9997 )
'CGBSV ',
604 $ n, kl, ku, imat, k, result( k )
614 $
CALL claset(
'Full', 2*kl+ku+1, n,
615 $ cmplx( zero ), cmplx( zero ),
617 CALL claset(
'Full', n, nrhs, cmplx( zero ),
618 $ cmplx( zero ), x, ldb )
619 IF( iequed.GT.1 .AND. n.GT.0 )
THEN
624 CALL claqgb( n, n, kl, ku, a, lda, s,
625 $ s( n+1 ), rowcnd, colcnd,
633 CALL cgbsvx( fact, trans, n, kl, ku, nrhs, a,
634 $ lda, afb, ldafb, iwork, equed,
635 $ s, s( ldb+1 ), b, ldb, x, ldb,
636 $ rcond, rwork, rwork( nrhs+1 ),
637 $ work, rwork( 2*nrhs+1 ), info )
642 $
CALL alaerh( path,
'CGBSVX', info, izero,
643 $ fact // trans, n, n, kl, ku,
644 $ nrhs, imat, nfail, nerrs,
649 IF( info.NE.0 .AND. info.LE.n)
THEN
652 DO 60 i = max( ku+2-j, 1 ),
653 $ min( n+ku+1-j, kl+ku+1 )
654 anrmpv = max( anrmpv,
655 $ abs( a( i+( j-1 )*lda ) ) )
658 rpvgrw = clantb(
'M',
'U',
'N', info,
659 $ min( info-1, kl+ku ),
660 $ afb( max( 1, kl+ku+2-info ) ),
662 IF( rpvgrw.EQ.zero )
THEN
665 rpvgrw = anrmpv / rpvgrw
668 rpvgrw = clantb(
'M',
'U',
'N', n, kl+ku,
670 IF( rpvgrw.EQ.zero )
THEN
673 rpvgrw = clangb(
'M', n, kl, ku, a,
674 $ lda, rdum ) / rpvgrw
677 result( 7 ) = abs( rpvgrw-rwork( 2*nrhs+1 ) )
678 $ / max( rwork( 2*nrhs+1 ),
679 $ rpvgrw ) / slamch(
'E' )
681 IF( .NOT.prefac )
THEN
686 CALL cgbt01( n, n, kl, ku, a, lda, afb,
687 $ ldafb, iwork, work,
699 CALL clacpy(
'Full', n, nrhs, bsav, ldb,
701 CALL cgbt02( trans, n, n, kl, ku, nrhs,
702 $ asav, lda, x, ldb, work, ldb,
709 IF( nofact .OR. ( prefac .AND.
710 $ lsame( equed,
'N' ) ) )
THEN
711 CALL cget04( n, nrhs, x, ldb, xact,
712 $ ldb, rcondc, result( 3 ) )
714 IF( itran.EQ.1 )
THEN
719 CALL cget04( n, nrhs, x, ldb, xact,
720 $ ldb, roldc, result( 3 ) )
726 CALL cgbt05( trans, n, kl, ku, nrhs, asav,
727 $ lda, bsav, ldb, x, ldb, xact,
728 $ ldb, rwork, rwork( nrhs+1 ),
737 result( 6 ) = sget06( rcond, rcondc )
742 IF( .NOT.trfcon )
THEN
744 IF( result( k ).GE.thresh )
THEN
745 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
746 $
CALL aladhd( nout, path )
748 WRITE( nout, fmt = 9995 )
749 $
'CGBSVX', fact, trans, n, kl,
750 $ ku, equed, imat, k,
753 WRITE( nout, fmt = 9996 )
754 $
'CGBSVX', fact, trans, n, kl,
755 $ ku, imat, k, result( k )
760 nrun = nrun + ntests - k1 + 1
762 IF( result( 1 ).GE.thresh .AND. .NOT.
764 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
765 $
CALL aladhd( nout, path )
767 WRITE( nout, fmt = 9995 )
'CGBSVX',
768 $ fact, trans, n, kl, ku, equed,
769 $ imat, 1, result( 1 )
771 WRITE( nout, fmt = 9996 )
'CGBSVX',
772 $ fact, trans, n, kl, ku, imat, 1,
778 IF( result( 6 ).GE.thresh )
THEN
779 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
780 $
CALL aladhd( nout, path )
782 WRITE( nout, fmt = 9995 )
'CGBSVX',
783 $ fact, trans, n, kl, ku, equed,
784 $ imat, 6, result( 6 )
786 WRITE( nout, fmt = 9996 )
'CGBSVX',
787 $ fact, trans, n, kl, ku, imat, 6,
793 IF( result( 7 ).GE.thresh )
THEN
794 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
795 $
CALL aladhd( nout, path )
797 WRITE( nout, fmt = 9995 )
'CGBSVX',
798 $ fact, trans, n, kl, ku, equed,
799 $ imat, 7, result( 7 )
801 WRITE( nout, fmt = 9996 )
'CGBSVX',
802 $ fact, trans, n, kl, ku, imat, 7,
819 CALL alasvm( path, nout, nfail, nrun, nerrs )
821 9999
FORMAT(
' *** In CDRVGB, LA=', i5,
' is too small for N=', i5,
822 $
', KU=', i5,
', KL=', i5, /
' ==> Increase LA to at least ',
824 9998
FORMAT(
' *** In CDRVGB, LAFB=', i5,
' is too small for N=', i5,
825 $
', KU=', i5,
', KL=', i5, /
826 $
' ==> Increase LAFB to at least ', i5 )
827 9997
FORMAT( 1x, a,
', N=', i5,
', KL=', i5,
', KU=', i5,
', type ',
828 $ i1,
', test(', i1,
')=', g12.5 )
829 9996
FORMAT( 1x, a,
'( ''', a1,
''',''', a1,
''',', i5,
',', i5,
',',
830 $ i5,
',...), type ', i1,
', test(', i1,
')=', g12.5 )
831 9995
FORMAT( 1x, a,
'( ''', a1,
''',''', a1,
''',', i5,
',', i5,
',',
832 $ 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 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 cgbtrf(m, n, kl, ku, ab, ldab, ipiv, info)
CGBTRF
subroutine cgbtrs(trans, n, kl, ku, nrhs, ab, ldab, ipiv, b, ldb, info)
CGBTRS
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.