216 SUBROUTINE dtgexc( WANTQ, WANTZ, N, A, LDA, B, LDB, Q, LDQ, Z,
217 $ LDZ, IFST, ILST, WORK, LWORK, INFO )
225 INTEGER IFST, ILST, INFO, LDA, LDB, LDQ, LDZ, LWORK, N
228 DOUBLE PRECISION A( LDA, * ), B( LDB, * ), Q( LDQ, * ),
229 $ work( * ), z( ldz, * )
235 DOUBLE PRECISION ZERO
236 parameter( zero = 0.0d+0 )
240 INTEGER HERE, LWMIN, NBF, NBL, NBNEXT
253 lquery = ( lwork.EQ.-1 )
256 ELSE IF( lda.LT.max( 1, n ) )
THEN
258 ELSE IF( ldb.LT.max( 1, n ) )
THEN
260 ELSE IF( ldq.LT.1 .OR. wantq .AND. ( ldq.LT.max( 1, n ) ) )
THEN
262 ELSE IF( ldz.LT.1 .OR. wantz .AND. ( ldz.LT.max( 1, n ) ) )
THEN
264 ELSE IF( ifst.LT.1 .OR. ifst.GT.n )
THEN
266 ELSE IF( ilst.LT.1 .OR. ilst.GT.n )
THEN
278 IF (lwork.LT.lwmin .AND. .NOT.lquery)
THEN
284 CALL xerbla(
'DTGEXC', -info )
286 ELSE IF( lquery )
THEN
299 IF( a( ifst, ifst-1 ).NE.zero )
304 IF( a( ifst+1, ifst ).NE.zero )
312 IF( a( ilst, ilst-1 ).NE.zero )
317 IF( a( ilst+1, ilst ).NE.zero )
323 IF( ifst.LT.ilst )
THEN
327 IF( nbf.EQ.2 .AND. nbl.EQ.1 )
329 IF( nbf.EQ.1 .AND. nbl.EQ.2 )
338 IF( nbf.EQ.1 .OR. nbf.EQ.2 )
THEN
343 IF( here+nbf+1.LE.n )
THEN
344 IF( a( here+nbf+1, here+nbf ).NE.zero )
347 CALL dtgex2( wantq, wantz, n, a, lda, b, ldb, q, ldq, z,
348 $ ldz, here, nbf, nbnext, work, lwork, info )
358 IF( a( here+1, here ).EQ.zero )
368 IF( here+3.LE.n )
THEN
369 IF( a( here+3, here+2 ).NE.zero )
372 CALL dtgex2( wantq, wantz, n, a, lda, b, ldb, q, ldq, z,
373 $ ldz, here+1, 1, nbnext, work, lwork, info )
378 IF( nbnext.EQ.1 )
THEN
382 CALL dtgex2( wantq, wantz, n, a, lda, b, ldb, q, ldq,
384 $ ldz, here, 1, 1, work, lwork, info )
395 IF( a( here+2, here+1 ).EQ.zero )
397 IF( nbnext.EQ.2 )
THEN
401 CALL dtgex2( wantq, wantz, n, a, lda, b, ldb, q,
403 $ z, ldz, here, 1, nbnext, work, lwork,
414 CALL dtgex2( wantq, wantz, n, a, lda, b, ldb, q,
416 $ z, ldz, here, 1, 1, work, lwork, info )
422 CALL dtgex2( wantq, wantz, n, a, lda, b, ldb, q,
424 $ z, ldz, here, 1, 1, work, lwork, info )
443 IF( nbf.EQ.1 .OR. nbf.EQ.2 )
THEN
449 IF( a( here-1, here-2 ).NE.zero )
452 CALL dtgex2( wantq, wantz, n, a, lda, b, ldb, q, ldq, z,
453 $ ldz, here-nbnext, nbnext, nbf, work, lwork,
464 IF( a( here+1, here ).EQ.zero )
475 IF( a( here-1, here-2 ).NE.zero )
478 CALL dtgex2( wantq, wantz, n, a, lda, b, ldb, q, ldq, z,
479 $ ldz, here-nbnext, nbnext, 1, work, lwork,
485 IF( nbnext.EQ.1 )
THEN
489 CALL dtgex2( wantq, wantz, n, a, lda, b, ldb, q, ldq,
491 $ ldz, here, nbnext, 1, work, lwork, info )
501 IF( a( here, here-1 ).EQ.zero )
503 IF( nbnext.EQ.2 )
THEN
507 CALL dtgex2( wantq, wantz, n, a, lda, b, ldb, q,
509 $ z, ldz, here-1, 2, 1, work, lwork, info )
519 CALL dtgex2( wantq, wantz, n, a, lda, b, ldb, q,
521 $ z, ldz, here, 1, 1, work, lwork, info )
527 CALL dtgex2( wantq, wantz, n, a, lda, b, ldb, q,
529 $ z, ldz, here, 1, 1, work, lwork, info )