3 /* Subroutine */ int slarrc_(char *jobt, integer *n, real *vl, real *vu, real
4 *d__, real *e, real *pivmin, integer *eigcnt, integer *lcnt, integer *
7 /* System generated locals */
13 real sl, su, tmp, tmp2;
15 extern logical lsame_(char *, char *);
19 /* -- LAPACK auxiliary routine (version 3.1) -- */
20 /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
23 /* .. Scalar Arguments .. */
25 /* .. Array Arguments .. */
31 /* Find the number of eigenvalues of the symmetric tridiagonal matrix T */
32 /* that are in the interval (VL,VU] if JOBT = 'T', and of L D L^T */
38 /* JOBT (input) CHARACTER*1 */
39 /* = 'T': Compute Sturm count for matrix T. */
40 /* = 'L': Compute Sturm count for matrix L D L^T. */
42 /* N (input) INTEGER */
43 /* The order of the matrix. N > 0. */
45 /* VL (input) DOUBLE PRECISION */
46 /* VU (input) DOUBLE PRECISION */
47 /* The lower and upper bounds for the eigenvalues. */
49 /* D (input) DOUBLE PRECISION array, dimension (N) */
50 /* JOBT = 'T': The N diagonal elements of the tridiagonal matrix T. */
51 /* JOBT = 'L': The N diagonal elements of the diagonal matrix D. */
53 /* E (input) DOUBLE PRECISION array, dimension (N) */
54 /* JOBT = 'T': The N-1 offdiagonal elements of the matrix T. */
55 /* JOBT = 'L': The N-1 offdiagonal elements of the matrix L. */
57 /* PIVMIN (input) DOUBLE PRECISION */
58 /* The minimum pivot in the Sturm sequence for T. */
60 /* EIGCNT (output) INTEGER */
61 /* The number of eigenvalues of the symmetric tridiagonal matrix T */
62 /* that are in the interval (VL,VU] */
64 /* LCNT (output) INTEGER */
65 /* RCNT (output) INTEGER */
66 /* The left and right negcounts of the interval. */
68 /* INFO (output) INTEGER */
73 /* Based on contributions by */
74 /* Beresford Parlett, University of California, Berkeley, USA */
75 /* Jim Demmel, University of California, Berkeley, USA */
76 /* Inderjit Dhillon, University of Texas, Austin, USA */
77 /* Osni Marques, LBNL/NERSC, USA */
78 /* Christof Voemel, University of California, Berkeley, USA */
80 /* ===================================================================== */
82 /* .. Parameters .. */
84 /* .. Local Scalars .. */
86 /* .. External Functions .. */
88 /* .. Executable Statements .. */
90 /* Parameter adjustments */
99 matt = lsame_(jobt, "T");
101 /* Sturm sequence count on T */
102 lpivot = d__[1] - *vl;
103 rpivot = d__[1] - *vu;
111 for (i__ = 1; i__ <= i__1; ++i__) {
112 /* Computing 2nd power */
115 lpivot = d__[i__ + 1] - *vl - tmp / lpivot;
116 rpivot = d__[i__ + 1] - *vu - tmp / rpivot;
126 /* Sturm sequence count on L D L^T */
130 for (i__ = 1; i__ <= i__1; ++i__) {
131 lpivot = d__[i__] + sl;
132 rpivot = d__[i__] + su;
139 tmp = e[i__] * d__[i__] * e[i__];
145 sl = sl * tmp2 - *vl;
152 su = su * tmp2 - *vu;
156 lpivot = d__[*n] + sl;
157 rpivot = d__[*n] + su;
165 *eigcnt = *rcnt - *lcnt;