LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ ddrvgb()

subroutine ddrvgb ( logical, dimension( * )  dotype,
integer  nn,
integer, dimension( * )  nval,
integer  nrhs,
double precision  thresh,
logical  tsterr,
double precision, dimension( * )  a,
integer  la,
double precision, dimension( * )  afb,
integer  lafb,
double precision, dimension( * )  asav,
double precision, dimension( * )  b,
double precision, dimension( * )  bsav,
double precision, dimension( * )  x,
double precision, dimension( * )  xact,
double precision, dimension( * )  s,
double precision, dimension( * )  work,
double precision, dimension( * )  rwork,
integer, dimension( * )  iwork,
integer  nout 
)

DDRVGBX

Purpose:
 DDRVGB tests the driver routines DGBSV, -SVX, and -SVXX.

 Note that this file is used only when the XBLAS are available,
 otherwise ddrvgb.f defines this subroutine.
Parameters
[in]DOTYPE
          DOTYPE is LOGICAL array, dimension (NTYPES)
          The matrix types to be used for testing.  Matrices of type j
          (for 1 <= j <= NTYPES) are used for testing if DOTYPE(j) =
          .TRUE.; if DOTYPE(j) = .FALSE., then type j is not used.
[in]NN
          NN is INTEGER
          The number of values of N contained in the vector NVAL.
[in]NVAL
          NVAL is INTEGER array, dimension (NN)
          The values of the matrix column dimension N.
[in]NRHS
          NRHS is INTEGER
          The number of right hand side vectors to be generated for
          each linear system.
[in]THRESH
          THRESH is DOUBLE PRECISION
          The threshold value for the test ratios.  A result is
          included in the output file if RESULT >= THRESH.  To have
          every test ratio printed, use THRESH = 0.
[in]TSTERR
          TSTERR is LOGICAL
          Flag that indicates whether error exits are to be tested.
[out]A
          A is DOUBLE PRECISION array, dimension (LA)
[in]LA
          LA is INTEGER
          The length of the array A.  LA >= (2*NMAX-1)*NMAX
          where NMAX is the largest entry in NVAL.
[out]AFB
          AFB is DOUBLE PRECISION array, dimension (LAFB)
[in]LAFB
          LAFB is INTEGER
          The length of the array AFB.  LAFB >= (3*NMAX-2)*NMAX
          where NMAX is the largest entry in NVAL.
[out]ASAV
          ASAV is DOUBLE PRECISION array, dimension (LA)
[out]B
          B is DOUBLE PRECISION array, dimension (NMAX*NRHS)
[out]BSAV
          BSAV is DOUBLE PRECISION array, dimension (NMAX*NRHS)
[out]X
          X is DOUBLE PRECISION array, dimension (NMAX*NRHS)
[out]XACT
          XACT is DOUBLE PRECISION array, dimension (NMAX*NRHS)
[out]S
          S is DOUBLE PRECISION array, dimension (2*NMAX)
[out]WORK
          WORK is DOUBLE PRECISION array, dimension
                      (NMAX*max(3,NRHS,NMAX))
[out]RWORK
          RWORK is DOUBLE PRECISION array, dimension
                      (max(2*NMAX,NMAX+2*NRHS))
[out]IWORK
          IWORK is INTEGER array, dimension (2*NMAX)
[in]NOUT
          NOUT is INTEGER
          The unit number for output.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 172 of file ddrvgbx.f.

175*
176* -- LAPACK test routine --
177* -- LAPACK is a software package provided by Univ. of Tennessee, --
178* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
179*
180* .. Scalar Arguments ..
181 LOGICAL TSTERR
182 INTEGER LA, LAFB, NN, NOUT, NRHS
183 DOUBLE PRECISION THRESH
184* ..
185* .. Array Arguments ..
186 LOGICAL DOTYPE( * )
187 INTEGER IWORK( * ), NVAL( * )
188 DOUBLE PRECISION A( * ), AFB( * ), ASAV( * ), B( * ), BSAV( * ),
189 $ RWORK( * ), S( * ), WORK( * ), X( * ),
190 $ XACT( * )
191* ..
192*
193* =====================================================================
194*
195* .. Parameters ..
196 DOUBLE PRECISION ONE, ZERO
197 parameter( one = 1.0d+0, zero = 0.0d+0 )
198 INTEGER NTYPES
199 parameter( ntypes = 8 )
200 INTEGER NTESTS
201 parameter( ntests = 7 )
202 INTEGER NTRAN
203 parameter( ntran = 3 )
204* ..
205* .. Local Scalars ..
206 LOGICAL EQUIL, NOFACT, PREFAC, TRFCON, ZEROT
207 CHARACTER DIST, EQUED, FACT, TRANS, TYPE, XTYPE
208 CHARACTER*3 PATH
209 INTEGER I, I1, I2, IEQUED, IFACT, IKL, IKU, IMAT, IN,
210 $ INFO, IOFF, ITRAN, IZERO, J, K, K1, KL, KU,
211 $ LDA, LDAFB, LDB, MODE, N, NB, NBMIN, NERRS,
212 $ NFACT, NFAIL, NIMAT, NKL, NKU, NRUN, NT,
213 $ N_ERR_BNDS
214 DOUBLE PRECISION AINVNM, AMAX, ANORM, ANORMI, ANORMO, ANRMPV,
215 $ CNDNUM, COLCND, RCOND, RCONDC, RCONDI, RCONDO,
216 $ ROLDC, ROLDI, ROLDO, ROWCND, RPVGRW,
217 $ RPVGRW_SVXX
218* ..
219* .. Local Arrays ..
220 CHARACTER EQUEDS( 4 ), FACTS( 3 ), TRANSS( NTRAN )
221 INTEGER ISEED( 4 ), ISEEDY( 4 )
222 DOUBLE PRECISION RESULT( NTESTS ), BERR( NRHS ),
223 $ ERRBNDS_N( NRHS, 3 ), ERRBNDS_C( NRHS, 3 )
224* ..
225* .. External Functions ..
226 LOGICAL LSAME
227 DOUBLE PRECISION DGET06, DLAMCH, DLANGB, DLANGE, DLANTB,
228 $ DLA_GBRPVGRW
229 EXTERNAL lsame, dget06, dlamch, dlangb, dlange, dlantb,
231* ..
232* .. External Subroutines ..
233 EXTERNAL aladhd, alaerh, alasvm, derrvx, dgbequ, dgbsv,
237* ..
238* .. Intrinsic Functions ..
239 INTRINSIC abs, max, min
240* ..
241* .. Scalars in Common ..
242 LOGICAL LERR, OK
243 CHARACTER*32 SRNAMT
244 INTEGER INFOT, NUNIT
245* ..
246* .. Common blocks ..
247 COMMON / infoc / infot, nunit, ok, lerr
248 COMMON / srnamc / srnamt
249* ..
250* .. Data statements ..
251 DATA iseedy / 1988, 1989, 1990, 1991 /
252 DATA transs / 'N', 'T', 'C' /
253 DATA facts / 'F', 'N', 'E' /
254 DATA equeds / 'N', 'R', 'C', 'B' /
255* ..
256* .. Executable Statements ..
257*
258* Initialize constants and the random number seed.
259*
260 path( 1: 1 ) = 'Double precision'
261 path( 2: 3 ) = 'GB'
262 nrun = 0
263 nfail = 0
264 nerrs = 0
265 DO 10 i = 1, 4
266 iseed( i ) = iseedy( i )
267 10 CONTINUE
268*
269* Test the error exits
270*
271 IF( tsterr )
272 $ CALL derrvx( path, nout )
273 infot = 0
274*
275* Set the block size and minimum block size for testing.
276*
277 nb = 1
278 nbmin = 2
279 CALL xlaenv( 1, nb )
280 CALL xlaenv( 2, nbmin )
281*
282* Do for each value of N in NVAL
283*
284 DO 150 in = 1, nn
285 n = nval( in )
286 ldb = max( n, 1 )
287 xtype = 'N'
288*
289* Set limits on the number of loop iterations.
290*
291 nkl = max( 1, min( n, 4 ) )
292 IF( n.EQ.0 )
293 $ nkl = 1
294 nku = nkl
295 nimat = ntypes
296 IF( n.LE.0 )
297 $ nimat = 1
298*
299 DO 140 ikl = 1, nkl
300*
301* Do for KL = 0, N-1, (3N-1)/4, and (N+1)/4. This order makes
302* it easier to skip redundant values for small values of N.
303*
304 IF( ikl.EQ.1 ) THEN
305 kl = 0
306 ELSE IF( ikl.EQ.2 ) THEN
307 kl = max( n-1, 0 )
308 ELSE IF( ikl.EQ.3 ) THEN
309 kl = ( 3*n-1 ) / 4
310 ELSE IF( ikl.EQ.4 ) THEN
311 kl = ( n+1 ) / 4
312 END IF
313 DO 130 iku = 1, nku
314*
315* Do for KU = 0, N-1, (3N-1)/4, and (N+1)/4. This order
316* makes it easier to skip redundant values for small
317* values of N.
318*
319 IF( iku.EQ.1 ) THEN
320 ku = 0
321 ELSE IF( iku.EQ.2 ) THEN
322 ku = max( n-1, 0 )
323 ELSE IF( iku.EQ.3 ) THEN
324 ku = ( 3*n-1 ) / 4
325 ELSE IF( iku.EQ.4 ) THEN
326 ku = ( n+1 ) / 4
327 END IF
328*
329* Check that A and AFB are big enough to generate this
330* matrix.
331*
332 lda = kl + ku + 1
333 ldafb = 2*kl + ku + 1
334 IF( lda*n.GT.la .OR. ldafb*n.GT.lafb ) THEN
335 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
336 $ CALL aladhd( nout, path )
337 IF( lda*n.GT.la ) THEN
338 WRITE( nout, fmt = 9999 )la, n, kl, ku,
339 $ n*( kl+ku+1 )
340 nerrs = nerrs + 1
341 END IF
342 IF( ldafb*n.GT.lafb ) THEN
343 WRITE( nout, fmt = 9998 )lafb, n, kl, ku,
344 $ n*( 2*kl+ku+1 )
345 nerrs = nerrs + 1
346 END IF
347 GO TO 130
348 END IF
349*
350 DO 120 imat = 1, nimat
351*
352* Do the tests only if DOTYPE( IMAT ) is true.
353*
354 IF( .NOT.dotype( imat ) )
355 $ GO TO 120
356*
357* Skip types 2, 3, or 4 if the matrix is too small.
358*
359 zerot = imat.GE.2 .AND. imat.LE.4
360 IF( zerot .AND. n.LT.imat-1 )
361 $ GO TO 120
362*
363* Set up parameters with DLATB4 and generate a
364* test matrix with DLATMS.
365*
366 CALL dlatb4( path, imat, n, n, TYPE, KL, KU, ANORM,
367 $ MODE, CNDNUM, DIST )
368 rcondc = one / cndnum
369*
370 srnamt = 'DLATMS'
371 CALL dlatms( n, n, dist, iseed, TYPE, RWORK, MODE,
372 $ CNDNUM, ANORM, KL, KU, 'Z', A, LDA, WORK,
373 $ INFO )
374*
375* Check the error code from DLATMS.
376*
377 IF( info.NE.0 ) THEN
378 CALL alaerh( path, 'DLATMS', info, 0, ' ', n, n,
379 $ kl, ku, -1, imat, nfail, nerrs, nout )
380 GO TO 120
381 END IF
382*
383* For types 2, 3, and 4, zero one or more columns of
384* the matrix to test that INFO is returned correctly.
385*
386 izero = 0
387 IF( zerot ) THEN
388 IF( imat.EQ.2 ) THEN
389 izero = 1
390 ELSE IF( imat.EQ.3 ) THEN
391 izero = n
392 ELSE
393 izero = n / 2 + 1
394 END IF
395 ioff = ( izero-1 )*lda
396 IF( imat.LT.4 ) THEN
397 i1 = max( 1, ku+2-izero )
398 i2 = min( kl+ku+1, ku+1+( n-izero ) )
399 DO 20 i = i1, i2
400 a( ioff+i ) = zero
401 20 CONTINUE
402 ELSE
403 DO 40 j = izero, n
404 DO 30 i = max( 1, ku+2-j ),
405 $ min( kl+ku+1, ku+1+( n-j ) )
406 a( ioff+i ) = zero
407 30 CONTINUE
408 ioff = ioff + lda
409 40 CONTINUE
410 END IF
411 END IF
412*
413* Save a copy of the matrix A in ASAV.
414*
415 CALL dlacpy( 'Full', kl+ku+1, n, a, lda, asav, lda )
416*
417 DO 110 iequed = 1, 4
418 equed = equeds( iequed )
419 IF( iequed.EQ.1 ) THEN
420 nfact = 3
421 ELSE
422 nfact = 1
423 END IF
424*
425 DO 100 ifact = 1, nfact
426 fact = facts( ifact )
427 prefac = lsame( fact, 'F' )
428 nofact = lsame( fact, 'N' )
429 equil = lsame( fact, 'E' )
430*
431 IF( zerot ) THEN
432 IF( prefac )
433 $ GO TO 100
434 rcondo = zero
435 rcondi = zero
436*
437 ELSE IF( .NOT.nofact ) THEN
438*
439* Compute the condition number for comparison
440* with the value returned by DGESVX (FACT =
441* 'N' reuses the condition number from the
442* previous iteration with FACT = 'F').
443*
444 CALL dlacpy( 'Full', kl+ku+1, n, asav, lda,
445 $ afb( kl+1 ), ldafb )
446 IF( equil .OR. iequed.GT.1 ) THEN
447*
448* Compute row and column scale factors to
449* equilibrate the matrix A.
450*
451 CALL dgbequ( n, n, kl, ku, afb( kl+1 ),
452 $ ldafb, s, s( n+1 ), rowcnd,
453 $ colcnd, amax, info )
454 IF( info.EQ.0 .AND. n.GT.0 ) THEN
455 IF( lsame( equed, 'R' ) ) THEN
456 rowcnd = zero
457 colcnd = one
458 ELSE IF( lsame( equed, 'C' ) ) THEN
459 rowcnd = one
460 colcnd = zero
461 ELSE IF( lsame( equed, 'B' ) ) THEN
462 rowcnd = zero
463 colcnd = zero
464 END IF
465*
466* Equilibrate the matrix.
467*
468 CALL dlaqgb( n, n, kl, ku, afb( kl+1 ),
469 $ ldafb, s, s( n+1 ),
470 $ rowcnd, colcnd, amax,
471 $ equed )
472 END IF
473 END IF
474*
475* Save the condition number of the
476* non-equilibrated system for use in DGET04.
477*
478 IF( equil ) THEN
479 roldo = rcondo
480 roldi = rcondi
481 END IF
482*
483* Compute the 1-norm and infinity-norm of A.
484*
485 anormo = dlangb( '1', n, kl, ku, afb( kl+1 ),
486 $ ldafb, rwork )
487 anormi = dlangb( 'I', n, kl, ku, afb( kl+1 ),
488 $ ldafb, rwork )
489*
490* Factor the matrix A.
491*
492 CALL dgbtrf( n, n, kl, ku, afb, ldafb, iwork,
493 $ info )
494*
495* Form the inverse of A.
496*
497 CALL dlaset( 'Full', n, n, zero, one, work,
498 $ ldb )
499 srnamt = 'DGBTRS'
500 CALL dgbtrs( 'No transpose', n, kl, ku, n,
501 $ afb, ldafb, iwork, work, ldb,
502 $ info )
503*
504* Compute the 1-norm condition number of A.
505*
506 ainvnm = dlange( '1', n, n, work, ldb,
507 $ rwork )
508 IF( anormo.LE.zero .OR. ainvnm.LE.zero ) THEN
509 rcondo = one
510 ELSE
511 rcondo = ( one / anormo ) / ainvnm
512 END IF
513*
514* Compute the infinity-norm condition number
515* of A.
516*
517 ainvnm = dlange( 'I', n, n, work, ldb,
518 $ rwork )
519 IF( anormi.LE.zero .OR. ainvnm.LE.zero ) THEN
520 rcondi = one
521 ELSE
522 rcondi = ( one / anormi ) / ainvnm
523 END IF
524 END IF
525*
526 DO 90 itran = 1, ntran
527*
528* Do for each value of TRANS.
529*
530 trans = transs( itran )
531 IF( itran.EQ.1 ) THEN
532 rcondc = rcondo
533 ELSE
534 rcondc = rcondi
535 END IF
536*
537* Restore the matrix A.
538*
539 CALL dlacpy( 'Full', kl+ku+1, n, asav, lda,
540 $ a, lda )
541*
542* Form an exact solution and set the right hand
543* side.
544*
545 srnamt = 'DLARHS'
546 CALL dlarhs( path, xtype, 'Full', trans, n,
547 $ n, kl, ku, nrhs, a, lda, xact,
548 $ ldb, b, ldb, iseed, info )
549 xtype = 'C'
550 CALL dlacpy( 'Full', n, nrhs, b, ldb, bsav,
551 $ ldb )
552*
553 IF( nofact .AND. itran.EQ.1 ) THEN
554*
555* --- Test DGBSV ---
556*
557* Compute the LU factorization of the matrix
558* and solve the system.
559*
560 CALL dlacpy( 'Full', kl+ku+1, n, a, lda,
561 $ afb( kl+1 ), ldafb )
562 CALL dlacpy( 'Full', n, nrhs, b, ldb, x,
563 $ ldb )
564*
565 srnamt = 'DGBSV '
566 CALL dgbsv( n, kl, ku, nrhs, afb, ldafb,
567 $ iwork, x, ldb, info )
568*
569* Check error code from DGBSV .
570*
571 IF( info.NE.izero )
572 $ CALL alaerh( path, 'DGBSV ', info,
573 $ izero, ' ', n, n, kl, ku,
574 $ nrhs, imat, nfail, nerrs,
575 $ nout )
576*
577* Reconstruct matrix from factors and
578* compute residual.
579*
580 CALL dgbt01( n, n, kl, ku, a, lda, afb,
581 $ ldafb, iwork, work,
582 $ result( 1 ) )
583 nt = 1
584 IF( izero.EQ.0 ) THEN
585*
586* Compute residual of the computed
587* solution.
588*
589 CALL dlacpy( 'Full', n, nrhs, b, ldb,
590 $ work, ldb )
591 CALL dgbt02( 'No transpose', n, n, kl,
592 $ ku, nrhs, a, lda, x, ldb,
593 $ work, ldb, rwork,
594 $ result( 2 ) )
595*
596* Check solution from generated exact
597* solution.
598*
599 CALL dget04( n, nrhs, x, ldb, xact,
600 $ ldb, rcondc, result( 3 ) )
601 nt = 3
602 END IF
603*
604* Print information about the tests that did
605* not pass the threshold.
606*
607 DO 50 k = 1, nt
608 IF( result( k ).GE.thresh ) THEN
609 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
610 $ CALL aladhd( nout, path )
611 WRITE( nout, fmt = 9997 )'DGBSV ',
612 $ n, kl, ku, imat, k, result( k )
613 nfail = nfail + 1
614 END IF
615 50 CONTINUE
616 nrun = nrun + nt
617 END IF
618*
619* --- Test DGBSVX ---
620*
621 IF( .NOT.prefac )
622 $ CALL dlaset( 'Full', 2*kl+ku+1, n, zero,
623 $ zero, afb, ldafb )
624 CALL dlaset( 'Full', n, nrhs, zero, zero, x,
625 $ ldb )
626 IF( iequed.GT.1 .AND. n.GT.0 ) THEN
627*
628* Equilibrate the matrix if FACT = 'F' and
629* EQUED = 'R', 'C', or 'B'.
630*
631 CALL dlaqgb( n, n, kl, ku, a, lda, s,
632 $ s( n+1 ), rowcnd, colcnd,
633 $ amax, equed )
634 END IF
635*
636* Solve the system and compute the condition
637* number and error bounds using DGBSVX.
638*
639 srnamt = 'DGBSVX'
640 CALL dgbsvx( fact, trans, n, kl, ku, nrhs, a,
641 $ lda, afb, ldafb, iwork, equed,
642 $ s, s( n+1 ), b, ldb, x, ldb,
643 $ rcond, rwork, rwork( nrhs+1 ),
644 $ work, iwork( n+1 ), info )
645*
646* Check the error code from DGBSVX.
647*
648 IF( info.NE.izero )
649 $ CALL alaerh( path, 'DGBSVX', info, izero,
650 $ fact // trans, n, n, kl, ku,
651 $ nrhs, imat, nfail, nerrs,
652 $ nout )
653*
654* Compare WORK(1) from DGBSVX with the computed
655* reciprocal pivot growth factor RPVGRW
656*
657 IF( info.NE.0 ) THEN
658 anrmpv = zero
659 DO 70 j = 1, info
660 DO 60 i = max( ku+2-j, 1 ),
661 $ min( n+ku+1-j, kl+ku+1 )
662 anrmpv = max( anrmpv,
663 $ abs( a( i+( j-1 )*lda ) ) )
664 60 CONTINUE
665 70 CONTINUE
666 rpvgrw = dlantb( 'M', 'U', 'N', info,
667 $ min( info-1, kl+ku ),
668 $ afb( max( 1, kl+ku+2-info ) ),
669 $ ldafb, work )
670 IF( rpvgrw.EQ.zero ) THEN
671 rpvgrw = one
672 ELSE
673 rpvgrw = anrmpv / rpvgrw
674 END IF
675 ELSE
676 rpvgrw = dlantb( 'M', 'U', 'N', n, kl+ku,
677 $ afb, ldafb, work )
678 IF( rpvgrw.EQ.zero ) THEN
679 rpvgrw = one
680 ELSE
681 rpvgrw = dlangb( 'M', n, kl, ku, a,
682 $ lda, work ) / rpvgrw
683 END IF
684 END IF
685 result( 7 ) = abs( rpvgrw-work( 1 ) ) /
686 $ max( work( 1 ), rpvgrw ) /
687 $ dlamch( 'E' )
688*
689 IF( .NOT.prefac ) THEN
690*
691* Reconstruct matrix from factors and
692* compute residual.
693*
694 CALL dgbt01( n, n, kl, ku, a, lda, afb,
695 $ ldafb, iwork, work,
696 $ result( 1 ) )
697 k1 = 1
698 ELSE
699 k1 = 2
700 END IF
701*
702 IF( info.EQ.0 ) THEN
703 trfcon = .false.
704*
705* Compute residual of the computed solution.
706*
707 CALL dlacpy( 'Full', n, nrhs, bsav, ldb,
708 $ work, ldb )
709 CALL dgbt02( trans, n, n, kl, ku, nrhs,
710 $ asav, lda, x, ldb, work, ldb,
711 $ rwork( 2*nrhs+1 ),
712 $ result( 2 ) )
713*
714* Check solution from generated exact
715* solution.
716*
717 IF( nofact .OR. ( prefac .AND.
718 $ lsame( equed, 'N' ) ) ) THEN
719 CALL dget04( n, nrhs, x, ldb, xact,
720 $ ldb, rcondc, result( 3 ) )
721 ELSE
722 IF( itran.EQ.1 ) THEN
723 roldc = roldo
724 ELSE
725 roldc = roldi
726 END IF
727 CALL dget04( n, nrhs, x, ldb, xact,
728 $ ldb, roldc, result( 3 ) )
729 END IF
730*
731* Check the error bounds from iterative
732* refinement.
733*
734 CALL dgbt05( trans, n, kl, ku, nrhs, asav,
735 $ lda, b, ldb, x, ldb, xact,
736 $ ldb, rwork, rwork( nrhs+1 ),
737 $ result( 4 ) )
738 ELSE
739 trfcon = .true.
740 END IF
741*
742* Compare RCOND from DGBSVX with the computed
743* value in RCONDC.
744*
745 result( 6 ) = dget06( rcond, rcondc )
746*
747* Print information about the tests that did
748* not pass the threshold.
749*
750 IF( .NOT.trfcon ) THEN
751 DO 80 k = k1, ntests
752 IF( result( k ).GE.thresh ) THEN
753 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
754 $ CALL aladhd( nout, path )
755 IF( prefac ) THEN
756 WRITE( nout, fmt = 9995 )
757 $ 'DGBSVX', fact, trans, n, kl,
758 $ ku, equed, imat, k,
759 $ result( k )
760 ELSE
761 WRITE( nout, fmt = 9996 )
762 $ 'DGBSVX', fact, trans, n, kl,
763 $ ku, imat, k, result( k )
764 END IF
765 nfail = nfail + 1
766 END IF
767 80 CONTINUE
768 nrun = nrun + 7 - k1
769 ELSE
770 IF( result( 1 ).GE.thresh .AND. .NOT.
771 $ prefac ) THEN
772 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
773 $ CALL aladhd( nout, path )
774 IF( prefac ) THEN
775 WRITE( nout, fmt = 9995 )'DGBSVX',
776 $ fact, trans, n, kl, ku, equed,
777 $ imat, 1, result( 1 )
778 ELSE
779 WRITE( nout, fmt = 9996 )'DGBSVX',
780 $ fact, trans, n, kl, ku, imat, 1,
781 $ result( 1 )
782 END IF
783 nfail = nfail + 1
784 nrun = nrun + 1
785 END IF
786 IF( result( 6 ).GE.thresh ) THEN
787 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
788 $ CALL aladhd( nout, path )
789 IF( prefac ) THEN
790 WRITE( nout, fmt = 9995 )'DGBSVX',
791 $ fact, trans, n, kl, ku, equed,
792 $ imat, 6, result( 6 )
793 ELSE
794 WRITE( nout, fmt = 9996 )'DGBSVX',
795 $ fact, trans, n, kl, ku, imat, 6,
796 $ result( 6 )
797 END IF
798 nfail = nfail + 1
799 nrun = nrun + 1
800 END IF
801 IF( result( 7 ).GE.thresh ) THEN
802 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
803 $ CALL aladhd( nout, path )
804 IF( prefac ) THEN
805 WRITE( nout, fmt = 9995 )'DGBSVX',
806 $ fact, trans, n, kl, ku, equed,
807 $ imat, 7, result( 7 )
808 ELSE
809 WRITE( nout, fmt = 9996 )'DGBSVX',
810 $ fact, trans, n, kl, ku, imat, 7,
811 $ result( 7 )
812 END IF
813 nfail = nfail + 1
814 nrun = nrun + 1
815 END IF
816*
817 END IF
818*
819* --- Test DGBSVXX ---
820*
821* Restore the matrices A and B.
822*
823 CALL dlacpy( 'Full', kl+ku+1, n, asav, lda, a,
824 $ lda )
825 CALL dlacpy( 'Full', n, nrhs, bsav, ldb, b, ldb )
826
827 IF( .NOT.prefac )
828 $ CALL dlaset( 'Full', 2*kl+ku+1, n, zero, zero,
829 $ afb, ldafb )
830 CALL dlaset( 'Full', n, nrhs, zero, zero, x, ldb )
831 IF( iequed.GT.1 .AND. n.GT.0 ) THEN
832*
833* Equilibrate the matrix if FACT = 'F' and
834* EQUED = 'R', 'C', or 'B'.
835*
836 CALL dlaqgb( n, n, kl, ku, a, lda, s, s( n+1 ),
837 $ rowcnd, colcnd, amax, equed )
838 END IF
839*
840* Solve the system and compute the condition number
841* and error bounds using DGBSVXX.
842*
843 srnamt = 'DGBSVXX'
844 n_err_bnds = 3
845 CALL dgbsvxx( fact, trans, n, kl, ku, nrhs, a, lda,
846 $ afb, ldafb, iwork, equed, s, s( n+1 ), b, ldb,
847 $ x, ldb, rcond, rpvgrw_svxx, berr, n_err_bnds,
848 $ errbnds_n, errbnds_c, 0, zero, work,
849 $ iwork( n+1 ), info )
850*
851* Check the error code from DGBSVXX.
852*
853 IF( info.EQ.n+1 ) GOTO 90
854 IF( info.NE.izero ) THEN
855 CALL alaerh( path, 'DGBSVXX', info, izero,
856 $ fact // trans, n, n, -1, -1, nrhs,
857 $ imat, nfail, nerrs, nout )
858 GOTO 90
859 END IF
860*
861* Compare rpvgrw_svxx from DGBSVXX with the computed
862* reciprocal pivot growth factor RPVGRW
863*
864
865 IF ( info .GT. 0 .AND. info .LT. n+1 ) THEN
866 rpvgrw = dla_gbrpvgrw(n, kl, ku, info, a, lda,
867 $ afb, ldafb)
868 ELSE
869 rpvgrw = dla_gbrpvgrw(n, kl, ku, n, a, lda,
870 $ afb, ldafb)
871 ENDIF
872
873 result( 7 ) = abs( rpvgrw-rpvgrw_svxx ) /
874 $ max( rpvgrw_svxx, rpvgrw ) /
875 $ dlamch( 'E' )
876*
877 IF( .NOT.prefac ) THEN
878*
879* Reconstruct matrix from factors and compute
880* residual.
881*
882 CALL dgbt01( n, n, kl, ku, a, lda, afb, ldafb,
883 $ iwork, work, result( 1 ) )
884 k1 = 1
885 ELSE
886 k1 = 2
887 END IF
888*
889 IF( info.EQ.0 ) THEN
890 trfcon = .false.
891*
892* Compute residual of the computed solution.
893*
894 CALL dlacpy( 'Full', n, nrhs, bsav, ldb, work,
895 $ ldb )
896 CALL dgbt02( trans, n, n, kl, ku, nrhs, asav,
897 $ lda, x, ldb, work, ldb, rwork,
898 $ result( 2 ) )
899*
900* Check solution from generated exact solution.
901*
902 IF( nofact .OR. ( prefac .AND. lsame( equed,
903 $ 'N' ) ) ) THEN
904 CALL dget04( n, nrhs, x, ldb, xact, ldb,
905 $ rcondc, result( 3 ) )
906 ELSE
907 IF( itran.EQ.1 ) THEN
908 roldc = roldo
909 ELSE
910 roldc = roldi
911 END IF
912 CALL dget04( n, nrhs, x, ldb, xact, ldb,
913 $ roldc, result( 3 ) )
914 END IF
915 ELSE
916 trfcon = .true.
917 END IF
918*
919* Compare RCOND from DGBSVXX with the computed value
920* in RCONDC.
921*
922 result( 6 ) = dget06( rcond, rcondc )
923*
924* Print information about the tests that did not pass
925* the threshold.
926*
927 IF( .NOT.trfcon ) THEN
928 DO 45 k = k1, ntests
929 IF( result( k ).GE.thresh ) THEN
930 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
931 $ CALL aladhd( nout, path )
932 IF( prefac ) THEN
933 WRITE( nout, fmt = 9995 )'DGBSVXX',
934 $ fact, trans, n, kl, ku, equed,
935 $ imat, k, result( k )
936 ELSE
937 WRITE( nout, fmt = 9996 )'DGBSVXX',
938 $ fact, trans, n, kl, ku, imat, k,
939 $ result( k )
940 END IF
941 nfail = nfail + 1
942 END IF
943 45 CONTINUE
944 nrun = nrun + 7 - k1
945 ELSE
946 IF( result( 1 ).GE.thresh .AND. .NOT.prefac )
947 $ THEN
948 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
949 $ CALL aladhd( nout, path )
950 IF( prefac ) THEN
951 WRITE( nout, fmt = 9995 )'DGBSVXX', fact,
952 $ trans, n, kl, ku, equed, imat, 1,
953 $ result( 1 )
954 ELSE
955 WRITE( nout, fmt = 9996 )'DGBSVXX', fact,
956 $ trans, n, kl, ku, imat, 1,
957 $ result( 1 )
958 END IF
959 nfail = nfail + 1
960 nrun = nrun + 1
961 END IF
962 IF( result( 6 ).GE.thresh ) THEN
963 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
964 $ CALL aladhd( nout, path )
965 IF( prefac ) THEN
966 WRITE( nout, fmt = 9995 )'DGBSVXX', fact,
967 $ trans, n, kl, ku, equed, imat, 6,
968 $ result( 6 )
969 ELSE
970 WRITE( nout, fmt = 9996 )'DGBSVXX', fact,
971 $ trans, n, kl, ku, imat, 6,
972 $ result( 6 )
973 END IF
974 nfail = nfail + 1
975 nrun = nrun + 1
976 END IF
977 IF( result( 7 ).GE.thresh ) THEN
978 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
979 $ CALL aladhd( nout, path )
980 IF( prefac ) THEN
981 WRITE( nout, fmt = 9995 )'DGBSVXX', fact,
982 $ trans, n, kl, ku, equed, imat, 7,
983 $ result( 7 )
984 ELSE
985 WRITE( nout, fmt = 9996 )'DGBSVXX', fact,
986 $ trans, n, kl, ku, imat, 7,
987 $ result( 7 )
988 END IF
989 nfail = nfail + 1
990 nrun = nrun + 1
991 END IF
992*
993 END IF
994 90 CONTINUE
995 100 CONTINUE
996 110 CONTINUE
997 120 CONTINUE
998 130 CONTINUE
999 140 CONTINUE
1000 150 CONTINUE
1001*
1002* Print a summary of the results.
1003*
1004 CALL alasvm( path, nout, nfail, nrun, nerrs )
1005
1006* Test Error Bounds from DGBSVXX
1007
1008 CALL debchvxx(thresh, path)
1009
1010 9999 FORMAT( ' *** In DDRVGB, LA=', i5, ' is too small for N=', i5,
1011 $ ', KU=', i5, ', KL=', i5, / ' ==> Increase LA to at least ',
1012 $ i5 )
1013 9998 FORMAT( ' *** In DDRVGB, LAFB=', i5, ' is too small for N=', i5,
1014 $ ', KU=', i5, ', KL=', i5, /
1015 $ ' ==> Increase LAFB to at least ', i5 )
1016 9997 FORMAT( 1x, a, ', N=', i5, ', KL=', i5, ', KU=', i5, ', type ',
1017 $ i1, ', test(', i1, ')=', g12.5 )
1018 9996 FORMAT( 1x, a, '( ''', a1, ''',''', a1, ''',', i5, ',', i5, ',',
1019 $ i5, ',...), type ', i1, ', test(', i1, ')=', g12.5 )
1020 9995 FORMAT( 1x, a, '( ''', a1, ''',''', a1, ''',', i5, ',', i5, ',',
1021 $ i5, ',...), EQUED=''', a1, ''', type ', i1, ', test(', i1,
1022 $ ')=', g12.5 )
1023*
1024 RETURN
1025*
1026* End of DDRVGBX
1027*
subroutine alasvm(type, nout, nfail, nrun, nerrs)
ALASVM
Definition alasvm.f:73
subroutine dlarhs(path, xtype, uplo, trans, m, n, kl, ku, nrhs, a, lda, x, ldx, b, ldb, iseed, info)
DLARHS
Definition dlarhs.f:205
subroutine xlaenv(ispec, nvalue)
XLAENV
Definition xlaenv.f:81
subroutine aladhd(iounit, path)
ALADHD
Definition aladhd.f:90
subroutine alaerh(path, subnam, info, infoe, opts, m, n, kl, ku, n5, imat, nfail, nerrs, nout)
ALAERH
Definition alaerh.f:147
subroutine debchvxx(thresh, path)
DEBCHVXX
Definition debchvxx.f:96
subroutine derrvx(path, nunit)
DERRVX
Definition derrvx.f:55
subroutine dgbt01(m, n, kl, ku, a, lda, afac, ldafac, ipiv, work, resid)
DGBT01
Definition dgbt01.f:126
subroutine dgbt02(trans, m, n, kl, ku, nrhs, a, lda, x, ldx, b, ldb, rwork, resid)
DGBT02
Definition dgbt02.f:149
subroutine dgbt05(trans, n, kl, ku, nrhs, ab, ldab, b, ldb, x, ldx, xact, ldxact, ferr, berr, reslts)
DGBT05
Definition dgbt05.f:176
subroutine dget04(n, nrhs, x, ldx, xact, ldxact, rcond, resid)
DGET04
Definition dget04.f:102
double precision function dget06(rcond, rcondc)
DGET06
Definition dget06.f:55
subroutine dlatb4(path, imat, m, n, type, kl, ku, anorm, mode, cndnum, dist)
DLATB4
Definition dlatb4.f:120
subroutine dlatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
DLATMS
Definition dlatms.f:321
subroutine dgbequ(m, n, kl, ku, ab, ldab, r, c, rowcnd, colcnd, amax, info)
DGBEQU
Definition dgbequ.f:153
subroutine dgbequb(m, n, kl, ku, ab, ldab, r, c, rowcnd, colcnd, amax, info)
DGBEQUB
Definition dgbequb.f:160
subroutine dgbsv(n, kl, ku, nrhs, ab, ldab, ipiv, b, ldb, info)
DGBSV computes the solution to system of linear equations A * X = B for GB matrices (simple driver)
Definition dgbsv.f:162
subroutine dgbsvx(fact, trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, equed, r, c, b, ldb, x, ldx, rcond, ferr, berr, work, iwork, info)
DGBSVX computes the solution to system of linear equations A * X = B for GB matrices
Definition dgbsvx.f:369
subroutine dgbsvxx(fact, trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, equed, r, c, b, ldb, x, ldx, rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, iwork, info)
DGBSVXX computes the solution to system of linear equations A * X = B for GB matrices
Definition dgbsvxx.f:560
subroutine dgbtrf(m, n, kl, ku, ab, ldab, ipiv, info)
DGBTRF
Definition dgbtrf.f:144
subroutine dgbtrs(trans, n, kl, ku, nrhs, ab, ldab, ipiv, b, ldb, info)
DGBTRS
Definition dgbtrs.f:138
double precision function dla_gbrpvgrw(n, kl, ku, ncols, ab, ldab, afb, ldafb)
DLA_GBRPVGRW computes the reciprocal pivot growth factor norm(A)/norm(U) for a general banded matrix.
subroutine dlacpy(uplo, m, n, a, lda, b, ldb)
DLACPY copies all or part of one two-dimensional array to another.
Definition dlacpy.f:103
double precision function dlamch(cmach)
DLAMCH
Definition dlamch.f:69
double precision function dlangb(norm, n, kl, ku, ab, ldab, work)
DLANGB returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition dlangb.f:124
double precision function dlange(norm, m, n, a, lda, work)
DLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition dlange.f:114
double precision function dlantb(norm, uplo, diag, n, k, ab, ldab, work)
DLANTB returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
Definition dlantb.f:140
subroutine dlaqgb(m, n, kl, ku, ab, ldab, r, c, rowcnd, colcnd, amax, equed)
DLAQGB scales a general band matrix, using row and column scaling factors computed by sgbequ.
Definition dlaqgb.f:159
subroutine dlaset(uplo, m, n, alpha, beta, a, lda)
DLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
Definition dlaset.f:110
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
Here is the call graph for this function: