165 SUBROUTINE cchkpb( DOTYPE, NN, NVAL, NNB, NBVAL, NNS, NSVAL,
166 $ THRESH, TSTERR, NMAX, A, AFAC, AINV, B, X,
167 $ XACT, WORK, RWORK, NOUT )
175 INTEGER NMAX, NN, NNB, NNS, NOUT
180 INTEGER NBVAL( * ), NSVAL( * ), NVAL( * )
182 COMPLEX A( * ), AFAC( * ), AINV( * ), B( * ),
183 $ work( * ), x( * ), xact( * )
190 PARAMETER ( ONE = 1.0e+0, zero = 0.0e+0 )
191 INTEGER NTYPES, NTESTS
192 parameter( ntypes = 8, ntests = 7 )
198 CHARACTER DIST, PACKIT,
TYPE, UPLO, XTYPE
200 INTEGER I, I1, I2, IKD, IMAT, IN, INB, INFO, IOFF,
201 $ irhs, iuplo, iw, izero, k, kd, kl, koff, ku,
202 $ lda, ldab, mode, n, nb, nerrs, nfail, nimat,
204 REAL AINVNM, ANORM, CNDNUM, RCOND, RCONDC
207 INTEGER ISEED( 4 ), ISEEDY( 4 ), KDVAL( NBW )
208 REAL RESULT( NTESTS )
211 REAL CLANGE, CLANHB, SGET06
212 EXTERNAL CLANGE, CLANHB, SGET06
221 INTRINSIC cmplx, max, min
229 COMMON / infoc / infot, nunit, ok, lerr
230 COMMON / srnamc / srnamt
233 DATA iseedy / 1988, 1989, 1990, 1991 /
239 path( 1: 1 ) =
'Complex precision'
245 iseed( i ) = iseedy( i )
251 $
CALL cerrpo( path, nout )
264 nkd = max( 1, min( n, 4 ) )
269 kdval( 2 ) = n + ( n+1 ) / 4
270 kdval( 3 ) = ( 3*n-1 ) / 4
271 kdval( 4 ) = ( n+1 ) / 4
286 IF( iuplo.EQ.1 )
THEN
288 koff = max( 1, kd+2-n )
295 DO 60 imat = 1, nimat
299 IF( .NOT.dotype( imat ) )
304 zerot = imat.GE.2 .AND. imat.LE.4
305 IF( zerot .AND. n.LT.imat-1 )
308 IF( .NOT.zerot .OR. .NOT.dotype( 1 ) )
THEN
313 CALL clatb4( path, imat, n, n,
TYPE, kl, ku, anorm,
314 $ mode, cndnum, dist )
317 CALL clatms( n, n, dist, iseed,
TYPE, rwork, mode,
318 $ cndnum, anorm, kd, kd, packit,
319 $ a( koff ), ldab, work, info )
324 CALL alaerh( path,
'CLATMS', info, 0, uplo, n,
325 $ n, kd, kd, -1, imat, nfail, nerrs,
329 ELSE IF( izero.GT.0 )
THEN
335 IF( iuplo.EQ.1 )
THEN
336 ioff = ( izero-1 )*ldab + kd + 1
337 CALL ccopy( izero-i1, work( iw ), 1,
338 $ a( ioff-izero+i1 ), 1 )
340 CALL ccopy( i2-izero+1, work( iw ), 1,
341 $ a( ioff ), max( ldab-1, 1 ) )
343 ioff = ( i1-1 )*ldab + 1
344 CALL ccopy( izero-i1, work( iw ), 1,
345 $ a( ioff+izero-i1 ),
347 ioff = ( izero-1 )*ldab + 1
349 CALL ccopy( i2-izero+1, work( iw ), 1,
361 ELSE IF( imat.EQ.3 )
THEN
370 DO 20 i = 1, min( 2*kd+1, n )
374 i1 = max( izero-kd, 1 )
375 i2 = min( izero+kd, n )
377 IF( iuplo.EQ.1 )
THEN
378 ioff = ( izero-1 )*ldab + kd + 1
379 CALL cswap( izero-i1, a( ioff-izero+i1 ), 1,
382 CALL cswap( i2-izero+1, a( ioff ),
383 $ max( ldab-1, 1 ), work( iw ), 1 )
385 ioff = ( i1-1 )*ldab + 1
386 CALL cswap( izero-i1, a( ioff+izero-i1 ),
387 $ max( ldab-1, 1 ), work( iw ), 1 )
388 ioff = ( izero-1 )*ldab + 1
390 CALL cswap( i2-izero+1, a( ioff ), 1,
397 IF( iuplo.EQ.1 )
THEN
398 CALL claipd( n, a( kd+1 ), ldab, 0 )
400 CALL claipd( n, a( 1 ), ldab, 0 )
412 CALL clacpy(
'Full', kd+1, n, a, ldab, afac, ldab )
414 CALL cpbtrf( uplo, n, kd, afac, ldab, info )
418 IF( info.NE.izero )
THEN
419 CALL alaerh( path,
'CPBTRF', info, izero, uplo,
420 $ n, n, kd, kd, nb, imat, nfail,
434 CALL clacpy(
'Full', kd+1, n, afac, ldab, ainv,
436 CALL cpbt01( uplo, n, kd, a, ldab, ainv, ldab,
437 $ rwork, result( 1 ) )
441 IF( result( 1 ).GE.thresh )
THEN
442 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
443 $
CALL alahd( nout, path )
444 WRITE( nout, fmt = 9999 )uplo, n, kd, nb, imat,
458 CALL claset(
'Full', n, n, cmplx( zero ),
459 $ cmplx( one ), ainv, lda )
461 CALL cpbtrs( uplo, n, kd, n, afac, ldab, ainv, lda,
466 anorm = clanhb(
'1', uplo, n, kd, a, ldab, rwork )
467 ainvnm = clange(
'1', n, n, ainv, lda, rwork )
468 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
471 rcondc = ( one / anorm ) / ainvnm
481 CALL clarhs( path, xtype, uplo,
' ', n, n, kd,
482 $ kd, nrhs, a, ldab, xact, lda, b,
484 CALL clacpy(
'Full', n, nrhs, b, lda, x, lda )
487 CALL cpbtrs( uplo, n, kd, nrhs, afac, ldab, x,
493 $
CALL alaerh( path,
'CPBTRS', info, 0, uplo,
494 $ n, n, kd, kd, nrhs, imat, nfail,
497 CALL clacpy(
'Full', n, nrhs, b, lda, work,
499 CALL cpbt02( uplo, n, kd, nrhs, a, ldab, x, lda,
500 $ work, lda, rwork, result( 2 ) )
505 CALL cget04( n, nrhs, x, lda, xact, lda, rcondc,
512 CALL cpbrfs( uplo, n, kd, nrhs, a, ldab, afac,
513 $ ldab, b, lda, x, lda, rwork,
514 $ rwork( nrhs+1 ), work,
515 $ rwork( 2*nrhs+1 ), info )
520 $
CALL alaerh( path,
'CPBRFS', info, 0, uplo,
521 $ n, n, kd, kd, nrhs, imat, nfail,
524 CALL cget04( n, nrhs, x, lda, xact, lda, rcondc,
526 CALL cpbt05( uplo, n, kd, nrhs, a, ldab, b, lda,
527 $ x, lda, xact, lda, rwork,
528 $ rwork( nrhs+1 ), result( 5 ) )
534 IF( result( k ).GE.thresh )
THEN
535 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
536 $
CALL alahd( nout, path )
537 WRITE( nout, fmt = 9998 )uplo, n, kd,
538 $ nrhs, imat, k, result( k )
549 CALL cpbcon( uplo, n, kd, afac, ldab, anorm, rcond,
550 $ work, rwork, info )
555 $
CALL alaerh( path,
'CPBCON', info, 0, uplo, n,
556 $ n, kd, kd, -1, imat, nfail, nerrs,
559 result( 7 ) = sget06( rcond, rcondc )
563 IF( result( 7 ).GE.thresh )
THEN
564 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
565 $
CALL alahd( nout, path )
566 WRITE( nout, fmt = 9997 )uplo, n, kd, imat, 7,
579 CALL alasum( path, nout, nfail, nrun, nerrs )
581 9999
FORMAT(
' UPLO=''', a1,
''', N=', i5,
', KD=', i5,
', NB=', i4,
582 $
', type ', i2,
', test ', i2,
', ratio= ', g12.5 )
583 9998
FORMAT(
' UPLO=''', a1,
''', N=', i5,
', KD=', i5,
', NRHS=', i3,
584 $
', type ', i2,
', test(', i2,
') = ', g12.5 )
585 9997
FORMAT(
' UPLO=''', a1,
''', N=', i5,
', KD=', i5,
',', 10x,
586 $
' type ', i2,
', test(', i2,
') = ', g12.5 )
subroutine alasum(type, nout, nfail, nrun, nerrs)
ALASUM
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 alaerh(path, subnam, info, infoe, opts, m, n, kl, ku, n5, imat, nfail, nerrs, nout)
ALAERH
subroutine alahd(iounit, path)
ALAHD
subroutine cchkpb(dotype, nn, nval, nnb, nbval, nns, nsval, thresh, tsterr, nmax, a, afac, ainv, b, x, xact, work, rwork, nout)
CCHKPB
subroutine cerrpo(path, nunit)
CERRPO
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 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 cpbcon(uplo, n, kd, ab, ldab, anorm, rcond, work, rwork, info)
CPBCON
subroutine cpbrfs(uplo, n, kd, nrhs, ab, ldab, afb, ldafb, b, ldb, x, ldx, ferr, berr, work, rwork, info)
CPBRFS
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