136 SUBROUTINE slaexc( WANTQ, N, T, LDT, Q, LDQ, J1, N1, N2, WORK,
145 INTEGER INFO, J1, LDQ, LDT, N, N1, N2
148 REAL Q( LDQ, * ), T( LDT, * ), WORK( * )
155 parameter( zero = 0.0e+0, one = 1.0e+0 )
157 parameter( ten = 1.0e+1 )
159 parameter( ldd = 4, ldx = 2 )
162 INTEGER IERR, J2, J3, J4, K, ND
163 REAL CS, DNORM, EPS, SCALE, SMLNUM, SN, T11, T22,
164 $ t33, tau, tau1, tau2, temp, thresh, wi1, wi2,
168 REAL D( LDD, 4 ), U( 3 ), U1( 3 ), U2( 3 ),
173 EXTERNAL slamch, slange
188 IF( n.EQ.0 .OR. n1.EQ.0 .OR. n2.EQ.0 )
197 IF( n1.EQ.1 .AND. n2.EQ.1 )
THEN
206 CALL slartg( t( j1, j2 ), t22-t11, cs, sn, temp )
211 $
CALL srot( n-j1-1, t( j1, j3 ), ldt, t( j2, j3 ), ldt, cs,
213 CALL srot( j1-1, t( 1, j1 ), 1, t( 1, j2 ), 1, cs, sn )
222 CALL srot( n, q( 1, j1 ), 1, q( 1, j2 ), 1, cs, sn )
233 CALL slacpy(
'Full', nd, nd, t( j1, j1 ), ldt, d, ldd )
234 dnorm = slange(
'Max', nd, nd, d, ldd, work )
240 smlnum = slamch(
'S' ) / eps
241 thresh = max( ten*eps*dnorm, smlnum )
245 CALL slasy2( .false., .false., -1, n1, n2, d, ldd,
246 $ d( n1+1, n1+1 ), ldd, d( 1, n1+1 ), ldd, scale, x,
252 GO TO ( 10, 20, 30 )k
263 CALL slarfg( 3, u( 3 ), u, 1, tau )
269 CALL slarfx(
'L', 3, 3, u, tau, d, ldd, work )
270 CALL slarfx(
'R', 3, 3, u, tau, d, ldd, work )
274 IF( max( abs( d( 3, 1 ) ), abs( d( 3, 2 ) ), abs( d( 3,
275 $ 3 )-t11 ) ).GT.thresh )
GO TO 50
279 CALL slarfx(
'L', 3, n-j1+1, u, tau, t( j1, j1 ), ldt, work )
280 CALL slarfx(
'R', j2, 3, u, tau, t( 1, j1 ), ldt, work )
290 CALL slarfx(
'R', n, 3, u, tau, q( 1, j1 ), ldq, work )
305 CALL slarfg( 3, u( 1 ), u( 2 ), 1, tau )
311 CALL slarfx(
'L', 3, 3, u, tau, d, ldd, work )
312 CALL slarfx(
'R', 3, 3, u, tau, d, ldd, work )
316 IF( max( abs( d( 2, 1 ) ), abs( d( 3, 1 ) ), abs( d( 1,
317 $ 1 )-t33 ) ).GT.thresh )
GO TO 50
321 CALL slarfx(
'R', j3, 3, u, tau, t( 1, j1 ), ldt, work )
322 CALL slarfx(
'L', 3, n-j1, u, tau, t( j1, j2 ), ldt, work )
332 CALL slarfx(
'R', n, 3, u, tau, q( 1, j1 ), ldq, work )
349 CALL slarfg( 3, u1( 1 ), u1( 2 ), 1, tau1 )
352 temp = -tau1*( x( 1, 2 )+u1( 2 )*x( 2, 2 ) )
353 u2( 1 ) = -temp*u1( 2 ) - x( 2, 2 )
354 u2( 2 ) = -temp*u1( 3 )
356 CALL slarfg( 3, u2( 1 ), u2( 2 ), 1, tau2 )
361 CALL slarfx(
'L', 3, 4, u1, tau1, d, ldd, work )
362 CALL slarfx(
'R', 4, 3, u1, tau1, d, ldd, work )
363 CALL slarfx(
'L', 3, 4, u2, tau2, d( 2, 1 ), ldd, work )
364 CALL slarfx(
'R', 4, 3, u2, tau2, d( 1, 2 ), ldd, work )
368 IF( max( abs( d( 3, 1 ) ), abs( d( 3, 2 ) ), abs( d( 4, 1 ) ),
369 $ abs( d( 4, 2 ) ) ).GT.thresh )
GO TO 50
373 CALL slarfx(
'L', 3, n-j1+1, u1, tau1, t( j1, j1 ), ldt, work )
374 CALL slarfx(
'R', j4, 3, u1, tau1, t( 1, j1 ), ldt, work )
375 CALL slarfx(
'L', 3, n-j1+1, u2, tau2, t( j2, j1 ), ldt, work )
376 CALL slarfx(
'R', j4, 3, u2, tau2, t( 1, j2 ), ldt, work )
387 CALL slarfx(
'R', n, 3, u1, tau1, q( 1, j1 ), ldq, work )
388 CALL slarfx(
'R', n, 3, u2, tau2, q( 1, j2 ), ldq, work )
397 CALL slanv2( t( j1, j1 ), t( j1, j2 ), t( j2, j1 ),
398 $ t( j2, j2 ), wr1, wi1, wr2, wi2, cs, sn )
399 CALL srot( n-j1-1, t( j1, j1+2 ), ldt, t( j2, j1+2 ), ldt,
401 CALL srot( j1-1, t( 1, j1 ), 1, t( 1, j2 ), 1, cs, sn )
403 $
CALL srot( n, q( 1, j1 ), 1, q( 1, j2 ), 1, cs, sn )
412 CALL slanv2( t( j3, j3 ), t( j3, j4 ), t( j4, j3 ),
413 $ t( j4, j4 ), wr1, wi1, wr2, wi2, cs, sn )
415 $
CALL srot( n-j3-1, t( j3, j3+2 ), ldt, t( j4, j3+2 ),
417 CALL srot( j3-1, t( 1, j3 ), 1, t( 1, j4 ), 1, cs, sn )
419 $
CALL srot( n, q( 1, j3 ), 1, q( 1, j4 ), 1, cs, sn )
subroutine slacpy(uplo, m, n, a, lda, b, ldb)
SLACPY copies all or part of one two-dimensional array to another.
subroutine slaexc(wantq, n, t, ldt, q, ldq, j1, n1, n2, work, info)
SLAEXC swaps adjacent diagonal blocks of a real upper quasi-triangular matrix in Schur canonical form...
subroutine slanv2(a, b, c, d, rt1r, rt1i, rt2r, rt2i, cs, sn)
SLANV2 computes the Schur factorization of a real 2-by-2 nonsymmetric matrix in standard form.
subroutine slarfg(n, alpha, x, incx, tau)
SLARFG generates an elementary reflector (Householder matrix).
subroutine slarfx(side, m, n, v, tau, c, ldc, work)
SLARFX applies an elementary reflector to a general rectangular matrix, with loop unrolling when the ...
subroutine slartg(f, g, c, s, r)
SLARTG generates a plane rotation with real cosine and real sine.
subroutine slasy2(ltranl, ltranr, isgn, n1, n2, tl, ldtl, tr, ldtr, b, ldb, scale, x, ldx, xnorm, info)
SLASY2 solves the Sylvester matrix equation where the matrices are of order 1 or 2.
subroutine srot(n, sx, incx, sy, incy, c, s)
SROT