LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ slarrc()

subroutine slarrc ( character  JOBT,
integer  N,
real  VL,
real  VU,
real, dimension( * )  D,
real, dimension( * )  E,
real  PIVMIN,
integer  EIGCNT,
integer  LCNT,
integer  RCNT,
integer  INFO 
)

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

Download SLARRC + 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 REAL
          The lower bound for the eigenvalues.
[in]VU
          VU is REAL
          The upper bound for the eigenvalues.
[in]D
          D is REAL 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 REAL 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 REAL
          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.
Date
June 2016
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 139 of file slarrc.f.

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