LAPACK 3.11.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ dlarrc()

subroutine dlarrc ( character  JOBT,
integer  N,
double precision  VL,
double precision  VU,
double precision, dimension( * )  D,
double precision, dimension( * )  E,
double precision  PIVMIN,
integer  EIGCNT,
integer  LCNT,
integer  RCNT,
integer  INFO 
)

DLARRC computes the number of eigenvalues of the symmetric tridiagonal matrix.

Download DLARRC + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 Find the number of eigenvalues of the symmetric tridiagonal matrix T
 that are in the interval (VL,VU] if JOBT = 'T', and of L D L^T
 if JOBT = 'L'.
Parameters
[in]JOBT
          JOBT is CHARACTER*1
          = 'T':  Compute Sturm count for matrix T.
          = 'L':  Compute Sturm count for matrix L D L^T.
[in]N
          N is INTEGER
          The order of the matrix. N > 0.
[in]VL
          VL is DOUBLE PRECISION
          The lower bound for the eigenvalues.
[in]VU
          VU is DOUBLE PRECISION
          The upper bound for the eigenvalues.
[in]D
          D is DOUBLE PRECISION array, dimension (N)
          JOBT = 'T': The N diagonal elements of the tridiagonal matrix T.
          JOBT = 'L': The N diagonal elements of the diagonal matrix D.
[in]E
          E is DOUBLE PRECISION array, dimension (N)
          JOBT = 'T': The N-1 offdiagonal elements of the matrix T.
          JOBT = 'L': The N-1 offdiagonal elements of the matrix L.
[in]PIVMIN
          PIVMIN is DOUBLE PRECISION
          The minimum pivot in the Sturm sequence for T.
[out]EIGCNT
          EIGCNT is INTEGER
          The number of eigenvalues of the symmetric tridiagonal matrix T
          that are in the interval (VL,VU]
[out]LCNT
          LCNT is INTEGER
[out]RCNT
          RCNT is INTEGER
          The left and right negcounts of the interval.
[out]INFO
          INFO is INTEGER
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Contributors:
Beresford Parlett, University of California, Berkeley, USA
Jim Demmel, University of California, Berkeley, USA
Inderjit Dhillon, University of Texas, Austin, USA
Osni Marques, LBNL/NERSC, USA
Christof Voemel, University of California, Berkeley, USA

Definition at line 135 of file dlarrc.f.

137*
138* -- LAPACK auxiliary routine --
139* -- LAPACK is a software package provided by Univ. of Tennessee, --
140* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
141*
142* .. Scalar Arguments ..
143 CHARACTER JOBT
144 INTEGER EIGCNT, INFO, LCNT, N, RCNT
145 DOUBLE PRECISION PIVMIN, VL, VU
146* ..
147* .. Array Arguments ..
148 DOUBLE PRECISION D( * ), E( * )
149* ..
150*
151* =====================================================================
152*
153* .. Parameters ..
154 DOUBLE PRECISION ZERO
155 parameter( zero = 0.0d0 )
156* ..
157* .. Local Scalars ..
158 INTEGER I
159 LOGICAL MATT
160 DOUBLE PRECISION LPIVOT, RPIVOT, SL, SU, TMP, TMP2
161
162* ..
163* .. External Functions ..
164 LOGICAL LSAME
165 EXTERNAL lsame
166* ..
167* .. Executable Statements ..
168*
169 info = 0
170*
171* Quick return if possible
172*
173 IF( n.LE.0 ) THEN
174 RETURN
175 END IF
176*
177 lcnt = 0
178 rcnt = 0
179 eigcnt = 0
180 matt = lsame( jobt, 'T' )
181
182
183 IF (matt) THEN
184* Sturm sequence count on T
185 lpivot = d( 1 ) - vl
186 rpivot = d( 1 ) - vu
187 IF( lpivot.LE.zero ) THEN
188 lcnt = lcnt + 1
189 ENDIF
190 IF( rpivot.LE.zero ) THEN
191 rcnt = rcnt + 1
192 ENDIF
193 DO 10 i = 1, n-1
194 tmp = e(i)**2
195 lpivot = ( d( i+1 )-vl ) - tmp/lpivot
196 rpivot = ( d( i+1 )-vu ) - tmp/rpivot
197 IF( lpivot.LE.zero ) THEN
198 lcnt = lcnt + 1
199 ENDIF
200 IF( rpivot.LE.zero ) THEN
201 rcnt = rcnt + 1
202 ENDIF
203 10 CONTINUE
204 ELSE
205* Sturm sequence count on L D L^T
206 sl = -vl
207 su = -vu
208 DO 20 i = 1, n - 1
209 lpivot = d( i ) + sl
210 rpivot = d( i ) + su
211 IF( lpivot.LE.zero ) THEN
212 lcnt = lcnt + 1
213 ENDIF
214 IF( rpivot.LE.zero ) THEN
215 rcnt = rcnt + 1
216 ENDIF
217 tmp = e(i) * d(i) * e(i)
218*
219 tmp2 = tmp / lpivot
220 IF( tmp2.EQ.zero ) THEN
221 sl = tmp - vl
222 ELSE
223 sl = sl*tmp2 - vl
224 END IF
225*
226 tmp2 = tmp / rpivot
227 IF( tmp2.EQ.zero ) THEN
228 su = tmp - vu
229 ELSE
230 su = su*tmp2 - vu
231 END IF
232 20 CONTINUE
233 lpivot = d( n ) + sl
234 rpivot = d( n ) + su
235 IF( lpivot.LE.zero ) THEN
236 lcnt = lcnt + 1
237 ENDIF
238 IF( rpivot.LE.zero ) THEN
239 rcnt = rcnt + 1
240 ENDIF
241 ENDIF
242 eigcnt = rcnt - lcnt
243
244 RETURN
245*
246* End of DLARRC
247*
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:53
Here is the caller graph for this function: