608 SUBROUTINE schkst2stg( 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,
624 INTEGER ISEED( 4 ), IWORK( * ), NN( * )
625 REAL 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 REAL ZERO, ONE, TWO, EIGHT, TEN, HUN
636 PARAMETER ( ZERO = 0.0e0, one = 1.0e0, two = 2.0e0,
637 $ eight = 8.0e0, ten = 10.0e0, hun = 100.0e0 )
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 REAL 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 ),
665 REAL SLAMCH, SLARND, SSXT1
666 EXTERNAL ILAENV, SLAMCH, SLARND, SSXT1
676 INTRINSIC abs, real, 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,
'SSYTRD',
'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(
'SCHKST2STG', -info )
733 IF( nsizes.EQ.0 .OR. ntypes.EQ.0 )
738 unfl = slamch(
'Safe minimum' )
740 ulp = slamch(
'Epsilon' )*slamch(
'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( real( 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 / real( 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 slaset(
'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 slatms( 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 slatms( 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 slatmr( 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 slatmr( 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 slatms( 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 slatms( 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 slacpy(
'U', n, n, a, lda, v, ldu )
930 CALL ssytrd(
'U', n, v, ldu, sd, se, tau, work, lwork,
933 IF( iinfo.NE.0 )
THEN
934 WRITE( nounit, fmt = 9999 )
'SSYTRD(U)', iinfo, n, jtype,
937 IF( iinfo.LT.0 )
THEN
945 CALL slacpy(
'U', n, n, v, ldu, u, ldu )
948 CALL sorgtr(
'U', n, u, ldu, tau, work, lwork, iinfo )
949 IF( iinfo.NE.0 )
THEN
950 WRITE( nounit, fmt = 9999 )
'SORGTR(U)', iinfo, n, jtype,
953 IF( iinfo.LT.0 )
THEN
963 CALL ssyt21( 2,
'Upper', n, 1, a, lda, sd, se, u, ldu, v,
964 $ ldu, tau, work, result( 1 ) )
965 CALL ssyt21( 3,
'Upper', n, 1, a, lda, sd, se, u, ldu, v,
966 $ ldu, tau, work, result( 2 ) )
975 CALL scopy( n, sd, 1, d1, 1 )
977 $
CALL scopy( n-1, se, 1, work, 1 )
979 CALL ssteqr(
'N', n, d1, work, work( n+1 ), ldu,
980 $ work( n+1 ), iinfo )
981 IF( iinfo.NE.0 )
THEN
982 WRITE( nounit, fmt = 9999 )
'SSTEQR(N)', iinfo, n, jtype,
985 IF( iinfo.LT.0 )
THEN
998 CALL slaset(
'Full', n, 1, zero, zero, sd, n )
999 CALL slaset(
'Full', n, 1, zero, zero, se, n )
1000 CALL slacpy(
"U", n, n, a, lda, v, ldu )
1004 $ work, lh, work( lh+1 ), lw, iinfo )
1008 CALL scopy( n, sd, 1, d2, 1 )
1010 $
CALL scopy( n-1, se, 1, work, 1 )
1012 CALL ssteqr(
'N', n, d2, work, work( n+1 ), ldu,
1013 $ work( n+1 ), iinfo )
1014 IF( iinfo.NE.0 )
THEN
1015 WRITE( nounit, fmt = 9999 )
'SSTEQR(N)', iinfo, n, jtype,
1018 IF( iinfo.LT.0 )
THEN
1021 result( 3 ) = ulpinv
1031 CALL slaset(
'Full', n, 1, zero, zero, sd, n )
1032 CALL slaset(
'Full', n, 1, zero, zero, se, n )
1033 CALL slacpy(
"L", n, n, a, lda, v, ldu )
1035 $ work, lh, work( lh+1 ), lw, iinfo )
1039 CALL scopy( n, sd, 1, d3, 1 )
1041 $
CALL scopy( n-1, se, 1, work, 1 )
1043 CALL ssteqr(
'N', n, d3, work, work( n+1 ), ldu,
1044 $ work( n+1 ), iinfo )
1045 IF( iinfo.NE.0 )
THEN
1046 WRITE( nounit, fmt = 9999 )
'SSTEQR(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 scopy( nap, ap, 1, vp, 1 )
1091 CALL ssptrd(
'U', n, vp, sd, se, tau, iinfo )
1093 IF( iinfo.NE.0 )
THEN
1094 WRITE( nounit, fmt = 9999 )
'SSPTRD(U)', iinfo, n, jtype,
1097 IF( iinfo.LT.0 )
THEN
1100 result( 5 ) = ulpinv
1106 CALL sopgtr(
'U', n, vp, tau, u, ldu, work, iinfo )
1107 IF( iinfo.NE.0 )
THEN
1108 WRITE( nounit, fmt = 9999 )
'SOPGTR(U)', iinfo, n, jtype,
1111 IF( iinfo.LT.0 )
THEN
1114 result( 6 ) = ulpinv
1121 CALL sspt21( 2,
'Upper', n, 1, ap, sd, se, u, ldu, vp, tau,
1122 $ work, result( 5 ) )
1123 CALL sspt21( 3,
'Upper', n, 1, ap, sd, se, u, ldu, vp, tau,
1124 $ work, result( 6 ) )
1132 ap( i ) = a( jr, jc )
1138 CALL scopy( nap, ap, 1, vp, 1 )
1141 CALL ssptrd(
'L', n, vp, sd, se, tau, iinfo )
1143 IF( iinfo.NE.0 )
THEN
1144 WRITE( nounit, fmt = 9999 )
'SSPTRD(L)', iinfo, n, jtype,
1147 IF( iinfo.LT.0 )
THEN
1150 result( 7 ) = ulpinv
1156 CALL sopgtr(
'L', n, vp, tau, u, ldu, work, iinfo )
1157 IF( iinfo.NE.0 )
THEN
1158 WRITE( nounit, fmt = 9999 )
'SOPGTR(L)', iinfo, n, jtype,
1161 IF( iinfo.LT.0 )
THEN
1164 result( 8 ) = ulpinv
1169 CALL sspt21( 2,
'Lower', n, 1, ap, sd, se, u, ldu, vp, tau,
1170 $ work, result( 7 ) )
1171 CALL sspt21( 3,
'Lower', n, 1, ap, sd, se, u, ldu, vp, tau,
1172 $ work, result( 8 ) )
1178 CALL scopy( n, sd, 1, d1, 1 )
1180 $
CALL scopy( n-1, se, 1, work, 1 )
1181 CALL slaset(
'Full', n, n, zero, one, z, ldu )
1184 CALL ssteqr(
'V', n, d1, work, z, ldu, work( n+1 ), iinfo )
1185 IF( iinfo.NE.0 )
THEN
1186 WRITE( nounit, fmt = 9999 )
'SSTEQR(V)', iinfo, n, jtype,
1189 IF( iinfo.LT.0 )
THEN
1192 result( 9 ) = ulpinv
1199 CALL scopy( n, sd, 1, d2, 1 )
1201 $
CALL scopy( n-1, se, 1, work, 1 )
1204 CALL ssteqr(
'N', n, d2, work, work( n+1 ), ldu,
1205 $ work( n+1 ), iinfo )
1206 IF( iinfo.NE.0 )
THEN
1207 WRITE( nounit, fmt = 9999 )
'SSTEQR(N)', iinfo, n, jtype,
1210 IF( iinfo.LT.0 )
THEN
1213 result( 11 ) = ulpinv
1220 CALL scopy( n, sd, 1, d3, 1 )
1222 $
CALL scopy( n-1, se, 1, work, 1 )
1225 CALL ssterf( n, d3, work, iinfo )
1226 IF( iinfo.NE.0 )
THEN
1227 WRITE( nounit, fmt = 9999 )
'SSTERF', iinfo, n, jtype,
1230 IF( iinfo.LT.0 )
THEN
1233 result( 12 ) = ulpinv
1240 CALL sstt21( 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 sstech( n, sd, se, d1, temp1, work, iinfo )
1274 result( 13 ) = temp1
1279 IF( jtype.GT.15 )
THEN
1283 CALL scopy( n, sd, 1, d4, 1 )
1285 $
CALL scopy( n-1, se, 1, work, 1 )
1286 CALL slaset(
'Full', n, n, zero, one, z, ldu )
1289 CALL spteqr(
'V', n, d4, work, z, ldu, work( n+1 ),
1291 IF( iinfo.NE.0 )
THEN
1292 WRITE( nounit, fmt = 9999 )
'SPTEQR(V)', iinfo, n,
1295 IF( iinfo.LT.0 )
THEN
1298 result( 14 ) = ulpinv
1305 CALL sstt21( n, 0, sd, se, d4, dumma, z, ldu, work,
1310 CALL scopy( n, sd, 1, d5, 1 )
1312 $
CALL scopy( n-1, se, 1, work, 1 )
1315 CALL spteqr(
'N', n, d5, work, z, ldu, work( n+1 ),
1317 IF( iinfo.NE.0 )
THEN
1318 WRITE( nounit, fmt = 9999 )
'SPTEQR(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 sstebz(
'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 )
'SSTEBZ(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 sstebz(
'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 )
'SSTEBZ(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( slarnd( 1, iseed2 ) )
1428 iu = 1 + ( n-1 )*int( slarnd( 1, iseed2 ) )
1436 CALL sstebz(
'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 )
'SSTEBZ(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 sstebz(
'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 )
'SSTEBZ(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 = ssxt1( 1, wa2, m2, wa3, m3, abstol, ulp, unfl )
1497 temp2 = ssxt1( 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 sstebz(
'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 )
'SSTEBZ(A,B)', iinfo, n,
1518 IF( iinfo.LT.0 )
THEN
1521 result( 20 ) = ulpinv
1522 result( 21 ) = ulpinv
1527 CALL sstein( 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 )
'SSTEIN', iinfo, n, jtype,
1534 IF( iinfo.LT.0 )
THEN
1537 result( 20 ) = ulpinv
1538 result( 21 ) = ulpinv
1545 CALL sstt21( n, 0, sd, se, wa1, dumma, z, ldu, work,
1552 CALL scopy( n, sd, 1, d1, 1 )
1554 $
CALL scopy( n-1, se, 1, work, 1 )
1555 CALL slaset(
'Full', n, n, zero, one, z, ldu )
1558 CALL sstedc(
'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 )
'SSTEDC(I)', iinfo, n, jtype,
1564 IF( iinfo.LT.0 )
THEN
1567 result( 22 ) = ulpinv
1574 CALL sstt21( n, 0, sd, se, d1, dumma, z, ldu, work,
1581 CALL scopy( n, sd, 1, d1, 1 )
1583 $
CALL scopy( n-1, se, 1, work, 1 )
1584 CALL slaset(
'Full', n, n, zero, one, z, ldu )
1587 CALL sstedc(
'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 )
'SSTEDC(V)', iinfo, n, jtype,
1593 IF( iinfo.LT.0 )
THEN
1596 result( 24 ) = ulpinv
1603 CALL sstt21( n, 0, sd, se, d1, dumma, z, ldu, work,
1610 CALL scopy( n, sd, 1, d2, 1 )
1612 $
CALL scopy( n-1, se, 1, work, 1 )
1613 CALL slaset(
'Full', n, n, zero, one, z, ldu )
1616 CALL sstedc(
'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 )
'SSTEDC(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,
'SSTEMR',
'VA', 1, 0, 0, 0 ).EQ.1 .AND.
1645 $ ilaenv( 11,
'SSTEMR',
'VA', 1, 0, 0, 0 ).EQ.1 )
THEN
1656 IF( jtype.EQ.21 .AND. srel )
THEN
1658 abstol = unfl + unfl
1659 CALL sstemr(
'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 )
'SSTEMR(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( slarnd( 1, iseed2 ) )
1689 iu = 1 + ( n-1 )*int( slarnd( 1, iseed2 ) )
1698 abstol = unfl + unfl
1699 CALL sstemr(
'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 )
'SSTEMR(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 scopy( n, sd, 1, d5, 1 )
1742 $
CALL scopy( n-1, se, 1, work, 1 )
1743 CALL slaset(
'Full', n, n, zero, one, z, ldu )
1747 il = 1 + ( n-1 )*int( slarnd( 1, iseed2 ) )
1748 iu = 1 + ( n-1 )*int( slarnd( 1, iseed2 ) )
1754 CALL sstemr(
'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 )
'SSTEMR(V,I)', iinfo,
1762 IF( iinfo.LT.0 )
THEN
1765 result( 29 ) = ulpinv
1772 CALL sstt22( n, m, 0, sd, se, d1, dumma, z, ldu, work,
1779 CALL scopy( n, sd, 1, d5, 1 )
1781 $
CALL scopy( n-1, se, 1, work, 1 )
1784 CALL sstemr(
'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 )
'SSTEMR(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 scopy( n, sd, 1, d5, 1 )
1820 $
CALL scopy( n-1, se, 1, work, 1 )
1821 CALL slaset(
'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 sstemr(
'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 )
'SSTEMR(V,V)', iinfo,
1855 IF( iinfo.LT.0 )
THEN
1858 result( 32 ) = ulpinv
1865 CALL sstt22( n, m, 0, sd, se, d1, dumma, z, ldu, work,
1872 CALL scopy( n, sd, 1, d5, 1 )
1874 $
CALL scopy( n-1, se, 1, work, 1 )
1877 CALL sstemr(
'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 )
'SSTEMR(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 scopy( n, sd, 1, d5, 1 )
1921 $
CALL scopy( n-1, se, 1, work, 1 )
1925 CALL sstemr(
'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 )
'SSTEMR(V,A)', iinfo, n,
1933 IF( iinfo.LT.0 )
THEN
1936 result( 35 ) = ulpinv
1943 CALL sstt22( n, m, 0, sd, se, d1, dumma, z, ldu, work, m,
1950 CALL scopy( n, sd, 1, d5, 1 )
1952 $
CALL scopy( n-1, se, 1, work, 1 )
1955 CALL sstemr(
'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 )
'SSTEMR(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 )
'SST'
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 slasum(
'SST', nounit, nerrs, ntestt )
2022 9999
FORMAT(
' SCHKST2STG: ', 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 SCHKST2STG 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 SCHKST2STG for details.', / )