136 SUBROUTINE dlaexc( WANTQ, N, T, LDT, Q, LDQ, J1, N1, N2, WORK,
145 INTEGER INFO, J1, LDQ, LDT, N, N1, N2
148 DOUBLE PRECISION Q( LDQ, * ), T( LDT, * ), WORK( * )
154 DOUBLE PRECISION ZERO, ONE
155 parameter( zero = 0.0d+0, one = 1.0d+0 )
157 parameter( ten = 1.0d+1 )
159 parameter( ldd = 4, ldx = 2 )
162 INTEGER IERR, J2, J3, J4, K, ND
163 DOUBLE PRECISION CS, DNORM, EPS, SCALE, SMLNUM, SN, T11, T22,
164 $ t33, tau, tau1, tau2, temp, thresh, wi1, wi2,
168 DOUBLE PRECISION D( LDD, 4 ), U( 3 ), U1( 3 ), U2( 3 ),
172 DOUBLE PRECISION DLAMCH, DLANGE
173 EXTERNAL dlamch, dlange
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 dlartg( t( j1, j2 ), t22-t11, cs, sn, temp )
211 $
CALL drot( n-j1-1, t( j1, j3 ), ldt, t( j2, j3 ), ldt, cs,
213 CALL drot( j1-1, t( 1, j1 ), 1, t( 1, j2 ), 1, cs, sn )
222 CALL drot( n, q( 1, j1 ), 1, q( 1, j2 ), 1, cs, sn )
233 CALL dlacpy(
'Full', nd, nd, t( j1, j1 ), ldt, d, ldd )
234 dnorm = dlange(
'Max', nd, nd, d, ldd, work )
240 smlnum = dlamch(
'S' ) / eps
241 thresh = max( ten*eps*dnorm, smlnum )
245 CALL dlasy2( .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 dlarfg( 3, u( 3 ), u, 1, tau )
269 CALL dlarfx(
'L', 3, 3, u, tau, d, ldd, work )
270 CALL dlarfx(
'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 dlarfx(
'L', 3, n-j1+1, u, tau, t( j1, j1 ), ldt, work )
280 CALL dlarfx(
'R', j2, 3, u, tau, t( 1, j1 ), ldt, work )
290 CALL dlarfx(
'R', n, 3, u, tau, q( 1, j1 ), ldq, work )
305 CALL dlarfg( 3, u( 1 ), u( 2 ), 1, tau )
311 CALL dlarfx(
'L', 3, 3, u, tau, d, ldd, work )
312 CALL dlarfx(
'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 dlarfx(
'R', j3, 3, u, tau, t( 1, j1 ), ldt, work )
322 CALL dlarfx(
'L', 3, n-j1, u, tau, t( j1, j2 ), ldt, work )
332 CALL dlarfx(
'R', n, 3, u, tau, q( 1, j1 ), ldq, work )
349 CALL dlarfg( 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 dlarfg( 3, u2( 1 ), u2( 2 ), 1, tau2 )
361 CALL dlarfx(
'L', 3, 4, u1, tau1, d, ldd, work )
362 CALL dlarfx(
'R', 4, 3, u1, tau1, d, ldd, work )
363 CALL dlarfx(
'L', 3, 4, u2, tau2, d( 2, 1 ), ldd, work )
364 CALL dlarfx(
'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 dlarfx(
'L', 3, n-j1+1, u1, tau1, t( j1, j1 ), ldt, work )
374 CALL dlarfx(
'R', j4, 3, u1, tau1, t( 1, j1 ), ldt, work )
375 CALL dlarfx(
'L', 3, n-j1+1, u2, tau2, t( j2, j1 ), ldt, work )
376 CALL dlarfx(
'R', j4, 3, u2, tau2, t( 1, j2 ), ldt, work )
387 CALL dlarfx(
'R', n, 3, u1, tau1, q( 1, j1 ), ldq, work )
388 CALL dlarfx(
'R', n, 3, u2, tau2, q( 1, j2 ), ldq, work )
397 CALL dlanv2( t( j1, j1 ), t( j1, j2 ), t( j2, j1 ),
398 $ t( j2, j2 ), wr1, wi1, wr2, wi2, cs, sn )
399 CALL drot( n-j1-1, t( j1, j1+2 ), ldt, t( j2, j1+2 ), ldt,
401 CALL drot( j1-1, t( 1, j1 ), 1, t( 1, j2 ), 1, cs, sn )
403 $
CALL drot( n, q( 1, j1 ), 1, q( 1, j2 ), 1, cs, sn )
412 CALL dlanv2( t( j3, j3 ), t( j3, j4 ), t( j4, j3 ),
413 $ t( j4, j4 ), wr1, wi1, wr2, wi2, cs, sn )
415 $
CALL drot( n-j3-1, t( j3, j3+2 ), ldt, t( j4, j3+2 ),
417 CALL drot( j3-1, t( 1, j3 ), 1, t( 1, j4 ), 1, cs, sn )
419 $
CALL drot( n, q( 1, j3 ), 1, q( 1, j4 ), 1, cs, sn )
subroutine dlacpy(uplo, m, n, a, lda, b, ldb)
DLACPY copies all or part of one two-dimensional array to another.
subroutine dlaexc(wantq, n, t, ldt, q, ldq, j1, n1, n2, work, info)
DLAEXC swaps adjacent diagonal blocks of a real upper quasi-triangular matrix in Schur canonical form...
subroutine dlanv2(a, b, c, d, rt1r, rt1i, rt2r, rt2i, cs, sn)
DLANV2 computes the Schur factorization of a real 2-by-2 nonsymmetric matrix in standard form.
subroutine dlarfg(n, alpha, x, incx, tau)
DLARFG generates an elementary reflector (Householder matrix).
subroutine dlarfx(side, m, n, v, tau, c, ldc, work)
DLARFX applies an elementary reflector to a general rectangular matrix, with loop unrolling when the ...
subroutine dlartg(f, g, c, s, r)
DLARTG generates a plane rotation with real cosine and real sine.
subroutine dlasy2(ltranl, ltranr, isgn, n1, n2, tl, ldtl, tr, ldtr, b, ldb, scale, x, ldx, xnorm, info)
DLASY2 solves the Sylvester matrix equation where the matrices are of order 1 or 2.
subroutine drot(n, dx, incx, dy, incy, c, s)
DROT