149 SUBROUTINE cchktb( DOTYPE, NN, NVAL, NNS, NSVAL, THRESH, TSTERR,
150 $ nmax, ab, ainv, b, x, xact, work, rwork, nout )
159 INTEGER NMAX, NN, NNS, NOUT
164 INTEGER NSVAL( * ), NVAL( * )
166 COMPLEX AB( * ), AINV( * ), B( * ), WORK( * ), X( * ),
173 INTEGER NTYPE1, NTYPES
174 parameter ( ntype1 = 9, ntypes = 17 )
176 parameter ( ntests = 8 )
178 parameter ( ntran = 3 )
180 parameter ( one = 1.0e+0, zero = 0.0e+0 )
183 CHARACTER DIAG, NORM, TRANS, UPLO, XTYPE
185 INTEGER I, IDIAG, IK, IMAT, IN, INFO, IRHS, ITRAN,
186 $ iuplo, j, k, kd, lda, ldab, n, nerrs, nfail,
187 $ nimat, nimat2, nk, nrhs, nrun
188 REAL AINVNM, ANORM, RCOND, RCONDC, RCONDI, RCONDO,
192 CHARACTER TRANSS( ntran ), UPLOS( 2 )
193 INTEGER ISEED( 4 ), ISEEDY( 4 )
194 REAL RESULT( ntests )
199 EXTERNAL lsame, clantb, clantr
210 INTEGER INFOT, IOUNIT
213 COMMON / infoc / infot, iounit, ok, lerr
214 COMMON / srnamc / srnamt
217 INTRINSIC cmplx, max, min
220 DATA iseedy / 1988, 1989, 1990, 1991 /
221 DATA uplos /
'U',
'L' / , transs /
'N',
'T',
'C' /
227 path( 1: 1 ) =
'Complex precision'
233 iseed( i ) = iseedy( i )
239 $
CALL cerrtr( path, nout )
264 ELSE IF( ik.EQ.2 )
THEN
266 ELSE IF( ik.EQ.3 )
THEN
268 ELSE IF( ik.EQ.4 )
THEN
273 DO 90 imat = 1, nimat
277 IF( .NOT.dotype( imat ) )
284 uplo = uplos( iuplo )
289 CALL clattb( imat, uplo,
'No transpose', diag, iseed,
290 $ n, kd, ab, ldab, x, work, rwork, info )
294 IF( lsame( diag,
'N' ) )
THEN
303 CALL claset(
'Full', n, n, cmplx( zero ),
304 $ cmplx( one ), ainv, lda )
305 IF( lsame( uplo,
'U' ) )
THEN
307 CALL ctbsv( uplo,
'No transpose', diag, j, kd,
308 $ ab, ldab, ainv( ( j-1 )*lda+1 ), 1 )
312 CALL ctbsv( uplo,
'No transpose', diag, n-j+1,
313 $ kd, ab( ( j-1 )*ldab+1 ), ldab,
314 $ ainv( ( j-1 )*lda+j ), 1 )
320 anorm = clantb(
'1', uplo, diag, n, kd, ab, ldab,
322 ainvnm = clantr(
'1', uplo, diag, n, n, ainv, lda,
324 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
327 rcondo = ( one / anorm ) / ainvnm
332 anorm = clantb(
'I', uplo, diag, n, kd, ab, ldab,
334 ainvnm = clantr(
'I', uplo, diag, n, n, ainv, lda,
336 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
339 rcondi = ( one / anorm ) / ainvnm
346 DO 50 itran = 1, ntran
350 trans = transs( itran )
351 IF( itran.EQ.1 )
THEN
363 CALL clarhs( path, xtype, uplo, trans, n, n, kd,
364 $ idiag, nrhs, ab, ldab, xact, lda,
365 $ b, lda, iseed, info )
367 CALL clacpy(
'Full', n, nrhs, b, lda, x, lda )
370 CALL ctbtrs( uplo, trans, diag, n, kd, nrhs, ab,
371 $ ldab, x, lda, info )
376 $
CALL alaerh( path,
'CTBTRS', info, 0,
377 $ uplo // trans // diag, n, n, kd,
378 $ kd, nrhs, imat, nfail, nerrs,
381 CALL ctbt02( uplo, trans, diag, n, kd, nrhs, ab,
382 $ ldab, x, lda, b, lda, work, rwork,
388 CALL cget04( n, nrhs, x, lda, xact, lda, rcondc,
396 CALL ctbrfs( uplo, trans, diag, n, kd, nrhs, ab,
397 $ ldab, b, lda, x, lda, rwork,
398 $ rwork( nrhs+1 ), work,
399 $ rwork( 2*nrhs+1 ), info )
404 $
CALL alaerh( path,
'CTBRFS', info, 0,
405 $ uplo // trans // diag, n, n, kd,
406 $ kd, nrhs, imat, nfail, nerrs,
409 CALL cget04( n, nrhs, x, lda, xact, lda, rcondc,
411 CALL ctbt05( uplo, trans, diag, n, kd, nrhs, ab,
412 $ ldab, b, lda, x, lda, xact, lda,
413 $ rwork, rwork( nrhs+1 ),
420 IF( result( k ).GE.thresh )
THEN
421 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
422 $
CALL alahd( nout, path )
423 WRITE( nout, fmt = 9999 )uplo, trans,
424 $ diag, n, kd, nrhs, imat, k, result( k )
436 IF( itran.EQ.1 )
THEN
444 CALL ctbcon( norm, uplo, diag, n, kd, ab, ldab,
445 $ rcond, work, rwork, info )
450 $
CALL alaerh( path,
'CTBCON', info, 0,
451 $ norm // uplo // diag, n, n, kd, kd,
452 $ -1, imat, nfail, nerrs, nout )
454 CALL ctbt06( rcond, rcondc, uplo, diag, n, kd, ab,
455 $ ldab, rwork, result( 6 ) )
459 IF( result( 6 ).GE.thresh )
THEN
460 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
461 $
CALL alahd( nout, path )
462 WRITE( nout, fmt = 9998 )
'CTBCON', norm, uplo,
463 $ diag, n, kd, imat, 6, result( 6 )
473 DO 120 imat = ntype1 + 1, nimat2
477 IF( .NOT.dotype( imat ) )
484 uplo = uplos( iuplo )
485 DO 100 itran = 1, ntran
489 trans = transs( itran )
494 CALL clattb( imat, uplo, trans, diag, iseed, n, kd,
495 $ ab, ldab, x, work, rwork, info )
501 CALL ccopy( n, x, 1, b, 1 )
502 CALL clatbs( uplo, trans, diag,
'N', n, kd, ab,
503 $ ldab, b, scale, rwork, info )
508 $
CALL alaerh( path,
'CLATBS', info, 0,
509 $ uplo // trans // diag //
'N', n, n,
510 $ kd, kd, -1, imat, nfail, nerrs,
513 CALL ctbt03( uplo, trans, diag, n, kd, 1, ab, ldab,
514 $ scale, rwork, one, b, lda, x, lda,
515 $ work, result( 7 ) )
520 CALL ccopy( n, x, 1, b, 1 )
521 CALL clatbs( uplo, trans, diag,
'Y', n, kd, ab,
522 $ ldab, b, scale, rwork, info )
527 $
CALL alaerh( path,
'CLATBS', info, 0,
528 $ uplo // trans // diag //
'Y', n, n,
529 $ kd, kd, -1, imat, nfail, nerrs,
532 CALL ctbt03( uplo, trans, diag, n, kd, 1, ab, ldab,
533 $ scale, rwork, one, b, lda, x, lda,
534 $ work, result( 8 ) )
539 IF( result( 7 ).GE.thresh )
THEN
540 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
541 $
CALL alahd( nout, path )
542 WRITE( nout, fmt = 9997 )
'CLATBS', uplo, trans,
543 $ diag,
'N', n, kd, imat, 7, result( 7 )
546 IF( result( 8 ).GE.thresh )
THEN
547 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
548 $
CALL alahd( nout, path )
549 WRITE( nout, fmt = 9997 )
'CLATBS', uplo, trans,
550 $ diag,
'Y', n, kd, imat, 8, result( 8 )
562 CALL alasum( path, nout, nfail, nrun, nerrs )
564 9999
FORMAT(
' UPLO=''', a1,
''', TRANS=''', a1,
''',
565 $ DIAG=''', a1,
''', N=', i5,
', KD=', i5,
', NRHS=', i5,
566 $
', type ', i2,
', test(', i2,
')=', g12.5 )
567 9998
FORMAT( 1x, a,
'( ''', a1,
''', ''', a1,
''', ''', a1,
''',',
568 $ i5,
',', i5,
', ... ), type ', i2,
', test(', i2,
')=',
570 9997
FORMAT( 1x, a,
'( ''', a1,
''', ''', a1,
''', ''', a1,
''', ''',
571 $ a1,
''',', i5,
',', i5,
', ... ), type ', i2,
', test(',
subroutine alahd(IOUNIT, PATH)
ALAHD
subroutine alaerh(PATH, SUBNAM, INFO, INFOE, OPTS, M, N, KL, KU, N5, IMAT, NFAIL, NERRS, NOUT)
ALAERH
subroutine clarhs(PATH, XTYPE, UPLO, TRANS, M, N, KL, KU, NRHS, A, LDA, X, LDX, B, LDB, ISEED, INFO)
CLARHS
subroutine ctbtrs(UPLO, TRANS, DIAG, N, KD, NRHS, AB, LDAB, B, LDB, INFO)
CTBTRS
subroutine cerrtr(PATH, NUNIT)
CERRTR
subroutine clatbs(UPLO, TRANS, DIAG, NORMIN, N, KD, AB, LDAB, X, SCALE, CNORM, INFO)
CLATBS solves a triangular banded system of equations.
subroutine ctbcon(NORM, UPLO, DIAG, N, KD, AB, LDAB, RCOND, WORK, RWORK, INFO)
CTBCON
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 ctbt03(UPLO, TRANS, DIAG, N, KD, NRHS, AB, LDAB, SCALE, CNORM, TSCAL, X, LDX, B, LDB, WORK, RESID)
CTBT03
subroutine clattb(IMAT, UPLO, TRANS, DIAG, ISEED, N, KD, AB, LDAB, B, WORK, RWORK, INFO)
CLATTB
subroutine cchktb(DOTYPE, NN, NVAL, NNS, NSVAL, THRESH, TSTERR, NMAX, AB, AINV, B, X, XACT, WORK, RWORK, NOUT)
CCHKTB
subroutine ctbt02(UPLO, TRANS, DIAG, N, KD, NRHS, AB, LDAB, X, LDX, B, LDB, WORK, RWORK, RESID)
CTBT02
subroutine clacpy(UPLO, M, N, A, LDA, B, LDB)
CLACPY copies all or part of one two-dimensional array to another.
subroutine ccopy(N, CX, INCX, CY, INCY)
CCOPY
subroutine ctbt05(UPLO, TRANS, DIAG, N, KD, NRHS, AB, LDAB, B, LDB, X, LDX, XACT, LDXACT, FERR, BERR, RESLTS)
CTBT05
subroutine ctbrfs(UPLO, TRANS, DIAG, N, KD, NRHS, AB, LDAB, B, LDB, X, LDX, FERR, BERR, WORK, RWORK, INFO)
CTBRFS
subroutine ctbsv(UPLO, TRANS, DIAG, N, K, A, LDA, X, INCX)
CTBSV
subroutine cget04(N, NRHS, X, LDX, XACT, LDXACT, RCOND, RESID)
CGET04
subroutine alasum(TYPE, NOUT, NFAIL, NRUN, NERRS)
ALASUM
subroutine ctbt06(RCOND, RCONDC, UPLO, DIAG, N, KD, AB, LDAB, RWORK, RAT)
CTBT06