240 SUBROUTINE dlaed8( ICOMPQ, K, N, QSIZ, D, Q, LDQ, INDXQ, RHO,
241 $ CUTPNT, Z, DLAMBDA, Q2, LDQ2, W, PERM, GIVPTR,
242 $ GIVCOL, GIVNUM, INDXP, INDX, INFO )
249 INTEGER CUTPNT, GIVPTR, ICOMPQ, INFO, K, LDQ, LDQ2, N,
254 INTEGER GIVCOL( 2, * ), INDX( * ), INDXP( * ),
255 $ INDXQ( * ), PERM( * )
256 DOUBLE PRECISION D( * ), DLAMBDA( * ), GIVNUM( 2, * ),
257 $ Q( LDQ, * ), Q2( LDQ2, * ), W( * ), Z( * )
263 DOUBLE PRECISION MONE, ZERO, ONE, TWO, EIGHT
264 PARAMETER ( MONE = -1.0d0, zero = 0.0d0, one = 1.0d0,
265 $ two = 2.0d0, eight = 8.0d0 )
269 INTEGER I, IMAX, J, JLAM, JMAX, JP, K2, N1, N1P1, N2
270 DOUBLE PRECISION C, EPS, S, T, TAU, TOL
274 DOUBLE PRECISION DLAMCH, DLAPY2
275 EXTERNAL idamax, dlamch, dlapy2
281 INTRINSIC abs, max, min, sqrt
289 IF( icompq.LT.0 .OR. icompq.GT.1 )
THEN
291 ELSE IF( n.LT.0 )
THEN
293 ELSE IF( icompq.EQ.1 .AND. qsiz.LT.n )
THEN
295 ELSE IF( ldq.LT.max( 1, n ) )
THEN
297 ELSE IF( cutpnt.LT.min( 1, n ) .OR. cutpnt.GT.n )
THEN
299 ELSE IF( ldq2.LT.max( 1, n ) )
THEN
303 CALL xerbla(
'DLAED8', -info )
323 IF( rho.LT.zero )
THEN
324 CALL dscal( n2, mone, z( n1p1 ), 1 )
329 t = one / sqrt( two )
333 CALL dscal( n, t, z, 1 )
338 DO 20 i = cutpnt + 1, n
339 indxq( i ) = indxq( i ) + cutpnt
342 dlambda( i ) = d( indxq( i ) )
343 w( i ) = z( indxq( i ) )
347 CALL dlamrg( n1, n2, dlambda, 1, 1, indx )
349 d( i ) = dlambda( indx( i ) )
350 z( i ) = w( indx( i ) )
355 imax = idamax( n, z, 1 )
356 jmax = idamax( n, d, 1 )
357 eps = dlamch(
'Epsilon' )
358 tol = eight*eps*abs( d( jmax ) )
364 IF( rho*abs( z( imax ) ).LE.tol )
THEN
366 IF( icompq.EQ.0 )
THEN
368 perm( j ) = indxq( indx( j ) )
372 perm( j ) = indxq( indx( j ) )
373 CALL dcopy( qsiz, q( 1, perm( j ) ), 1, q2( 1, j ), 1 )
375 CALL dlacpy(
'A', qsiz, n, q2( 1, 1 ), ldq2, q( 1, 1 ),
390 IF( rho*abs( z( j ) ).LE.tol )
THEN
407 IF( rho*abs( z( j ) ).LE.tol )
THEN
424 t = d( j ) - d( jlam )
427 IF( abs( t*c*s ).LE.tol )
THEN
437 givcol( 1, givptr ) = indxq( indx( jlam ) )
438 givcol( 2, givptr ) = indxq( indx( j ) )
439 givnum( 1, givptr ) = c
440 givnum( 2, givptr ) = s
441 IF( icompq.EQ.1 )
THEN
442 CALL drot( qsiz, q( 1, indxq( indx( jlam ) ) ), 1,
443 $ q( 1, indxq( indx( j ) ) ), 1, c, s )
445 t = d( jlam )*c*c + d( j )*s*s
446 d( j ) = d( jlam )*s*s + d( j )*c*c
452 IF( d( jlam ).LT.d( indxp( k2+i ) ) )
THEN
453 indxp( k2+i-1 ) = indxp( k2+i )
458 indxp( k2+i-1 ) = jlam
461 indxp( k2+i-1 ) = jlam
467 dlambda( k ) = d( jlam )
479 dlambda( k ) = d( jlam )
489 IF( icompq.EQ.0 )
THEN
492 dlambda( j ) = d( jp )
493 perm( j ) = indxq( indx( jp ) )
498 dlambda( j ) = d( jp )
499 perm( j ) = indxq( indx( jp ) )
500 CALL dcopy( qsiz, q( 1, perm( j ) ), 1, q2( 1, j ), 1 )
508 IF( icompq.EQ.0 )
THEN
509 CALL dcopy( n-k, dlambda( k+1 ), 1, d( k+1 ), 1 )
511 CALL dcopy( n-k, dlambda( k+1 ), 1, d( k+1 ), 1 )
512 CALL dlacpy(
'A', qsiz, n-k, q2( 1, k+1 ), ldq2,
subroutine xerbla(srname, info)
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
subroutine dlacpy(uplo, m, n, a, lda, b, ldb)
DLACPY copies all or part of one two-dimensional array to another.
subroutine dlaed8(icompq, k, n, qsiz, d, q, ldq, indxq, rho, cutpnt, z, dlambda, q2, ldq2, w, perm, givptr, givcol, givnum, indxp, indx, info)
DLAED8 used by DSTEDC. Merges eigenvalues and deflates secular equation. Used when the original matri...
subroutine dlamrg(n1, n2, a, dtrd1, dtrd2, index)
DLAMRG creates a permutation list to merge the entries of two independently sorted sets into a single...
subroutine drot(n, dx, incx, dy, incy, c, s)
DROT
subroutine dscal(n, da, dx, incx)
DSCAL