SCALAPACK 2.2.2
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ pdlaebz()

subroutine pdlaebz ( integer  ijob,
integer  n,
integer  mmax,
integer  minp,
double precision  abstol,
double precision  reltol,
double precision  pivmin,
double precision, dimension( * )  d,
integer, dimension( * )  nval,
double precision, dimension( * )  intvl,
integer, dimension( * )  intvlct,
integer  mout,
double precision  lsave,
integer  ieflag,
integer  info 
)

Definition at line 883 of file pdstebz.f.

886*
887* -- ScaLAPACK routine (version 1.7) --
888* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
889* and University of California, Berkeley.
890* November 15, 1997
891*
892*
893* .. Scalar Arguments ..
894 INTEGER IEFLAG, IJOB, INFO, MINP, MMAX, MOUT, N
895 DOUBLE PRECISION ABSTOL, LSAVE, PIVMIN, RELTOL
896* ..
897* .. Array Arguments ..
898 INTEGER INTVLCT( * ), NVAL( * )
899 DOUBLE PRECISION D( * ), INTVL( * )
900* ..
901*
902* Purpose
903* =======
904*
905* PDLAEBZ contains the iteration loop which computes the eigenvalues
906* contained in the input intervals [ INTVL(2*j-1), INTVL(2*j) ] where
907* j = 1,...,MINP. It uses and computes the function N(w), which is
908* the count of eigenvalues of a symmetric tridiagonal matrix less than
909* or equal to its argument w.
910*
911* This is a ScaLAPACK internal subroutine and arguments are not
912* checked for unreasonable values.
913*
914* Arguments
915* =========
916*
917* IJOB (input) INTEGER
918* Specifies the computation done by PDLAEBZ
919* = 0 : Find an interval with desired values of N(w) at the
920* endpoints of the interval.
921* = 1 : Find a floating point number contained in the initial
922* interval with a desired value of N(w).
923* = 2 : Perform bisection iteration to find eigenvalues of T.
924*
925* N (input) INTEGER
926* The order of the tridiagonal matrix T. N >= 1.
927*
928* MMAX (input) INTEGER
929* The maximum number of intervals that may be generated. If
930* more than MMAX intervals are generated, then PDLAEBZ will
931* quit with INFO = MMAX+1.
932*
933* MINP (input) INTEGER
934* The initial number of intervals. MINP <= MMAX.
935*
936* ABSTOL (input) DOUBLE PRECISION
937* The minimum (absolute) width of an interval. When an interval
938* is narrower than ABSTOL, or than RELTOL times the larger (in
939* magnitude) endpoint, then it is considered to be sufficiently
940* small, i.e., converged.
941* This must be at least zero.
942*
943* RELTOL (input) DOUBLE PRECISION
944* The minimum relative width of an interval. When an interval
945* is narrower than ABSTOL, or than RELTOL times the larger (in
946* magnitude) endpoint, then it is considered to be sufficiently
947* small, i.e., converged.
948* Note : This should be at least radix*machine epsilon.
949*
950* PIVMIN (input) DOUBLE PRECISION
951* The minimum absolute of a "pivot" in the "paranoid"
952* implementation of the Sturm sequence loop. This must be at
953* least max_j |e(j)^2| *safe_min, and at least safe_min, where
954* safe_min is at least the smallest number that can divide 1.0
955* without overflow.
956* See PDLAPDCT for the "paranoid" implementation of the Sturm
957* sequence loop.
958*
959* D (input) DOUBLE PRECISION array, dimension (2*N - 1)
960* Contains the diagonals and the squares of the off-diagonal
961* elements of the tridiagonal matrix T. These elements are
962* assumed to be interleaved in memory for better cache
963* performance. The diagonal entries of T are in the entries
964* D(1),D(3),...,D(2*N-1), while the squares of the off-diagonal
965* entries are D(2),D(4),...,D(2*N-2). To avoid overflow, the
966* matrix must be scaled so that its largest entry is no greater
967* than overflow**(1/2) * underflow**(1/4) in absolute value,
968* and for greatest accuracy, it should not be much smaller
969* than that.
970*
971* NVAL (input/output) INTEGER array, dimension (4)
972* If IJOB = 0, the desired values of N(w) are in NVAL(1) and
973* NVAL(2).
974* If IJOB = 1, NVAL(2) is the desired value of N(w).
975* If IJOB = 2, not referenced.
976* This array will, in general, be reordered on output.
977*
978* INTVL (input/output) DOUBLE PRECISION array, dimension (2*MMAX)
979* The endpoints of the intervals. INTVL(2*j-1) is the left
980* endpoint of the j-th interval, and INTVL(2*j) is the right
981* endpoint of the j-th interval. The input intervals will,
982* in general, be modified, split and reordered by the
983* calculation.
984* On input, INTVL contains the MINP input intervals.
985* On output, INTVL contains the converged intervals.
986*
987* INTVLCT (input/output) INTEGER array, dimension (2*MMAX)
988* The counts at the endpoints of the intervals. INTVLCT(2*j-1)
989* is the count at the left endpoint of the j-th interval, i.e.,
990* the function value N(INTVL(2*j-1)), and INTVLCT(2*j) is the
991* count at the right endpoint of the j-th interval.
992* On input, INTVLCT contains the counts at the endpoints of
993* the MINP input intervals.
994* On output, INTVLCT contains the counts at the endpoints of
995* the converged intervals.
996*
997* MOUT (output) INTEGER
998* The number of intervals output.
999*
1000* LSAVE (output) DOUBLE PRECISION
1001* If IJOB = 0 or 2, not referenced.
1002* If IJOB = 1, this is the largest floating point number
1003* encountered which has count N(w) = NVAL(1).
1004*
1005* IEFLAG (input) INTEGER
1006* A flag which indicates whether N(w) should be speeded up by
1007* exploiting IEEE Arithmetic.
1008*
1009* INFO (output) INTEGER
1010* = 0 : All intervals converged.
1011* = 1 - MMAX : The last INFO intervals did not converge.
1012* = MMAX + 1 : More than MMAX intervals were generated.
1013*
1014* =====================================================================
1015*
1016* .. Intrinsic Functions ..
1017 INTRINSIC abs, int, log, max, min
1018* ..
1019* .. External Subroutines ..
1020 EXTERNAL pdlaecv, pdlaiectb, pdlaiectl, pdlapdct
1021* ..
1022* .. Parameters ..
1023 DOUBLE PRECISION ZERO, TWO, HALF
1024 parameter( zero = 0.0d+0, two = 2.0d+0,
1025 $ half = 1.0d+0 / two )
1026* ..
1027* .. Local Scalars ..
1028 INTEGER I, ITMAX, J, K, KF, KL, KLNEW, L, LCNT, LREQ,
1029 $ NALPHA, NBETA, NMID, RCNT, RREQ
1030 DOUBLE PRECISION ALPHA, BETA, MID
1031* ..
1032* .. Executable Statements ..
1033*
1034 kf = 1
1035 kl = minp + 1
1036 info = 0
1037 IF( intvl( 2 )-intvl( 1 ).LE.zero ) THEN
1038 info = minp
1039 mout = kf
1040 RETURN
1041 END IF
1042 IF( ijob.EQ.0 ) THEN
1043*
1044* Check if some input intervals have "converged"
1045*
1046 CALL pdlaecv( 0, kf, kl, intvl, intvlct, nval,
1047 $ max( abstol, pivmin ), reltol )
1048 IF( kf.GE.kl )
1049 $ GO TO 60
1050*
1051* Compute upper bound on number of iterations needed
1052*
1053 itmax = int( ( log( intvl( 2 )-intvl( 1 )+pivmin )-
1054 $ log( pivmin ) ) / log( two ) ) + 2
1055*
1056* Iteration Loop
1057*
1058 DO 20 i = 1, itmax
1059 klnew = kl
1060 DO 10 j = kf, kl - 1
1061 k = 2*j
1062*
1063* Bisect the interval and find the count at that point
1064*
1065 mid = half*( intvl( k-1 )+intvl( k ) )
1066 IF( ieflag.EQ.0 ) THEN
1067 CALL pdlapdct( mid, n, d, pivmin, nmid )
1068 ELSE IF( ieflag.EQ.1 ) THEN
1069 CALL pdlaiectb( mid, n, d, nmid )
1070 ELSE
1071 CALL pdlaiectl( mid, n, d, nmid )
1072 END IF
1073 lreq = nval( k-1 )
1074 rreq = nval( k )
1075 IF( kl.EQ.1 )
1076 $ nmid = min( intvlct( k ),
1077 $ max( intvlct( k-1 ), nmid ) )
1078 IF( nmid.LE.nval( k-1 ) ) THEN
1079 intvl( k-1 ) = mid
1080 intvlct( k-1 ) = nmid
1081 END IF
1082 IF( nmid.GE.nval( k ) ) THEN
1083 intvl( k ) = mid
1084 intvlct( k ) = nmid
1085 END IF
1086 IF( nmid.GT.lreq .AND. nmid.LT.rreq ) THEN
1087 l = 2*klnew
1088 intvl( l-1 ) = mid
1089 intvl( l ) = intvl( k )
1090 intvlct( l-1 ) = nval( k )
1091 intvlct( l ) = intvlct( k )
1092 intvl( k ) = mid
1093 intvlct( k ) = nval( k-1 )
1094 nval( l-1 ) = nval( k )
1095 nval( l ) = nval( l-1 )
1096 nval( k ) = nval( k-1 )
1097 klnew = klnew + 1
1098 END IF
1099 10 CONTINUE
1100 kl = klnew
1101 CALL pdlaecv( 0, kf, kl, intvl, intvlct, nval,
1102 $ max( abstol, pivmin ), reltol )
1103 IF( kf.GE.kl )
1104 $ GO TO 60
1105 20 CONTINUE
1106 ELSE IF( ijob.EQ.1 ) THEN
1107 alpha = intvl( 1 )
1108 beta = intvl( 2 )
1109 nalpha = intvlct( 1 )
1110 nbeta = intvlct( 2 )
1111 lsave = alpha
1112 lreq = nval( 1 )
1113 rreq = nval( 2 )
1114 30 CONTINUE
1115 IF( nbeta.NE.rreq .AND. beta-alpha.GT.
1116 $ max( abstol, reltol*max( abs( alpha ), abs( beta ) ) ) )
1117 $ THEN
1118*
1119* Bisect the interval and find the count at that point
1120*
1121 mid = half*( alpha+beta )
1122 IF( ieflag.EQ.0 ) THEN
1123 CALL pdlapdct( mid, n, d, pivmin, nmid )
1124 ELSE IF( ieflag.EQ.1 ) THEN
1125 CALL pdlaiectb( mid, n, d, nmid )
1126 ELSE
1127 CALL pdlaiectl( mid, n, d, nmid )
1128 END IF
1129 nmid = min( nbeta, max( nalpha, nmid ) )
1130 IF( nmid.GE.rreq ) THEN
1131 beta = mid
1132 nbeta = nmid
1133 ELSE
1134 alpha = mid
1135 nalpha = nmid
1136 IF( nmid.EQ.lreq )
1137 $ lsave = alpha
1138 END IF
1139 GO TO 30
1140 END IF
1141 kl = kf
1142 intvl( 1 ) = alpha
1143 intvl( 2 ) = beta
1144 intvlct( 1 ) = nalpha
1145 intvlct( 2 ) = nbeta
1146 ELSE IF( ijob.EQ.2 ) THEN
1147*
1148* Check if some input intervals have "converged"
1149*
1150 CALL pdlaecv( 1, kf, kl, intvl, intvlct, nval,
1151 $ max( abstol, pivmin ), reltol )
1152 IF( kf.GE.kl )
1153 $ GO TO 60
1154*
1155* Compute upper bound on number of iterations needed
1156*
1157 itmax = int( ( log( intvl( 2 )-intvl( 1 )+pivmin )-
1158 $ log( pivmin ) ) / log( two ) ) + 2
1159*
1160* Iteration Loop
1161*
1162 DO 50 i = 1, itmax
1163 klnew = kl
1164 DO 40 j = kf, kl - 1
1165 k = 2*j
1166 mid = half*( intvl( k-1 )+intvl( k ) )
1167 IF( ieflag.EQ.0 ) THEN
1168 CALL pdlapdct( mid, n, d, pivmin, nmid )
1169 ELSE IF( ieflag.EQ.1 ) THEN
1170 CALL pdlaiectb( mid, n, d, nmid )
1171 ELSE
1172 CALL pdlaiectl( mid, n, d, nmid )
1173 END IF
1174 lcnt = intvlct( k-1 )
1175 rcnt = intvlct( k )
1176 nmid = min( rcnt, max( lcnt, nmid ) )
1177*
1178* Form New Interval(s)
1179*
1180 IF( nmid.EQ.lcnt ) THEN
1181 intvl( k-1 ) = mid
1182 ELSE IF( nmid.EQ.rcnt ) THEN
1183 intvl( k ) = mid
1184 ELSE IF( klnew.LT.mmax+1 ) THEN
1185 l = 2*klnew
1186 intvl( l-1 ) = mid
1187 intvl( l ) = intvl( k )
1188 intvlct( l-1 ) = nmid
1189 intvlct( l ) = intvlct( k )
1190 intvl( k ) = mid
1191 intvlct( k ) = nmid
1192 klnew = klnew + 1
1193 ELSE
1194 info = mmax + 1
1195 RETURN
1196 END IF
1197 40 CONTINUE
1198 kl = klnew
1199 CALL pdlaecv( 1, kf, kl, intvl, intvlct, nval,
1200 $ max( abstol, pivmin ), reltol )
1201 IF( kf.GE.kl )
1202 $ GO TO 60
1203 50 CONTINUE
1204 END IF
1205 60 CONTINUE
1206 info = max( kl-kf, 0 )
1207 mout = kl - 1
1208 RETURN
1209*
1210* End of PDLAEBZ
1211*
#define max(A, B)
Definition pcgemr.c:180
#define min(A, B)
Definition pcgemr.c:181
subroutine pdlaecv(ijob, kf, kl, intvl, intvlct, nval, abstol, reltol)
Definition pdstebz.f:1217
subroutine pdlapdct(sigma, n, d, pivmin, count)
Definition pdstebz.f:1365
Here is the call graph for this function:
Here is the caller graph for this function: