156 SUBROUTINE cdrvpb( DOTYPE, NN, NVAL, NRHS, THRESH, TSTERR, NMAX,
157 $ A, AFAC, ASAV, B, BSAV, X, XACT, S, WORK,
166 INTEGER NMAX, NN, NOUT, NRHS
172 REAL RWORK( * ), S( * )
173 COMPLEX A( * ), AFAC( * ), ASAV( * ), B( * ),
174 $ bsav( * ), work( * ), x( * ), xact( * )
181 PARAMETER ( ONE = 1.0e+0, zero = 0.0e+0 )
182 INTEGER NTYPES, NTESTS
183 parameter( ntypes = 8, ntests = 6 )
188 LOGICAL EQUIL, NOFACT, PREFAC, ZEROT
189 CHARACTER DIST, EQUED, FACT, PACKIT,
TYPE, UPLO, XTYPE
191 INTEGER I, I1, I2, IEQUED, IFACT, IKD, IMAT, IN, INFO,
192 $ ioff, iuplo, iw, izero, k, k1, kd, kl, koff,
193 $ ku, lda, ldab, mode, n, nb, nbmin, nerrs,
194 $ nfact, nfail, nimat, nkd, nrun, nt
195 REAL AINVNM, AMAX, ANORM, CNDNUM, RCOND, RCONDC,
199 CHARACTER EQUEDS( 2 ), FACTS( 3 )
200 INTEGER ISEED( 4 ), ISEEDY( 4 ), KDVAL( NBW )
201 REAL RESULT( NTESTS )
205 REAL CLANGE, CLANHB, SGET06
206 EXTERNAL lsame, clange, clanhb, sget06
215 INTRINSIC cmplx, max, min
223 COMMON / infoc / infot, nunit, ok, lerr
224 COMMON / srnamc / srnamt
227 DATA iseedy / 1988, 1989, 1990, 1991 /
228 DATA facts /
'F',
'N',
'E' / , equeds /
'N',
'Y' /
234 path( 1: 1 ) =
'Complex precision'
240 iseed( i ) = iseedy( i )
246 $
CALL cerrvx( path, nout )
266 nkd = max( 1, min( n, 4 ) )
271 kdval( 2 ) = n + ( n+1 ) / 4
272 kdval( 3 ) = ( 3*n-1 ) / 4
273 kdval( 4 ) = ( n+1 ) / 4
288 IF( iuplo.EQ.1 )
THEN
291 koff = max( 1, kd+2-n )
297 DO 80 imat = 1, nimat
301 IF( .NOT.dotype( imat ) )
306 zerot = imat.GE.2 .AND. imat.LE.4
307 IF( zerot .AND. n.LT.imat-1 )
310 IF( .NOT.zerot .OR. .NOT.dotype( 1 ) )
THEN
315 CALL clatb4( path, imat, n, n,
TYPE, kl, ku, anorm,
316 $ mode, cndnum, dist )
319 CALL clatms( n, n, dist, iseed,
TYPE, rwork, mode,
320 $ cndnum, anorm, kd, kd, packit,
321 $ a( koff ), ldab, work, info )
326 CALL alaerh( path,
'CLATMS', info, 0, uplo, n,
327 $ n, -1, -1, -1, imat, nfail, nerrs,
331 ELSE IF( izero.GT.0 )
THEN
337 IF( iuplo.EQ.1 )
THEN
338 ioff = ( izero-1 )*ldab + kd + 1
339 CALL ccopy( izero-i1, work( iw ), 1,
340 $ a( ioff-izero+i1 ), 1 )
342 CALL ccopy( i2-izero+1, work( iw ), 1,
343 $ a( ioff ), max( ldab-1, 1 ) )
345 ioff = ( i1-1 )*ldab + 1
346 CALL ccopy( izero-i1, work( iw ), 1,
347 $ a( ioff+izero-i1 ),
349 ioff = ( izero-1 )*ldab + 1
351 CALL ccopy( i2-izero+1, work( iw ), 1,
363 ELSE IF( imat.EQ.3 )
THEN
372 DO 20 i = 1, min( 2*kd+1, n )
376 i1 = max( izero-kd, 1 )
377 i2 = min( izero+kd, n )
379 IF( iuplo.EQ.1 )
THEN
380 ioff = ( izero-1 )*ldab + kd + 1
381 CALL cswap( izero-i1, a( ioff-izero+i1 ), 1,
384 CALL cswap( i2-izero+1, a( ioff ),
385 $ max( ldab-1, 1 ), work( iw ), 1 )
387 ioff = ( i1-1 )*ldab + 1
388 CALL cswap( izero-i1, a( ioff+izero-i1 ),
389 $ max( ldab-1, 1 ), work( iw ), 1 )
390 ioff = ( izero-1 )*ldab + 1
392 CALL cswap( i2-izero+1, a( ioff ), 1,
399 IF( iuplo.EQ.1 )
THEN
400 CALL claipd( n, a( kd+1 ), ldab, 0 )
402 CALL claipd( n, a( 1 ), ldab, 0 )
407 CALL clacpy(
'Full', kd+1, n, a, ldab, asav, ldab )
410 equed = equeds( iequed )
411 IF( iequed.EQ.1 )
THEN
417 DO 60 ifact = 1, nfact
418 fact = facts( ifact )
419 prefac = lsame( fact,
'F' )
420 nofact = lsame( fact,
'N' )
421 equil = lsame( fact,
'E' )
428 ELSE IF( .NOT.lsame( fact,
'N' ) )
THEN
435 CALL clacpy(
'Full', kd+1, n, asav, ldab,
437 IF( equil .OR. iequed.GT.1 )
THEN
442 CALL cpbequ( uplo, n, kd, afac, ldab, s,
443 $ scond, amax, info )
444 IF( info.EQ.0 .AND. n.GT.0 )
THEN
450 CALL claqhb( uplo, n, kd, afac, ldab,
451 $ s, scond, amax, equed )
463 anorm = clanhb(
'1', uplo, n, kd, afac, ldab,
468 CALL cpbtrf( uplo, n, kd, afac, ldab, info )
472 CALL claset(
'Full', n, n, cmplx( zero ),
473 $ cmplx( one ), a, lda )
475 CALL cpbtrs( uplo, n, kd, n, afac, ldab, a,
480 ainvnm = clange(
'1', n, n, a, lda, rwork )
481 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
484 rcondc = ( one / anorm ) / ainvnm
490 CALL clacpy(
'Full', kd+1, n, asav, ldab, a,
497 CALL clarhs( path, xtype, uplo,
' ', n, n, kd,
498 $ kd, nrhs, a, ldab, xact, lda, b,
501 CALL clacpy(
'Full', n, nrhs, b, lda, bsav,
511 CALL clacpy(
'Full', kd+1, n, a, ldab, afac,
513 CALL clacpy(
'Full', n, nrhs, b, lda, x,
517 CALL cpbsv( uplo, n, kd, nrhs, afac, ldab, x,
522 IF( info.NE.izero )
THEN
523 CALL alaerh( path,
'CPBSV ', info, izero,
524 $ uplo, n, n, kd, kd, nrhs,
525 $ imat, nfail, nerrs, nout )
527 ELSE IF( info.NE.0 )
THEN
534 CALL cpbt01( uplo, n, kd, a, ldab, afac,
535 $ ldab, rwork, result( 1 ) )
539 CALL clacpy(
'Full', n, nrhs, b, lda, work,
541 CALL cpbt02( uplo, n, kd, nrhs, a, ldab, x,
542 $ lda, work, lda, rwork,
547 CALL cget04( n, nrhs, x, lda, xact, lda,
548 $ rcondc, result( 3 ) )
555 IF( result( k ).GE.thresh )
THEN
556 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
557 $
CALL aladhd( nout, path )
558 WRITE( nout, fmt = 9999 )
'CPBSV ',
559 $ uplo, n, kd, imat, k, result( k )
570 $
CALL claset(
'Full', kd+1, n, cmplx( zero ),
571 $ cmplx( zero ), afac, ldab )
572 CALL claset(
'Full', n, nrhs, cmplx( zero ),
573 $ cmplx( zero ), x, lda )
574 IF( iequed.GT.1 .AND. n.GT.0 )
THEN
579 CALL claqhb( uplo, n, kd, a, ldab, s, scond,
587 CALL cpbsvx( fact, uplo, n, kd, nrhs, a, ldab,
588 $ afac, ldab, equed, s, b, lda, x,
589 $ lda, rcond, rwork, rwork( nrhs+1 ),
590 $ work, rwork( 2*nrhs+1 ), info )
594 IF( info.NE.izero )
THEN
595 CALL alaerh( path,
'CPBSVX', info, izero,
596 $ fact // uplo, n, n, kd, kd,
597 $ nrhs, imat, nfail, nerrs, nout )
602 IF( .NOT.prefac )
THEN
607 CALL cpbt01( uplo, n, kd, a, ldab, afac,
608 $ ldab, rwork( 2*nrhs+1 ),
617 CALL clacpy(
'Full', n, nrhs, bsav, lda,
619 CALL cpbt02( uplo, n, kd, nrhs, asav, ldab,
621 $ rwork( 2*nrhs+1 ), result( 2 ) )
625 IF( nofact .OR. ( prefac .AND. lsame( equed,
627 CALL cget04( n, nrhs, x, lda, xact, lda,
628 $ rcondc, result( 3 ) )
630 CALL cget04( n, nrhs, x, lda, xact, lda,
631 $ roldc, result( 3 ) )
637 CALL cpbt05( uplo, n, kd, nrhs, asav, ldab,
638 $ b, lda, x, lda, xact, lda,
639 $ rwork, rwork( nrhs+1 ),
648 result( 6 ) = sget06( rcond, rcondc )
654 IF( result( k ).GE.thresh )
THEN
655 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
656 $
CALL aladhd( nout, path )
658 WRITE( nout, fmt = 9997 )
'CPBSVX',
659 $ fact, uplo, n, kd, equed, imat, k,
662 WRITE( nout, fmt = 9998 )
'CPBSVX',
663 $ fact, uplo, n, kd, imat, k,
679 CALL alasvm( path, nout, nfail, nrun, nerrs )
681 9999
FORMAT( 1x, a,
', UPLO=''', a1,
''', N =', i5,
', KD =', i5,
682 $
', type ', i1,
', test(', i1,
')=', g12.5 )
683 9998
FORMAT( 1x, a,
'( ''', a1,
''', ''', a1,
''', ', i5,
', ', i5,
684 $
', ... ), type ', i1,
', test(', i1,
')=', g12.5 )
685 9997
FORMAT( 1x, a,
'( ''', a1,
''', ''', a1,
''', ', i5,
', ', i5,
686 $
', ... ), 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 cdrvpb(dotype, nn, nval, nrhs, thresh, tsterr, nmax, a, afac, asav, b, bsav, x, xact, s, work, rwork, nout)
CDRVPB
subroutine cerrvx(path, nunit)
CERRVX
subroutine cget04(n, nrhs, x, ldx, xact, ldxact, rcond, resid)
CGET04
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 cpbt01(uplo, n, kd, a, lda, afac, ldafac, rwork, resid)
CPBT01
subroutine cpbt02(uplo, n, kd, nrhs, a, lda, x, ldx, b, ldb, rwork, resid)
CPBT02
subroutine cpbt05(uplo, n, kd, nrhs, ab, ldab, b, ldb, x, ldx, xact, ldxact, ferr, berr, reslts)
CPBT05
subroutine ccopy(n, cx, incx, cy, incy)
CCOPY
subroutine clacpy(uplo, m, n, a, lda, b, ldb)
CLACPY copies all or part of one two-dimensional array to another.
subroutine claqhb(uplo, n, kd, ab, ldab, s, scond, amax, equed)
CLAQHB scales a Hermitian band matrix, using scaling factors computed by cpbequ.
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.
subroutine cpbequ(uplo, n, kd, ab, ldab, s, scond, amax, info)
CPBEQU
subroutine cpbsv(uplo, n, kd, nrhs, ab, ldab, b, ldb, info)
CPBSV computes the solution to system of linear equations A * X = B for OTHER matrices
subroutine cpbsvx(fact, uplo, n, kd, nrhs, ab, ldab, afb, ldafb, equed, s, b, ldb, x, ldx, rcond, ferr, berr, work, rwork, info)
CPBSVX computes the solution to system of linear equations A * X = B for OTHER matrices
subroutine cpbtrf(uplo, n, kd, ab, ldab, info)
CPBTRF
subroutine cpbtrs(uplo, n, kd, nrhs, ab, ldab, b, ldb, info)
CPBTRS
subroutine cswap(n, cx, incx, cy, incy)
CSWAP