312 SUBROUTINE strsen( JOB, COMPQ, SELECT, N, T, LDT, Q, LDQ, WR, WI,
313 $ M, S, SEP, WORK, LWORK, IWORK, LIWORK, INFO )
321 INTEGER INFO, LDQ, LDT, LIWORK, LWORK, M, N
327 REAL Q( LDQ, * ), T( LDT, * ), WI( * ), WORK( * ),
335 parameter( zero = 0.0e+0, one = 1.0e+0 )
338 LOGICAL LQUERY, PAIR, SWAP, WANTBH, WANTQ, WANTS,
340 INTEGER IERR, K, KASE, KK, KS, LIWMIN, LWMIN, N1, N2,
342 REAL EST, RNORM, SCALE
349 REAL SLANGE, SROUNDUP_LWORK
350 EXTERNAL lsame, slange, sroundup_lwork
356 INTRINSIC abs, max, sqrt
362 wantbh = lsame( job,
'B' )
363 wants = lsame( job,
'E' ) .OR. wantbh
364 wantsp = lsame( job,
'V' ) .OR. wantbh
365 wantq = lsame( compq,
'V' )
368 lquery = ( lwork.EQ.-1 )
369 IF( .NOT.lsame( job,
'N' ) .AND. .NOT.wants .AND. .NOT.wantsp )
372 ELSE IF( .NOT.lsame( compq,
'N' ) .AND. .NOT.wantq )
THEN
374 ELSE IF( n.LT.0 )
THEN
376 ELSE IF( ldt.LT.max( 1, n ) )
THEN
378 ELSE IF( ldq.LT.1 .OR. ( wantq .AND. ldq.LT.n ) )
THEN
392 IF( t( k+1, k ).EQ.zero )
THEN
397 IF(
SELECT( k ) .OR.
SELECT( k+1 ) )
412 lwmin = max( 1, 2*nn )
413 liwmin = max( 1, nn )
414 ELSE IF( lsame( job,
'N' ) )
THEN
417 ELSE IF( lsame( job,
'E' ) )
THEN
422 IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
424 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery )
THEN
430 work( 1 ) = sroundup_lwork(lwmin)
435 CALL xerbla(
'STRSEN', -info )
437 ELSE IF( lquery )
THEN
443 IF( m.EQ.n .OR. m.EQ.0 )
THEN
447 $ sep = slange(
'1', n, n, t, ldt, work )
461 IF( t( k+1, k ).NE.zero )
THEN
463 swap = swap .OR.
SELECT( k+1 )
474 $
CALL strexc( compq, n, t, ldt, q, ldq, kk, ks, work,
476 IF( ierr.EQ.1 .OR. ierr.EQ.2 )
THEN
499 CALL slacpy(
'F', n1, n2, t( 1, n1+1 ), ldt, work, n1 )
500 CALL strsyl(
'N',
'N', -1, n1, n2, t, ldt, t( n1+1, n1+1 ),
501 $ ldt, work, n1, scale, ierr )
506 rnorm = slange(
'F', n1, n2, work, n1, work )
507 IF( rnorm.EQ.zero )
THEN
510 s = scale / ( sqrt( scale*scale / rnorm+rnorm )*
522 CALL slacn2( nn, work( nn+1 ), work, iwork, est, kase, isave )
528 CALL strsyl(
'N',
'N', -1, n1, n2, t, ldt,
529 $ t( n1+1, n1+1 ), ldt, work, n1, scale,
535 CALL strsyl(
'T',
'T', -1, n1, n2, t, ldt,
536 $ t( n1+1, n1+1 ), ldt, work, n1, scale,
554 IF( t( k+1, k ).NE.zero )
THEN
555 wi( k ) = sqrt( abs( t( k, k+1 ) ) )*
556 $ sqrt( abs( t( k+1, k ) ) )
561 work( 1 ) = sroundup_lwork(lwmin)
subroutine xerbla(srname, info)
subroutine slacn2(n, v, x, isgn, est, kase, isave)
SLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
subroutine slacpy(uplo, m, n, a, lda, b, ldb)
SLACPY copies all or part of one two-dimensional array to another.
subroutine strexc(compq, n, t, ldt, q, ldq, ifst, ilst, work, info)
STREXC
subroutine strsen(job, compq, select, n, t, ldt, q, ldq, wr, wi, m, s, sep, work, lwork, iwork, liwork, info)
STRSEN
subroutine strsyl(trana, tranb, isgn, m, n, a, lda, b, ldb, c, ldc, scale, info)
STRSYL