225 SUBROUTINE claed8( 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 REAL D( * ), DLAMBDA( * ), GIVNUM( 2, * ), W( * ),
242 COMPLEX Q( LDQ, * ), Q2( LDQ2, * )
248 REAL MONE, ZERO, ONE, TWO, EIGHT
249 PARAMETER ( MONE = -1.0e0, zero = 0.0e0, one = 1.0e0,
250 $ two = 2.0e0, eight = 8.0e0 )
253 INTEGER I, IMAX, J, JLAM, JMAX, JP, K2, N1, N1P1, N2
254 REAL C, EPS, S, T, TAU, TOL
259 EXTERNAL isamax, slamch, slapy2
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(
'CLAED8', -info )
306 IF( rho.LT.zero )
THEN
307 CALL sscal( n2, mone, z( n1p1 ), 1 )
312 t = one / sqrt( two )
316 CALL sscal( 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 slamrg( n1, n2, dlambda, 1, 1, indx )
332 d( i ) = dlambda( indx( i ) )
333 z( i ) = w( indx( i ) )
338 imax = isamax( n, z, 1 )
339 jmax = isamax( n, d, 1 )
340 eps = slamch(
'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 ccopy( qsiz, q( 1, perm( j ) ), 1, q2( 1, j ), 1 )
353 CALL clacpy(
'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 csrot( 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 ccopy( qsiz, q( 1, perm( j ) ), 1, q2( 1, j ), 1 )
474 CALL scopy( n-k, dlambda( k+1 ), 1, d( k+1 ), 1 )
475 CALL clacpy(
'A', qsiz, n-k, q2( 1, k+1 ), ldq2, q( 1, k+1 ),
subroutine xerbla(srname, info)
subroutine scopy(n, sx, incx, sy, incy)
SCOPY
subroutine ccopy(n, cx, incx, cy, incy)
CCOPY
subroutine clacpy(uplo, m, n, a, lda, b, ldb)
CLACPY copies all or part of one two-dimensional array to another.
subroutine claed8(k, n, qsiz, q, ldq, d, rho, cutpnt, z, dlambda, q2, ldq2, w, indxp, indx, indxq, perm, givptr, givcol, givnum, info)
CLAED8 used by CSTEDC. Merges eigenvalues and deflates secular equation. Used when the original matri...
subroutine slamrg(n1, n2, a, strd1, strd2, index)
SLAMRG creates a permutation list to merge the entries of two independently sorted sets into a single...
subroutine csrot(n, cx, incx, cy, incy, c, s)
CSROT
subroutine sscal(n, sa, sx, incx)
SSCAL