169 SUBROUTINE schkpb( DOTYPE, NN, NVAL, NNB, NBVAL, NNS, NSVAL,
170 $ THRESH, TSTERR, NMAX, A, AFAC, AINV, B, X,
171 $ XACT, WORK, RWORK, IWORK, NOUT )
179 INTEGER NMAX, NN, NNB, NNS, NOUT
184 INTEGER IWORK( * ), NBVAL( * ), NSVAL( * ), NVAL( * )
185 REAL A( * ), AFAC( * ), AINV( * ), B( * ),
186 $ rwork( * ), work( * ), x( * ), xact( * )
193 PARAMETER ( ONE = 1.0e+0, zero = 0.0e+0 )
194 INTEGER NTYPES, NTESTS
195 parameter( ntypes = 8, ntests = 7 )
201 CHARACTER DIST, PACKIT,
TYPE, UPLO, XTYPE
203 INTEGER I, I1, I2, IKD, IMAT, IN, INB, INFO, IOFF,
204 $ irhs, iuplo, iw, izero, k, kd, kl, koff, ku,
205 $ lda, ldab, mode, n, nb, nerrs, nfail, nimat,
207 REAL AINVNM, ANORM, CNDNUM, RCOND, RCONDC
210 INTEGER ISEED( 4 ), ISEEDY( 4 ), KDVAL( NBW )
211 REAL RESULT( NTESTS )
214 REAL SGET06, SLANGE, SLANSB
215 EXTERNAL SGET06, SLANGE, SLANSB
232 COMMON / infoc / infot, nunit, ok, lerr
233 COMMON / srnamc / srnamt
236 DATA iseedy / 1988, 1989, 1990, 1991 /
242 path( 1: 1 ) =
'Single precision'
248 iseed( i ) = iseedy( i )
254 $
CALL serrpo( path, nout )
268 nkd = max( 1, min( n, 4 ) )
273 kdval( 2 ) = n + ( n+1 ) / 4
274 kdval( 3 ) = ( 3*n-1 ) / 4
275 kdval( 4 ) = ( n+1 ) / 4
290 IF( iuplo.EQ.1 )
THEN
292 koff = max( 1, kd+2-n )
299 DO 60 imat = 1, nimat
303 IF( .NOT.dotype( imat ) )
308 zerot = imat.GE.2 .AND. imat.LE.4
309 IF( zerot .AND. n.LT.imat-1 )
312 IF( .NOT.zerot .OR. .NOT.dotype( 1 ) )
THEN
317 CALL slatb4( path, imat, n, n,
TYPE, kl, ku, anorm,
318 $ mode, cndnum, dist )
321 CALL slatms( n, n, dist, iseed,
TYPE, rwork, mode,
322 $ cndnum, anorm, kd, kd, packit,
323 $ a( koff ), ldab, work, info )
328 CALL alaerh( path,
'SLATMS', info, 0, uplo, n,
329 $ n, kd, kd, -1, imat, nfail, nerrs,
333 ELSE IF( izero.GT.0 )
THEN
339 IF( iuplo.EQ.1 )
THEN
340 ioff = ( izero-1 )*ldab + kd + 1
341 CALL scopy( izero-i1, work( iw ), 1,
342 $ a( ioff-izero+i1 ), 1 )
344 CALL scopy( i2-izero+1, work( iw ), 1,
345 $ a( ioff ), max( ldab-1, 1 ) )
347 ioff = ( i1-1 )*ldab + 1
348 CALL scopy( izero-i1, work( iw ), 1,
349 $ a( ioff+izero-i1 ),
351 ioff = ( izero-1 )*ldab + 1
353 CALL scopy( i2-izero+1, work( iw ), 1,
365 ELSE IF( imat.EQ.3 )
THEN
374 DO 20 i = 1, min( 2*kd+1, n )
378 i1 = max( izero-kd, 1 )
379 i2 = min( izero+kd, n )
381 IF( iuplo.EQ.1 )
THEN
382 ioff = ( izero-1 )*ldab + kd + 1
383 CALL sswap( izero-i1, a( ioff-izero+i1 ), 1,
386 CALL sswap( i2-izero+1, a( ioff ),
387 $ max( ldab-1, 1 ), work( iw ), 1 )
389 ioff = ( i1-1 )*ldab + 1
390 CALL sswap( izero-i1, a( ioff+izero-i1 ),
391 $ max( ldab-1, 1 ), work( iw ), 1 )
392 ioff = ( izero-1 )*ldab + 1
394 CALL sswap( i2-izero+1, a( ioff ), 1,
408 CALL slacpy(
'Full', kd+1, n, a, ldab, afac, ldab )
410 CALL spbtrf( uplo, n, kd, afac, ldab, info )
414 IF( info.NE.izero )
THEN
415 CALL alaerh( path,
'SPBTRF', info, izero, uplo,
416 $ n, n, kd, kd, nb, imat, nfail,
430 CALL slacpy(
'Full', kd+1, n, afac, ldab, ainv,
432 CALL spbt01( uplo, n, kd, a, ldab, ainv, ldab,
433 $ rwork, result( 1 ) )
437 IF( result( 1 ).GE.thresh )
THEN
438 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
439 $
CALL alahd( nout, path )
440 WRITE( nout, fmt = 9999 )uplo, n, kd, nb, imat,
454 CALL slaset(
'Full', n, n, zero, one, ainv, lda )
456 CALL spbtrs( uplo, n, kd, n, afac, ldab, ainv, lda,
461 anorm = slansb(
'1', uplo, n, kd, a, ldab, rwork )
462 ainvnm = slange(
'1', n, n, ainv, lda, rwork )
463 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
466 rcondc = ( one / anorm ) / ainvnm
476 CALL slarhs( path, xtype, uplo,
' ', n, n, kd,
477 $ kd, nrhs, a, ldab, xact, lda, b,
479 CALL slacpy(
'Full', n, nrhs, b, lda, x, lda )
482 CALL spbtrs( uplo, n, kd, nrhs, afac, ldab, x,
488 $
CALL alaerh( path,
'SPBTRS', info, 0, uplo,
489 $ n, n, kd, kd, nrhs, imat, nfail,
492 CALL slacpy(
'Full', n, nrhs, b, lda, work,
494 CALL spbt02( uplo, n, kd, nrhs, a, ldab, x, lda,
495 $ work, lda, rwork, result( 2 ) )
500 CALL sget04( n, nrhs, x, lda, xact, lda, rcondc,
507 CALL spbrfs( uplo, n, kd, nrhs, a, ldab, afac,
508 $ ldab, b, lda, x, lda, rwork,
509 $ rwork( nrhs+1 ), work, iwork,
515 $
CALL alaerh( path,
'SPBRFS', info, 0, uplo,
516 $ n, n, kd, kd, nrhs, imat, nfail,
519 CALL sget04( n, nrhs, x, lda, xact, lda, rcondc,
521 CALL spbt05( uplo, n, kd, nrhs, a, ldab, b, lda,
522 $ x, lda, xact, lda, rwork,
523 $ rwork( nrhs+1 ), result( 5 ) )
529 IF( result( k ).GE.thresh )
THEN
530 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
531 $
CALL alahd( nout, path )
532 WRITE( nout, fmt = 9998 )uplo, n, kd,
533 $ nrhs, imat, k, result( k )
544 CALL spbcon( uplo, n, kd, afac, ldab, anorm, rcond,
545 $ work, iwork, info )
550 $
CALL alaerh( path,
'SPBCON', info, 0, uplo, n,
551 $ n, kd, kd, -1, imat, nfail, nerrs,
554 result( 7 ) = sget06( rcond, rcondc )
558 IF( result( 7 ).GE.thresh )
THEN
559 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
560 $
CALL alahd( nout, path )
561 WRITE( nout, fmt = 9997 )uplo, n, kd, imat, 7,
574 CALL alasum( path, nout, nfail, nrun, nerrs )
576 9999
FORMAT(
' UPLO=''', a1,
''', N=', i5,
', KD=', i5,
', NB=', i4,
577 $
', type ', i2,
', test ', i2,
', ratio= ', g12.5 )
578 9998
FORMAT(
' UPLO=''', a1,
''', N=', i5,
', KD=', i5,
', NRHS=', i3,
579 $
', type ', i2,
', test(', i2,
') = ', g12.5 )
580 9997
FORMAT(
' UPLO=''', a1,
''', N=', i5,
', KD=', i5,
',', 10x,
581 $
' type ', i2,
', test(', i2,
') = ', g12.5 )