314 SUBROUTINE strsen( JOB, COMPQ, SELECT, N, T, LDT, Q, LDQ, WR, WI,
315 $ m, s, sep, work, lwork, iwork, liwork, info )
324 INTEGER info, ldq, ldt, liwork, lwork, m, n
330 REAL q( ldq, * ), t( ldt, * ), wi( * ), work( * ),
338 parameter( zero = 0.0e+0, one = 1.0e+0 )
341 LOGICAL lquery, pair, swap, wantbh, wantq, wants,
343 INTEGER ierr, k, kase, kk, ks, liwmin, lwmin, n1, n2,
345 REAL est, rnorm, scale
359 INTRINSIC abs, max, sqrt
365 wantbh =
lsame( job,
'B' )
366 wants =
lsame( job,
'E' ) .OR. wantbh
367 wantsp =
lsame( job,
'V' ) .OR. wantbh
368 wantq =
lsame( compq,
'V' )
371 lquery = ( lwork.EQ.-1 )
372 IF( .NOT.
lsame( job,
'N' ) .AND. .NOT.wants .AND. .NOT.wantsp )
375 ELSE IF( .NOT.
lsame( compq,
'N' ) .AND. .NOT.wantq )
THEN
377 ELSE IF( n.LT.0 )
THEN
379 ELSE IF( ldt.LT.max( 1, n ) )
THEN
381 ELSE IF( ldq.LT.1 .OR. ( wantq .AND. ldq.LT.n ) )
THEN
395 IF( t( k+1, k ).EQ.zero )
THEN
400 IF(
SELECT( k ) .OR.
SELECT( k+1 ) )
415 lwmin = max( 1, 2*nn )
416 liwmin = max( 1, nn )
417 ELSE IF(
lsame( job,
'N' ) )
THEN
420 ELSE IF(
lsame( job,
'E' ) )
THEN
425 IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
427 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery )
THEN
438 CALL
xerbla(
'STRSEN', -info )
440 ELSE IF( lquery )
THEN
446 IF( m.EQ.n .OR. m.EQ.0 )
THEN
450 $ sep =
slange(
'1', n, n, t, ldt, work )
464 IF( t( k+1, k ).NE.zero )
THEN
466 swap = swap .OR.
SELECT( k+1 )
477 $ CALL
strexc( compq, n, t, ldt, q, ldq, kk, ks, work,
479 IF( ierr.EQ.1 .OR. ierr.EQ.2 )
THEN
502 CALL
slacpy(
'F', n1, n2, t( 1, n1+1 ), ldt, work, n1 )
503 CALL
strsyl(
'N',
'N', -1, n1, n2, t, ldt, t( n1+1, n1+1 ),
504 $ ldt, work, n1, scale, ierr )
509 rnorm =
slange(
'F', n1, n2, work, n1, work )
510 IF( rnorm.EQ.zero )
THEN
513 s = scale / ( sqrt( scale*scale / rnorm+rnorm )*
525 CALL
slacn2( nn, work( nn+1 ), work, iwork, est, kase, isave )
531 CALL
strsyl(
'N',
'N', -1, n1, n2, t, ldt,
532 $ t( n1+1, n1+1 ), ldt, work, n1, scale,
538 CALL
strsyl(
'T',
'T', -1, n1, n2, t, ldt,
539 $ t( n1+1, n1+1 ), ldt, work, n1, scale,
557 IF( t( k+1, k ).NE.zero )
THEN
558 wi( k ) = sqrt( abs( t( k, k+1 ) ) )*
559 $ sqrt( abs( t( k+1, k ) ) )