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

◆ dlarrk()

subroutine dlarrk ( integer n,
integer iw,
double precision gl,
double precision gu,
double precision, dimension( * ) d,
double precision, dimension( * ) e2,
double precision pivmin,
double precision reltol,
double precision w,
double precision werr,
integer info )

DLARRK computes one eigenvalue of a symmetric tridiagonal matrix T to suitable accuracy.

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

Purpose:
!>
!> DLARRK computes one eigenvalue of a symmetric tridiagonal
!> matrix T to suitable accuracy. This is an auxiliary code to be
!> called from DSTEMR.
!>
!> To avoid overflow, the matrix must be scaled so that its
!> largest element is no greater than overflow**(1/2) * underflow**(1/4) in absolute value, and for greatest
!> accuracy, it should not be much smaller than that.
!>
!> See W. Kahan , Report CS41, Computer Science Dept., Stanford
!> University, July 21, 1966.
!> 
Parameters
[in]N
!>          N is INTEGER
!>          The order of the tridiagonal matrix T.  N >= 0.
!> 
[in]IW
!>          IW is INTEGER
!>          The index of the eigenvalues to be returned.
!> 
[in]GL
!>          GL is DOUBLE PRECISION
!> 
[in]GU
!>          GU is DOUBLE PRECISION
!>          An upper and a lower bound on the eigenvalue.
!> 
[in]D
!>          D is DOUBLE PRECISION array, dimension (N)
!>          The n diagonal elements of the tridiagonal matrix T.
!> 
[in]E2
!>          E2 is DOUBLE PRECISION array, dimension (N-1)
!>          The (n-1) squared off-diagonal elements of the tridiagonal matrix T.
!> 
[in]PIVMIN
!>          PIVMIN is DOUBLE PRECISION
!>          The minimum pivot allowed in the Sturm sequence for T.
!> 
[in]RELTOL
!>          RELTOL is DOUBLE PRECISION
!>          The minimum relative width of an interval.  When an interval
!>          is narrower than RELTOL times the larger (in
!>          magnitude) endpoint, then it is considered to be
!>          sufficiently small, i.e., converged.  Note: this should
!>          always be at least radix*machine epsilon.
!> 
[out]W
!>          W is DOUBLE PRECISION
!> 
[out]WERR
!>          WERR is DOUBLE PRECISION
!>          The error bound on the corresponding eigenvalue approximation
!>          in W.
!> 
[out]INFO
!>          INFO is INTEGER
!>          = 0:       Eigenvalue converged
!>          = -1:      Eigenvalue did NOT converge
!> 
Internal Parameters:
!>  FUDGE   DOUBLE PRECISION, default = 2
!>          A  to widen the Gershgorin intervals.
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 141 of file dlarrk.f.

143*
144* -- LAPACK auxiliary routine --
145* -- LAPACK is a software package provided by Univ. of Tennessee, --
146* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
147*
148* .. Scalar Arguments ..
149 INTEGER INFO, IW, N
150 DOUBLE PRECISION PIVMIN, RELTOL, GL, GU, W, WERR
151* ..
152* .. Array Arguments ..
153 DOUBLE PRECISION D( * ), E2( * )
154* ..
155*
156* =====================================================================
157*
158* .. Parameters ..
159 DOUBLE PRECISION FUDGE, HALF, TWO, ZERO
160 parameter( half = 0.5d0, two = 2.0d0,
161 $ fudge = two, zero = 0.0d0 )
162* ..
163* .. Local Scalars ..
164 INTEGER I, IT, ITMAX, NEGCNT
165 DOUBLE PRECISION ATOLI, EPS, LEFT, MID, RIGHT, RTOLI, TMP1,
166 $ TMP2, TNORM
167* ..
168* .. External Functions ..
169 DOUBLE PRECISION DLAMCH
170 EXTERNAL dlamch
171* ..
172* .. Intrinsic Functions ..
173 INTRINSIC abs, int, log, max
174* ..
175* .. Executable Statements ..
176*
177* Quick return if possible
178*
179 IF( n.LE.0 ) THEN
180 info = 0
181 RETURN
182 END IF
183*
184* Get machine constants
185 eps = dlamch( 'P' )
186
187 tnorm = max( abs( gl ), abs( gu ) )
188 rtoli = reltol
189 atoli = fudge*two*pivmin
190
191 itmax = int( ( log( tnorm+pivmin )-log( pivmin ) ) /
192 $ log( two ) ) + 2
193
194 info = -1
195
196 left = gl - fudge*tnorm*eps*n - fudge*two*pivmin
197 right = gu + fudge*tnorm*eps*n + fudge*two*pivmin
198 it = 0
199
200 10 CONTINUE
201*
202* Check if interval converged or maximum number of iterations reached
203*
204 tmp1 = abs( right - left )
205 tmp2 = max( abs(right), abs(left) )
206 IF( tmp1.LT.max( atoli, pivmin, rtoli*tmp2 ) ) THEN
207 info = 0
208 GOTO 30
209 ENDIF
210 IF(it.GT.itmax)
211 $ GOTO 30
212
213*
214* Count number of negative pivots for mid-point
215*
216 it = it + 1
217 mid = half * (left + right)
218 negcnt = 0
219 tmp1 = d( 1 ) - mid
220 IF( abs( tmp1 ).LT.pivmin )
221 $ tmp1 = -pivmin
222 IF( tmp1.LE.zero )
223 $ negcnt = negcnt + 1
224*
225 DO 20 i = 2, n
226 tmp1 = d( i ) - e2( i-1 ) / tmp1 - mid
227 IF( abs( tmp1 ).LT.pivmin )
228 $ tmp1 = -pivmin
229 IF( tmp1.LE.zero )
230 $ negcnt = negcnt + 1
231 20 CONTINUE
232
233 IF(negcnt.GE.iw) THEN
234 right = mid
235 ELSE
236 left = mid
237 ENDIF
238 GOTO 10
239
240 30 CONTINUE
241*
242* Converged or maximum number of iterations reached
243*
244 w = half * (left + right)
245 werr = half * abs( right - left )
246
247 RETURN
248*
249* End of DLARRK
250*
double precision function dlamch(cmach)
DLAMCH
Definition dlamch.f:69
Here is the caller graph for this function: