366 SUBROUTINE zdrvsg( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH,
367 $ NOUNIT, A, LDA, B, LDB, D, Z, LDZ, AB, BB, AP,
368 $ BP, WORK, NWORK, RWORK, LRWORK, IWORK, LIWORK,
376 INTEGER INFO, LDA, LDB, LDZ, LIWORK, LRWORK, NOUNIT,
377 $ NSIZES, NTYPES, NWORK
378 DOUBLE PRECISION THRESH
382 INTEGER ISEED( 4 ), IWORK( * ), NN( * )
383 DOUBLE PRECISION D( * ), RESULT( * ), RWORK( * )
384 COMPLEX*16 A( LDA, * ), AB( LDA, * ), AP( * ),
385 $ b( ldb, * ), bb( ldb, * ), bp( * ), work( * ),
392 DOUBLE PRECISION ZERO, ONE, TEN
393 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0, ten = 10.0d+0 )
394 COMPLEX*16 CZERO, CONE
395 parameter( czero = ( 0.0d+0, 0.0d+0 ),
396 $ cone = ( 1.0d+0, 0.0d+0 ) )
398 parameter( maxtyp = 21 )
403 INTEGER I, IBTYPE, IBUPLO, IINFO, IJ, IL, IMODE, ITEMP,
404 $ itype, iu, j, jcol, jsize, jtype, ka, ka9, kb,
405 $ kb9, m, mtypes, n, nerrs, nmats, nmax, ntest,
407 DOUBLE PRECISION ABSTOL, ANINV, ANORM, COND, OVFL, RTOVFL,
408 $ RTUNFL, ULP, ULPINV, UNFL, VL, VU
411 INTEGER IDUMMA( 1 ), IOLDSD( 4 ), ISEED2( 4 ),
412 $ KMAGN( MAXTYP ), KMODE( MAXTYP ),
417 DOUBLE PRECISION DLAMCH, DLARND
418 EXTERNAL LSAME, DLAMCH, DLARND
426 INTRINSIC abs, dble, max, min, sqrt
429 DATA ktype / 1, 2, 5*4, 5*5, 3*8, 6*9 /
430 DATA kmagn / 2*1, 1, 1, 1, 2, 3, 1, 1, 1, 2, 3, 1,
432 DATA kmode / 2*0, 4, 3, 1, 4, 4, 4, 3, 1, 4, 4, 0,
445 nmax = max( nmax, nn( j ) )
452 IF( nsizes.LT.0 )
THEN
454 ELSE IF( badnn )
THEN
456 ELSE IF( ntypes.LT.0 )
THEN
458 ELSE IF( lda.LE.1 .OR. lda.LT.nmax )
THEN
460 ELSE IF( ldz.LE.1 .OR. ldz.LT.nmax )
THEN
462 ELSE IF( 2*max( nmax, 2 )**2.GT.nwork )
THEN
464 ELSE IF( 2*max( nmax, 2 )**2.GT.lrwork )
THEN
466 ELSE IF( 2*max( nmax, 2 )**2.GT.liwork )
THEN
471 CALL xerbla(
'ZDRVSG', -info )
477 IF( nsizes.EQ.0 .OR. ntypes.EQ.0 )
482 unfl = dlamch(
'Safe minimum' )
483 ovfl = dlamch(
'Overflow' )
484 ulp = dlamch(
'Epsilon' )*dlamch(
'Base' )
486 rtunfl = sqrt( unfl )
487 rtovfl = sqrt( ovfl )
490 iseed2( i ) = iseed( i )
498 DO 650 jsize = 1, nsizes
500 aninv = one / dble( max( 1, n ) )
502 IF( nsizes.NE.1 )
THEN
503 mtypes = min( maxtyp, ntypes )
505 mtypes = min( maxtyp+1, ntypes )
510 DO 640 jtype = 1, mtypes
511 IF( .NOT.dotype( jtype ) )
517 ioldsd( j ) = iseed( j )
535 IF( mtypes.GT.maxtyp )
538 itype = ktype( jtype )
539 imode = kmode( jtype )
543 GO TO ( 40, 50, 60 )kmagn( jtype )
550 anorm = ( rtovfl*ulp )*aninv
554 anorm = rtunfl*n*ulpinv
564 IF( itype.EQ.1 )
THEN
570 CALL zlaset(
'Full', lda, n, czero, czero, a, lda )
572 ELSE IF( itype.EQ.2 )
THEN
578 CALL zlaset(
'Full', lda, n, czero, czero, a, lda )
580 a( jcol, jcol ) = anorm
583 ELSE IF( itype.EQ.4 )
THEN
589 CALL zlatms( n, n,
'S', iseed,
'H', rwork, imode, cond,
590 $ anorm, 0, 0,
'N', a, lda, work, iinfo )
592 ELSE IF( itype.EQ.5 )
THEN
598 CALL zlatms( n, n,
'S', iseed,
'H', rwork, imode, cond,
599 $ anorm, n, n,
'N', a, lda, work, iinfo )
601 ELSE IF( itype.EQ.7 )
THEN
607 CALL zlatmr( n, n,
'S', iseed,
'H', work, 6, one, cone,
608 $
'T',
'N', work( n+1 ), 1, one,
609 $ work( 2*n+1 ), 1, one,
'N', idumma, 0, 0,
610 $ zero, anorm,
'NO', a, lda, iwork, iinfo )
612 ELSE IF( itype.EQ.8 )
THEN
618 CALL zlatmr( n, n,
'S', iseed,
'H', work, 6, one, cone,
619 $
'T',
'N', work( n+1 ), 1, one,
620 $ work( 2*n+1 ), 1, one,
'N', idumma, n, n,
621 $ zero, anorm,
'NO', a, lda, iwork, iinfo )
623 ELSE IF( itype.EQ.9 )
THEN
637 IF( kb9.GT.ka9 )
THEN
641 ka = max( 0, min( n-1, ka9 ) )
642 kb = max( 0, min( n-1, kb9 ) )
643 CALL zlatms( n, n,
'S', iseed,
'H', rwork, imode, cond,
644 $ anorm, ka, ka,
'N', a, lda, work, iinfo )
651 IF( iinfo.NE.0 )
THEN
652 WRITE( nounit, fmt = 9999 )
'Generator', iinfo, n, jtype,
665 il = 1 + int( ( n-1 )*dlarnd( 1, iseed2 ) )
666 iu = 1 + int( ( n-1 )*dlarnd( 1, iseed2 ) )
695 CALL zlatms( n, n,
'U', iseed,
'P', rwork, 5, ten,
696 $ one, kb, kb, uplo, b, ldb, work( n+1 ),
703 CALL zlacpy(
' ', n, n, a, lda, z, ldz )
704 CALL zlacpy( uplo, n, n, b, ldb, bb, ldb )
706 CALL zhegv( ibtype,
'V', uplo, n, z, ldz, bb, ldb, d,
707 $ work, nwork, rwork, iinfo )
708 IF( iinfo.NE.0 )
THEN
709 WRITE( nounit, fmt = 9999 )
'ZHEGV(V,' // uplo //
710 $
')', iinfo, n, jtype, ioldsd
712 IF( iinfo.LT.0 )
THEN
715 result( ntest ) = ulpinv
722 CALL zsgt01( ibtype, uplo, n, n, a, lda, b, ldb, z,
723 $ ldz, d, work, rwork, result( ntest ) )
729 CALL zlacpy(
' ', n, n, a, lda, z, ldz )
730 CALL zlacpy( uplo, n, n, b, ldb, bb, ldb )
732 CALL zhegvd( ibtype,
'V', uplo, n, z, ldz, bb, ldb, d,
733 $ work, nwork, rwork, lrwork, iwork,
735 IF( iinfo.NE.0 )
THEN
736 WRITE( nounit, fmt = 9999 )
'ZHEGVD(V,' // uplo //
737 $
')', iinfo, n, jtype, ioldsd
739 IF( iinfo.LT.0 )
THEN
742 result( ntest ) = ulpinv
749 CALL zsgt01( ibtype, uplo, n, n, a, lda, b, ldb, z,
750 $ ldz, d, work, rwork, result( ntest ) )
756 CALL zlacpy(
' ', n, n, a, lda, ab, lda )
757 CALL zlacpy( uplo, n, n, b, ldb, bb, ldb )
759 CALL zhegvx( ibtype,
'V',
'A', uplo, n, ab, lda, bb,
760 $ ldb, vl, vu, il, iu, abstol, m, d, z,
761 $ ldz, work, nwork, rwork, iwork( n+1 ),
763 IF( iinfo.NE.0 )
THEN
764 WRITE( nounit, fmt = 9999 )
'ZHEGVX(V,A' // uplo //
765 $
')', iinfo, n, jtype, ioldsd
767 IF( iinfo.LT.0 )
THEN
770 result( ntest ) = ulpinv
777 CALL zsgt01( ibtype, uplo, n, n, a, lda, b, ldb, z,
778 $ ldz, d, work, rwork, result( ntest ) )
782 CALL zlacpy(
' ', n, n, a, lda, ab, lda )
783 CALL zlacpy( uplo, n, n, b, ldb, bb, ldb )
792 CALL zhegvx( ibtype,
'V',
'V', uplo, n, ab, lda, bb,
793 $ ldb, vl, vu, il, iu, abstol, m, d, z,
794 $ ldz, work, nwork, rwork, iwork( n+1 ),
796 IF( iinfo.NE.0 )
THEN
797 WRITE( nounit, fmt = 9999 )
'ZHEGVX(V,V,' //
798 $ uplo //
')', iinfo, n, jtype, ioldsd
800 IF( iinfo.LT.0 )
THEN
803 result( ntest ) = ulpinv
810 CALL zsgt01( ibtype, uplo, n, m, a, lda, b, ldb, z,
811 $ ldz, d, work, rwork, result( ntest ) )
815 CALL zlacpy(
' ', n, n, a, lda, ab, lda )
816 CALL zlacpy( uplo, n, n, b, ldb, bb, ldb )
818 CALL zhegvx( ibtype,
'V',
'I', uplo, n, ab, lda, bb,
819 $ ldb, vl, vu, il, iu, abstol, m, d, z,
820 $ ldz, work, nwork, rwork, iwork( n+1 ),
822 IF( iinfo.NE.0 )
THEN
823 WRITE( nounit, fmt = 9999 )
'ZHEGVX(V,I,' //
824 $ uplo //
')', iinfo, n, jtype, ioldsd
826 IF( iinfo.LT.0 )
THEN
829 result( ntest ) = ulpinv
836 CALL zsgt01( ibtype, uplo, n, m, a, lda, b, ldb, z,
837 $ ldz, d, work, rwork, result( ntest ) )
847 IF( lsame( uplo,
'U' ) )
THEN
867 CALL zhpgv( ibtype,
'V', uplo, n, ap, bp, d, z, ldz,
868 $ work, rwork, iinfo )
869 IF( iinfo.NE.0 )
THEN
870 WRITE( nounit, fmt = 9999 )
'ZHPGV(V,' // uplo //
871 $
')', iinfo, n, jtype, ioldsd
873 IF( iinfo.LT.0 )
THEN
876 result( ntest ) = ulpinv
883 CALL zsgt01( ibtype, uplo, n, n, a, lda, b, ldb, z,
884 $ ldz, d, work, rwork, result( ntest ) )
892 IF( lsame( uplo,
'U' ) )
THEN
912 CALL zhpgvd( ibtype,
'V', uplo, n, ap, bp, d, z, ldz,
913 $ work, nwork, rwork, lrwork, iwork,
915 IF( iinfo.NE.0 )
THEN
916 WRITE( nounit, fmt = 9999 )
'ZHPGVD(V,' // uplo //
917 $
')', iinfo, n, jtype, ioldsd
919 IF( iinfo.LT.0 )
THEN
922 result( ntest ) = ulpinv
929 CALL zsgt01( ibtype, uplo, n, n, a, lda, b, ldb, z,
930 $ ldz, d, work, rwork, result( ntest ) )
938 IF( lsame( uplo,
'U' ) )
THEN
958 CALL zhpgvx( ibtype,
'V',
'A', uplo, n, ap, bp, vl,
959 $ vu, il, iu, abstol, m, d, z, ldz, work,
960 $ rwork, iwork( n+1 ), iwork, info )
961 IF( iinfo.NE.0 )
THEN
962 WRITE( nounit, fmt = 9999 )
'ZHPGVX(V,A' // uplo //
963 $
')', iinfo, n, jtype, ioldsd
965 IF( iinfo.LT.0 )
THEN
968 result( ntest ) = ulpinv
975 CALL zsgt01( ibtype, uplo, n, n, a, lda, b, ldb, z,
976 $ ldz, d, work, rwork, result( ntest ) )
982 IF( lsame( uplo,
'U' ) )
THEN
1004 CALL zhpgvx( ibtype,
'V',
'V', uplo, n, ap, bp, vl,
1005 $ vu, il, iu, abstol, m, d, z, ldz, work,
1006 $ rwork, iwork( n+1 ), iwork, info )
1007 IF( iinfo.NE.0 )
THEN
1008 WRITE( nounit, fmt = 9999 )
'ZHPGVX(V,V' // uplo //
1009 $
')', iinfo, n, jtype, ioldsd
1011 IF( iinfo.LT.0 )
THEN
1014 result( ntest ) = ulpinv
1021 CALL zsgt01( ibtype, uplo, n, m, a, lda, b, ldb, z,
1022 $ ldz, d, work, rwork, result( ntest ) )
1028 IF( lsame( uplo,
'U' ) )
THEN
1032 ap( ij ) = a( i, j )
1033 bp( ij ) = b( i, j )
1041 ap( ij ) = a( i, j )
1042 bp( ij ) = b( i, j )
1048 CALL zhpgvx( ibtype,
'V',
'I', uplo, n, ap, bp, vl,
1049 $ vu, il, iu, abstol, m, d, z, ldz, work,
1050 $ rwork, iwork( n+1 ), iwork, info )
1051 IF( iinfo.NE.0 )
THEN
1052 WRITE( nounit, fmt = 9999 )
'ZHPGVX(V,I' // uplo //
1053 $
')', iinfo, n, jtype, ioldsd
1055 IF( iinfo.LT.0 )
THEN
1058 result( ntest ) = ulpinv
1065 CALL zsgt01( ibtype, uplo, n, m, a, lda, b, ldb, z,
1066 $ ldz, d, work, rwork, result( ntest ) )
1070 IF( ibtype.EQ.1 )
THEN
1078 IF( lsame( uplo,
'U' ) )
THEN
1080 DO 320 i = max( 1, j-ka ), j
1081 ab( ka+1+i-j, j ) = a( i, j )
1083 DO 330 i = max( 1, j-kb ), j
1084 bb( kb+1+i-j, j ) = b( i, j )
1089 DO 350 i = j, min( n, j+ka )
1090 ab( 1+i-j, j ) = a( i, j )
1092 DO 360 i = j, min( n, j+kb )
1093 bb( 1+i-j, j ) = b( i, j )
1098 CALL zhbgv(
'V', uplo, n, ka, kb, ab, lda, bb, ldb,
1099 $ d, z, ldz, work, rwork, iinfo )
1100 IF( iinfo.NE.0 )
THEN
1101 WRITE( nounit, fmt = 9999 )
'ZHBGV(V,' //
1102 $ uplo //
')', iinfo, n, jtype, ioldsd
1104 IF( iinfo.LT.0 )
THEN
1107 result( ntest ) = ulpinv
1114 CALL zsgt01( ibtype, uplo, n, n, a, lda, b, ldb, z,
1115 $ ldz, d, work, rwork, result( ntest ) )
1123 IF( lsame( uplo,
'U' ) )
THEN
1125 DO 380 i = max( 1, j-ka ), j
1126 ab( ka+1+i-j, j ) = a( i, j )
1128 DO 390 i = max( 1, j-kb ), j
1129 bb( kb+1+i-j, j ) = b( i, j )
1134 DO 410 i = j, min( n, j+ka )
1135 ab( 1+i-j, j ) = a( i, j )
1137 DO 420 i = j, min( n, j+kb )
1138 bb( 1+i-j, j ) = b( i, j )
1143 CALL zhbgvd(
'V', uplo, n, ka, kb, ab, lda, bb,
1144 $ ldb, d, z, ldz, work, nwork, rwork,
1145 $ lrwork, iwork, liwork, iinfo )
1146 IF( iinfo.NE.0 )
THEN
1147 WRITE( nounit, fmt = 9999 )
'ZHBGVD(V,' //
1148 $ uplo //
')', iinfo, n, jtype, ioldsd
1150 IF( iinfo.LT.0 )
THEN
1153 result( ntest ) = ulpinv
1160 CALL zsgt01( ibtype, uplo, n, n, a, lda, b, ldb, z,
1161 $ ldz, d, work, rwork, result( ntest ) )
1169 IF( lsame( uplo,
'U' ) )
THEN
1171 DO 440 i = max( 1, j-ka ), j
1172 ab( ka+1+i-j, j ) = a( i, j )
1174 DO 450 i = max( 1, j-kb ), j
1175 bb( kb+1+i-j, j ) = b( i, j )
1180 DO 470 i = j, min( n, j+ka )
1181 ab( 1+i-j, j ) = a( i, j )
1183 DO 480 i = j, min( n, j+kb )
1184 bb( 1+i-j, j ) = b( i, j )
1189 CALL zhbgvx(
'V',
'A', uplo, n, ka, kb, ab, lda,
1190 $ bb, ldb, bp, max( 1, n ), vl, vu, il,
1191 $ iu, abstol, m, d, z, ldz, work, rwork,
1192 $ iwork( n+1 ), iwork, iinfo )
1193 IF( iinfo.NE.0 )
THEN
1194 WRITE( nounit, fmt = 9999 )
'ZHBGVX(V,A' //
1195 $ uplo //
')', iinfo, n, jtype, ioldsd
1197 IF( iinfo.LT.0 )
THEN
1200 result( ntest ) = ulpinv
1207 CALL zsgt01( ibtype, uplo, n, n, a, lda, b, ldb, z,
1208 $ ldz, d, work, rwork, result( ntest ) )
1214 IF( lsame( uplo,
'U' ) )
THEN
1216 DO 500 i = max( 1, j-ka ), j
1217 ab( ka+1+i-j, j ) = a( i, j )
1219 DO 510 i = max( 1, j-kb ), j
1220 bb( kb+1+i-j, j ) = b( i, j )
1225 DO 530 i = j, min( n, j+ka )
1226 ab( 1+i-j, j ) = a( i, j )
1228 DO 540 i = j, min( n, j+kb )
1229 bb( 1+i-j, j ) = b( i, j )
1236 CALL zhbgvx(
'V',
'V', uplo, n, ka, kb, ab, lda,
1237 $ bb, ldb, bp, max( 1, n ), vl, vu, il,
1238 $ iu, abstol, m, d, z, ldz, work, rwork,
1239 $ iwork( n+1 ), iwork, iinfo )
1240 IF( iinfo.NE.0 )
THEN
1241 WRITE( nounit, fmt = 9999 )
'ZHBGVX(V,V' //
1242 $ uplo //
')', iinfo, n, jtype, ioldsd
1244 IF( iinfo.LT.0 )
THEN
1247 result( ntest ) = ulpinv
1254 CALL zsgt01( ibtype, uplo, n, m, a, lda, b, ldb, z,
1255 $ ldz, d, work, rwork, result( ntest ) )
1261 IF( lsame( uplo,
'U' ) )
THEN
1263 DO 560 i = max( 1, j-ka ), j
1264 ab( ka+1+i-j, j ) = a( i, j )
1266 DO 570 i = max( 1, j-kb ), j
1267 bb( kb+1+i-j, j ) = b( i, j )
1272 DO 590 i = j, min( n, j+ka )
1273 ab( 1+i-j, j ) = a( i, j )
1275 DO 600 i = j, min( n, j+kb )
1276 bb( 1+i-j, j ) = b( i, j )
1281 CALL zhbgvx(
'V',
'I', uplo, n, ka, kb, ab, lda,
1282 $ bb, ldb, bp, max( 1, n ), vl, vu, il,
1283 $ iu, abstol, m, d, z, ldz, work, rwork,
1284 $ iwork( n+1 ), iwork, iinfo )
1285 IF( iinfo.NE.0 )
THEN
1286 WRITE( nounit, fmt = 9999 )
'ZHBGVX(V,I' //
1287 $ uplo //
')', iinfo, n, jtype, ioldsd
1289 IF( iinfo.LT.0 )
THEN
1292 result( ntest ) = ulpinv
1299 CALL zsgt01( ibtype, uplo, n, m, a, lda, b, ldb, z,
1300 $ ldz, d, work, rwork, result( ntest ) )
1309 ntestt = ntestt + ntest
1310 CALL dlafts(
'ZSG', n, n, jtype, ntest, result, ioldsd,
1311 $ thresh, nounit, nerrs )
1317 CALL dlasum(
'ZSG', nounit, nerrs, ntestt )
1321 9999
FORMAT(
' ZDRVSG: ', a,
' returned INFO=', i6,
'.', / 9x,
'N=',
1322 $ i6,
', JTYPE=', i6,
', ISEED=(', 3( i5,
',' ), i5,
')' )
subroutine xerbla(srname, info)
subroutine dlafts(type, m, n, imat, ntests, result, iseed, thresh, iounit, ie)
DLAFTS
subroutine dlasum(type, iounit, ie, nrun)
DLASUM
subroutine zhbgv(jobz, uplo, n, ka, kb, ab, ldab, bb, ldbb, w, z, ldz, work, rwork, info)
ZHBGV
subroutine zhbgvd(jobz, uplo, n, ka, kb, ab, ldab, bb, ldbb, w, z, ldz, work, lwork, rwork, lrwork, iwork, liwork, info)
ZHBGVD
subroutine zhbgvx(jobz, range, uplo, n, ka, kb, ab, ldab, bb, ldbb, q, ldq, vl, vu, il, iu, abstol, m, w, z, ldz, work, rwork, iwork, ifail, info)
ZHBGVX
subroutine zhegv(itype, jobz, uplo, n, a, lda, b, ldb, w, work, lwork, rwork, info)
ZHEGV
subroutine zhegvd(itype, jobz, uplo, n, a, lda, b, ldb, w, work, lwork, rwork, lrwork, iwork, liwork, info)
ZHEGVD
subroutine zhegvx(itype, jobz, range, uplo, n, a, lda, b, ldb, vl, vu, il, iu, abstol, m, w, z, ldz, work, lwork, rwork, iwork, ifail, info)
ZHEGVX
subroutine zhpgv(itype, jobz, uplo, n, ap, bp, w, z, ldz, work, rwork, info)
ZHPGV
subroutine zhpgvd(itype, jobz, uplo, n, ap, bp, w, z, ldz, work, lwork, rwork, lrwork, iwork, liwork, info)
ZHPGVD
subroutine zhpgvx(itype, jobz, range, uplo, n, ap, bp, vl, vu, il, iu, abstol, m, w, z, ldz, work, rwork, iwork, ifail, info)
ZHPGVX
subroutine zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.
subroutine zlaset(uplo, m, n, alpha, beta, a, lda)
ZLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine zdrvsg(nsizes, nn, ntypes, dotype, iseed, thresh, nounit, a, lda, b, ldb, d, z, ldz, ab, bb, ap, bp, work, nwork, rwork, lrwork, iwork, liwork, result, info)
ZDRVSG
subroutine zlatmr(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)
ZLATMR
subroutine zlatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
ZLATMS
subroutine zsgt01(itype, uplo, n, m, a, lda, b, ldb, z, ldz, d, work, rwork, result)
ZSGT01