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

◆ pslaebz()

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

Definition at line 873 of file psstebz.f.

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