|
|
| |
| # lines: |
145 | | # code: |
145 | | # comment: | 0 | |
# blank: | 0 |
| # Variables: | 10 |
| # Callers: | 0 |
| # Callings: | 0 |
| # Words: | 77 |
| # Keywords: | 61 |
|
|
|
|
|
..
.. Array Arguments ..
..
Purpose
=======
SLASORTE sorts eigenpairs so that real eigenpairs are together and
complex are together. This way one can employ 2x2 shifts easily
since every 2nd subdiagonal is guaranteed to be zero.
This routine does no parallel work.
Arguments
=========
S (local input/output) REAL array, dimension LDS
On entry, a matrix already in Schur form.
On exit, the diagonal blocks of S have been rewritten to pair
the eigenvalues. The resulting matrix is no longer
similar to the input.
LDS (local input) INTEGER
On entry, the leading dimension of the local array S.
Unchanged on exit.
J (local input) INTEGER
On entry, the order of the matrix S.
Unchanged on exit.
OUT (local input/output) REAL array, dimension Jx2
This is the work buffer required by this routine.
INFO (local input) INTEGER
This is set if the input matrix had an odd number of real
eigenvalues and things couldn't be paired or if the input
matrix S was not originally in Schur form.
0 indicates successful completion.
Implemented by: G. Henry, November 17, 1996
=====================================================================
.. Parameters ..
|
|
|
|
001 SUBROUTINE SLASORTE( S , LDS , J , OUT , INFO )
002
003 * -- ScaLAPACK routine(version 1.7) --
004 * University of Tennessee , Knoxville , Oak Ridge National Laboratory ,
005 * and University of California , Berkeley.
006 * December 31 , 1998
007
008 * .. Scalar Arguments ..
009 INTEGER INFO , J , LDS
010 REAL ZERO
011 PARAMETER( ZERO = 0.0E + 0 )
012 * ..
013 * .. Local Scalars ..
014 INTEGER BOT , I , LAST , TOP
015 * ..
016 * .. Intrinsic Functions ..
017 INTRINSIC MOD
018 * ..
019 * .. Executable Statements ..
020
021 LAST = J
022 TOP = 1
023 BOT = J
024 INFO = 0
025 DO 10 I = J - 1 , 1 , - 1
025
026 IF( S( I + 1 , I ).EQ.ZERO ) THEN
026
027 IF( LAST - I.EQ.2 ) THEN
027
028 OUT( BOT - 1 , 1 ) = S( I + 1 , I + 1 )
029 OUT( BOT , 2 ) = S( I + 2 , I + 2 )
030 OUT( BOT - 1 , 2 ) = S( I + 1 , I + 2 )
031 OUT( BOT , 1 ) = S( I + 2 , I + 1 )
032 BOT = BOT - 2
033 END IF
034 IF( LAST - I.EQ.1 ) THEN
034
035 IF( MOD( TOP , 2 ).EQ.1 ) THEN
036
037 * FIRST OF A PAIR
038
038
039 IF(( I.EQ.J - 1 ) .OR.( I.EQ.1 ) ) THEN
039
040 OUT( TOP , 1 ) = S( I + 1 , I + 1 )
041 ELSE
041
042 OUT( TOP , 1 ) = S( I + 1 , I + 1 )
043 END IF
044 OUT( TOP , 2 ) = ZERO
045 ELSE
046
047 * SECOND OF A PAIR
048
048
049 IF(( I.EQ.J - 1 ) .OR.( I.EQ.1 ) ) THEN
049
050 OUT( TOP , 2 ) = S( I + 1 , I + 1 )
051 ELSE
051
052 OUT( TOP , 2 ) = S( I + 1 , I + 1 )
053 END IF
054 OUT( TOP , 1 ) = ZERO
055 END IF
056 TOP = TOP + 1
057 END IF
058 IF( LAST - I.GT.2 ) THEN
058
059 INFO = I
060 RETURN
061 END IF
062 LAST = I
063 END IF
064 10 CONTINUE
065 IF( LAST.EQ.2 ) THEN
066
067 * GRAB LAST DOUBLE PAIR
068
068
069 OUT( BOT - 1 , 1 ) = S( 1 , 1 )
070 OUT( BOT , 2 ) = S( 2 , 2 )
071 OUT( BOT - 1 , 2 ) = S( 1 , 2 )
072 OUT( BOT , 1 ) = S( 2 , 1 )
073 BOT = BOT - 2
074 END IF
075 IF( LAST.EQ.1 .and. mod(top , 2) .eq. 0 ) THEN
076
077 * GRAB SECOND PART OF LAST PAIR
078
078
079 OUT(TOP , 2) = s(1 , 1)
080 OUT(TOP , 1) = zero
081 TOP = TOP + 1
082 END IF
083 IF( TOP - 1.NE.BOT ) THEN
083
084 INFO = - BOT
085 RETURN
086 END IF
087
088 * Overwrite the S diagonals
089
090 DO 20 I = 1 , J , 2
090
091 S( I , I ) = OUT( I , 1 )
092 S( I + 1 , I ) = OUT( I + 1 , 1 )
093 S( I , I + 1 ) = OUT( I , 2 )
094 S( I + 1 , I + 1 ) = OUT( I + 1 , 2 )
095 20 CONTINUE
096
097 RETURN
098
099 * End of SLASORTE
100
101 END16
15
|
|
Variables in Routine SLASORTE()
| Summary Report |
| Data Type | Quantity | Size(byte) |
| INTEGER | 7 | 28 |
| REAL | 3 | 12 |
| TOTAL | 10 | 40 |
List of Variables
INTEGER
| BOT | I | INFO | J | LAST |
| LDS | TOP | | | |
REAL
Variables Dependence Graph Put the mouse over a right hand side variable to display the corresponding line of the dependence | | - | | - | - | | BOT | <--- | BOTBOT = BOT - 2{2BOT = BOT - 2}, JBOT = J |
| I | <--- | JDO 10 I = J - 1, 1, -1{2DO 20 I = 1, J, 2} |
| INFO | <--- | BOTINFO = -BOT, IINFO = I |
| LAST | <--- | ILAST = I, JLAST = J |
| OUT | <--- | ZEROOUT( TOP, 2 ) = ZERO{2OUT( TOP, 1 ) = ZERO, 3OUT(TOP, 1) = zero}, IOUT( BOT-1, 1 ) = S( I+1, I+1 ){2OUT( BOT, 2 ) = S( I+2, I+2 ), 3OUT( BOT-1, 2 ) = S( I+1, I+2 ), 4OUT( BOT, 1 ) = S( I+2, I+1 ), 5OUT( TOP, 1 ) = S( I+1, I+1 ), 6OUT( TOP, 1 ) = S( I+1, I+1 ), 7OUT( TOP, 2 ) = S( I+1, I+1 ), 8OUT( TOP, 2 ) = S( I+1, I+1 )}, SOUT( BOT-1, 1 ) = S( I+1, I+1 ){2OUT( BOT, 2 ) = S( I+2, I+2 ), 3OUT( BOT-1, 2 ) = S( I+1, I+2 ), 4OUT( BOT, 1 ) = S( I+2, I+1 ), 5OUT( TOP, 1 ) = S( I+1, I+1 ), 6OUT( TOP, 1 ) = S( I+1, I+1 ), 7OUT( TOP, 2 ) = S( I+1, I+1 ), 8OUT( TOP, 2 ) = S( I+1, I+1 ), 9OUT( BOT-1, 1 ) = S( 1, 1 ), 10OUT( BOT, 2 ) = S( 2, 2 ), 11OUT( BOT-1, 2 ) = S( 1, 2 ), 12OUT( BOT, 1 ) = S( 2, 1 ), 13OUT(TOP, 2) = s(1,1)} |
| S | <--- | IS( I, I ) = OUT( I, 1 ){2S( I+1, I ) = OUT( I+1, 1 ), 3S( I, I+1 ) = OUT( I, 2 ), 4S( I+1, I+1 ) = OUT( I+1, 2 )}, OUTS( I, I ) = OUT( I, 1 ){2S( I+1, I ) = OUT( I+1, 1 ), 3S( I, I+1 ) = OUT( I, 2 ), 4S( I+1, I+1 ) = OUT( I+1, 2 )} |
| TOP | <--- | TOPTOP = TOP + 1{2TOP = TOP + 1} |
|
|
Analysis elements of the routine SLASORTE() Put the mouse over each element to display detailed matching information
Assigned variables |
| | | BOT , I , INFO , LAST , TOP , ZERO |
|
Active variables |
| | | BOT , I , INFO , J , LAST , LDS , OUT , S , TOP , ZERO |
|
Accessed arrays [ array name : associated index ] |
| | OUT | : BOT, 1 , BOT, 1 , BOT, 2 , BOT, 2 , BOT-1, 1 , BOT-1, 1 , BOT-1, 2 , BOT-1, 2 , I, 1 , I, 2 , I+1, 1 , I+1, 2 , TOP, 1 , TOP, 1 , TOP, 1 , TOP, 1 , TOP, 2 , TOP, 2 , TOP, 2 , TOP, 2 |
| | S | : 1, 1 , 1, 2 , 1,1 , 2, 1 , 2, 2 , I, I , I, I+1 , I+1, I , I+1, I , I+1, I+1 , I+1, I+1 , I+1, I+1 , I+1, I+1 , I+1, I+1 , I+1, I+1 , I+1, I+2 , I+2, I+1 , I+2, I+2 |
|
Conditional statements [ statement : associated predicate ] |
| | do | : ( 10 I = J - 1 , 1 , - 1 ) , ( 20 I = 1 , J , 2 ) |
| | if | : ( (S( I+1 , I ).EQ.ZERO ) ) , ( LAST-I.EQ.2 ) , ( LAST-I.EQ.1 ) , ( (MOD( TOP , 2 ).EQ.1 ) ) , ( (( I.EQ.J - 1 ) .OR. ( I.EQ.1 ) ) ) , ( (( I.EQ.J - 1 ) .OR. ( I.EQ.1 ) ) ) , ( LAST-I.GT.2 ) , ( LAST.EQ.2 ) , ( (LAST.EQ.1 .and. mod(top , 2) .eq. 0 ) ) , ( TOP-1.NE.BOT ) |
|
| List of variables | BOT I INFO J LAST LDS OUT
| S TOP ZERO | | close
| |
BOT
I
INFO
J
LAST
LDS
OUT
S
TOP
ZERO
| |