608 SUBROUTINE dchkst2stg( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH,
609 $ NOUNIT, A, LDA, AP, SD, SE, D1, D2, D3, D4, D5,
610 $ WA1, WA2, WA3, WR, U, LDU, V, VP, TAU, Z, WORK,
611 $ LWORK, IWORK, LIWORK, RESULT, INFO )
618 INTEGER INFO, LDA, LDU, LIWORK, LWORK, NOUNIT, NSIZES,
620 DOUBLE PRECISION THRESH
624 INTEGER ISEED( 4 ), IWORK( * ), NN( * )
625 DOUBLE PRECISION A( LDA, * ), AP( * ), D1( * ), D2( * ),
626 $ d3( * ), d4( * ), d5( * ), result( * ),
627 $ sd( * ), se( * ), tau( * ), u( ldu, * ),
628 $ v( ldu, * ), vp( * ), wa1( * ), wa2( * ),
629 $ wa3( * ), work( * ), wr( * ), z( ldu, * )
635 DOUBLE PRECISION ZERO, ONE, TWO, EIGHT, TEN, HUN
636 PARAMETER ( ZERO = 0.0d0, one = 1.0d0, two = 2.0d0,
637 $ eight = 8.0d0, ten = 10.0d0, hun = 100.0d0 )
638 DOUBLE PRECISION HALF
639 parameter( half = one / two )
641 parameter( maxtyp = 21 )
643 parameter( srange = .false. )
645 parameter( srel = .false. )
648 LOGICAL BADNN, TRYRAC
649 INTEGER I, IINFO, IL, IMODE, ITEMP, ITYPE, IU, J, JC,
650 $ JR, JSIZE, JTYPE, LGN, LIWEDC, LOG2UI, LWEDC,
651 $ m, m2, m3, mtypes, n, nap, nblock, nerrs,
652 $ nmats, nmax, nsplit, ntest, ntestt, lh, lw
653 DOUBLE PRECISION ABSTOL, ANINV, ANORM, COND, OVFL, RTOVFL,
654 $ RTUNFL, TEMP1, TEMP2, TEMP3, TEMP4, ULP,
655 $ ULPINV, UNFL, VL, VU
658 INTEGER IDUMMA( 1 ), IOLDSD( 4 ), ISEED2( 4 ),
659 $ KMAGN( MAXTYP ), KMODE( MAXTYP ),
661 DOUBLE PRECISION DUMMA( 1 )
665 DOUBLE PRECISION DLAMCH, DLARND, DSXT1
666 EXTERNAL ILAENV, DLAMCH, DLARND, DSXT1
676 INTRINSIC abs, dble, int, log, max, min, sqrt
679 DATA ktype / 1, 2, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 8,
680 $ 8, 8, 9, 9, 9, 9, 9, 10 /
681 DATA kmagn / 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 2, 3, 1,
682 $ 2, 3, 1, 1, 1, 2, 3, 1 /
683 DATA kmode / 0, 0, 4, 3, 1, 4, 4, 4, 3, 1, 4, 4, 0,
684 $ 0, 0, 4, 3, 1, 4, 4, 3 /
702 nmax = max( nmax, nn( j ) )
707 nblock = ilaenv( 1,
'DSYTRD',
'L', nmax, -1, -1, -1 )
708 nblock = min( nmax, max( 1, nblock ) )
712 IF( nsizes.LT.0 )
THEN
714 ELSE IF( badnn )
THEN
716 ELSE IF( ntypes.LT.0 )
THEN
718 ELSE IF( lda.LT.nmax )
THEN
720 ELSE IF( ldu.LT.nmax )
THEN
722 ELSE IF( 2*max( 2, nmax )**2.GT.lwork )
THEN
727 CALL xerbla(
'DCHKST2STG', -info )
733 IF( nsizes.EQ.0 .OR. ntypes.EQ.0 )
738 unfl = dlamch(
'Safe minimum' )
740 ulp = dlamch(
'Epsilon' )*dlamch(
'Base' )
742 log2ui = int( log( ulpinv ) / log( two ) )
743 rtunfl = sqrt( unfl )
744 rtovfl = sqrt( ovfl )
749 iseed2( i ) = iseed( i )
754 DO 310 jsize = 1, nsizes
757 lgn = int( log( dble( n ) ) / log( two ) )
762 lwedc = 1 + 4*n + 2*n*lgn + 4*n**2
763 liwedc = 6 + 6*n + 5*n*lgn
768 nap = ( n*( n+1 ) ) / 2
769 aninv = one / dble( max( 1, n ) )
771 IF( nsizes.NE.1 )
THEN
772 mtypes = min( maxtyp, ntypes )
774 mtypes = min( maxtyp+1, ntypes )
777 DO 300 jtype = 1, mtypes
778 IF( .NOT.dotype( jtype ) )
784 ioldsd( j ) = iseed( j )
803 IF( mtypes.GT.maxtyp )
806 itype = ktype( jtype )
807 imode = kmode( jtype )
811 GO TO ( 40, 50, 60 )kmagn( jtype )
818 anorm = ( rtovfl*ulp )*aninv
822 anorm = rtunfl*n*ulpinv
827 CALL dlaset(
'Full', lda, n, zero, zero, a, lda )
829 IF( jtype.LE.15 )
THEN
832 cond = ulpinv*aninv / ten
839 IF( itype.EQ.1 )
THEN
842 ELSE IF( itype.EQ.2 )
THEN
850 ELSE IF( itype.EQ.4 )
THEN
854 CALL dlatms( n, n,
'S', iseed,
'S', work, imode, cond,
855 $ anorm, 0, 0,
'N', a, lda, work( n+1 ),
859 ELSE IF( itype.EQ.5 )
THEN
863 CALL dlatms( n, n,
'S', iseed,
'S', work, imode, cond,
864 $ anorm, n, n,
'N', a, lda, work( n+1 ),
867 ELSE IF( itype.EQ.7 )
THEN
871 CALL dlatmr( n, n,
'S', iseed,
'S', work, 6, one, one,
872 $
'T',
'N', work( n+1 ), 1, one,
873 $ work( 2*n+1 ), 1, one,
'N', idumma, 0, 0,
874 $ zero, anorm,
'NO', a, lda, iwork, iinfo )
876 ELSE IF( itype.EQ.8 )
THEN
880 CALL dlatmr( n, n,
'S', iseed,
'S', work, 6, one, one,
881 $
'T',
'N', work( n+1 ), 1, one,
882 $ work( 2*n+1 ), 1, one,
'N', idumma, n, n,
883 $ zero, anorm,
'NO', a, lda, iwork, iinfo )
885 ELSE IF( itype.EQ.9 )
THEN
889 CALL dlatms( n, n,
'S', iseed,
'P', work, imode, cond,
890 $ anorm, n, n,
'N', a, lda, work( n+1 ),
893 ELSE IF( itype.EQ.10 )
THEN
897 CALL dlatms( n, n,
'S', iseed,
'P', work, imode, cond,
898 $ anorm, 1, 1,
'N', a, lda, work( n+1 ),
901 temp1 = abs( a( i-1, i ) ) /
902 $ sqrt( abs( a( i-1, i-1 )*a( i, i ) ) )
903 IF( temp1.GT.half )
THEN
904 a( i-1, i ) = half*sqrt( abs( a( i-1, i-1 )*a( i,
906 a( i, i-1 ) = a( i-1, i )
915 IF( iinfo.NE.0 )
THEN
916 WRITE( nounit, fmt = 9999 )
'Generator', iinfo, n, jtype,
927 CALL dlacpy(
'U', n, n, a, lda, v, ldu )
930 CALL dsytrd(
'U', n, v, ldu, sd, se, tau, work, lwork,
933 IF( iinfo.NE.0 )
THEN
934 WRITE( nounit, fmt = 9999 )
'DSYTRD(U)', iinfo, n, jtype,
937 IF( iinfo.LT.0 )
THEN
945 CALL dlacpy(
'U', n, n, v, ldu, u, ldu )
948 CALL dorgtr(
'U', n, u, ldu, tau, work, lwork, iinfo )
949 IF( iinfo.NE.0 )
THEN
950 WRITE( nounit, fmt = 9999 )
'DORGTR(U)', iinfo, n, jtype,
953 IF( iinfo.LT.0 )
THEN
963 CALL dsyt21( 2,
'Upper', n, 1, a, lda, sd, se, u, ldu, v,
964 $ ldu, tau, work, result( 1 ) )
965 CALL dsyt21( 3,
'Upper', n, 1, a, lda, sd, se, u, ldu, v,
966 $ ldu, tau, work, result( 2 ) )
975 CALL dcopy( n, sd, 1, d1, 1 )
977 $
CALL dcopy( n-1, se, 1, work, 1 )
979 CALL dsteqr(
'N', n, d1, work, work( n+1 ), ldu,
980 $ work( n+1 ), iinfo )
981 IF( iinfo.NE.0 )
THEN
982 WRITE( nounit, fmt = 9999 )
'DSTEQR(N)', iinfo, n, jtype,
985 IF( iinfo.LT.0 )
THEN
998 CALL dlaset(
'Full', n, 1, zero, zero, sd, n )
999 CALL dlaset(
'Full', n, 1, zero, zero, se, n )
1000 CALL dlacpy(
"U", n, n, a, lda, v, ldu )
1004 $ work, lh, work( lh+1 ), lw, iinfo )
1008 CALL dcopy( n, sd, 1, d2, 1 )
1010 $
CALL dcopy( n-1, se, 1, work, 1 )
1012 CALL dsteqr(
'N', n, d2, work, work( n+1 ), ldu,
1013 $ work( n+1 ), iinfo )
1014 IF( iinfo.NE.0 )
THEN
1015 WRITE( nounit, fmt = 9999 )
'DSTEQR(N)', iinfo, n, jtype,
1018 IF( iinfo.LT.0 )
THEN
1021 result( 3 ) = ulpinv
1031 CALL dlaset(
'Full', n, 1, zero, zero, sd, n )
1032 CALL dlaset(
'Full', n, 1, zero, zero, se, n )
1033 CALL dlacpy(
"L", n, n, a, lda, v, ldu )
1035 $ work, lh, work( lh+1 ), lw, iinfo )
1039 CALL dcopy( n, sd, 1, d3, 1 )
1041 $
CALL dcopy( n-1, se, 1, work, 1 )
1043 CALL dsteqr(
'N', n, d3, work, work( n+1 ), ldu,
1044 $ work( n+1 ), iinfo )
1045 IF( iinfo.NE.0 )
THEN
1046 WRITE( nounit, fmt = 9999 )
'DSTEQR(N)', iinfo, n, jtype,
1049 IF( iinfo.LT.0 )
THEN
1052 result( 4 ) = ulpinv
1067 temp1 = max( temp1, abs( d1( j ) ), abs( d2( j ) ) )
1068 temp2 = max( temp2, abs( d1( j )-d2( j ) ) )
1069 temp3 = max( temp3, abs( d1( j ) ), abs( d3( j ) ) )
1070 temp4 = max( temp4, abs( d1( j )-d3( j ) ) )
1073 result( 3 ) = temp2 / max( unfl, ulp*max( temp1, temp2 ) )
1074 result( 4 ) = temp4 / max( unfl, ulp*max( temp3, temp4 ) )
1082 ap( i ) = a( jr, jc )
1088 CALL dcopy( nap, ap, 1, vp, 1 )
1091 CALL dsptrd(
'U', n, vp, sd, se, tau, iinfo )
1093 IF( iinfo.NE.0 )
THEN
1094 WRITE( nounit, fmt = 9999 )
'DSPTRD(U)', iinfo, n, jtype,
1097 IF( iinfo.LT.0 )
THEN
1100 result( 5 ) = ulpinv
1106 CALL dopgtr(
'U', n, vp, tau, u, ldu, work, iinfo )
1107 IF( iinfo.NE.0 )
THEN
1108 WRITE( nounit, fmt = 9999 )
'DOPGTR(U)', iinfo, n, jtype,
1111 IF( iinfo.LT.0 )
THEN
1114 result( 6 ) = ulpinv
1121 CALL dspt21( 2,
'Upper', n, 1, ap, sd, se, u, ldu, vp, tau,
1122 $ work, result( 5 ) )
1123 CALL dspt21( 3,
'Upper', n, 1, ap, sd, se, u, ldu, vp, tau,
1124 $ work, result( 6 ) )
1132 ap( i ) = a( jr, jc )
1138 CALL dcopy( nap, ap, 1, vp, 1 )
1141 CALL dsptrd(
'L', n, vp, sd, se, tau, iinfo )
1143 IF( iinfo.NE.0 )
THEN
1144 WRITE( nounit, fmt = 9999 )
'DSPTRD(L)', iinfo, n, jtype,
1147 IF( iinfo.LT.0 )
THEN
1150 result( 7 ) = ulpinv
1156 CALL dopgtr(
'L', n, vp, tau, u, ldu, work, iinfo )
1157 IF( iinfo.NE.0 )
THEN
1158 WRITE( nounit, fmt = 9999 )
'DOPGTR(L)', iinfo, n, jtype,
1161 IF( iinfo.LT.0 )
THEN
1164 result( 8 ) = ulpinv
1169 CALL dspt21( 2,
'Lower', n, 1, ap, sd, se, u, ldu, vp, tau,
1170 $ work, result( 7 ) )
1171 CALL dspt21( 3,
'Lower', n, 1, ap, sd, se, u, ldu, vp, tau,
1172 $ work, result( 8 ) )
1178 CALL dcopy( n, sd, 1, d1, 1 )
1180 $
CALL dcopy( n-1, se, 1, work, 1 )
1181 CALL dlaset(
'Full', n, n, zero, one, z, ldu )
1184 CALL dsteqr(
'V', n, d1, work, z, ldu, work( n+1 ), iinfo )
1185 IF( iinfo.NE.0 )
THEN
1186 WRITE( nounit, fmt = 9999 )
'DSTEQR(V)', iinfo, n, jtype,
1189 IF( iinfo.LT.0 )
THEN
1192 result( 9 ) = ulpinv
1199 CALL dcopy( n, sd, 1, d2, 1 )
1201 $
CALL dcopy( n-1, se, 1, work, 1 )
1204 CALL dsteqr(
'N', n, d2, work, work( n+1 ), ldu,
1205 $ work( n+1 ), iinfo )
1206 IF( iinfo.NE.0 )
THEN
1207 WRITE( nounit, fmt = 9999 )
'DSTEQR(N)', iinfo, n, jtype,
1210 IF( iinfo.LT.0 )
THEN
1213 result( 11 ) = ulpinv
1220 CALL dcopy( n, sd, 1, d3, 1 )
1222 $
CALL dcopy( n-1, se, 1, work, 1 )
1225 CALL dsterf( n, d3, work, iinfo )
1226 IF( iinfo.NE.0 )
THEN
1227 WRITE( nounit, fmt = 9999 )
'DSTERF', iinfo, n, jtype,
1230 IF( iinfo.LT.0 )
THEN
1233 result( 12 ) = ulpinv
1240 CALL dstt21( n, 0, sd, se, d1, dumma, z, ldu, work,
1251 temp1 = max( temp1, abs( d1( j ) ), abs( d2( j ) ) )
1252 temp2 = max( temp2, abs( d1( j )-d2( j ) ) )
1253 temp3 = max( temp3, abs( d1( j ) ), abs( d3( j ) ) )
1254 temp4 = max( temp4, abs( d1( j )-d3( j ) ) )
1257 result( 11 ) = temp2 / max( unfl, ulp*max( temp1, temp2 ) )
1258 result( 12 ) = temp4 / max( unfl, ulp*max( temp3, temp4 ) )
1264 temp1 = thresh*( half-ulp )
1266 DO 160 j = 0, log2ui
1267 CALL dstech( n, sd, se, d1, temp1, work, iinfo )
1274 result( 13 ) = temp1
1279 IF( jtype.GT.15 )
THEN
1283 CALL dcopy( n, sd, 1, d4, 1 )
1285 $
CALL dcopy( n-1, se, 1, work, 1 )
1286 CALL dlaset(
'Full', n, n, zero, one, z, ldu )
1289 CALL dpteqr(
'V', n, d4, work, z, ldu, work( n+1 ),
1291 IF( iinfo.NE.0 )
THEN
1292 WRITE( nounit, fmt = 9999 )
'DPTEQR(V)', iinfo, n,
1295 IF( iinfo.LT.0 )
THEN
1298 result( 14 ) = ulpinv
1305 CALL dstt21( n, 0, sd, se, d4, dumma, z, ldu, work,
1310 CALL dcopy( n, sd, 1, d5, 1 )
1312 $
CALL dcopy( n-1, se, 1, work, 1 )
1315 CALL dpteqr(
'N', n, d5, work, z, ldu, work( n+1 ),
1317 IF( iinfo.NE.0 )
THEN
1318 WRITE( nounit, fmt = 9999 )
'DPTEQR(N)', iinfo, n,
1321 IF( iinfo.LT.0 )
THEN
1324 result( 16 ) = ulpinv
1334 temp1 = max( temp1, abs( d4( j ) ), abs( d5( j ) ) )
1335 temp2 = max( temp2, abs( d4( j )-d5( j ) ) )
1338 result( 16 ) = temp2 / max( unfl,
1339 $ hun*ulp*max( temp1, temp2 ) )
1355 IF( jtype.EQ.21 )
THEN
1357 abstol = unfl + unfl
1358 CALL dstebz(
'A',
'E', n, vl, vu, il, iu, abstol, sd, se,
1359 $ m, nsplit, wr, iwork( 1 ), iwork( n+1 ),
1360 $ work, iwork( 2*n+1 ), iinfo )
1361 IF( iinfo.NE.0 )
THEN
1362 WRITE( nounit, fmt = 9999 )
'DSTEBZ(A,rel)', iinfo, n,
1365 IF( iinfo.LT.0 )
THEN
1368 result( 17 ) = ulpinv
1375 temp2 = two*( two*n-one )*ulp*( one+eight*half**2 ) /
1380 temp1 = max( temp1, abs( d4( j )-wr( n-j+1 ) ) /
1381 $ ( abstol+abs( d4( j ) ) ) )
1384 result( 17 ) = temp1 / temp2
1392 abstol = unfl + unfl
1393 CALL dstebz(
'A',
'E', n, vl, vu, il, iu, abstol, sd, se, m,
1394 $ nsplit, wa1, iwork( 1 ), iwork( n+1 ), work,
1395 $ iwork( 2*n+1 ), iinfo )
1396 IF( iinfo.NE.0 )
THEN
1397 WRITE( nounit, fmt = 9999 )
'DSTEBZ(A)', iinfo, n, jtype,
1400 IF( iinfo.LT.0 )
THEN
1403 result( 18 ) = ulpinv
1413 temp1 = max( temp1, abs( d3( j ) ), abs( wa1( j ) ) )
1414 temp2 = max( temp2, abs( d3( j )-wa1( j ) ) )
1417 result( 18 ) = temp2 / max( unfl, ulp*max( temp1, temp2 ) )
1427 il = 1 + ( n-1 )*int( dlarnd( 1, iseed2 ) )
1428 iu = 1 + ( n-1 )*int( dlarnd( 1, iseed2 ) )
1436 CALL dstebz(
'I',
'E', n, vl, vu, il, iu, abstol, sd, se,
1437 $ m2, nsplit, wa2, iwork( 1 ), iwork( n+1 ),
1438 $ work, iwork( 2*n+1 ), iinfo )
1439 IF( iinfo.NE.0 )
THEN
1440 WRITE( nounit, fmt = 9999 )
'DSTEBZ(I)', iinfo, n, jtype,
1443 IF( iinfo.LT.0 )
THEN
1446 result( 19 ) = ulpinv
1456 vl = wa1( il ) - max( half*( wa1( il )-wa1( il-1 ) ),
1457 $ ulp*anorm, two*rtunfl )
1459 vl = wa1( 1 ) - max( half*( wa1( n )-wa1( 1 ) ),
1460 $ ulp*anorm, two*rtunfl )
1463 vu = wa1( iu ) + max( half*( wa1( iu+1 )-wa1( iu ) ),
1464 $ ulp*anorm, two*rtunfl )
1466 vu = wa1( n ) + max( half*( wa1( n )-wa1( 1 ) ),
1467 $ ulp*anorm, two*rtunfl )
1474 CALL dstebz(
'V',
'E', n, vl, vu, il, iu, abstol, sd, se,
1475 $ m3, nsplit, wa3, iwork( 1 ), iwork( n+1 ),
1476 $ work, iwork( 2*n+1 ), iinfo )
1477 IF( iinfo.NE.0 )
THEN
1478 WRITE( nounit, fmt = 9999 )
'DSTEBZ(V)', iinfo, n, jtype,
1481 IF( iinfo.LT.0 )
THEN
1484 result( 19 ) = ulpinv
1489 IF( m3.EQ.0 .AND. n.NE.0 )
THEN
1490 result( 19 ) = ulpinv
1496 temp1 = dsxt1( 1, wa2, m2, wa3, m3, abstol, ulp, unfl )
1497 temp2 = dsxt1( 1, wa3, m3, wa2, m2, abstol, ulp, unfl )
1499 temp3 = max( abs( wa1( n ) ), abs( wa1( 1 ) ) )
1504 result( 19 ) = ( temp1+temp2 ) / max( unfl, temp3*ulp )
1511 CALL dstebz(
'A',
'B', n, vl, vu, il, iu, abstol, sd, se, m,
1512 $ nsplit, wa1, iwork( 1 ), iwork( n+1 ), work,
1513 $ iwork( 2*n+1 ), iinfo )
1514 IF( iinfo.NE.0 )
THEN
1515 WRITE( nounit, fmt = 9999 )
'DSTEBZ(A,B)', iinfo, n,
1518 IF( iinfo.LT.0 )
THEN
1521 result( 20 ) = ulpinv
1522 result( 21 ) = ulpinv
1527 CALL dstein( n, sd, se, m, wa1, iwork( 1 ), iwork( n+1 ), z,
1528 $ ldu, work, iwork( 2*n+1 ), iwork( 3*n+1 ),
1530 IF( iinfo.NE.0 )
THEN
1531 WRITE( nounit, fmt = 9999 )
'DSTEIN', iinfo, n, jtype,
1534 IF( iinfo.LT.0 )
THEN
1537 result( 20 ) = ulpinv
1538 result( 21 ) = ulpinv
1545 CALL dstt21( n, 0, sd, se, wa1, dumma, z, ldu, work,
1552 CALL dcopy( n, sd, 1, d1, 1 )
1554 $
CALL dcopy( n-1, se, 1, work, 1 )
1555 CALL dlaset(
'Full', n, n, zero, one, z, ldu )
1558 CALL dstedc(
'I', n, d1, work, z, ldu, work( n+1 ), lwedc-n,
1559 $ iwork, liwedc, iinfo )
1560 IF( iinfo.NE.0 )
THEN
1561 WRITE( nounit, fmt = 9999 )
'DSTEDC(I)', iinfo, n, jtype,
1564 IF( iinfo.LT.0 )
THEN
1567 result( 22 ) = ulpinv
1574 CALL dstt21( n, 0, sd, se, d1, dumma, z, ldu, work,
1581 CALL dcopy( n, sd, 1, d1, 1 )
1583 $
CALL dcopy( n-1, se, 1, work, 1 )
1584 CALL dlaset(
'Full', n, n, zero, one, z, ldu )
1587 CALL dstedc(
'V', n, d1, work, z, ldu, work( n+1 ), lwedc-n,
1588 $ iwork, liwedc, iinfo )
1589 IF( iinfo.NE.0 )
THEN
1590 WRITE( nounit, fmt = 9999 )
'DSTEDC(V)', iinfo, n, jtype,
1593 IF( iinfo.LT.0 )
THEN
1596 result( 24 ) = ulpinv
1603 CALL dstt21( n, 0, sd, se, d1, dumma, z, ldu, work,
1610 CALL dcopy( n, sd, 1, d2, 1 )
1612 $
CALL dcopy( n-1, se, 1, work, 1 )
1613 CALL dlaset(
'Full', n, n, zero, one, z, ldu )
1616 CALL dstedc(
'N', n, d2, work, z, ldu, work( n+1 ), lwedc-n,
1617 $ iwork, liwedc, iinfo )
1618 IF( iinfo.NE.0 )
THEN
1619 WRITE( nounit, fmt = 9999 )
'DSTEDC(N)', iinfo, n, jtype,
1622 IF( iinfo.LT.0 )
THEN
1625 result( 26 ) = ulpinv
1636 temp1 = max( temp1, abs( d1( j ) ), abs( d2( j ) ) )
1637 temp2 = max( temp2, abs( d1( j )-d2( j ) ) )
1640 result( 26 ) = temp2 / max( unfl, ulp*max( temp1, temp2 ) )
1644 IF( ilaenv( 10,
'DSTEMR',
'VA', 1, 0, 0, 0 ).EQ.1 .AND.
1645 $ ilaenv( 11,
'DSTEMR',
'VA', 1, 0, 0, 0 ).EQ.1 )
THEN
1656 IF( jtype.EQ.21 .AND. srel )
THEN
1658 abstol = unfl + unfl
1659 CALL dstemr(
'V',
'A', n, sd, se, vl, vu, il, iu,
1660 $ m, wr, z, ldu, n, iwork( 1 ), tryrac,
1661 $ work, lwork, iwork( 2*n+1 ), lwork-2*n,
1663 IF( iinfo.NE.0 )
THEN
1664 WRITE( nounit, fmt = 9999 )
'DSTEMR(V,A,rel)',
1665 $ iinfo, n, jtype, ioldsd
1667 IF( iinfo.LT.0 )
THEN
1670 result( 27 ) = ulpinv
1677 temp2 = two*( two*n-one )*ulp*( one+eight*half**2 ) /
1682 temp1 = max( temp1, abs( d4( j )-wr( n-j+1 ) ) /
1683 $ ( abstol+abs( d4( j ) ) ) )
1686 result( 27 ) = temp1 / temp2
1688 il = 1 + ( n-1 )*int( dlarnd( 1, iseed2 ) )
1689 iu = 1 + ( n-1 )*int( dlarnd( 1, iseed2 ) )
1698 abstol = unfl + unfl
1699 CALL dstemr(
'V',
'I', n, sd, se, vl, vu, il, iu,
1700 $ m, wr, z, ldu, n, iwork( 1 ), tryrac,
1701 $ work, lwork, iwork( 2*n+1 ),
1702 $ lwork-2*n, iinfo )
1704 IF( iinfo.NE.0 )
THEN
1705 WRITE( nounit, fmt = 9999 )
'DSTEMR(V,I,rel)',
1706 $ iinfo, n, jtype, ioldsd
1708 IF( iinfo.LT.0 )
THEN
1711 result( 28 ) = ulpinv
1718 temp2 = two*( two*n-one )*ulp*
1719 $ ( one+eight*half**2 ) / ( one-half )**4
1723 temp1 = max( temp1, abs( wr( j-il+1 )-d4( n-j+
1724 $ 1 ) ) / ( abstol+abs( wr( j-il+1 ) ) ) )
1727 result( 28 ) = temp1 / temp2
1740 CALL dcopy( n, sd, 1, d5, 1 )
1742 $
CALL dcopy( n-1, se, 1, work, 1 )
1743 CALL dlaset(
'Full', n, n, zero, one, z, ldu )
1747 il = 1 + ( n-1 )*int( dlarnd( 1, iseed2 ) )
1748 iu = 1 + ( n-1 )*int( dlarnd( 1, iseed2 ) )
1754 CALL dstemr(
'V',
'I', n, d5, work, vl, vu, il, iu,
1755 $ m, d1, z, ldu, n, iwork( 1 ), tryrac,
1756 $ work( n+1 ), lwork-n, iwork( 2*n+1 ),
1757 $ liwork-2*n, iinfo )
1758 IF( iinfo.NE.0 )
THEN
1759 WRITE( nounit, fmt = 9999 )
'DSTEMR(V,I)', iinfo,
1762 IF( iinfo.LT.0 )
THEN
1765 result( 29 ) = ulpinv
1772 CALL dstt22( n, m, 0, sd, se, d1, dumma, z, ldu, work,
1779 CALL dcopy( n, sd, 1, d5, 1 )
1781 $
CALL dcopy( n-1, se, 1, work, 1 )
1784 CALL dstemr(
'N',
'I', n, d5, work, vl, vu, il, iu,
1785 $ m, d2, z, ldu, n, iwork( 1 ), tryrac,
1786 $ work( n+1 ), lwork-n, iwork( 2*n+1 ),
1787 $ liwork-2*n, iinfo )
1788 IF( iinfo.NE.0 )
THEN
1789 WRITE( nounit, fmt = 9999 )
'DSTEMR(N,I)', iinfo,
1792 IF( iinfo.LT.0 )
THEN
1795 result( 31 ) = ulpinv
1805 DO 240 j = 1, iu - il + 1
1806 temp1 = max( temp1, abs( d1( j ) ),
1808 temp2 = max( temp2, abs( d1( j )-d2( j ) ) )
1811 result( 31 ) = temp2 / max( unfl,
1812 $ ulp*max( temp1, temp2 ) )
1818 CALL dcopy( n, sd, 1, d5, 1 )
1820 $
CALL dcopy( n-1, se, 1, work, 1 )
1821 CALL dlaset(
'Full', n, n, zero, one, z, ldu )
1827 vl = d2( il ) - max( half*
1828 $ ( d2( il )-d2( il-1 ) ), ulp*anorm,
1831 vl = d2( 1 ) - max( half*( d2( n )-d2( 1 ) ),
1832 $ ulp*anorm, two*rtunfl )
1835 vu = d2( iu ) + max( half*
1836 $ ( d2( iu+1 )-d2( iu ) ), ulp*anorm,
1839 vu = d2( n ) + max( half*( d2( n )-d2( 1 ) ),
1840 $ ulp*anorm, two*rtunfl )
1847 CALL dstemr(
'V',
'V', n, d5, work, vl, vu, il, iu,
1848 $ m, d1, z, ldu, n, iwork( 1 ), tryrac,
1849 $ work( n+1 ), lwork-n, iwork( 2*n+1 ),
1850 $ liwork-2*n, iinfo )
1851 IF( iinfo.NE.0 )
THEN
1852 WRITE( nounit, fmt = 9999 )
'DSTEMR(V,V)', iinfo,
1855 IF( iinfo.LT.0 )
THEN
1858 result( 32 ) = ulpinv
1865 CALL dstt22( n, m, 0, sd, se, d1, dumma, z, ldu, work,
1872 CALL dcopy( n, sd, 1, d5, 1 )
1874 $
CALL dcopy( n-1, se, 1, work, 1 )
1877 CALL dstemr(
'N',
'V', n, d5, work, vl, vu, il, iu,
1878 $ m, d2, z, ldu, n, iwork( 1 ), tryrac,
1879 $ work( n+1 ), lwork-n, iwork( 2*n+1 ),
1880 $ liwork-2*n, iinfo )
1881 IF( iinfo.NE.0 )
THEN
1882 WRITE( nounit, fmt = 9999 )
'DSTEMR(N,V)', iinfo,
1885 IF( iinfo.LT.0 )
THEN
1888 result( 34 ) = ulpinv
1898 DO 250 j = 1, iu - il + 1
1899 temp1 = max( temp1, abs( d1( j ) ),
1901 temp2 = max( temp2, abs( d1( j )-d2( j ) ) )
1904 result( 34 ) = temp2 / max( unfl,
1905 $ ulp*max( temp1, temp2 ) )
1919 CALL dcopy( n, sd, 1, d5, 1 )
1921 $
CALL dcopy( n-1, se, 1, work, 1 )
1925 CALL dstemr(
'V',
'A', n, d5, work, vl, vu, il, iu,
1926 $ m, d1, z, ldu, n, iwork( 1 ), tryrac,
1927 $ work( n+1 ), lwork-n, iwork( 2*n+1 ),
1928 $ liwork-2*n, iinfo )
1929 IF( iinfo.NE.0 )
THEN
1930 WRITE( nounit, fmt = 9999 )
'DSTEMR(V,A)', iinfo, n,
1933 IF( iinfo.LT.0 )
THEN
1936 result( 35 ) = ulpinv
1943 CALL dstt22( n, m, 0, sd, se, d1, dumma, z, ldu, work, m,
1950 CALL dcopy( n, sd, 1, d5, 1 )
1952 $
CALL dcopy( n-1, se, 1, work, 1 )
1955 CALL dstemr(
'N',
'A', n, d5, work, vl, vu, il, iu,
1956 $ m, d2, z, ldu, n, iwork( 1 ), tryrac,
1957 $ work( n+1 ), lwork-n, iwork( 2*n+1 ),
1958 $ liwork-2*n, iinfo )
1959 IF( iinfo.NE.0 )
THEN
1960 WRITE( nounit, fmt = 9999 )
'DSTEMR(N,A)', iinfo, n,
1963 IF( iinfo.LT.0 )
THEN
1966 result( 37 ) = ulpinv
1977 temp1 = max( temp1, abs( d1( j ) ), abs( d2( j ) ) )
1978 temp2 = max( temp2, abs( d1( j )-d2( j ) ) )
1981 result( 37 ) = temp2 / max( unfl,
1982 $ ulp*max( temp1, temp2 ) )
1986 ntestt = ntestt + ntest
1992 DO 290 jr = 1, ntest
1993 IF( result( jr ).GE.thresh )
THEN
1998 IF( nerrs.EQ.0 )
THEN
1999 WRITE( nounit, fmt = 9998 )
'DST'
2000 WRITE( nounit, fmt = 9997 )
2001 WRITE( nounit, fmt = 9996 )
2002 WRITE( nounit, fmt = 9995 )
'Symmetric'
2003 WRITE( nounit, fmt = 9994 )
2007 WRITE( nounit, fmt = 9988 )
2010 WRITE( nounit, fmt = 9990 )n, ioldsd, jtype, jr,
2019 CALL dlasum(
'DST', nounit, nerrs, ntestt )
2022 9999
FORMAT(
' DCHKST2STG: ', a,
' returned INFO=', i6,
'.', / 9x,
2023 $
'N=', i6,
', JTYPE=', i6,
', ISEED=(', 3( i5,
',' ), i5,
')' )
2025 9998
FORMAT( / 1x, a3,
' -- Real Symmetric eigenvalue problem' )
2026 9997
FORMAT(
' Matrix types (see DCHKST2STG for details): ' )
2028 9996
FORMAT( /
' Special Matrices:',
2029 $ /
' 1=Zero matrix. ',
2030 $
' 5=Diagonal: clustered entries.',
2031 $ /
' 2=Identity matrix. ',
2032 $
' 6=Diagonal: large, evenly spaced.',
2033 $ /
' 3=Diagonal: evenly spaced entries. ',
2034 $
' 7=Diagonal: small, evenly spaced.',
2035 $ /
' 4=Diagonal: geometr. spaced entries.' )
2036 9995
FORMAT(
' Dense ', a,
' Matrices:',
2037 $ /
' 8=Evenly spaced eigenvals. ',
2038 $
' 12=Small, evenly spaced eigenvals.',
2039 $ /
' 9=Geometrically spaced eigenvals. ',
2040 $
' 13=Matrix with random O(1) entries.',
2041 $ /
' 10=Clustered eigenvalues. ',
2042 $
' 14=Matrix with large random entries.',
2043 $ /
' 11=Large, evenly spaced eigenvals. ',
2044 $
' 15=Matrix with small random entries.' )
2045 9994
FORMAT(
' 16=Positive definite, evenly spaced eigenvalues',
2046 $ /
' 17=Positive definite, geometrically spaced eigenvlaues',
2047 $ /
' 18=Positive definite, clustered eigenvalues',
2048 $ /
' 19=Positive definite, small evenly spaced eigenvalues',
2049 $ /
' 20=Positive definite, large evenly spaced eigenvalues',
2050 $ /
' 21=Diagonally dominant tridiagonal, geometrically',
2051 $
' spaced eigenvalues' )
2053 9990
FORMAT(
' N=', i5,
', seed=', 4( i4,
',' ),
' type ', i2,
2054 $
', test(', i2,
')=', g10.3 )
2056 9988
FORMAT( /
'Test performed: see DCHKST2STG for details.', / )
subroutine xerbla(srname, info)
subroutine dchkst2stg(nsizes, nn, ntypes, dotype, iseed, thresh, nounit, a, lda, ap, sd, se, d1, d2, d3, d4, d5, wa1, wa2, wa3, wr, u, ldu, v, vp, tau, z, work, lwork, iwork, liwork, result, info)
DCHKST2STG
subroutine dlasum(type, iounit, ie, nrun)
DLASUM
subroutine dlatmr(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)
DLATMR
subroutine dlatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
DLATMS
subroutine dspt21(itype, uplo, n, kband, ap, d, e, u, ldu, vp, tau, work, result)
DSPT21
subroutine dstech(n, a, b, eig, tol, work, info)
DSTECH
subroutine dstt21(n, kband, ad, ae, sd, se, u, ldu, work, result)
DSTT21
subroutine dstt22(n, m, kband, ad, ae, sd, se, u, ldu, work, ldwork, result)
DSTT22
subroutine dsyt21(itype, uplo, n, kband, a, lda, d, e, u, ldu, v, ldv, tau, work, result)
DSYT21
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
subroutine dsytrd_2stage(vect, uplo, n, a, lda, d, e, tau, hous2, lhous2, work, lwork, info)
DSYTRD_2STAGE
subroutine dsytrd(uplo, n, a, lda, d, e, tau, work, lwork, info)
DSYTRD
subroutine dsptrd(uplo, n, ap, d, e, tau, info)
DSPTRD
subroutine dlacpy(uplo, m, n, a, lda, b, ldb)
DLACPY copies all or part of one two-dimensional array to another.
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.
subroutine dpteqr(compz, n, d, e, z, ldz, work, info)
DPTEQR
subroutine dstebz(range, order, n, vl, vu, il, iu, abstol, d, e, m, nsplit, w, iblock, isplit, work, iwork, info)
DSTEBZ
subroutine dstedc(compz, n, d, e, z, ldz, work, lwork, iwork, liwork, info)
DSTEDC
subroutine dstein(n, d, e, m, w, iblock, isplit, z, ldz, work, iwork, ifail, info)
DSTEIN
subroutine dstemr(jobz, range, n, d, e, vl, vu, il, iu, m, w, z, ldz, nzc, isuppz, tryrac, work, lwork, iwork, liwork, info)
DSTEMR
subroutine dsteqr(compz, n, d, e, z, ldz, work, info)
DSTEQR
subroutine dsterf(n, d, e, info)
DSTERF
subroutine dorgtr(uplo, n, a, lda, tau, work, lwork, info)
DORGTR
subroutine dopgtr(uplo, n, ap, tau, q, ldq, work, info)
DOPGTR