313 SUBROUTINE dtrsen( JOB, COMPQ, SELECT, N, T, LDT, Q, LDQ, WR, WI,
314 $ m, s, sep, work, lwork, iwork, liwork, info )
323 INTEGER INFO, LDQ, LDT, LIWORK, LWORK, M, N
324 DOUBLE PRECISION S, SEP
329 DOUBLE PRECISION Q( ldq, * ), T( ldt, * ), WI( * ), WORK( * ),
336 DOUBLE PRECISION ZERO, ONE
337 parameter ( zero = 0.0d+0, one = 1.0d+0 )
340 LOGICAL LQUERY, PAIR, SWAP, WANTBH, WANTQ, WANTS,
342 INTEGER IERR, K, KASE, KK, KS, LIWMIN, LWMIN, N1, N2,
344 DOUBLE PRECISION EST, RNORM, SCALE
351 DOUBLE PRECISION DLANGE
352 EXTERNAL lsame, dlange
358 INTRINSIC abs, max, sqrt
364 wantbh = lsame( job,
'B' )
365 wants = lsame( job,
'E' ) .OR. wantbh
366 wantsp = lsame( job,
'V' ) .OR. wantbh
367 wantq = lsame( compq,
'V' )
370 lquery = ( lwork.EQ.-1 )
371 IF( .NOT.lsame( job,
'N' ) .AND. .NOT.wants .AND. .NOT.wantsp )
374 ELSE IF( .NOT.lsame( compq,
'N' ) .AND. .NOT.wantq )
THEN
376 ELSE IF( n.LT.0 )
THEN
378 ELSE IF( ldt.LT.max( 1, n ) )
THEN
380 ELSE IF( ldq.LT.1 .OR. ( wantq .AND. ldq.LT.n ) )
THEN
394 IF( t( k+1, k ).EQ.zero )
THEN
399 IF(
SELECT( k ) .OR.
SELECT( k+1 ) )
414 lwmin = max( 1, 2*nn )
415 liwmin = max( 1, nn )
416 ELSE IF( lsame( job,
'N' ) )
THEN
419 ELSE IF( lsame( job,
'E' ) )
THEN
424 IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
426 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery )
THEN
437 CALL xerbla(
'DTRSEN', -info )
439 ELSE IF( lquery )
THEN
445 IF( m.EQ.n .OR. m.EQ.0 )
THEN
449 $ sep = dlange(
'1', n, n, t, ldt, work )
463 IF( t( k+1, k ).NE.zero )
THEN
465 swap = swap .OR.
SELECT( k+1 )
476 $
CALL dtrexc( compq, n, t, ldt, q, ldq, kk, ks, work,
478 IF( ierr.EQ.1 .OR. ierr.EQ.2 )
THEN
501 CALL dlacpy(
'F', n1, n2, t( 1, n1+1 ), ldt, work, n1 )
502 CALL dtrsyl(
'N',
'N', -1, n1, n2, t, ldt, t( n1+1, n1+1 ),
503 $ ldt, work, n1, scale, ierr )
508 rnorm = dlange(
'F', n1, n2, work, n1, work )
509 IF( rnorm.EQ.zero )
THEN
512 s = scale / ( sqrt( scale*scale / rnorm+rnorm )*
524 CALL dlacn2( nn, work( nn+1 ), work, iwork, est, kase, isave )
530 CALL dtrsyl(
'N',
'N', -1, n1, n2, t, ldt,
531 $ t( n1+1, n1+1 ), ldt, work, n1, scale,
537 CALL dtrsyl(
'T',
'T', -1, n1, n2, t, ldt,
538 $ t( n1+1, n1+1 ), ldt, work, n1, scale,
556 IF( t( k+1, k ).NE.zero )
THEN
557 wi( k ) = sqrt( abs( t( k, k+1 ) ) )*
558 $ sqrt( abs( t( k+1, k ) ) )
subroutine dtrexc(COMPQ, N, T, LDT, Q, LDQ, IFST, ILST, WORK, INFO)
DTREXC
subroutine dlacpy(UPLO, M, N, A, LDA, B, LDB)
DLACPY copies all or part of one two-dimensional array to another.
subroutine xerbla(SRNAME, INFO)
XERBLA
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
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...