208 SUBROUTINE dlaed2( K, N, N1, D, Q, LDQ, INDXQ, RHO, Z, DLAMBDA,
210 $ Q2, INDX, INDXC, INDXP, COLTYP, INFO )
217 INTEGER INFO, K, LDQ, N, N1
221 INTEGER COLTYP( * ), INDX( * ), INDXC( * ), INDXP( * ),
223 DOUBLE PRECISION D( * ), DLAMBDA( * ), Q( LDQ, * ), Q2( * ),
230 DOUBLE PRECISION MONE, ZERO, ONE, TWO, EIGHT
231 PARAMETER ( MONE = -1.0d0, zero = 0.0d0, one = 1.0d0,
232 $ two = 2.0d0, eight = 8.0d0 )
235 INTEGER CTOT( 4 ), PSM( 4 )
238 INTEGER CT, I, IMAX, IQ1, IQ2, J, JMAX, JS, K2, N1P1,
240 DOUBLE PRECISION C, EPS, S, T, TAU, TOL
244 DOUBLE PRECISION DLAMCH, DLAPY2
245 EXTERNAL idamax, dlamch, dlapy2
252 INTRINSIC abs, max, min, sqrt
262 ELSE IF( ldq.LT.max( 1, n ) )
THEN
264 ELSE IF( min( 1, ( n / 2 ) ).GT.n1 .OR. ( n / 2 ).LT.n1 )
THEN
268 CALL xerbla(
'DLAED2', -info )
280 IF( rho.LT.zero )
THEN
281 CALL dscal( n2, mone, z( n1p1 ), 1 )
287 t = one / sqrt( two )
288 CALL dscal( n, t, z, 1 )
297 indxq( i ) = indxq( i ) + n1
303 dlambda( i ) = d( indxq( i ) )
305 CALL dlamrg( n1, n2, dlambda, 1, 1, indxc )
307 indx( i ) = indxq( indxc( i ) )
312 imax = idamax( n, z, 1 )
313 jmax = idamax( n, d, 1 )
314 eps = dlamch(
'Epsilon' )
315 tol = eight*eps*max( abs( d( jmax ) ), abs( z( imax ) ) )
321 IF( rho*abs( z( imax ) ).LE.tol )
THEN
326 CALL dcopy( n, q( 1, i ), 1, q2( iq2 ), 1 )
327 dlambda( j ) = d( i )
330 CALL dlacpy(
'A', n, n, q2, n, q, ldq )
331 CALL dcopy( n, dlambda, 1, d, 1 )
353 IF( rho*abs( z( nj ) ).LE.tol )
THEN
372 IF( rho*abs( z( nj ) ).LE.tol )
THEN
390 t = d( nj ) - d( pj )
393 IF( abs( t*c*s ).LE.tol )
THEN
399 IF( coltyp( nj ).NE.coltyp( pj ) )
402 CALL drot( n, q( 1, pj ), 1, q( 1, nj ), 1, c, s )
403 t = d( pj )*c**2 + d( nj )*s**2
404 d( nj ) = d( pj )*s**2 + d( nj )*c**2
410 IF( d( pj ).LT.d( indxp( k2+i ) ) )
THEN
411 indxp( k2+i-1 ) = indxp( k2+i )
424 dlambda( k ) = d( pj )
436 dlambda( k ) = d( pj )
450 ctot( ct ) = ctot( ct ) + 1
456 psm( 2 ) = 1 + ctot( 1 )
457 psm( 3 ) = psm( 2 ) + ctot( 2 )
458 psm( 4 ) = psm( 3 ) + ctot( 3 )
468 indx( psm( ct ) ) = js
469 indxc( psm( ct ) ) = j
470 psm( ct ) = psm( ct ) + 1
480 iq2 = 1 + ( ctot( 1 )+ctot( 2 ) )*n1
481 DO 140 j = 1, ctot( 1 )
483 CALL dcopy( n1, q( 1, js ), 1, q2( iq1 ), 1 )
489 DO 150 j = 1, ctot( 2 )
491 CALL dcopy( n1, q( 1, js ), 1, q2( iq1 ), 1 )
492 CALL dcopy( n2, q( n1+1, js ), 1, q2( iq2 ), 1 )
499 DO 160 j = 1, ctot( 3 )
501 CALL dcopy( n2, q( n1+1, js ), 1, q2( iq2 ), 1 )
508 DO 170 j = 1, ctot( 4 )
510 CALL dcopy( n, q( 1, js ), 1, q2( iq2 ), 1 )
520 CALL dlacpy(
'A', n, ctot( 4 ), q2( iq1 ), n,
522 CALL dcopy( n-k, z( k+1 ), 1, d( k+1 ), 1 )
528 coltyp( j ) = ctot( j )
subroutine dlaed2(k, n, n1, d, q, ldq, indxq, rho, z, dlambda, w, q2, indx, indxc, indxp, coltyp, info)
DLAED2 used by DSTEDC. Merges eigenvalues and deflates secular equation. Used when the original matri...