352 SUBROUTINE sdrvsg( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH,
353 $ NOUNIT, A, LDA, B, LDB, D, Z, LDZ, AB, BB, AP,
354 $ BP, WORK, NWORK, IWORK, LIWORK, RESULT, INFO )
361 INTEGER INFO, LDA, LDB, LDZ, LIWORK, NOUNIT, NSIZES,
367 INTEGER ISEED( 4 ), IWORK( * ), NN( * )
368 REAL A( LDA, * ), AB( LDA, * ), AP( * ),
369 $ b( ldb, * ), bb( ldb, * ), bp( * ), d( * ),
370 $ result( * ), work( * ), z( ldz, * )
377 PARAMETER ( ZERO = 0.0e0, one = 1.0e0, ten = 10.0e0 )
379 parameter( maxtyp = 21 )
384 INTEGER I, IBTYPE, IBUPLO, IINFO, IJ, IL, IMODE, ITEMP,
385 $ itype, iu, j, jcol, jsize, jtype, ka, ka9, kb,
386 $ kb9, m, mtypes, n, nerrs, nmats, nmax, ntest,
388 REAL ABSTOL, ANINV, ANORM, COND, OVFL, RTOVFL,
389 $ RTUNFL, ULP, ULPINV, UNFL, VL, VU
392 INTEGER IDUMMA( 1 ), IOLDSD( 4 ), ISEED2( 4 ),
393 $ KMAGN( MAXTYP ), KMODE( MAXTYP ),
399 EXTERNAL lsame, slamch, slarnd
407 INTRINSIC abs, max, min, real, sqrt
410 DATA ktype / 1, 2, 5*4, 5*5, 3*8, 6*9 /
411 DATA kmagn / 2*1, 1, 1, 1, 2, 3, 1, 1, 1, 2, 3, 1,
413 DATA kmode / 2*0, 4, 3, 1, 4, 4, 4, 3, 1, 4, 4, 0,
426 nmax = max( nmax, nn( j ) )
433 IF( nsizes.LT.0 )
THEN
435 ELSE IF( badnn )
THEN
437 ELSE IF( ntypes.LT.0 )
THEN
439 ELSE IF( lda.LE.1 .OR. lda.LT.nmax )
THEN
441 ELSE IF( ldz.LE.1 .OR. ldz.LT.nmax )
THEN
443 ELSE IF( 2*max( nmax, 3 )**2.GT.nwork )
THEN
445 ELSE IF( 2*max( nmax, 3 )**2.GT.liwork )
THEN
450 CALL xerbla(
'SDRVSG', -info )
456 IF( nsizes.EQ.0 .OR. ntypes.EQ.0 )
461 unfl = slamch(
'Safe minimum' )
462 ovfl = slamch(
'Overflow' )
463 ulp = slamch(
'Epsilon' )*slamch(
'Base' )
465 rtunfl = sqrt( unfl )
466 rtovfl = sqrt( ovfl )
469 iseed2( i ) = iseed( i )
477 DO 650 jsize = 1, nsizes
479 aninv = one / real( max( 1, n ) )
481 IF( nsizes.NE.1 )
THEN
482 mtypes = min( maxtyp, ntypes )
484 mtypes = min( maxtyp+1, ntypes )
489 DO 640 jtype = 1, mtypes
490 IF( .NOT.dotype( jtype ) )
496 ioldsd( j ) = iseed( j )
514 IF( mtypes.GT.maxtyp )
517 itype = ktype( jtype )
518 imode = kmode( jtype )
522 GO TO ( 40, 50, 60 )kmagn( jtype )
529 anorm = ( rtovfl*ulp )*aninv
533 anorm = rtunfl*n*ulpinv
543 IF( itype.EQ.1 )
THEN
549 CALL slaset(
'Full', lda, n, zero, zero, a, lda )
551 ELSE IF( itype.EQ.2 )
THEN
557 CALL slaset(
'Full', lda, n, zero, zero, a, lda )
559 a( jcol, jcol ) = anorm
562 ELSE IF( itype.EQ.4 )
THEN
568 CALL slatms( n, n,
'S', iseed,
'S', work, imode, cond,
569 $ anorm, 0, 0,
'N', a, lda, work( n+1 ),
572 ELSE IF( itype.EQ.5 )
THEN
578 CALL slatms( n, n,
'S', iseed,
'S', work, imode, cond,
579 $ anorm, n, n,
'N', a, lda, work( n+1 ),
582 ELSE IF( itype.EQ.7 )
THEN
588 CALL slatmr( n, n,
'S', iseed,
'S', work, 6, one, one,
589 $
'T',
'N', work( n+1 ), 1, one,
590 $ work( 2*n+1 ), 1, one,
'N', idumma, 0, 0,
591 $ zero, anorm,
'NO', a, lda, iwork, iinfo )
593 ELSE IF( itype.EQ.8 )
THEN
599 CALL slatmr( n, n,
'S', iseed,
'H', work, 6, one, one,
600 $
'T',
'N', work( n+1 ), 1, one,
601 $ work( 2*n+1 ), 1, one,
'N', idumma, n, n,
602 $ zero, anorm,
'NO', a, lda, iwork, iinfo )
604 ELSE IF( itype.EQ.9 )
THEN
618 IF( kb9.GT.ka9 )
THEN
622 ka = max( 0, min( n-1, ka9 ) )
623 kb = max( 0, min( n-1, kb9 ) )
624 CALL slatms( n, n,
'S', iseed,
'S', work, imode, cond,
625 $ anorm, ka, ka,
'N', a, lda, work( n+1 ),
633 IF( iinfo.NE.0 )
THEN
634 WRITE( nounit, fmt = 9999 )
'Generator', iinfo, n, jtype,
647 il = 1 + int( ( n-1 )*slarnd( 1, iseed2 ) )
648 iu = 1 + int( ( n-1 )*slarnd( 1, iseed2 ) )
677 CALL slatms( n, n,
'U', iseed,
'P', work, 5, ten, one,
678 $ kb, kb, uplo, b, ldb, work( n+1 ),
685 CALL slacpy(
' ', n, n, a, lda, z, ldz )
686 CALL slacpy( uplo, n, n, b, ldb, bb, ldb )
688 CALL ssygv( ibtype,
'V', uplo, n, z, ldz, bb, ldb, d,
689 $ work, nwork, iinfo )
690 IF( iinfo.NE.0 )
THEN
691 WRITE( nounit, fmt = 9999 )
'SSYGV(V,' // uplo //
692 $
')', iinfo, n, jtype, ioldsd
694 IF( iinfo.LT.0 )
THEN
697 result( ntest ) = ulpinv
704 CALL ssgt01( ibtype, uplo, n, n, a, lda, b, ldb, z,
705 $ ldz, d, work, result( ntest ) )
711 CALL slacpy(
' ', n, n, a, lda, z, ldz )
712 CALL slacpy( uplo, n, n, b, ldb, bb, ldb )
714 CALL ssygvd( ibtype,
'V', uplo, n, z, ldz, bb, ldb, d,
715 $ work, nwork, iwork, liwork, iinfo )
716 IF( iinfo.NE.0 )
THEN
717 WRITE( nounit, fmt = 9999 )
'SSYGVD(V,' // uplo //
718 $
')', iinfo, n, jtype, ioldsd
720 IF( iinfo.LT.0 )
THEN
723 result( ntest ) = ulpinv
730 CALL ssgt01( ibtype, uplo, n, n, a, lda, b, ldb, z,
731 $ ldz, d, work, result( ntest ) )
737 CALL slacpy(
' ', n, n, a, lda, ab, lda )
738 CALL slacpy( uplo, n, n, b, ldb, bb, ldb )
740 CALL ssygvx( ibtype,
'V',
'A', uplo, n, ab, lda, bb,
741 $ ldb, vl, vu, il, iu, abstol, m, d, z,
742 $ ldz, work, nwork, iwork( n+1 ), iwork,
744 IF( iinfo.NE.0 )
THEN
745 WRITE( nounit, fmt = 9999 )
'SSYGVX(V,A' // uplo //
746 $
')', iinfo, n, jtype, ioldsd
748 IF( iinfo.LT.0 )
THEN
751 result( ntest ) = ulpinv
758 CALL ssgt01( ibtype, uplo, n, n, a, lda, b, ldb, z,
759 $ ldz, d, work, result( ntest ) )
763 CALL slacpy(
' ', n, n, a, lda, ab, lda )
764 CALL slacpy( uplo, n, n, b, ldb, bb, ldb )
773 CALL ssygvx( ibtype,
'V',
'V', uplo, n, ab, lda, bb,
774 $ ldb, vl, vu, il, iu, abstol, m, d, z,
775 $ ldz, work, nwork, iwork( n+1 ), iwork,
777 IF( iinfo.NE.0 )
THEN
778 WRITE( nounit, fmt = 9999 )
'SSYGVX(V,V,' //
779 $ uplo //
')', iinfo, n, jtype, ioldsd
781 IF( iinfo.LT.0 )
THEN
784 result( ntest ) = ulpinv
791 CALL ssgt01( ibtype, uplo, n, m, a, lda, b, ldb, z,
792 $ ldz, d, work, result( ntest ) )
796 CALL slacpy(
' ', n, n, a, lda, ab, lda )
797 CALL slacpy( uplo, n, n, b, ldb, bb, ldb )
799 CALL ssygvx( ibtype,
'V',
'I', uplo, n, ab, lda, bb,
800 $ ldb, vl, vu, il, iu, abstol, m, d, z,
801 $ ldz, work, nwork, iwork( n+1 ), iwork,
803 IF( iinfo.NE.0 )
THEN
804 WRITE( nounit, fmt = 9999 )
'SSYGVX(V,I,' //
805 $ uplo //
')', iinfo, n, jtype, ioldsd
807 IF( iinfo.LT.0 )
THEN
810 result( ntest ) = ulpinv
817 CALL ssgt01( ibtype, uplo, n, m, a, lda, b, ldb, z,
818 $ ldz, d, work, result( ntest ) )
828 IF( lsame( uplo,
'U' ) )
THEN
848 CALL sspgv( ibtype,
'V', uplo, n, ap, bp, d, z, ldz,
850 IF( iinfo.NE.0 )
THEN
851 WRITE( nounit, fmt = 9999 )
'SSPGV(V,' // uplo //
852 $
')', iinfo, n, jtype, ioldsd
854 IF( iinfo.LT.0 )
THEN
857 result( ntest ) = ulpinv
864 CALL ssgt01( ibtype, uplo, n, n, a, lda, b, ldb, z,
865 $ ldz, d, work, result( ntest ) )
873 IF( lsame( uplo,
'U' ) )
THEN
893 CALL sspgvd( ibtype,
'V', uplo, n, ap, bp, d, z, ldz,
894 $ work, nwork, iwork, liwork, iinfo )
895 IF( iinfo.NE.0 )
THEN
896 WRITE( nounit, fmt = 9999 )
'SSPGVD(V,' // uplo //
897 $
')', iinfo, n, jtype, ioldsd
899 IF( iinfo.LT.0 )
THEN
902 result( ntest ) = ulpinv
909 CALL ssgt01( ibtype, uplo, n, n, a, lda, b, ldb, z,
910 $ ldz, d, work, result( ntest ) )
918 IF( lsame( uplo,
'U' ) )
THEN
938 CALL sspgvx( ibtype,
'V',
'A', uplo, n, ap, bp, vl,
939 $ vu, il, iu, abstol, m, d, z, ldz, work,
940 $ iwork( n+1 ), iwork, info )
941 IF( iinfo.NE.0 )
THEN
942 WRITE( nounit, fmt = 9999 )
'SSPGVX(V,A' // uplo //
943 $
')', iinfo, n, jtype, ioldsd
945 IF( iinfo.LT.0 )
THEN
948 result( ntest ) = ulpinv
955 CALL ssgt01( ibtype, uplo, n, m, a, lda, b, ldb, z,
956 $ ldz, d, work, result( ntest ) )
962 IF( lsame( uplo,
'U' ) )
THEN
984 CALL sspgvx( ibtype,
'V',
'V', uplo, n, ap, bp, vl,
985 $ vu, il, iu, abstol, m, d, z, ldz, work,
986 $ iwork( n+1 ), iwork, info )
987 IF( iinfo.NE.0 )
THEN
988 WRITE( nounit, fmt = 9999 )
'SSPGVX(V,V' // uplo //
989 $
')', iinfo, n, jtype, ioldsd
991 IF( iinfo.LT.0 )
THEN
994 result( ntest ) = ulpinv
1001 CALL ssgt01( ibtype, uplo, n, m, a, lda, b, ldb, z,
1002 $ ldz, d, work, result( ntest ) )
1008 IF( lsame( uplo,
'U' ) )
THEN
1012 ap( ij ) = a( i, j )
1013 bp( ij ) = b( i, j )
1021 ap( ij ) = a( i, j )
1022 bp( ij ) = b( i, j )
1028 CALL sspgvx( ibtype,
'V',
'I', uplo, n, ap, bp, vl,
1029 $ vu, il, iu, abstol, m, d, z, ldz, work,
1030 $ iwork( n+1 ), iwork, info )
1031 IF( iinfo.NE.0 )
THEN
1032 WRITE( nounit, fmt = 9999 )
'SSPGVX(V,I' // uplo //
1033 $
')', iinfo, n, jtype, ioldsd
1035 IF( iinfo.LT.0 )
THEN
1038 result( ntest ) = ulpinv
1045 CALL ssgt01( ibtype, uplo, n, m, a, lda, b, ldb, z,
1046 $ ldz, d, work, result( ntest ) )
1050 IF( ibtype.EQ.1 )
THEN
1058 IF( lsame( uplo,
'U' ) )
THEN
1060 DO 320 i = max( 1, j-ka ), j
1061 ab( ka+1+i-j, j ) = a( i, j )
1063 DO 330 i = max( 1, j-kb ), j
1064 bb( kb+1+i-j, j ) = b( i, j )
1069 DO 350 i = j, min( n, j+ka )
1070 ab( 1+i-j, j ) = a( i, j )
1072 DO 360 i = j, min( n, j+kb )
1073 bb( 1+i-j, j ) = b( i, j )
1078 CALL ssbgv(
'V', uplo, n, ka, kb, ab, lda, bb, ldb,
1079 $ d, z, ldz, work, iinfo )
1080 IF( iinfo.NE.0 )
THEN
1081 WRITE( nounit, fmt = 9999 )
'SSBGV(V,' //
1082 $ uplo //
')', iinfo, n, jtype, ioldsd
1084 IF( iinfo.LT.0 )
THEN
1087 result( ntest ) = ulpinv
1094 CALL ssgt01( ibtype, uplo, n, n, a, lda, b, ldb, z,
1095 $ ldz, d, work, result( ntest ) )
1103 IF( lsame( uplo,
'U' ) )
THEN
1105 DO 380 i = max( 1, j-ka ), j
1106 ab( ka+1+i-j, j ) = a( i, j )
1108 DO 390 i = max( 1, j-kb ), j
1109 bb( kb+1+i-j, j ) = b( i, j )
1114 DO 410 i = j, min( n, j+ka )
1115 ab( 1+i-j, j ) = a( i, j )
1117 DO 420 i = j, min( n, j+kb )
1118 bb( 1+i-j, j ) = b( i, j )
1123 CALL ssbgvd(
'V', uplo, n, ka, kb, ab, lda, bb,
1124 $ ldb, d, z, ldz, work, nwork, iwork,
1126 IF( iinfo.NE.0 )
THEN
1127 WRITE( nounit, fmt = 9999 )
'SSBGVD(V,' //
1128 $ uplo //
')', iinfo, n, jtype, ioldsd
1130 IF( iinfo.LT.0 )
THEN
1133 result( ntest ) = ulpinv
1140 CALL ssgt01( ibtype, uplo, n, n, a, lda, b, ldb, z,
1141 $ ldz, d, work, result( ntest ) )
1149 IF( lsame( uplo,
'U' ) )
THEN
1151 DO 440 i = max( 1, j-ka ), j
1152 ab( ka+1+i-j, j ) = a( i, j )
1154 DO 450 i = max( 1, j-kb ), j
1155 bb( kb+1+i-j, j ) = b( i, j )
1160 DO 470 i = j, min( n, j+ka )
1161 ab( 1+i-j, j ) = a( i, j )
1163 DO 480 i = j, min( n, j+kb )
1164 bb( 1+i-j, j ) = b( i, j )
1169 CALL ssbgvx(
'V',
'A', uplo, n, ka, kb, ab, lda,
1170 $ bb, ldb, bp, max( 1, n ), vl, vu, il,
1171 $ iu, abstol, m, d, z, ldz, work,
1172 $ iwork( n+1 ), iwork, iinfo )
1173 IF( iinfo.NE.0 )
THEN
1174 WRITE( nounit, fmt = 9999 )
'SSBGVX(V,A' //
1175 $ uplo //
')', iinfo, n, jtype, ioldsd
1177 IF( iinfo.LT.0 )
THEN
1180 result( ntest ) = ulpinv
1187 CALL ssgt01( ibtype, uplo, n, m, a, lda, b, ldb, z,
1188 $ ldz, d, work, result( ntest ) )
1195 IF( lsame( uplo,
'U' ) )
THEN
1197 DO 500 i = max( 1, j-ka ), j
1198 ab( ka+1+i-j, j ) = a( i, j )
1200 DO 510 i = max( 1, j-kb ), j
1201 bb( kb+1+i-j, j ) = b( i, j )
1206 DO 530 i = j, min( n, j+ka )
1207 ab( 1+i-j, j ) = a( i, j )
1209 DO 540 i = j, min( n, j+kb )
1210 bb( 1+i-j, j ) = b( i, j )
1217 CALL ssbgvx(
'V',
'V', uplo, n, ka, kb, ab, lda,
1218 $ bb, ldb, bp, max( 1, n ), vl, vu, il,
1219 $ iu, abstol, m, d, z, ldz, work,
1220 $ iwork( n+1 ), iwork, iinfo )
1221 IF( iinfo.NE.0 )
THEN
1222 WRITE( nounit, fmt = 9999 )
'SSBGVX(V,V' //
1223 $ uplo //
')', iinfo, n, jtype, ioldsd
1225 IF( iinfo.LT.0 )
THEN
1228 result( ntest ) = ulpinv
1235 CALL ssgt01( ibtype, uplo, n, m, a, lda, b, ldb, z,
1236 $ ldz, d, work, result( ntest ) )
1242 IF( lsame( uplo,
'U' ) )
THEN
1244 DO 560 i = max( 1, j-ka ), j
1245 ab( ka+1+i-j, j ) = a( i, j )
1247 DO 570 i = max( 1, j-kb ), j
1248 bb( kb+1+i-j, j ) = b( i, j )
1253 DO 590 i = j, min( n, j+ka )
1254 ab( 1+i-j, j ) = a( i, j )
1256 DO 600 i = j, min( n, j+kb )
1257 bb( 1+i-j, j ) = b( i, j )
1262 CALL ssbgvx(
'V',
'I', uplo, n, ka, kb, ab, lda,
1263 $ bb, ldb, bp, max( 1, n ), vl, vu, il,
1264 $ iu, abstol, m, d, z, ldz, work,
1265 $ iwork( n+1 ), iwork, iinfo )
1266 IF( iinfo.NE.0 )
THEN
1267 WRITE( nounit, fmt = 9999 )
'SSBGVX(V,I' //
1268 $ uplo //
')', iinfo, n, jtype, ioldsd
1270 IF( iinfo.LT.0 )
THEN
1273 result( ntest ) = ulpinv
1280 CALL ssgt01( ibtype, uplo, n, m, a, lda, b, ldb, z,
1281 $ ldz, d, work, result( ntest ) )
1290 ntestt = ntestt + ntest
1291 CALL slafts(
'SSG', n, n, jtype, ntest, result, ioldsd,
1292 $ thresh, nounit, nerrs )
1298 CALL slasum(
'SSG', nounit, nerrs, ntestt )
1304 9999
FORMAT(
' SDRVSG: ', a,
' returned INFO=', i6,
'.', / 9x,
'N=',
1305 $ i6,
', JTYPE=', i6,
', ISEED=(', 3( i5,
',' ), i5,
')' )
subroutine xerbla(srname, info)
subroutine ssbgv(jobz, uplo, n, ka, kb, ab, ldab, bb, ldbb, w, z, ldz, work, info)
SSBGV
subroutine ssbgvd(jobz, uplo, n, ka, kb, ab, ldab, bb, ldbb, w, z, ldz, work, lwork, iwork, liwork, info)
SSBGVD
subroutine ssbgvx(jobz, range, uplo, n, ka, kb, ab, ldab, bb, ldbb, q, ldq, vl, vu, il, iu, abstol, m, w, z, ldz, work, iwork, ifail, info)
SSBGVX
subroutine ssygv(itype, jobz, uplo, n, a, lda, b, ldb, w, work, lwork, info)
SSYGV
subroutine ssygvd(itype, jobz, uplo, n, a, lda, b, ldb, w, work, lwork, iwork, liwork, info)
SSYGVD
subroutine ssygvx(itype, jobz, range, uplo, n, a, lda, b, ldb, vl, vu, il, iu, abstol, m, w, z, ldz, work, lwork, iwork, ifail, info)
SSYGVX
subroutine sspgv(itype, jobz, uplo, n, ap, bp, w, z, ldz, work, info)
SSPGV
subroutine sspgvd(itype, jobz, uplo, n, ap, bp, w, z, ldz, work, lwork, iwork, liwork, info)
SSPGVD
subroutine sspgvx(itype, jobz, range, uplo, n, ap, bp, vl, vu, il, iu, abstol, m, w, z, ldz, work, iwork, ifail, info)
SSPGVX
subroutine slacpy(uplo, m, n, a, lda, b, ldb)
SLACPY copies all or part of one two-dimensional array to another.
subroutine slaset(uplo, m, n, alpha, beta, a, lda)
SLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine sdrvsg(nsizes, nn, ntypes, dotype, iseed, thresh, nounit, a, lda, b, ldb, d, z, ldz, ab, bb, ap, bp, work, nwork, iwork, liwork, result, info)
SDRVSG
subroutine slafts(type, m, n, imat, ntests, result, iseed, thresh, iounit, ie)
SLAFTS
subroutine slasum(type, iounit, ie, nrun)
SLASUM
subroutine slatmr(m, n, dist, iseed, sym, d, mode, cond, dmax, rsign, grade, dl, model, condl, dr, moder, condr, pivtng, ipivot, kl, ku, sparse, anorm, pack, a, lda, iwork, info)
SLATMR
subroutine slatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
SLATMS
subroutine ssgt01(itype, uplo, n, m, a, lda, b, ldb, z, ldz, d, work, result)
SSGT01