165 SUBROUTINE zchkpb( 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
176 DOUBLE PRECISION THRESH
180 INTEGER NBVAL( * ), NSVAL( * ), NVAL( * )
181 DOUBLE PRECISION RWORK( * )
182 COMPLEX*16 A( * ), AFAC( * ), AINV( * ), B( * ),
183 $ work( * ), x( * ), xact( * )
189 DOUBLE PRECISION ONE, ZERO
190 PARAMETER ( ONE = 1.0d+0, zero = 0.0d+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 DOUBLE PRECISION AINVNM, ANORM, CNDNUM, RCOND, RCONDC
207 INTEGER ISEED( 4 ), ISEEDY( 4 ), KDVAL( NBW )
208 DOUBLE PRECISION RESULT( NTESTS )
211 DOUBLE PRECISION DGET06, ZLANGE, ZLANHB
212 EXTERNAL DGET06, ZLANGE, ZLANHB
221 INTRINSIC dcmplx, max, min
229 COMMON / infoc / infot, nunit, ok, lerr
230 COMMON / srnamc / srnamt
233 DATA iseedy / 1988, 1989, 1990, 1991 /
239 path( 1: 1 ) =
'Zomplex precision'
245 iseed( i ) = iseedy( i )
251 $
CALL zerrpo( 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 zlatb4( path, imat, n, n,
TYPE, kl, ku, anorm,
314 $ mode, cndnum, dist )
317 CALL zlatms( n, n, dist, iseed,
TYPE, rwork, mode,
318 $ cndnum, anorm, kd, kd, packit,
319 $ a( koff ), ldab, work, info )
324 CALL alaerh( path,
'ZLATMS', 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 zcopy( izero-i1, work( iw ), 1,
338 $ a( ioff-izero+i1 ), 1 )
340 CALL zcopy( i2-izero+1, work( iw ), 1,
341 $ a( ioff ), max( ldab-1, 1 ) )
343 ioff = ( i1-1 )*ldab + 1
344 CALL zcopy( izero-i1, work( iw ), 1,
345 $ a( ioff+izero-i1 ),
347 ioff = ( izero-1 )*ldab + 1
349 CALL zcopy( 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 zswap( izero-i1, a( ioff-izero+i1 ), 1,
382 CALL zswap( i2-izero+1, a( ioff ),
383 $ max( ldab-1, 1 ), work( iw ), 1 )
385 ioff = ( i1-1 )*ldab + 1
386 CALL zswap( izero-i1, a( ioff+izero-i1 ),
387 $ max( ldab-1, 1 ), work( iw ), 1 )
388 ioff = ( izero-1 )*ldab + 1
390 CALL zswap( i2-izero+1, a( ioff ), 1,
397 IF( iuplo.EQ.1 )
THEN
398 CALL zlaipd( n, a( kd+1 ), ldab, 0 )
400 CALL zlaipd( n, a( 1 ), ldab, 0 )
412 CALL zlacpy(
'Full', kd+1, n, a, ldab, afac, ldab )
414 CALL zpbtrf( uplo, n, kd, afac, ldab, info )
418 IF( info.NE.izero )
THEN
419 CALL alaerh( path,
'ZPBTRF', info, izero, uplo,
420 $ n, n, kd, kd, nb, imat, nfail,
434 CALL zlacpy(
'Full', kd+1, n, afac, ldab, ainv,
436 CALL zpbt01( 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 zlaset(
'Full', n, n, dcmplx( zero ),
459 $ dcmplx( one ), ainv, lda )
461 CALL zpbtrs( uplo, n, kd, n, afac, ldab, ainv, lda,
466 anorm = zlanhb(
'1', uplo, n, kd, a, ldab, rwork )
467 ainvnm = zlange(
'1', n, n, ainv, lda, rwork )
468 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
471 rcondc = ( one / anorm ) / ainvnm
481 CALL zlarhs( path, xtype, uplo,
' ', n, n, kd,
482 $ kd, nrhs, a, ldab, xact, lda, b,
484 CALL zlacpy(
'Full', n, nrhs, b, lda, x, lda )
487 CALL zpbtrs( uplo, n, kd, nrhs, afac, ldab, x,
493 $
CALL alaerh( path,
'ZPBTRS', info, 0, uplo,
494 $ n, n, kd, kd, nrhs, imat, nfail,
497 CALL zlacpy(
'Full', n, nrhs, b, lda, work,
499 CALL zpbt02( uplo, n, kd, nrhs, a, ldab, x, lda,
500 $ work, lda, rwork, result( 2 ) )
505 CALL zget04( n, nrhs, x, lda, xact, lda, rcondc,
512 CALL zpbrfs( 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,
'ZPBRFS', info, 0, uplo,
521 $ n, n, kd, kd, nrhs, imat, nfail,
524 CALL zget04( n, nrhs, x, lda, xact, lda, rcondc,
526 CALL zpbt05( 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 zpbcon( uplo, n, kd, afac, ldab, anorm, rcond,
550 $ work, rwork, info )
555 $
CALL alaerh( path,
'ZPBCON', info, 0, uplo, n,
556 $ n, kd, kd, -1, imat, nfail, nerrs,
559 result( 7 ) = dget06( 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 xlaenv(ispec, nvalue)
XLAENV
subroutine zlarhs(path, xtype, uplo, trans, m, n, kl, ku, nrhs, a, lda, x, ldx, b, ldb, iseed, info)
ZLARHS
subroutine alaerh(path, subnam, info, infoe, opts, m, n, kl, ku, n5, imat, nfail, nerrs, nout)
ALAERH
subroutine alahd(iounit, path)
ALAHD
subroutine zcopy(n, zx, incx, zy, incy)
ZCOPY
subroutine zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.
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 zpbcon(uplo, n, kd, ab, ldab, anorm, rcond, work, rwork, info)
ZPBCON
subroutine zpbrfs(uplo, n, kd, nrhs, ab, ldab, afb, ldafb, b, ldb, x, ldx, ferr, berr, work, rwork, info)
ZPBRFS
subroutine zpbtrf(uplo, n, kd, ab, ldab, info)
ZPBTRF
subroutine zpbtrs(uplo, n, kd, nrhs, ab, ldab, b, ldb, info)
ZPBTRS
subroutine zswap(n, zx, incx, zy, incy)
ZSWAP
subroutine zchkpb(dotype, nn, nval, nnb, nbval, nns, nsval, thresh, tsterr, nmax, a, afac, ainv, b, x, xact, work, rwork, nout)
ZCHKPB
subroutine zerrpo(path, nunit)
ZERRPO
subroutine zget04(n, nrhs, x, ldx, xact, ldxact, rcond, resid)
ZGET04
subroutine zlaipd(n, a, inda, vinda)
ZLAIPD
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
subroutine zpbt01(uplo, n, kd, a, lda, afac, ldafac, rwork, resid)
ZPBT01
subroutine zpbt02(uplo, n, kd, nrhs, a, lda, x, ldx, b, ldb, rwork, resid)
ZPBT02
subroutine zpbt05(uplo, n, kd, nrhs, ab, ldab, b, ldb, x, ldx, xact, ldxact, ferr, berr, reslts)
ZPBT05