309 SUBROUTINE dtrsen( JOB, COMPQ, SELECT, N, T, LDT, Q, LDQ, WR,
311 $ M, S, SEP, WORK, LWORK, IWORK, LIWORK, INFO )
319 INTEGER INFO, LDQ, LDT, LIWORK, LWORK, M, N
320 DOUBLE PRECISION S, SEP
325 DOUBLE PRECISION Q( LDQ, * ), T( LDT, * ), WI( * ), WORK( * ),
332 DOUBLE PRECISION ZERO, ONE
333 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0 )
336 LOGICAL LQUERY, PAIR, SWAP, WANTBH, WANTQ, WANTS,
338 INTEGER IERR, K, KASE, KK, KS, LIWMIN, LWMIN, N1, N2,
340 DOUBLE PRECISION EST, RNORM, SCALE
347 DOUBLE PRECISION DLANGE
348 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,
476 IF( ierr.EQ.1 .OR. ierr.EQ.2 )
THEN
499 CALL dlacpy(
'F', n1, n2, t( 1, n1+1 ), ldt, work, n1 )
500 CALL dtrsyl(
'N',
'N', -1, n1, n2, t, ldt, t( n1+1, n1+1 ),
501 $ ldt, work, n1, scale, ierr )
506 rnorm = dlange(
'F', n1, n2, work, n1, work )
507 IF( rnorm.EQ.zero )
THEN
510 s = scale / ( sqrt( scale*scale / rnorm+rnorm )*
522 CALL dlacn2( nn, work( nn+1 ), work, iwork, est, kase,
529 CALL dtrsyl(
'N',
'N', -1, n1, n2, t, ldt,
530 $ t( n1+1, n1+1 ), ldt, work, n1, scale,
536 CALL dtrsyl(
'T',
'T', -1, n1, n2, t, ldt,
537 $ t( n1+1, n1+1 ), ldt, work, n1, scale,
555 IF( t( k+1, k ).NE.zero )
THEN
556 wi( k ) = sqrt( abs( t( k, k+1 ) ) )*
557 $ sqrt( abs( t( k+1, k ) ) )
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 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