LAPACK 3.12.1
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 133 of file dlarrc.f.

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