311 SUBROUTINE dtrsen( JOB, COMPQ, SELECT, N, T, LDT, Q, LDQ, WR, WI,
312 $ M, S, SEP, WORK, LWORK, IWORK, LIWORK, INFO )
320 INTEGER INFO, LDQ, LDT, LIWORK, LWORK, M, N
321 DOUBLE PRECISION S, SEP
326 DOUBLE PRECISION Q( LDQ, * ), T( LDT, * ), WI( * ), WORK( * ),
333 DOUBLE PRECISION ZERO, ONE
334 parameter( zero = 0.0d+0, one = 1.0d+0 )
337 LOGICAL LQUERY, PAIR, SWAP, WANTBH, WANTQ, WANTS,
339 INTEGER IERR, K, KASE, KK, KS, LIWMIN, LWMIN, N1, N2,
341 DOUBLE PRECISION EST, RNORM, SCALE
348 DOUBLE PRECISION DLANGE
349 EXTERNAL lsame, dlange
355 INTRINSIC abs, max, sqrt
361 wantbh = lsame( job,
'B' )
362 wants = lsame( job,
'E' ) .OR. wantbh
363 wantsp = lsame( job,
'V' ) .OR. wantbh
364 wantq = lsame( compq,
'V' )
367 lquery = ( lwork.EQ.-1 )
368 IF( .NOT.lsame( job,
'N' ) .AND. .NOT.wants .AND. .NOT.wantsp )
371 ELSE IF( .NOT.lsame( compq,
'N' ) .AND. .NOT.wantq )
THEN
373 ELSE IF( n.LT.0 )
THEN
375 ELSE IF( ldt.LT.max( 1, n ) )
THEN
377 ELSE IF( ldq.LT.1 .OR. ( wantq .AND. ldq.LT.n ) )
THEN
391 IF( t( k+1, k ).EQ.zero )
THEN
396 IF(
SELECT( k ) .OR.
SELECT( k+1 ) )
411 lwmin = max( 1, 2*nn )
412 liwmin = max( 1, nn )
413 ELSE IF( lsame( job,
'N' ) )
THEN
416 ELSE IF( lsame( job,
'E' ) )
THEN
421 IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
423 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery )
THEN
434 CALL xerbla(
'DTRSEN', -info )
436 ELSE IF( lquery )
THEN
442 IF( m.EQ.n .OR. m.EQ.0 )
THEN
446 $ sep = dlange(
'1', n, n, t, ldt, work )
460 IF( t( k+1, k ).NE.zero )
THEN
462 swap = swap .OR.
SELECT( k+1 )
473 $
CALL dtrexc( compq, n, t, ldt, q, ldq, kk, ks, work,
475 IF( ierr.EQ.1 .OR. ierr.EQ.2 )
THEN
498 CALL dlacpy(
'F', n1, n2, t( 1, n1+1 ), ldt, work, n1 )
499 CALL dtrsyl(
'N',
'N', -1, n1, n2, t, ldt, t( n1+1, n1+1 ),
500 $ ldt, work, n1, scale, ierr )
505 rnorm = dlange(
'F', n1, n2, work, n1, work )
506 IF( rnorm.EQ.zero )
THEN
509 s = scale / ( sqrt( scale*scale / rnorm+rnorm )*
521 CALL dlacn2( nn, work( nn+1 ), work, iwork, est, kase, isave )
527 CALL dtrsyl(
'N',
'N', -1, n1, n2, t, ldt,
528 $ t( n1+1, n1+1 ), ldt, work, n1, scale,
534 CALL dtrsyl(
'T',
'T', -1, n1, n2, t, ldt,
535 $ t( n1+1, n1+1 ), ldt, work, n1, scale,
553 IF( t( k+1, k ).NE.zero )
THEN
554 wi( k ) = sqrt( abs( t( k, k+1 ) ) )*
555 $ sqrt( abs( t( k+1, k ) ) )
subroutine xerbla(srname, info)
subroutine dlacn2(n, v, x, isgn, est, kase, isave)
DLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
subroutine dlacpy(uplo, m, n, a, lda, b, ldb)
DLACPY copies all or part of one two-dimensional array to another.
subroutine dtrexc(compq, n, t, ldt, q, ldq, ifst, ilst, work, info)
DTREXC
subroutine dtrsen(job, compq, select, n, t, ldt, q, ldq, wr, wi, m, s, sep, work, lwork, iwork, liwork, info)
DTRSEN
subroutine dtrsyl(trana, tranb, isgn, m, n, a, lda, b, ldb, c, ldc, scale, info)
DTRSYL