161 SUBROUTINE sdrvpb( DOTYPE, NN, NVAL, NRHS, THRESH, TSTERR, NMAX,
162 $ A, AFAC, ASAV, B, BSAV, X, XACT, S, WORK,
163 $ RWORK, IWORK, NOUT )
171 INTEGER NMAX, NN, NOUT, NRHS
176 INTEGER IWORK( * ), NVAL( * )
177 REAL A( * ), AFAC( * ), ASAV( * ), B( * ),
178 $ bsav( * ), rwork( * ), s( * ), work( * ),
186 PARAMETER ( ONE = 1.0e+0, zero = 0.0e+0 )
187 INTEGER NTYPES, NTESTS
188 parameter( ntypes = 8, ntests = 6 )
193 LOGICAL EQUIL, NOFACT, PREFAC, ZEROT
194 CHARACTER DIST, EQUED, FACT, PACKIT,
TYPE, UPLO, XTYPE
196 INTEGER I, I1, I2, IEQUED, IFACT, IKD, IMAT, IN, INFO,
197 $ ioff, iuplo, iw, izero, k, k1, kd, kl, koff,
198 $ ku, lda, ldab, mode, n, nb, nbmin, nerrs,
199 $ nfact, nfail, nimat, nkd, nrun, nt
200 REAL AINVNM, AMAX, ANORM, CNDNUM, RCOND, RCONDC,
204 CHARACTER EQUEDS( 2 ), FACTS( 3 )
205 INTEGER ISEED( 4 ), ISEEDY( 4 ), KDVAL( NBW )
206 REAL RESULT( NTESTS )
210 REAL SGET06, SLANGE, SLANSB
211 EXTERNAL lsame, sget06, slange, slansb
228 COMMON / infoc / infot, nunit, ok, lerr
229 COMMON / srnamc / srnamt
232 DATA iseedy / 1988, 1989, 1990, 1991 /
233 DATA facts /
'F',
'N',
'E' /
234 DATA equeds /
'N',
'Y' /
240 path( 1: 1 ) =
'Single precision'
246 iseed( i ) = iseedy( i )
252 $
CALL serrvx( path, nout )
272 nkd = max( 1, min( n, 4 ) )
277 kdval( 2 ) = n + ( n+1 ) / 4
278 kdval( 3 ) = ( 3*n-1 ) / 4
279 kdval( 4 ) = ( n+1 ) / 4
294 IF( iuplo.EQ.1 )
THEN
297 koff = max( 1, kd+2-n )
303 DO 80 imat = 1, nimat
307 IF( .NOT.dotype( imat ) )
312 zerot = imat.GE.2 .AND. imat.LE.4
313 IF( zerot .AND. n.LT.imat-1 )
316 IF( .NOT.zerot .OR. .NOT.dotype( 1 ) )
THEN
321 CALL slatb4( path, imat, n, n,
TYPE, kl, ku, anorm,
322 $ mode, cndnum, dist )
325 CALL slatms( n, n, dist, iseed,
TYPE, rwork, mode,
326 $ cndnum, anorm, kd, kd, packit,
327 $ a( koff ), ldab, work, info )
332 CALL alaerh( path,
'SLATMS', info, 0, uplo, n,
333 $ n, -1, -1, -1, imat, nfail, nerrs,
337 ELSE IF( izero.GT.0 )
THEN
343 IF( iuplo.EQ.1 )
THEN
344 ioff = ( izero-1 )*ldab + kd + 1
345 CALL scopy( izero-i1, work( iw ), 1,
346 $ a( ioff-izero+i1 ), 1 )
348 CALL scopy( i2-izero+1, work( iw ), 1,
349 $ a( ioff ), max( ldab-1, 1 ) )
351 ioff = ( i1-1 )*ldab + 1
352 CALL scopy( izero-i1, work( iw ), 1,
353 $ a( ioff+izero-i1 ),
355 ioff = ( izero-1 )*ldab + 1
357 CALL scopy( i2-izero+1, work( iw ), 1,
369 ELSE IF( imat.EQ.3 )
THEN
378 DO 20 i = 1, min( 2*kd+1, n )
382 i1 = max( izero-kd, 1 )
383 i2 = min( izero+kd, n )
385 IF( iuplo.EQ.1 )
THEN
386 ioff = ( izero-1 )*ldab + kd + 1
387 CALL sswap( izero-i1, a( ioff-izero+i1 ), 1,
390 CALL sswap( i2-izero+1, a( ioff ),
391 $ max( ldab-1, 1 ), work( iw ), 1 )
393 ioff = ( i1-1 )*ldab + 1
394 CALL sswap( izero-i1, a( ioff+izero-i1 ),
395 $ max( ldab-1, 1 ), work( iw ), 1 )
396 ioff = ( izero-1 )*ldab + 1
398 CALL sswap( i2-izero+1, a( ioff ), 1,
405 CALL slacpy(
'Full', kd+1, n, a, ldab, asav, ldab )
408 equed = equeds( iequed )
409 IF( iequed.EQ.1 )
THEN
415 DO 60 ifact = 1, nfact
416 fact = facts( ifact )
417 prefac = lsame( fact,
'F' )
418 nofact = lsame( fact,
'N' )
419 equil = lsame( fact,
'E' )
426 ELSE IF( .NOT.lsame( fact,
'N' ) )
THEN
433 CALL slacpy(
'Full', kd+1, n, asav, ldab,
435 IF( equil .OR. iequed.GT.1 )
THEN
440 CALL spbequ( uplo, n, kd, afac, ldab, s,
441 $ scond, amax, info )
442 IF( info.EQ.0 .AND. n.GT.0 )
THEN
448 CALL slaqsb( uplo, n, kd, afac, ldab,
449 $ s, scond, amax, equed )
461 anorm = slansb(
'1', uplo, n, kd, afac, ldab,
466 CALL spbtrf( uplo, n, kd, afac, ldab, info )
470 CALL slaset(
'Full', n, n, zero, one, a,
473 CALL spbtrs( uplo, n, kd, n, afac, ldab, a,
478 ainvnm = slange(
'1', n, n, a, lda, rwork )
479 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
482 rcondc = ( one / anorm ) / ainvnm
488 CALL slacpy(
'Full', kd+1, n, asav, ldab, a,
495 CALL slarhs( path, xtype, uplo,
' ', n, n, kd,
496 $ kd, nrhs, a, ldab, xact, lda, b,
499 CALL slacpy(
'Full', n, nrhs, b, lda, bsav,
509 CALL slacpy(
'Full', kd+1, n, a, ldab, afac,
511 CALL slacpy(
'Full', n, nrhs, b, lda, x,
515 CALL spbsv( uplo, n, kd, nrhs, afac, ldab, x,
520 IF( info.NE.izero )
THEN
521 CALL alaerh( path,
'SPBSV ', info, izero,
522 $ uplo, n, n, kd, kd, nrhs,
523 $ imat, nfail, nerrs, nout )
525 ELSE IF( info.NE.0 )
THEN
532 CALL spbt01( uplo, n, kd, a, ldab, afac,
533 $ ldab, rwork, result( 1 ) )
537 CALL slacpy(
'Full', n, nrhs, b, lda, work,
539 CALL spbt02( uplo, n, kd, nrhs, a, ldab, x,
540 $ lda, work, lda, rwork,
545 CALL sget04( n, nrhs, x, lda, xact, lda,
546 $ rcondc, result( 3 ) )
553 IF( result( k ).GE.thresh )
THEN
554 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
555 $
CALL aladhd( nout, path )
556 WRITE( nout, fmt = 9999 )
'SPBSV ',
557 $ uplo, n, kd, imat, k, result( k )
568 $
CALL slaset(
'Full', kd+1, n, zero, zero,
570 CALL slaset(
'Full', n, nrhs, zero, zero, x,
572 IF( iequed.GT.1 .AND. n.GT.0 )
THEN
577 CALL slaqsb( uplo, n, kd, a, ldab, s, scond,
585 CALL spbsvx( fact, uplo, n, kd, nrhs, a, ldab,
586 $ afac, ldab, equed, s, b, lda, x,
587 $ lda, rcond, rwork, rwork( nrhs+1 ),
588 $ work, iwork, info )
592 IF( info.NE.izero )
THEN
593 CALL alaerh( path,
'SPBSVX', info, izero,
594 $ fact // uplo, n, n, kd, kd,
595 $ nrhs, imat, nfail, nerrs, nout )
600 IF( .NOT.prefac )
THEN
605 CALL spbt01( uplo, n, kd, a, ldab, afac,
606 $ ldab, rwork( 2*nrhs+1 ),
615 CALL slacpy(
'Full', n, nrhs, bsav, lda,
617 CALL spbt02( uplo, n, kd, nrhs, asav, ldab,
619 $ rwork( 2*nrhs+1 ), result( 2 ) )
623 IF( nofact .OR. ( prefac .AND. lsame( equed,
625 CALL sget04( n, nrhs, x, lda, xact, lda,
626 $ rcondc, result( 3 ) )
628 CALL sget04( n, nrhs, x, lda, xact, lda,
629 $ roldc, result( 3 ) )
635 CALL spbt05( uplo, n, kd, nrhs, asav, ldab,
636 $ b, lda, x, lda, xact, lda,
637 $ rwork, rwork( nrhs+1 ),
646 result( 6 ) = sget06( rcond, rcondc )
652 IF( result( k ).GE.thresh )
THEN
653 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
654 $
CALL aladhd( nout, path )
656 WRITE( nout, fmt = 9997 )
'SPBSVX',
657 $ fact, uplo, n, kd, equed, imat, k,
660 WRITE( nout, fmt = 9998 )
'SPBSVX',
661 $ fact, uplo, n, kd, imat, k,
677 CALL alasvm( path, nout, nfail, nrun, nerrs )
679 9999
FORMAT( 1x, a,
', UPLO=''', a1,
''', N =', i5,
', KD =', i5,
680 $
', type ', i1,
', test(', i1,
')=', g12.5 )
681 9998
FORMAT( 1x, a,
'( ''', a1,
''', ''', a1,
''', ', i5,
', ', i5,
682 $
', ... ), type ', i1,
', test(', i1,
')=', g12.5 )
683 9997
FORMAT( 1x, a,
'( ''', a1,
''', ''', a1,
''', ', i5,
', ', i5,
684 $
', ... ), EQUED=''', a1,
''', type ', i1,
', test(', i1,