240 SUBROUTINE slaed8( 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 REAL D( * ), DLAMBDA( * ), GIVNUM( 2, * ),
257 $ Q( LDQ, * ), Q2( LDQ2, * ), W( * ), Z( * )
263 REAL MONE, ZERO, ONE, TWO, EIGHT
264 PARAMETER ( MONE = -1.0e0, zero = 0.0e0, one = 1.0e0,
265 $ two = 2.0e0, eight = 8.0e0 )
269 INTEGER I, IMAX, J, JLAM, JMAX, JP, K2, N1, N1P1, N2
270 REAL C, EPS, S, T, TAU, TOL
275 EXTERNAL isamax, slamch, slapy2
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(
'SLAED8', -info )
323 IF( rho.LT.zero )
THEN
324 CALL sscal( n2, mone, z( n1p1 ), 1 )
329 t = one / sqrt( two )
333 CALL sscal( 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 slamrg( n1, n2, dlambda, 1, 1, indx )
349 d( i ) = dlambda( indx( i ) )
350 z( i ) = w( indx( i ) )
355 imax = isamax( n, z, 1 )
356 jmax = isamax( n, d, 1 )
357 eps = slamch(
'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 scopy( qsiz, q( 1, perm( j ) ), 1, q2( 1, j ), 1 )
375 CALL slacpy(
'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 srot( 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 scopy( qsiz, q( 1, perm( j ) ), 1, q2( 1, j ), 1 )
508 IF( icompq.EQ.0 )
THEN
509 CALL scopy( n-k, dlambda( k+1 ), 1, d( k+1 ), 1 )
511 CALL scopy( n-k, dlambda( k+1 ), 1, d( k+1 ), 1 )
512 CALL slacpy(
'A', qsiz, n-k, q2( 1, k+1 ), ldq2,
subroutine xerbla(srname, info)
subroutine scopy(n, sx, incx, sy, incy)
SCOPY
subroutine slacpy(uplo, m, n, a, lda, b, ldb)
SLACPY copies all or part of one two-dimensional array to another.
subroutine slaed8(icompq, k, n, qsiz, d, q, ldq, indxq, rho, cutpnt, z, dlambda, q2, ldq2, w, perm, givptr, givcol, givnum, indxp, indx, info)
SLAED8 used by SSTEDC. 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 srot(n, sx, incx, sy, incy, c, s)
SROT
subroutine sscal(n, sa, sx, incx)
SSCAL