225 SUBROUTINE zlaed8( K, N, QSIZ, Q, LDQ, D, RHO, CUTPNT, Z, DLAMBDA,
226 $ Q2, LDQ2, W, INDXP, INDX, INDXQ, PERM, GIVPTR,
227 $ GIVCOL, GIVNUM, INFO )
234 INTEGER CUTPNT, GIVPTR, INFO, K, LDQ, LDQ2, N, QSIZ
238 INTEGER GIVCOL( 2, * ), INDX( * ), INDXP( * ),
239 $ INDXQ( * ), PERM( * )
240 DOUBLE PRECISION D( * ), DLAMBDA( * ), GIVNUM( 2, * ), W( * ),
242 COMPLEX*16 Q( LDQ, * ), Q2( LDQ2, * )
248 DOUBLE PRECISION MONE, ZERO, ONE, TWO, EIGHT
249 PARAMETER ( MONE = -1.0d0, zero = 0.0d0, one = 1.0d0,
250 $ two = 2.0d0, eight = 8.0d0 )
253 INTEGER I, IMAX, J, JLAM, JMAX, JP, K2, N1, N1P1, N2
254 DOUBLE PRECISION C, EPS, S, T, TAU, TOL
258 DOUBLE PRECISION DLAMCH, DLAPY2
259 EXTERNAL idamax, dlamch, dlapy2
266 INTRINSIC abs, max, min, sqrt
276 ELSE IF( qsiz.LT.n )
THEN
278 ELSE IF( ldq.LT.max( 1, n ) )
THEN
280 ELSE IF( cutpnt.LT.min( 1, n ) .OR. cutpnt.GT.n )
THEN
282 ELSE IF( ldq2.LT.max( 1, n ) )
THEN
286 CALL xerbla(
'ZLAED8', -info )
306 IF( rho.LT.zero )
THEN
307 CALL dscal( n2, mone, z( n1p1 ), 1 )
312 t = one / sqrt( two )
316 CALL dscal( n, t, z, 1 )
321 DO 20 i = cutpnt + 1, n
322 indxq( i ) = indxq( i ) + cutpnt
325 dlambda( i ) = d( indxq( i ) )
326 w( i ) = z( indxq( i ) )
330 CALL dlamrg( n1, n2, dlambda, 1, 1, indx )
332 d( i ) = dlambda( indx( i ) )
333 z( i ) = w( indx( i ) )
338 imax = idamax( n, z, 1 )
339 jmax = idamax( n, d, 1 )
340 eps = dlamch(
'Epsilon' )
341 tol = eight*eps*abs( d( jmax ) )
347 IF( rho*abs( z( imax ) ).LE.tol )
THEN
350 perm( j ) = indxq( indx( j ) )
351 CALL zcopy( qsiz, q( 1, perm( j ) ), 1, q2( 1, j ), 1 )
353 CALL zlacpy(
'A', qsiz, n, q2( 1, 1 ), ldq2, q( 1, 1 ), ldq )
366 IF( rho*abs( z( j ) ).LE.tol )
THEN
383 IF( rho*abs( z( j ) ).LE.tol )
THEN
400 t = d( j ) - d( jlam )
403 IF( abs( t*c*s ).LE.tol )
THEN
413 givcol( 1, givptr ) = indxq( indx( jlam ) )
414 givcol( 2, givptr ) = indxq( indx( j ) )
415 givnum( 1, givptr ) = c
416 givnum( 2, givptr ) = s
417 CALL zdrot( qsiz, q( 1, indxq( indx( jlam ) ) ), 1,
418 $ q( 1, indxq( indx( j ) ) ), 1, c, s )
419 t = d( jlam )*c*c + d( j )*s*s
420 d( j ) = d( jlam )*s*s + d( j )*c*c
426 IF( d( jlam ).LT.d( indxp( k2+i ) ) )
THEN
427 indxp( k2+i-1 ) = indxp( k2+i )
432 indxp( k2+i-1 ) = jlam
435 indxp( k2+i-1 ) = jlam
441 dlambda( k ) = d( jlam )
453 dlambda( k ) = d( jlam )
465 dlambda( j ) = d( jp )
466 perm( j ) = indxq( indx( jp ) )
467 CALL zcopy( qsiz, q( 1, perm( j ) ), 1, q2( 1, j ), 1 )
474 CALL dcopy( n-k, dlambda( k+1 ), 1, d( k+1 ), 1 )
475 CALL zlacpy(
'A', qsiz, n-k, q2( 1, k+1 ), ldq2, q( 1, k+1 ),
subroutine xerbla(srname, info)
subroutine zcopy(n, zx, incx, zy, incy)
ZCOPY
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
subroutine zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.
subroutine zlaed8(k, n, qsiz, q, ldq, d, rho, cutpnt, z, dlambda, q2, ldq2, w, indxp, indx, indxq, perm, givptr, givcol, givnum, info)
ZLAED8 used by ZSTEDC. 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 zdrot(n, zx, incx, zy, incy, c, s)
ZDROT
subroutine dscal(n, da, dx, incx)
DSCAL