128 parameter( cbias = 1.50e0 )
129 REAL ZERO, HALF, ONE, TWO, FOUR, HUNDRD
130 parameter( zero = 0.0e0, half = 0.5e0, one = 1.0e0,
131 $ two = 2.0e0, four = 4.0e0, hundrd = 100.0e0 )
135 INTEGER I0, I4, IINFO, IPN4, ITER, IWHILA, IWHILB, K,
136 $ KMIN, N0, NBIG, NDIV, NFAIL, PP, SPLT, TTYPE,
138 REAL D, DEE, DEEMIN, DESIG, DMIN, DMIN1, DMIN2, DN,
139 $ DN1, DN2, E, EMAX, EMIN, EPS, G, OLDEMN, QMAX,
140 $ QMIN, S, SAFMIN, SIGMA, T, TAU, TEMP, TOL,
141 $ TOL2, TRACE, ZMAX, TEMPE, TEMPQ
151 INTRINSIC abs, max, min, real, sqrt
159 eps = slamch(
'Precision' )
160 safmin = slamch(
'Safe minimum' )
166 CALL xerbla(
'SLASQ2', 1 )
168 ELSE IF( n.EQ.0 )
THEN
170 ELSE IF( n.EQ.1 )
THEN
174 IF( z( 1 ).LT.zero )
THEN
176 CALL xerbla(
'SLASQ2', 2 )
179 ELSE IF( n.EQ.2 )
THEN
183 IF( z( 1 ).LT.zero )
THEN
185 CALL xerbla(
'SLASQ2', 2 )
187 ELSE IF( z( 2 ).LT.zero )
THEN
189 CALL xerbla(
'SLASQ2', 2 )
191 ELSE IF( z( 3 ).LT.zero )
THEN
193 CALL xerbla(
'SLASQ2', 2 )
195 ELSE IF( z( 3 ).GT.z( 1 ) )
THEN
200 z( 5 ) = z( 1 ) + z( 2 ) + z( 3 )
201 IF( z( 2 ).GT.z( 3 )*tol2 )
THEN
202 t = half*( ( z( 1 )-z( 3 ) )+z( 2 ) )
203 s = z( 3 )*( z( 2 ) / t )
205 s = z( 3 )*( z( 2 ) / ( t*( one+sqrt( one+s / t ) ) ) )
207 s = z( 3 )*( z( 2 ) / ( t+sqrt( t )*sqrt( t+s ) ) )
209 t = z( 1 ) + ( s+z( 2 ) )
210 z( 3 ) = z( 3 )*( z( 1 ) / t )
214 z( 6 ) = z( 2 ) + z( 1 )
227 DO 10 k = 1, 2*( n-1 ), 2
228 IF( z( k ).LT.zero )
THEN
230 CALL xerbla(
'SLASQ2', 2 )
232 ELSE IF( z( k+1 ).LT.zero )
THEN
234 CALL xerbla(
'SLASQ2', 2 )
239 qmax = max( qmax, z( k ) )
240 emin = min( emin, z( k+1 ) )
241 zmax = max( qmax, zmax, z( k+1 ) )
243 IF( z( 2*n-1 ).LT.zero )
THEN
244 info = -( 200+2*n-1 )
245 CALL xerbla(
'SLASQ2', 2 )
249 qmax = max( qmax, z( 2*n-1 ) )
250 zmax = max( qmax, zmax )
258 CALL slasrt(
'D', n, z, iinfo )
267 IF( trace.EQ.zero )
THEN
287 z( 2*k-3 ) = z( k-1 )
295 IF( cbias*z( 4*i0-3 ).LT.z( 4*n0-3 ) )
THEN
297 DO 40 i4 = 4*i0, 2*( i0+n0-1 ), 4
299 z( i4-3 ) = z( ipn4-i4-3 )
300 z( ipn4-i4-3 ) = temp
302 z( i4-1 ) = z( ipn4-i4-5 )
303 z( ipn4-i4-5 ) = temp
314 DO 50 i4 = 4*( n0-1 ) + pp, 4*i0 + pp, -4
315 IF( z( i4-1 ).LE.tol2*d )
THEN
319 d = z( i4-3 )*( d / ( d+z( i4-1 ) ) )
325 emin = z( 4*i0+pp+1 )
327 DO 60 i4 = 4*i0 + pp, 4*( n0-1 ) + pp, 4
328 z( i4-2*pp-2 ) = d + z( i4-1 )
329 IF( z( i4-1 ).LE.tol2*d )
THEN
334 ELSE IF( safmin*z( i4+1 ).LT.z( i4-2*pp-2 ) .AND.
335 $ safmin*z( i4-2*pp-2 ).LT.z( i4+1 ) )
THEN
336 temp = z( i4+1 ) / z( i4-2*pp-2 )
337 z( i4-2*pp ) = z( i4-1 )*temp
340 z( i4-2*pp ) = z( i4+1 )*( z( i4-1 ) / z( i4-2*pp-2 ) )
341 d = z( i4+1 )*( d / z( i4-2*pp-2 ) )
343 emin = min( emin, z( i4-2*pp ) )
349 qmax = z( 4*i0-pp-2 )
350 DO 70 i4 = 4*i0 - pp + 2, 4*n0 - pp - 2, 4
351 qmax = max( qmax, z( i4 ) )
374 DO 160 iwhila = 1, n + 1
389 IF( sigma.LT.zero )
THEN
399 emin = abs( z( 4*n0-5 ) )
405 DO 90 i4 = 4*n0, 8, -4
406 IF( z( i4-5 ).LE.zero )
408 IF( qmin.GE.four*emax )
THEN
409 qmin = min( qmin, z( i4-3 ) )
410 emax = max( emax, z( i4-5 ) )
412 qmax = max( qmax, z( i4-7 )+z( i4-5 ) )
413 emin = min( emin, z( i4-5 ) )
421 IF( n0-i0.GT.1 )
THEN
425 DO 110 i4 = 4*i0+1, 4*n0-3, 4
426 dee = z( i4 )*( dee /( dee+z( i4-2 ) ) )
427 IF( dee.LE.deemin )
THEN
432 IF( (kmin-i0)*2.LT.n0-kmin .AND.
433 $ deemin.LE.half*z(4*n0-3) )
THEN
436 DO 120 i4 = 4*i0, 2*( i0+n0-1 ), 4
438 z( i4-3 ) = z( ipn4-i4-3 )
439 z( ipn4-i4-3 ) = temp
441 z( i4-2 ) = z( ipn4-i4-2 )
442 z( ipn4-i4-2 ) = temp
444 z( i4-1 ) = z( ipn4-i4-5 )
445 z( ipn4-i4-5 ) = temp
447 z( i4 ) = z( ipn4-i4-4 )
448 z( ipn4-i4-4 ) = temp
455 dmin = -max( zero, qmin-two*sqrt( qmin )*sqrt( emax ) )
463 nbig = 100*( n0-i0+1 )
464 DO 140 iwhilb = 1, nbig
470 CALL slasq3( i0, n0, z, pp, dmin, sigma, desig, qmax, nfail,
471 $ iter, ndiv, ieee, ttype, dmin1, dmin2, dn, dn1,
478 IF( pp.EQ.0 .AND. n0-i0.GE.3 )
THEN
479 IF( z( 4*n0 ).LE.tol2*qmax .OR.
480 $ z( 4*n0-1 ).LE.tol2*sigma )
THEN
485 DO 130 i4 = 4*i0, 4*( n0-3 ), 4
486 IF( z( i4 ).LE.tol2*z( i4-3 ) .OR.
487 $ z( i4-1 ).LE.tol2*sigma )
THEN
494 qmax = max( qmax, z( i4+1 ) )
495 emin = min( emin, z( i4-1 ) )
496 oldemn = min( oldemn, z( i4 ) )
517 z( 4*i0-3 ) = z( 4*i0-3 ) + sigma
520 z( 4*k-5 ) = z( 4*k-5 ) * (tempq / z( 4*k-7 ))
522 z( 4*k-3 ) = z( 4*k-3 ) + sigma + tempe - z( 4*k-5 )
529 DO WHILE( ( i1.GE.2 ) .AND. ( z(4*i1-5).GE.zero ) )
539 z( 2*k-1 ) = z( 4*k-3 )
546 z( 2*k ) = z( 4*k-1 )
574 CALL slasrt(
'D', n, z, iinfo )
585 z( 2*n+3 ) = real( iter )
586 z( 2*n+4 ) = real( ndiv ) / real( n**2 )
587 z( 2*n+5 ) = hundrd*nfail / real( iter )
subroutine xerbla(srname, info)
subroutine slasq2(n, z, info)
SLASQ2 computes all the eigenvalues of the symmetric positive definite tridiagonal matrix associated ...
subroutine slasq3(i0, n0, z, pp, dmin, sigma, desig, qmax, nfail, iter, ndiv, ieee, ttype, dmin1, dmin2, dn, dn1, dn2, g, tau)
SLASQ3 checks for deflation, computes a shift and calls dqds. Used by sbdsqr.
subroutine slasrt(id, n, d, info)
SLASRT sorts numbers in increasing or decreasing order.