Docstoc

AX+XB =

Document Sample
AX+XB = Powered By Docstoc
					Swapping Algori thm                                                                                18

 [9] C. Davis and W. Kahan, The Rotation of Eigenvectors by a Perturbation III, SIAM J. Num.
     Anal. 7:1-46(1970)
[ 10] J. D               m                 i           um                               puti
          ongarra, S. Ham arl i ng and J. Wl ki nson, N eri cal consi derati ons i n com ng i nvari -
                        PA
      ant subspaces, LA CKworki ng note 25, Uni versi ty of Tennessee, CS- 90- 117, 1990.
[ 11] F. R. Gantm                                           ew
                 acher, T of Matrices, Vol . I , Chel sea, N York, 1959.
                        heory
       . ol        ash         an                          roblem AX +XB =
[ 12] G G ub, S. N and C. V Loan, A Hessen Schur M for the P
                                          berg-     ethod
      C, I EEE Trans. A    at.       C-
                       utom Control A 24: 909- 913(1979).
        . ehrm
[ 13] V M ann, AS plectic orthogon m for sin in or sin output discrete tim
                       ym            al ethod      gle put     gle             e
                                       l                           s                . atta et al
      optim con problem, i n Li near A gebra i n Si gnal s System and Control , B. N D
          al trol       s
      eds. SI AMPhi l adel phi a, Penn. pp. 128- 140(1988).
       .     g             .
[ 14] K C. N and B. N Parl ett, Developm t of an accurate algorithmfor E (Bt), P I,
                                            en                          XP       art
                                        A-       ni
      P s to swap diagon block, P II, CP M 294, U versi ty of Cal i f orni a, Berkel ey. 1988.
      rogram            al      art
               i
[ 15] B. T. Sm th et at, M E systemR es - E PCK guide, second edi ti on. Lecture
                           atrix igen      outin    ISA
      Notes i n Computer Sci ence, N                   erl
                                      119, Spri nger- V ag, 1976
       . .
[ 16] G W Stewart, S ultan Iterationfor C putin In t S
                      im eous                                        -H itian
                                          om g varian ubspaces of Non erm
                um
      atrices, N er. M
      M               ath. 25, 12- 56 (1976).
        . .
[ 17] G W Stewart, A                       QR d XHN                 e              g d
                           lgorithm506 H 3 an ECAG: Fortransubroutin for calculatin an
             g
      orderin the eigen                      essen atrix 2] CMTOM 2: 275- 280 (1976).
                       values of areal upper H bergm [F , A        S
        . .
[ 18] G W Stewart, On the perturbation of pseudo-In                 s, d ear
                                                   verse, projection an lin least squares
      problem, SI A
             s     MRevi ew 19, 634- 62 (1977).
       . .
[ 19] G W Stewart, P                 ds       Rfactorizationof a m , SI A
                      erturbationboun for the Q                  atrix        um nal
                                                                         MJ. N . A .
      14, 509- 18, (1977).
       . .                    atrix erturbationT , A
[ 20] G W Stewart and J. Sun, M P                         i                ewW
                                               heory cadem c Press, I nc. N ork, 1990
       . an ooren, A
[ 21] P V D                              S S d XHZ: ortran subroutin for com g
                           lgorithm590, DUBPan ECQ F                es     putin
                                           , CMTO S 8: 376- 382 (1982).
      de
atin subspaces w specied spectrum A
             g           ith                     M
          . i          he lgebraic E value P , O ord U v. Press, 1965
[ 22] J. H Wl ki nson, T A         igen    roblem xf  ni
Swappi ng A gor i t hm
           l                                                                                       17

6    Conclusions
I n thi s paper, we have devel oped a di rect swappi ng al gori thmwhi ch reorders the ei genval ues on the
                    atri                                i                       i
di agonal of a m x i n real Schur f ormby perf orm ng an orthogonal si m l ari ty transf orm on. A   ati
      pl
com ete set of FO TRA                                                                    P CKl
                       R Nsubrouti nes has been devel oped and i ncl uded i n the LA A i brary
   ]                                            eri
[ 2 . The al gori thmi s guaranteed to be num cal l y stabl e because we expl i ci tl y test f or i nstabi l i ty
and do not reorder the ei genval ues i f thi s woul d be unstabl e; thi s can onl y happen i f the ei genval ues
                                                nf                                               ard
are so cl ose as to be i ndi sti ngui shabl e. U ortunatel y there i s no proof of the backw stabi l i ty of
                                                                                       pl
the al gori thmwi thout thi s expl i ci t test, even though we have not seen an exam e where i nstabi l i ty
                                                          eri           pl
coul d occur. The detai l ed error anal ysi s and num cal exam es show how wel l i t deal s wi th
                                                                                N ay
i l l - condi ti oned cases, whereas the al ternati ve stabl e al gori thmEXCH Gm occasi onal l y f ai l to
converge.

Acknowl edgement
                                    .      g                                          s
The authors woul d l i ke to thank K C. N and B. Parl ett f or shari ng thei r program duri ng our
                                                   m        . .
i ni ti al work on the subject. The val uabl e com ents of G W Stewart and B. Parl ett duri ng the
           ent         are                       l                                       .
devel opm of sof tw are gratef ul l y acknow edged. The authors are al so i ndebted to A Edel m  an
       . i                             m
and N H ghamf or thei r val uabl e com ents on the subj ect.

References
 [ 1] E. A                                     em el
           nderson, Z. Bai , C. Bi schof , J. D m , J. D              u
                                                         ongarra, J. D Croz, A G           ,
                                                                                 . reenbaum S.
       am arl
      H m i ng, A M  . ckenney, S. O                 .
                                     strouchov and D Sorensen, LAAKU G R
                                                                 PC sers' uide, elease
               M
      1.0, SI A , 1992 (to appear)
 [ 2] E. A                                     em el
           nderson, Z. Bai , C. Bi schof , J. D m , J. D                 u
                                                           ongarra, J. D Croz, A G            ,
                                                                                    . reenbaum S.
        am arl
      H m i ng, A M                     .
                     . ckenney, and D Sorensen, LPC: AP           in lgebra L
                                                     AAK ortable L ear A     ibrary
                                        puti          arti
      for H erform ce C puters, Supercom ng'90 (J. M n, ed. ) A
          igh-P an om                                                         ewY
                                                                   CMPress, N ork,
      pp. 2- 10, 1990.
                   em el
 [ 3] Z. Bai , J. D m and A M. ckenney, O con in of the n symetric eigen
                                         nthe dition g       on m              ,
                                                                         problem
        P CKworki ng note 13, U versi ty of T
      LA A                     ni            ennessee, CS- 89- 86, 1989.
                       . .
 [ 4] Z. Bai and G W Stewart, S R : AF                  e                   in t varian
                                     RIT ortransubroutin to calculate the dom an in    t
                                          i
      subspace of a n symetric m , to subm t to A
                     on m      atrix                    M
                                                 CMTO S, 1991.
 [ 5] S. Batterson, C vergen of the Q
                    on      ce                                     um ath. 58: 341{
                                                     orm atrices, N . M
                                    Ralgorithmon3x3 n al m
      352, 1990.
                       . .
 [ 6] C. Bavel y and G W Stewart, A                 putin      g
                                    nalgorithmfor com g reducin subspaces by block diago-
      n         ,
       alization SI A     um    nal
                     MJ. N er. A . , 16: 359- 367(1979).
                          . .
 [ 7] R. S. Bartel s and G W Stewart, S                                          m
                                       olution of the m equation AX +XB = C , Com .
                                                      atrix
      ACM15: 820- 826(1972).
 [ 8] Z. Cao and F. Zhang, D m
                            irect ethods for orderin eigen
                                                    g                                    ni
                                                          values of a real m , Chi nese U -
                                                                           atrix
                        p. ath. N 1, pp. 27- 36 (1981), i n Chi nese.
      versi ty J. of Com M         o.
Swappi ng A gor i t hm
           l                                                                                  16

i s the sol uti on of the Syl vester equati on. N that  200:01, (X) =0: 99498. W used
                                                   ote 1 (X)           2                  e
  A B
MTLA to com                                                           achi
                pute the di erent quanti ti es i n the bound (where m ne preci si on i s doubl ed
"M =2: 2204 2 10 16). Fi rst the normof the resi dual m x Y f or com
                   0                                         atri                      
                                                                                      X of
                                                                           puted sol uti on the
Syl vester equati on i s
                         kY kF =kA 12 0 A11X + XA22kF =4:
                                                                      0272 210012;
           ost
whi ch al m reaches the esti mated bound (16) of Y :
                           "M ( kA11kF +kA 22kF ) kX kF =8: 8830 210012 :
Furtherm                                     ~
        ore, the observed normof (2, 1) bl ock21 af ter swappi ng:
                                            A
                                        
                                       kA21k2 =1:
                                        ~                   2973 210012:
                                                          k2
whi ch i s al so roughl y attai ned to the bound (26) of21kE:

                            kE21k2  1 +12(X)kY kF =2:              0237 210012;
                                              2

 ote                  pl                                  ard
N that f or thi s exam e, the al gori thmi s sti l l backw stabl e, si nce
                       
                      kA21k2 =1:
                       ~           2973 210012 " M kA kF =4: 4189 210012 :

 f           ~
A ter setti ng 21 =0, then the m                ard
                                easures of backw stabi l i ty are E 2922 and EA =1: 8205.
             A                                                       Q =2:
    >FromRem 1 af ter Theorem2, we m ght worry that a huge kX k F or ti ny sepA11; A )
             ark                          i                                          (      22
                 eri                     ow                           pl
coul d cause num cal i nstabi l i ty. H ever the f ol l owi ng exam e i l l ustrates how i n practi ce a
   al                 A
sm l separati on of 11 and A 22 does not necessari l y l ead to i nstabi l i ty. Let
                                   "                #
                           A11 =       1   010 06       ;
                                                                           p
                                                                 A =A 11 + "M I;
                                                                 22
                                       1     1

then the separati on of 11 and A 22 i s ti ny; that i s sep ; A ) = 2: 9802 210014. Let A be
                         A                               (A11 22                           12
                    (A                                                                  al
chosen such that col 12 ) i s the l ef t si ngul ar vector of K correspondi ng to the sm l est si ngul ar
val ue  (K), so that the normof the sol uti on X of the Syl vester equati on 0XA 22 =A 12
        min                                                                  11X A
reaches i ts upper bound (28), that i s
                                         kA
                              kX kF = sep(A12;kFA ) =3:             3554 21013
                                                  11        22

and cond(X) =10 6. Hence the esti mated bound of the normof resi dual Y i s
                            " ( kA kF +kA 22kF ) kX kF =2: 5810 21002 :
                                 11

                                                 F k
H ever i n practi ce, the observed resi dual normkY=3: 7253 21009 . A ter swappi ng, i t turns
 ow                                                                  f
out that
                    kA21kF =7: 3985 210024  "M kA kF =5: 8747 210016:
                      ~
So the swappi ng i s perf ectl y stabl e!
Swappi ng A gor i t hm
           l                                                                                                                            15


                            abl      pari               s   EX      CH G
                           T e 2: com son of al gori thm SLA Cand EX N
                                EX
                              SLA C                                                                CH G
                                                                                                EX N
   1  ~
      2 =0:           7010001E +01 6 i0: 2085661E +02                       ~
                                                                             2 =0:     7026377E +01 6i 0: 2085408E +02
      ~
      1 =0:           7000999E +01 6i 0: 2085665E +02                       ~
                                                                             1 =0:     6984615E +01 6i 0: 2085919E +02
      ~
  10 2 =0:            7010000E +01 6i 0: 2085660E +02                       ~
                                                                             2 =0:     7063053E +01 6i 0: 2086175E +02
      ~
      1 =0:           7000999E +01 6i 0: 2085665E +02                       ~
                                                                             1 =0:     6947970E +01 6i 0: 2085144E +02
      ~
  100 2 =0:           7009999E +01 6i 0: 2085660E +02                                       not convergent
      ~
      1 =0:           7000999E +01 6i 0: 2085665E +02                                      af ter 30 QR steps


whi ch has ei genval ues
                                     2 =0: 7026377E +01 6i 0: 2085408E +02
                                     ~
                                     1 =0: 6984615E +01 6i 0: 2085919E +02
                                     ~
                           o      al                   1 or
f or  , i t sti l l has tw deci m di gi ts correct, but, f al l si gni cant di gi ts have been l ost. By
     2
the way, af ter standardi zati onA, i t becom
                                    ~
                                    of        es
          0
              0: 70263767E +01 0 86978951E +02 0 39378300E +02 0:
                                0:                0:                                                           22319088E +02
   B 0: 49999757E +01
  A = B 0: 00000000E +00
  ~ B                            0: 70263767E +01 0: 12174266E +02 0:                                          35997513E +02 C
                                                                                                                             C:
      @                          0: 00000000E +00 0: 69846153E +01 0:                                          11755766E +02 C
              0: 00000000E +00 0: 00000000E +00 0 37012115E +02 0:
                                                  0:                                                           69846153E +01
     abl                  eri
    T e 2 shows the num cal resul ts wi th di erent choi ces of param   eter  , where when  =10,
                 R                                                                                  EX
i t takes 17 Q i terati ons to convergence. I t cl earl y shows the superi ori ty of al gori thmSLA C.
                                             CH Gi
I n parti cul ar, we note that al gori thmEX N s nonconvergent when  = 100. I t m        eans that
                                                                CH G
the ei genval ues are not abl e to be exchanged by al gori thmEX N . But the al gori thmSLA C EX
                                           cul     ay
has no di cul ty. Thi s convergence di  ty m re
ect recent work of Batterson [ 5 has] , who
                                m       atri            Ri
di scovered cl asses of nonsym etri c m ces where Q terati on does f ai l to converge, or converges
qui te sl owl y.

5.2.3      On the upp r bou d (2
                     e     n    6) of                 kE          k
                                                                21 2

                                                                                                 21k2
Fi nal l y, i n the i nterest of theoreti cal anal ysi s, we di scuss the sharpness of the bound, on kE
                           eri                                EX        ost                   pl
whi ch control s the num cal stabi l i ty of al gori thmSLA C. I n m of the test exam es, we see
that the bound (26) of kE k2 i s very pessi m sti c. H ever, we do nd som exam es i ndi cati ng
                             21                 i         ow                   e      pl
                                                                                         2 pl
that the bound i n (26) can roughl y be attai ned. Let us consi der the f ol l owi ng exam e:
                                      0
         2   2            1: 0000E +00 0 0000E +02 1: 9900E +04 1: 0201E +02
                                           1:
      2 A11 A12                             1: 0000E +00 1: 0000E +02 0 9800E +00 C
                                    B 1: 0000E 002                       1:
   A=                              =B
                                    B
                                                                                    C
      2 0 A22                       @           0       0 1: 0100E +00 0 0000E 002 C
                                                                         1:
                                      0                 0 1: 0000E +02 1: 0100E +00
where sep(A11; A ) =2 210 06 . The A12 bl ock of A i s desi gned so that
               22


                                          X=        1: 0000E +00 0 0000E +02
                                                                  2:
                                                    1: 0000E +00 0 0000E +00
                                                                  1:
  2 For
          brevity, only ve di gi ts are di spl ayed for al l the data i n thi s secti on though we di d run i n doubl e preci si on.
Swappi ng A gor i t hm
           l                                                                                                                             14


                                             abl      eri                         EX
                                            T e 1: num cal tests of al gori thmSLA C
 Test                         atri
                             m x                                   sep(A ; A ) EQ
                                                                        11  22          EA    ei genval ues af ter swappi ng
                  2    087 020000 10000
   1              5
                  0
                          2 020000 010000
                          0           1     011                    3: 337 210 1 0. 260 0. 197 0 2000000 01 0 2085665 02
                                                                            0                 0 1000001 :
                                                                                                        :01
                                                                                                             0 2017424 02
                                                                                                                        i :
                                                                                                                        i :
                  0       0         37         1
                     1 03        3576    4888
   2                 1
                     0
                            1    088 01440
                            0 1 001:       03                       8: 442 210 4
                                                                             0         0. 625 0. 423   0:1001000
                                                                                                       0:1000000
                                                                                                                   01
                                                                                                                   01
                                                                                                                        0 1732917
                                                                                                                        i :
                                                                                                                        0 1732051
                                                                                                                        i :
                                                                                                                                    01
                                                                                                                                    01
                     0      0 1 001:    1 001:

                     1 0100         400 01000
   3              0 01
                   :
                     0
                              1    1200
                              0 1 001  :
                                            010
                                          00 01      :
                                                                    2: 000 210
                                                                             0         0. 417 0. 001   0:1000996
                                                                                                       0:1000003
                                                                                                                   01
                                                                                                                   01
                                                                                                                        0 1000360
                                                                                                                        i :
                                                                                                                        0 9995396
                                                                                                                        i :
                                                                                                                                    01
                                                                                                                                    00
                     0        0     100    1 001 :

                        1 03 3          2
   4                    1
                        0
                                1 9
                                0 1 03
                                        0
                                                                                       0. 687 0. 241   0:9999987
                                                                                                       0:1000002
                                                                                                                   00
                                                                                                                   01
                                                                                                                        0 1732051
                                                                                                                        i :
                                                                                                                        0 1732051
                                                                                                                        i :
                                                                                                                                    01
                                                                                                                                    01
                         0     0       1     1




 .2
5 .2          o        pr on           th   te           rt'          r
                                                                     o th


  e              eri        pari                                                EX
W have done num cal com sons between the di rect swappi ng al gori thmSLA Cand Stew-
                              CH G[                   R                            s
art' s swappi ng al gori thmEX N 17 ] , whi ch uses Q i terati on. Both al gori thm perf ormwel l
     ost                                                CH Gi                            EX
i n m cases, but i n certai n cases, the al gori thmEX N s i nf eri or to al gori thmSLA C. For
     pl
exam e, l et                     0
                                   7: 001 087     39: 4     22: 2
                                 B
                                 B     5 7: 001 0 2
                                                 12:         36: 0C
                                                                   C
                          A( ) =B                                   ;
                                 @     0     0     7: 01 0 7567 C
                                                          11:
                                       0     0       37       7: 01
where  i s a param             atri
                     eter, the m x A( ) has i nvari ant ei genval ues
                                            1 = 0: 7001000E +01 6i 0: 2085666E +02
                                            2 = 0: 7010000E +01 6i 0: 2085660E +02;
                        hen                 atri                    EX
sep(A11 ; A ) =0: 0024. W  =1, the output m x of the al gori thmSLA Ci s
          22
        0
        0: 70100012E +01 0 86993660E +02 0 39390938E +02 0 22241005E +02
                          0:              0:                0:
   = B 0: 50003409E +01 0: 70100012E +01 0: 12191071E +02 0 35999401E +02 C
      B                                                     0:              C
  ~
  A B 0: 00000000E +00 0: 00000000E +00 0: 70009995E +01 0 11755549E +02 C
      @                                                     0:
        0: 00000000E +00 0: 00000000E +00 0: 37003792E +02 0: 70009995E +01
The ei genval ues af ter swappi ng are
                                            2 = 0: 7010001E +01 6i 0: 2085661E +02;
                                            ~
                                            1 = 0: 7000999E +01 6i 0: 2085665E +02;
                                            ~
                         achi              ow                                CH Gaf
whi ch i s accurate i n m ne preci si on. H ever, the output of al gori thmEX N ter 8 QR
i terati ons 1i s
        0
             0: 28140299E +02 0 81122643E +02
                               0:                                                  00:   39849255E +02
                                                                                               15834051E +0200:
  B 0: 10856283E +02 0 14087547E +02 0 23942078E +02
     B                  0:               0:                                                 0: 32877380E +02 C
 A = B 0: 00000000E +00 0: 00000000E +00 0: 19211971E +02
 ~
     @
                                                                                                             C;
                                                                                            0: 21227583E +02 C
             0: 00000000E +00                            0: 00000000E +00 0 27540298E +02 0 52427406E +01
                                                                           0:              0:
  1w
    here   the stoppi ng cri teri on used i n                  i terati on i s     :
                                                                                             07 .
Swappi ng A gor i t hm
           l                                                                                       13

subrouti ne          , and the subprobl emof standardi zi ng a 2 22 bl ock i s i m em
                                                                                  pl ented i n subrouti ne
        .
                            pl                          e
   I n the i nterest of si m i ci ty, we al so used som other subrouti nes f romLA A  P CKand the BLA  S
                 e
to perf ormsom basi c l i near al gebra operati ons, such as generati ng H                            ati
                                                                                ousehol der transf orm ons,
   puti
com ng the 2- normof a vector and so on.
                                                            ati                                 EX
   Fi nal l y, a test subrouti ne has been wri tten to autom cal l y test the subrouti ne SLA C. There
                                                              eri
are nested l oops over di erent bl ock si zes, di erent num cal scal es, and di erent condi ti oni ngs of
the probl em  .



 .2
5 .               d
                 r t b t    te t


  o easure the backw stabi l i ty of a swappi ng al gori thm we need to test (I ) how cl ose the
T m                     ard                                           ,
com  puted orthogonal m x atri                                                           
                                     i s to the i denti ty m x, and (I I ) how cl ose  i s to the
                                                              atri                     A~
             atri                                                            o
ori gi nal m x A. I n other words, we need to test whether the tw quanti ti es:
                                      kI 0  k1 ; E = kA 0 A  k1 ;
                                                                     ~
                              EQ =                       A
                                             "                   " kA k1
                               achi                    o                      ong
are around 1, where " i s m ne preci si on. T check the changes am ei genval ues i s not requi red
                                                   ,                              ust
to j udge the correctness of an al gori thm si nce we know that there m have at l east an order
of (" kA k) perturbati on to the ori gi nal m x af ter swappi ng, and the nonsym etri c ei genval ue
                                                      atri                                   m
                                                     ow                                      atri
probl emi s potenti al l y i l l - condi ti oned. H ever, f or a reasonabl y condi ti oned m ces, the changes
i n the ei genval ues do m                                                 .
                          easure the accuracy of a swappi ng al gori thm For thi s reason, i n the f ol l owi ng
     eri          pl
num cal exam es, we al so com           pare the ei genval ues bef ore and af ter swappi ng, besi des checki ng
        ard                        E
backw stabl e quanti ti es Q and E A .
      e                                        atri                    i
     W have done extensi ve testi ng on m ces wi th vari ous m xtures of the bl ock si zes, scal es and
               ong                     ore                                            EX
cl oseness am ei genval ues. M speci cal l y, we showthe al gori thmSLA C on the f ol l owi ng
                  atri
f our types of m ces:
      est atri                                  and
     T M x 1: wel l separati on of11A A 22, the ei genval ues bef ore swappi ng are
                               1 =0: 2000000E +01 6i 0: 2085666E +02
                               2 =0: 1000000E +01 6i 0: 2017424E +02
     est atri
   T M x 2: m                                         11 and
                     oderate separati on separati on of A A 22 , the ei genval ues bef ore swappi ng
are:
                            1 =0: 1000000E +01 6i 0: 1732051E +01
                            2 =0: 1001000E +01 6i 0: 1732916E +01
     est atri
   T M x 3: cl ose ei genval ues, the correspondi ng the Syl vester equati on i s very i l l - condi ti oned,
the ei genval ues bef ore swappi ng are
                            1 =0: 1000000E +01 6i 0: 1000000E +01
                            2 =0: 1001000E +01 6i 0: 1000000E +01
     est atri                  e                               11 A                 e,
   T M x 4: the extrem case, where the ei genval ues of and A 22 i s the sam theoreti cal l y,
                                                          atri
the Syl vester equati on sol uti on i s i nni te. Thi s m x i s used to test the robustness of our sof tware
agai nst over
ow.
     abl        m                                           EX          (A
   T e 1 sum ari zes the resul ts of al gori thm SLA C, where sep 11; A ) i s com
                                                                               22         puted by
 A B,                                                                                 abl
MTLA i t i s i ncl uded here f or the i nterest of theoreti cal anal ysi s. FromT e 1, we see that
               ard                                                  EX
both the backw stabi l i ty and accuracy of the al gori thmSLA Care sati sf actory.
Swappi ng A gor i t hm
           l                                                                                         12

 n
O the other hand, i t i s easy to see that
                                                  kA
                                       kX kF  sep(A12;kFA ) :                                    (28)
                                                      11   22

                                        col
where the equal i ty i s attai ned when (A12 ) i s a l ef t si ngul ar vector of K correspondi ng to the
  al                     m                            bi                    o
sm l est si ngul ar val uei n (K) =sep(A11; A ). Com ni ng the above tw i nequal i ti es, we have
                                             22

                                          " ( kA kF +kA 22kF ) kA12kF
                              kE21k2          11
                                          (1 + 2 (X))sepA11; A )
                                                 2       (
                                                                      :
                                                                 22

                                                          eri
Logi cal l y, the above bound i ndi cates that the num cal i nstabi l i ty wi l l occur i f we have sm l       al
                                           eri
sep(A11 ; A ). But i n practi ce, num cal experi m
            22                                          ents show that thi s upper bound i s very pes-
    i          al (A                          pl               e
si m sti c. Sm l sep11; A ) does not i m y i nstabi l i ty. W wi l l di scuss thi s f urther i n the f ol l owi ng
                           22
secti on.
                                         ent
    Re ma r k 2 . I terati ve renem appl i ed to the Syl vester equati on wi l l i m    prove the accuracy of
com puted X, (unl ess the Syl vester equati on i s too cl ose to si ngul ar), but i t need not i mF, kY k
                                                                                                  prove
at l east when G                 i                pl
                 aussi an el i m nati on wi th com ete pi voti ng i s used to sol ve the Syl vester equati on.
    Re ma r k 3 . The f actor  (1 +2 (X)) that aects k11k2 and kE 22k2 i s i nteresti ng, si nce
                              1 (X)          2                   E
                                                   ay
i t warns that l arge and i l l - condi ti oned X m endanger accuracy, because of (27) and
                                     1(X)        cond(X)
                                             =          0      :
                                   1 + 2 (X) 2 (X) + 2 1 (X)
                                        2


                                      ow              (
where cond(X) =  1(X) 2(X). H cond(X), sepA11; A ), and the accuracy of the swapped
                                                             22
ei genval ues are rel ated i n practi ce needs f urther i nvesti gati on.

       of tw re        e el o ment nd                eri
                                                   um c l                      ent
                                                                          eri m s
                                                    ent           are
I n thi s secti on, we rst di scuss the devel opm of sof tw f or the swappi ng al gori thmSLA C.   EX
                       eri
Then we di scuss num cal experi m                                                   are
                                        ents to show the capabi l i ty of our sof tw to deal wi th i l l -
condi ti oned cases, com                                                CH G
                           pare wi th Stewart' s swappi ng al gori thmEX N , and nal l y demonstrate
the sharpness of our perturbati on bounds.
     l      eri
    A l num cal experi m     ents were carri ed out on a SU                   .             eti
                                                            Nsparc stati on 1+ The ari thm c i s I EEE
standard si ngl e preci si on, wi th m ne preci si on " 
                                       achi               023=21: 192 2100 .



             R Nsubrouti nes has been devel oped to i m em the di rect swappi ng al gori thm
Aset of FO TRA                                               pl ent
                                              P CKproj ect .[ 2 s wi th other LA A
descri bed i n Secti on 3. I t i s part of LA A             ] A                  P CKrouti nes, thi s
al gori thmwas desi gned f or accuracy, robustness and portabi l i ty.
    The m n subrouti ne i s cal l ed
          ai                                  .          m oves a gi ven 1 2 1 or 2 22 di agonal bl ock
                                 atri                                     n
of a real quasi - tri angul ar m x to a user speci ed posi ti on. O return, param         eter        reports
whether the gi ven bl ock has m oved to the desi red posi ti on, or whether there are bl ocks too cl ose to
swap, and what i s the current posi ti on of the gi ven bl ock. The subrouti ne            i s supported by
subrouti ne         , whi ch perf orma swap to exchange adj acent bl ocks. The subrouti ne           i s an
   pl entati on of the al gori thmSLA Cdescri bed i n Secti on 3, where the subprobl emof sol vi ng
i m em                                  EX
the Syl vester equati on (12) by G                   i                 pl                      pl ented i n
                                      aussi an el i m nati on wi th com ete pi voti ng i s i m em
Swappi ng A gor i t hm
           l                                                                                                                                                     11

                     posi
      By the CS decom ti on of                            and (23), we have
                                                                                  1 (X)
                                                           k    11 2k    =
                                                                              (1 + 1 (X))1
                                                                                    2                      2

and
                                                 k    12 2k =k            k
                                                                        21 2;        k 22k2 =k                   k
                                                                                                               11 2 ;

Thus, f or E , we have
            11


                            kE11k2 k         12 2 k kY kF k         01 k2 k          k k
                                                                                     11 2
                                                                                                   0
                                                                                                   12      k2 = 1 +(X) kY kF:
                                                                                                                  1
                                                                                                                     2(X)
                                                                                                                          2

    i              E
Si m l arl y, f or22, we have
                                                                    01 k2                 1(X)
                           kE22k2 k          k kY kF k
                                           11 2
                                                                                (1 + 1
                                                                                      2 (X)) 2(1 + 2(X)) 2
                                                                                           1            1
                                                                                                                                      kY kF:
                                                                                                    2

                  E
Fi nal l y, f or 21, we have
                                                                                     01 k2 =            1
                                      kE21k2 k            12 2k kY kF k                            1 + 2 (X)
                                                                                                         2    kY          kF:
Hence we have the f ol l owi ng theorem.

       er
       ho e            .
                       2      t   Y =A        12   0A 11X + XA22
                                                                              w r
                                                                                 h       
                                                                                         X =X +E i t h                         om t
                                                                                                                                 p               ol   t i on o   th

"
S l
           #
           t   r           at i on        a        m t hat t h           r r or      m ri
                                                                                      at    E i non i ng                       l ar    l   t th            a t or i   at i on o

    0X 
                   at i
     I
                                                               "            #          "           #
                                                                    0X
                                                                     
                                                                                = 
                                                                                            
                                                                                                       ;
                                                                     I                      0
th n                                                           "                      #        "                      #
                                                                    ~   ~
                                                                    A22 A12                        E22 E12
                                                A =                                     +
                                                                        ~
                                                                     0 A11                         E21 E11
w r
 h         ~
           A       i          i
                           i m l ar t o   Ai =1; 2             an        p to th            r t or             r p rt     r    at i on     2)(   kE k
                                                               1 (X)
                                      kE11k2                      2   kY k ;
                                                             1 + 2 (X) F
                                                                                                                                                            (24)
                                                                        1 (X)
                                      kE22k2                (1 + 1 (X))1 2(1 + 2 (X))1
                                                                     2            2                               2
                                                                                                                      kY kF;                                (25)
                                                                  1
                                      kE21k2                      2   kY k ;
                                                             1 + 2 (X) F
                                                                                                                                                            (26)

w r
 h         1 (X)            2 (X)       0 ar       th    i ng      l ar       al         o       2 22 m r i X .
                                                                                                         at



    e ake
   W m the f ol l owi ng remarks f or the above theorem  :
                                   ,
   Re ma r k 1 . Fromthe theorem we see that the departure f romupper bl ock- tri angul ar f orm(the
m                                                   k (1+ 2
 easure of num cal i nstabi l i ty) i s dom nated byF Y k 2 (X)). Fromthe normof the resi dual
              eri                          i
Y (16), we have
                             kY kF  " ( kA11kF +kA 22kF) kX kF:                        (27)
Swappi ng A gor i t hm
           l                                                                                                                 10

and
                       E21 =        0             0       01 +                         01 A22 01
                                         12A11    12       12E               12E
                                    0                        01
                           =             12( 0 11 E +E A 22)
                                              A
                           =             Y 01 :
                                        12

 e                                           ,
W see that up to rst order perturbati ons,11E E22 and E 21 are essenti al l y rel ated to the resi dual
vector Y of the Syl vester equati on sol ver, and the subbl ocks 11 and   12 of     . Furtherm ore,
rewri ti ng (7) as             "     # "               #"     #
                                 0X = 11 21
                                  I            21   22      0
we see that
                                                        21   = 01
and
                                                        =I +X X:
                                                    atri
Let  (C ) denote the set of si ngul ar val ues of m x C , and  (C ) denote the set of ei genval ues of
 atri
m x C , then
                    2 ( ) = (          ) = (I +X X) =1 + (X X) =1 + 2(X):
Theref ore
                                                1
                                             01 k2 =         1
                            k      k =k
                                  21 2              =
                                              2( ) (1 + 2 2(X)) 2 ;
                                                                   1
                                                                                           (23)

where 1(C ); 2 ) denote the si ngul ar val ues of 2 22 m x C wi th )  (C ) 0. N
                   (C                                      atri        1 (C    2             ow
           ate                                                              posi
to esti m the normof the bl ocks of , we use the f ol l owi ng CS decom ti on (cosi ne- si ne
        posi                                   atri                                 ] , 18
decom ti on) of a parti ti oned orthogonal m x, whi ch was i ntroduced by Stewart [al though
           pl                      avi     ahan The       posi                    e
i t i s i m i ci t i n a paper of D s and K ] .[ 9 decom ti on has l ed to som usef ul resul ts
on the si ngul ar val ues of products and di erence of proj ecti ons. A proof of the exi stence of the
        posi
decom ti on can be f ound i n [ 20   ].

         e o    o
               p ton   :   t th     or t hogonal       m ri
                                                        at
                                                                             2     2       par t i t i on    i n th   or m




                                                              11        12
                                                  =
                                                              21        22

 h n th r     ar   or t hogonal    m ri
                                    at                = ( ag
                                                        i 1;       2)   an         =       ( 1;
                                                                                        i ag       2)    i
                                                                                                        w th   1; 1
   h t hat



                                                                   C
                                                       =
                                                                   0     C
 h
w r
                                                                                                  2     2
              C=       ( 1; 2; . .; . )
                    i ag                     0;         =        ( ; 2; . .; . )
                                                             i ag 1                       0;      C+        =I :
Swappi ng A gor i t hm
           l                                                                                                                                                               9

and up to the rst order perturbati ons, we have
                                                                          =           0           01
                                                                    11                       11 E                                                                   (20)
                                                                          =           0           01
                                                                    21                       12 E                                                                   (21)
 o
T express     22 ,   agai n f rom(18),
                                   "                        #             "           #              "           #       "               #         "       #
              (I +             )
                                       0X 0E                    =                         +                          =
                                                                                                                             0X              +                  :
                                               I                               0                         0                    I                        0
              "           #
By cancel i ng
                     0X                                                  ul
                              f romboth si des of the equati on, and prem ti pl yi ng by , we obtai n
                     I
                                                    "                         #         "        #                   "       #
                                                        0X 0E                     =                      +
                                                                                                                         E
                                                                                                                                 :
                                                                I                            0                           0

I nserti ng       =I i n the l ef t si de of the above equati on, we have
                                                        "                          #         "           #               "           #
                                                            0X 0E                       =                    +               E           :
                                                                     I                           0                           0

Si nce        =0              =0 , we have
                                       "        #           "                     #              "           #       "                   #
                                                    0                    11E           =0                        0           11E             :
                                           0                             12E                         0                       12E

Thus the bottom equati on i s

                                               21       0       21       11E      0         22   12E         =0          12E ;

                 i               atri
by (21) and assum ng that error m x E i s nonsi ngul ar, then
                                                   =0                         0 =                            01              0 :
                                           22               21       11       12                 12E                 11      12                                     (22)
>Fromexpressi ons (20), (21) and (22) of11;                                        12     and        22,         the E , E22 and E 21 are recast as
                                                                                                                      11

                                   0         01    0         01    0                                                                                       0
              E11 =            12 A11
                                   12  12E      11 12 0 12 E    11 12                                                                            12A11     12
                           + 12 E 01( 0 A 22 01 11 0 + 11 A11 0 )
                                                     12         12
                         = 12 (A11E 0E A 22) 01 11 0 12
                         = 0 12 Y 01 11 0 ;
                                          12

and
                          E22 =            0 A 22 01 11E 01 + 11E 01 A22 01
                                           0( 0 A 22 01 11 0 + 11A11 0 ) 12E
                                                              12     12
                                                                                                                                                 01
                                                                 01
                                   =         11( 0 11 E +E A 22)
                                                  A
                                   =                        01 ;
                                                11Y
Swappi ng A gor i t hm
           l                                                                                                                                        8
                                                                                                               "            #
perturbati on of the Q actori zati on,
                      Rf                                            Rf
                                                                                   0X
                                                   we knowthat the Q actori zati on of
                                                                                       
                                                                                                                                can be wri tten
                                                                                                                       I
as                       "     # "       #      "                                                              #
                     =    0X + 0E =   =( + )                                                        +
                                                                                                                   ;                         (18)
                            I          0                                                               0
where and are the perturbati ons of orthogonal m x and tri angul ar m x , respecti vel y,
                                                 atri                      atri
                                                                                 0k
 = + i s orthogonal . k k and k k are essenti al l y bounded by the term of order 1k kE k.
                                                                         s
>From( + ) ( + ) =I , up to the rst order of the perturbati on, we have
                                                           =0                  :
hen  = +
W                          s
                 transf orm A, i gnori ng the second order perturbati on we have
                             A  = ( + ) A( + )
                                  =    A +   A + A +                                                   A
                                  = A~+    1 A + A 1
                                     ~ ~
                                  = A+A     0    ~
                                                A:
D ng
 eni     =                                        al     ~th
                   and parti ti oni ng i t conf orm l y wiA i n the f orm
                                                       "                       #
                                                              11       12
                                                   =                               ;
                                                              21       22

we have                                    "                       #       "                       #
                                               ~   ~
                                               A22 A12                         E22 E12 ;
                                  A =                                +                                                                     (19)
                                                   ~
                                                0 A22                          E21 E11
where
                                       ~
                                 E11 = A11               22 0        ~
                                                                   22A11       0         ~
                                                                                       21A12 ;
                                       ~
                                 E22 = A22               11 0        ~
                                                                   11A22   ~
                                                                         + A12             21 ;
                                       ~
                                 E21 = A11               21 0        ~
                                                                   21A22;

                                                   21 s
E11 and E 22 perturb the ei genval ues di rectl y. iE of i nterest because i t essenti al l y re
ects the
     eri                                  i                        ~
num cal stabi l i ty of swappi ng.12 Es the error to the bl ock12. I t i s not of i nterest si nce i t
                                                                  A
                             eri
nei ther aects the num cal stabi l i ty of the al gori thmnor the perturbati on of ei genval ues. The
                                                  s 11 22             o
f ol l owi ng task i s to gi ve bounds on the norm of ;E E and E 21. T do so, l et us rst express
          s
i n term of the bl ocks of , E and . From(18), we have
                        "          #           "           #               "           #       "       #       "                  #
          (I +      )
                             +
                                       =
                                                   0X          +
                                                                               0E          =               +
                                                                                                                       0   11 E       :
                             0                      I                              0               0                   0   12 E

Postm ti pl yi ng by ( + 01 on both si des of the above equati on, and noti ng that
      ul                 )                                                                                                                = , the
resul t i s                      " # "                 #
                         (I + )
                                   I =         0 11E ( + ) 01 ;
                                   0          0 12E
theref ore
                             11 = 0 +( 0 11E )( + ) ;
                                      I                       01
                             21 = 0       E ( + ) 01 ;
                                                    12
Swappi ng A gor i t hm
           l                                                                                                                                                                               7

                o                                                 i                      ati
    I f the tw bl ocks are exchanged, then an orthogonal si m l ari ty transf orm on i s perf orm on      ed
the 2 22 bl ocks (i f any exi st) to return themto standard f orm(4).
                                  m                                                                ,    al
    Fi nal l y, si nce the nonsym etri c ei genval ue probl emi s an i l l - condi ti oned probl em a sm l per-
turbati on to a 2 22 bl ock (com ex conj ugate ei genpai r) coul d cause a l arge perturbati on of i ts
                                    pl
ei genval ues. I n the extrem case, a 2 22 bl ock coul d spl i t i nto tw 1 21 bl ocks i f i ts com ex
                                e                                               o                          pl
                                e
conj ugate ei genval ues becom real . Caref ul l y desi gned standardi zati on steps wi l l detect and report
such phenom    ena.
      l                                  m
    A l above consi derati ons are sum ed up i n the f ol l owi ng al gori thm   .

            o th
             r                                 i                l                                      eti
                                             (D rect Swappi ng A gori thmusi ng 
oati ng poi nt ari thm c)
    .       op    A     to
                                                                     "                          #               "                        #
                                                                             11           12                          A11 A12
                                                            =                                            A=
                                                                             0            22                           0 A22
    .             a         i an          i          i
                                     l i m nat i on w t h                        ompl           t   pi    ot i ng t o           ol



                                                                                     11X   0X        22   =         12;

         h
        w r             i       a    al i ng        a t or t o pr                         nt o       r    ow.          th r          i       a       m l
                                                                                                                                                      al         i agonal           l   m nt          r i ng

            a     i an               i
                                l i m nat i on              t i t to ro                    ghl       a
                                                                                                    m hi n            pr    i    i on                al              th      nor m o     th           at
                                                                                                                                                                                                     m ri

        i         i r           .

                                                                     "                #
    .       om t
              p             th              a t or i     at i on
                                                                             0X            =                  o       hol        r t r an                 at
                                                                                                                                                      or m i on .
                                                                                 I
    .       r or m wappi ng t                     nt at i        l       .            i         w th r to a
                                                                                                 h                          pt       wap         i        th    nor mo        th                 nt r

            l o         o               i     l       t han or                        al    to       (" ) k
                                                                                                        M         k
                                                                                                                  go t o t h          n      t       t    p     an       ot h r wi             i t


    .       th        wap i         a       pt        t r an         or m         A                 an        t th                       nt r             l o        o   A     to       r o.


    . St an ar              i       2 22      l o            i       an               i    t.




                pl entati on of SLA C i n LA A , we have chosen 10" kA k M as the stabi l i ty
    I n our i m em                    EX         P CK
cri teri on i n step 4, where kA k ax
                                M =m            .
                                                                  Ci   P CKwhi ch cal l s SLA C
    Fi nal l y, we note that we al so provi de a subrouti ne STREX n LA A                    EX
                                                                                               ay
to reorder al l the ei genval ues i nto a user sel ected order. I n parti cul ar, the user m sel ect any
                                                                                          atri
subset of the spectrumwhi ch wi l l be reordered to appear at the top l ef t of the m x usi ng the
                                 EX
f ewest possi bl e cal l s to SLA C.

                  n
            rror A l s i s of t e                                                     i rect w                                  l
                                                                                                                          i ng A gori t m
                                                                                        EX
I n thi s secti on, we gi ve an error anal ysi s of the di rect swappi ng al gori thmSLA Cdescri bed i n the
                                                            e
l ast secti on. I n the i nterest of brevi ty, we assum that = =2, i . e. , we onl y consi der swappi ng
tw 2 22 bl ocks, the hardest case of the probl em I n addi ti on, we al so assum that the scal i ng
   o                                                     .                               e
f actor =1. Q                               i
                                             ke
                  uanti ti es wi th bars (l X) denote com   puted quanti ti es.
          
     Let X be the com                                                      
                                                                          X =X
                        puted sol uti on of the Syl vester equati on, where +E , X i s the exact
                                    atri                   ent
sol uti on, and E i s an error m x. By the argum of (17), and a resul t of Stewart [ the    ] on 19
Swappi ng A gor i t hm
           l                                                                                              6

          A                       e
case, i f 11 and A 22 have the sam ei genval ues, the Syl vester equati on i s si ngul ar and the sol uti on
                  o                           ,
X i s i nni te. T prevent possi bl e over
ow i nstead we sol ve the equati on
                                        A11 X 0XA 22 = A 12                                        (12)
or the correspondi ng l i near system
                                                 K =                                               (13)
where i s a scal i ng f actor (  1), and K i s dened as (9). Possi bl e over
owof X i s taken care
of by choosi ng a sm l scal i ng f actor . I n the extrem case, whenand A 22 have the sam
                     al                                        e          11 A                       e
ei genval ues, we choose =0. Because the l i near system(13) can onl y be up to 4 24, i t does not
           uch
cost too m to use G                    i                 pl                                            eri
                        aussi an el i m nati on wi th com ete pi voti ng to sol ve i t wi th better num cal
properti es (i n parti cul ar, the pi vots are wi thi n a m odest f actor of the si ngul ar val ues of the 4 by
    atri
4 m x, so setti ng ti ny pi vots to a chosen ti ny val ue control s the condi ti oni ng of the systemand
                            ppl                             ], a                ard
normof the sol uti on). A yi ng standard resul ts f rom[ 22strai ghtf orw anal ysi s shows that
f or the com                
            puted sol uti on of the Syl vester equati on:
                           X
                                 kE kF      " ( kA k +kB k F ) kK01k2 ;
                                 kX kF            F                                               (14)

where E = X 0 X, i s sm l constant of order (1), and " i s m ne preci si on. N ce that
                                al                                            achi                 oti
kK  01 k2 i s the reci procal of the m ni m si ngul ar val ue of K, denoted  Si nce m n (K) i s
                                          i al                                m n (K).
                                                                               i           i
                                                               atri and A
cl osel y rel ated to the separati on of the spectra of m 11ces A 22 , m n (K) i s al so cal l ed the
                                                                                 i
                        atri     A                         (            ]
separati on of the m ces11 and A 22 , denoted sepA11; A ) [ 20 . Theref ore (14) can be wri tten
                                                                  22
as
                                                         k
                                        kE kF  " ( kAF +kB k F) :                                (15)
                                        kX kF       sep(A11; A )
                                                              22
                                                         ,                          eri
I n the f ol l owi ng error anal ysi s of the al gori thm we wi l l see that the num cal stabi l i ty i s essenti al
governed by the resi dual
                            Y     A 0A 11X + XA22 =0
                                   12             A                  11 E   +E A 22:
 ppl
A yi ng standard error anal ysi s of G               i      ] 12
                                      aussi an el i m nati on, [we have
              kY kF =kA 12 0A 11X + XA22kF  " ( kA11kF +kA 22kF) kX kF:
                                                                                     (16)
N ce that the bound does not i nvol ve k01k2" or sepA11; A ).
 oti                                    K ,        (
                                                   #     22

   N f or the Q actori zati on of the m x0X , by H
                                                 
     ext       Rf                        atri            ousehol der el ementary re
ectors, we
                                                           I
knowthat                                "        #         "       #
                                            0X
                                             
                                                     = 
                                                               
                                                                       ;                           (17)
                                             I                 0
where  = + ; k k  " ,                = I , i . e. , the computed m  i s orthogonal to m ne
                                                                    atri x                     achi
              ].
preci si on [ 22
     e                                         e
    W wi l l showi n the next secti on, i n som pathol ogi cal cases, the normof the (2, 1) entry (bl ock)
of  A  m be l arger than (" ) kA k, i . e. , i t m be backw unstabl e i f we are f orced to treat
             ay                                         ay         ard
 A  as bl ock upper tri angul ar by setti ng the (2, 1) entry to zero. Theref ore we propose to perf orm
                                                                                 A
adj acent bl ocks swappi ng tentati vel y; i f the normof the (2, 1) entry (bl ock) of i s l ess than
or equal to (" ) kA k, we swap them otherwi se we return wi thout perf orm ng the swap.
                                       ,                                      i
Swappi ng A gor i t hm
           l                                                                                                                    5

   .      p
        om t   an or t hogonal      at
                                   m ri                    h t hat

                                                       "             #         "       #
                                                           0X              =               ;
                                                            I                      0

   .    r or man or t hogonal         i
                                   i m l ar i t        t r an            at
                                                                     or m i on

                                                                 "                      #
                                                                      ~   ~
                                                                      A22 A12
                                                  A =                     ~   :
                                                                       0 A11

                                                              see       ne
   For l i terature on howto sol ve the Syl vester equati on, , 12][.7 O di rect way i s to recast i t
as a l i near systemof equati ons:
                                             K =;                                              (8)
where
                      K =I         A11 0A 22           I;                   (
                                                                         =col X);                     (A
                                                                                                    =col 12):             (9)
  ere
H the K   ronecker product             o atri
                                  of tw m ces                             atri
                                                      and i s the bl ock m x whose (i ; ) bl ock
i s ( ). For an 2 m x , col ) denotes the col um vector f orm by taki ng col um
                        atri         (                        n           ed             ns
of    and stacki ng thematop one another f roml ef t to ri ght. That i s
               col(   ) =[   11;   21;   . .; .   1;       12;       22;   . .; .      2;      . .; . 1 ; . .; .   ] :
                                  m                         ci    atri
Si nce A and A 22 have no com on ei genval ues, the coe ent m x K of the l i near system(8)
         11
i s nonsi ngul ar. H  ence there i s a uni que sol uti on. N that the m ces A 21 or 2 22
                                                            ote           atri are 1
m ces, the l i near system(8) can onl y be up to 4 24. W can si m y use G
  atri                                                          e      pl                       i
                                                                                 aussi an el i m nati on
to sol ve i t.
                                             atri                 11 and
    I n the second step, "the orthogonal m x whi ch swaps the A A 22 can be com
                                 #                                                      puted by
the Q f actori zati on of
       R                    0X usi ng Househol der or Gi vens transf orm ons.
                                                                          ati
                             I
                                         Rf                                   atri
    Fi nal l y, we note that f romthe Q actori zati on (7), the orthogonal m x whi ch swaps A     11
and A 22 can al so be expl i ci tl y wri tten as
                                         "                       #"                             #
                                             0X        I                    0
                                                                           C1 1 0
                                     =                                          0                                        (10)
                                              I        X                    0 C2 1
where
                             C1 C1 =I +X X;                           C C2 =I +XX :
                                                                      2                                                  (11)
H                  pl entati on of the di rect swappi ng al gori thmi s to use the expl i ci t expressi on
 ence another i m em
                       puti                                         g            i m[ em
(10) f or , af ter com ng the Chol esky f actori zati ons (11). N and Parl ]ett pl14 ented thi s
      e,             eri
schem but our num cal experi m                                 e     uch                      l
                                   ents showthat thi s schem i s m l ess robust than A gori thm
                      eri
1, because of the num cal sensi ti vi ty of the Chol esky f actori zati on (11), and the use of the i nverses
  0        0
C1 1 and C 2 1 . W have not pursued thi s schem
                 e                             e.

         e     r ct i c l          i rect w                                l
                                                                     i ng A gori t m
I n the presence of roundo, the bi ggest concern i s sol vi ng the Syl vester equati on (6). The l i near
                                                   11 f A
system(8) coul d possi bl y be i l l - condi ti oned i and A 22 have cl ose ei genval ues. I n the extreme
Swappi ng A gor i t hm
           l                                                                                                                                           4

then                                                  "                  #          "                 #
                                                          0X        I
                                                                             =                   11        :
                                                           I        0                    0       12

             atri
Si nce both m ces on the l ef t are i nverti bl e so are                                          12. Thus
                                                                                                  and
                   "                  #                   "                      #"                        #"                #
                       A11 A12
                                                   =
                                                               I    0X             I X  A11 0
                        0 A22                                  0I                  0 I   0 A22
                                                     "          #"         #"                  #
                                                                   A22 0        01 0 01 11 0
                                                   =         11
                                                                                       0
                                                                                           12
                                                       0     12     0 A11      0       12
                                                     "                                       #
                                                         A22   01 0 A 22 01 11 0 + 11A11 12
                                                   =                            12
                                                           0                  A11 0                   12            12
                                                      "                     #
                                                          ~   ~
                                                          A22 A12
                                                              ~
                                                           0 A11

        ~         i        ,
where A i s si m l ar to A i =1; 2, so that the ei genval ues are i nvari ant, but thei r posi ti ons are
exchanged. Furtherm                                                                                ati
                      ore, we have the f ol l owi ng theoremto speci f y such orthogonal transf orm on,
                    g              ]:
whi ch i s due to N and Parl ett [ 14

       ho e
       er            g
                   (N and Parl ett).                 n
                                                    A or t hogonal               ( + ) 2( + )                  m ri
                                                                                                                at               wap   A 11 an A22 i
an   onl      i
                                                               "             #          "    #
                                               =
                                                                    0X                   (7)
                                          I         0
or  om i n    rti l    2 mat r i wh r X i        n    i n   .

   Proof . The i f part has been shown above, we j ust need to show the o n l y i f part. I f                                                              swaps
A11 and A 22 then there exi st 12, and 11 such that
             "           #       "       #"           #"                       #
                ~    ~
               A22 A12                      A22 0          01 0 01 11 0
                     ~      =         11
                                                                     0
                                                                          12
                 0 A11             0  12     0 A11         0         12
                                                      "                  #"                           #"                 #
                                          =               0X        I               A22 0                      0 I
                                                           I        0                0 A11                     I X
                            "                  #01        "                     #                               "                  #
I t f ol l ows that                       11                   0X
                                                                I com utes wi th A22 0 . Si nce A and
                                                                        m                                     11
                       0      12                             I  0                        0 A11
                                 m
A22 have no ei genval ues i n com on,                       ust           i          (A                 ,
                                                           m be a pol ynom al i n di ag 22; A ). See [ 11 vol . 1, page
                                                                                            11
222] .                              "                                   #           "                 #
                                             I =          0X
                                                           11
                                         I    0       0    12
 ust                                         pl
m be bl ock upper tri angul ar. Thi s com etes the proof . .
                                                       o
   Thus we have the f ol l owi ng al gori thmto swap tw adj acent bl ocks:

      r
     o th           i                l
                  (D rect Swappi ng A gori thm)
     . Sol        th    2       S l       t    r      at i on


                                                               A11X 0XA 22 =A 12;
Swappi ng A gor i t hm
           l                                                                                                   3

of the al gori thmshows that backward i nstabi l i ty i s possi bl e onl y i n very i l l - condi ti oned cases, so
                                                                                                         ur
i l l - condi ti oned i n f act that we have been unabl e to construct a case where i t f ai l s. O goal was
to have an absol ute stabi l i ty guarantee, however; we achi eved thi s by di rectl y and cheapl y testi ng
f or i nstabi l i ty and rej ecti ng a swap i f i t woul d have been unstabl e. Thi s can occur onl y when the
                                                                                                              um
ei genval ues are so i l l - condi ti oned as to be i ndi sti ngui shabl e i n a certai n reasonabl e sense. N eri ca
experi m   ents showthe superi ori ti es of our di rect swappi ng al gori thmover previ ous i m em pl entati ons.
      The rest of the paper i s organi zed as f ol l ows: Secti on 2 descri bes the di rect swappi ng al gori thm .
Secti on 3 di scusses the al gori thmi n presence of roundi ng errors. The error anal ysi s of the al gori thm
                                               are pl entati on and num cal experm
i s carri ed out i n Secti on 4. The sof tw i m em                              eri           ents are reported
                                                        l       are                              s
i n Secti on 5. Secti on 6 draws concl usi ons. A l sof tw rel ated to the al gori thm di scussed i n thi s
                                   P CKl
paper can be f ound i n the LA A i brary [ 2] .
      W assum that any 2 22 di agonal bl ock i n the quasi - tri angul ar m x i s i n standardi zed f orm
        e       e                                                               atri                           .
Thi s m   eans that i ts di agonal entri es are equal and i ts o di agonal s nonzero and of opposi te si gn,
that i s                                   "        #
                                                      ;           0:                                    (4)

Such a bl ock has com ex conj ugate ei genval ues 6 where2 = . I t i s known that f or any 2 22
                       pl
                pl                                              i                   ati
bl ock wi th com ex conj ugate ei genval ues, an orthogonal si m l ari ty transf orm on wi l l standardi ze
the bl ock. The LA A P CKsubrouti ne SH Rreturns the real Schur f actori zati on wi th 2 22 bl ocks
                                       SEQ
i n standard f orm .

        i rect w                  l
                            i ng A gori t m
  s
A we descri bed i n the i ntroducti on, the crux of reorderi ng the di agonal bl ocks to f orma speci ed
                                                                       ocks A
i nvari ant subspace i s to i nterchange the consecuti ve di agonal bl 11 andA 22 i n the f ol l owi ng
         atri
bl ock m x                                   "           #
                                               A11 A12
                                        A=                                                        (5)
                                                0 A22
where A11 i s 2 , A i s 2 , ; =1; 2. Throughout thi s paper, we assum that A A 22
                       22                                                         e 11 and
                            m
have no ei genval ue i n com on, otherwi se, they need not to be exchanged. I t i s seen that the bl ock
  atri
m x (5) can be di agonal i zed as
                      "             #       "                    #"                   #"         #
                          A11 A12
                                        =
                                                I       0X               A11 0             I X
                                                                                                     ;
                           0 A22                0           I             0 A22            0 I
where X i s the sol uti on of the Syl vester equati on
                                            A11 X 0XA 22 =A 12:                                          (6)
                    ed     A                                      m
Si nce i t i s assum that 11 and A 22 have no ei genval ue i n com on, the sol uti on X i s uni que. I f
we choose an orthogonal m x such that
                           atri
                                                    "            #       "        #
                                                        0X           =
                                                         I                    0
            al
and conf orm l y parti ti on     i n the f orm
                                                        "                     #
                                                                11       12
                                                =                                 ;
                                                                21       22
Swappi ng A gor i t hm
           l                                                                                               2

of A. The ei genval ues of the 2 22 di agonal bl ocks are the com ex conj ugate ei genval ues of A.
                                                                   pl
                       ay
The real Schur f ormm be com                              Q            A
                                puted usi ng subrouti ne H R f romEI SP CK[ 15 ] or subrouti ne
   SEQ
SH R f romLA A 2P CK[      ] ),
    H                                    al
     ere or provi des an orthonorm basi s f or the i nvari ant subspace of certai n subsets of
                      atri
ei genval ues of the m x A. I f we parti ti on and as
                                                               "             #
                                                                   11   12
                                    =[    1;   2];         =                     ;
                                                                   0    22

then f rom(1), we have
                                               A   1   =   1 11                                      (2)
                                    al
and hence 1 gi ves an orthonorm basi s f or the i nvari ant subspaces of A correspondi ng to the
ei genval ues contai ned i n .
                           11
     nf
    U ortunatel y, the 11 gi ven by the Q al gori thmwi l l not general l y contai n the ei genval ues
                                           R
                                 e ust                         e                        i
i n whi ch we are i nterested. W m theref ore perf ormsom f urther orthogonal si m l ari ti es that
preserve bl ock tri angul ar f ormbut reorder the desi red ei genval ues of A to the upper l ef t corner of
the Schur f orm , to get the desi red i nvari ant subspace as i n (2). The crux of such reorderi ng or
swappi ng techni ques i s howto swap tw adj acent 1 21 or 2 22 di agonal bl ocks by an orthogonal
                                        o
transf orm on. Form l y, l et A a 2 m x, A22 be a 2 m x, ; =1; 2; we want to
           ati          al      11 be         atri                 atri
com pute an orthogonal ( + ) 2( + ) m x such that
                                          atri
                                    "                #         "             #
                                        A11 A12                    ~   ~
                                                                   A22 A12
                                                           =           ~             ;               (3)
                                         0 A22                      0 A11
          ~
where A i s si m l ar to A i =1; 2, so that the ei genval ues are unchanged but thei r posi ti ons are
                     i        ,
exchanged al ong the (bl ock) di agonal .
    T thi s end, Stewart [ 17has descri bed an i terati ve al gori thmf or swappi ng consecuti ve 1 21 and
      o                         ]
2 22 bl ocks of a quasi - tri angul ar m x, whi ch we ref er to as al gori thmEX N . I n hi s m
                                         atri                                         CH G            ethod,
                                     i         pl
the rst bl ock i s used to determ ne an i m i ci t Q               n
                                                         Rshi f t. A arbi trary Q                    ed
                                                                                 Rstep i s perf orm on both
bl ocks to create a dense ( + ) 2( + ) bl ock. Then a sequence of Q steps usi ng the previ ousl y
                                                                             R
         i                        ed                                                             R
determ ned shi f t i s perf orm on both bl ocks. Theoreti cal l y, af ter one step of Q i terati on, the
ei genval ues of the rst bl ock wi l l em                       er                                 ay
                                              erge i n the l ow part. But i n practi ce, we m need tw           o
            ore R                                 R
or even m Q i terati ons. Thi s use of Q i terati on has been extended by V D                        ] to
                                                                                         an ooren [ 21
                                                                                  Z
reorderi ng the ei genval ues of a general i zed ei genval ue probl emusi ng Q i terati on.
    A nother al gori thmto be f urther devel oped i n thi s paper i s the so- cal l ed d i r e c t s wa p p i n g me t
                             oti
whi ch was ori gi nal l y m vated by the work of D                    am arl           i
                                                           ongarra, H m i ng and Wl ki nson i n 1983,
                                                      [ 10 g               ]
al though the paper was ni shed l ater (1990) ] . N and Parl ett [ 14 al so devel oped a program
       pl ent                                      .         i
to i m em the di rect swappi ng al gori thm A si m l ar i dea has al so been publ i shed by Cao and
Zhang [ 8] .
    Thi s previ ous work sti l l does not sol ve the probl emsati sf actori l y. The i terati ve swappi ng al -
                                                                                          ul
gori thmhas the advantage of guaranteed backward stabi l i ty, si nce i t j ust m ti pl es the data by
                 atri               ay
orthogonal m ces. But i t m be i naccurate and even f ai l to reorder the ei genval ues i n m               oder-
                                       n                                                              pl
atel y i l l - condi ti oned cases. O the other hand, the di rect swappi ng al gori thmi s si m e and can
better deal wi th i l l - condi ti oned cases. But the current i m empl entati ons do not guarantee backw      ard
stabi l i ty.
    I n thi s paper, we f urther i m                                          . ari
                                      prove the di rect swappi ng al gori thm V ous strategi es have been
desi gned at each stage of the al gori thmto i m     prove i ts accuracy and robustness. Adetai l ed anal ysi s
                                                                                     .

                          .                                                                      .

                                                                                         .




       nt roduct i on
The probl emof reorderi ng the ei genval ues i nto a desi red order al ong the (bl ock) di agonal of a quasi -
                    atri                                           puti
tri angul ar real m x ari ses i n several appl i cati ons: com ng an i nvari ant subspace correspondi ng
                                              ati
to a gi ven group of ei genval ues, esti m ng condi ti on num      bers f or a cl uster of ei genval ues or thei r
                                                     m                          , 3] ,    puti
associ ated i nvari ant subspace i n the nonsym etri c ei genval ue probl em[ 20com ng parti al
                                  m         atri            ul                        ethod com
ei genval ues of a l arge nonsym etri c m x by the si m taneous i terati on m , 4][ ,16 puti ng
  atri                                                                      , and
m x f uncti ons [, 614] , sol vi ng the l i near quadrati c control probl ]em[ 13 so on. These probl ems
                       o
can be sol ved i n tw phases: the rst i s to com                             posi
                                                       pute the Schur decom ti on of the gi ven m x,   atri
and the second i s to reorder a group of speci ed ei genval ues to appear at the upper l ef t of the
  atri
m x to get the correspondi ng i nvari ant subspace. I n thi s paper we descri be an al gori thmand i ts
   pl entati on f or thi s reorderi ng probl em The sof tw i s avai l abl e i n LA A, 2] ,1 a publ i c
i m em                                             .           are                       P CK[
    ai      eri
dom n num al l i near al gebra l i brary.
    Speci cal l y, f or any gi ven 2 m x A, f romthe Q gori thmwe coul d com
                                            atri                Ral                         pute the Schur
       posi
decom ti on of A i n the f orm
                                               A=         ;
                                 atri                                                    atri
where i s an upper tri angul ar m x, cal l ed the S c h u r f o r m, and i s a uni tary mi s x.
the conj ugate transpose of , and so =I . The di agonal entri es of are the ei genval ues of
A.            ay       pl                                    atri ay          pl
       and m be com ex even i f A i s real , si nce a real m x m have com ex ei genval ues.
            atri                                atri
For a real m x A, there i s a real orthogonal m x such that
                                                   A=            ;                                                  (1)
                                                   atri
where i s a real upper quasi - tri angul ar m x, cal l ed the r e a l S c h u r f o r m.              i s bl ock up
tri angul ar wi th 1 21 and 2 22 bl ocks on the di agonal . The 1 21 bl ocks contai n the real ei genval ues
            or as
      hi s w w supported i n part by F grant                    and         grant                      vi a a
subcontract fro the ni versi ty of ennessee. he rst author w al so supported i n part by F grant
                                                               as
         .
      epart ent of athe ati cs, ni versi ty of entuc y, e i ngton,         . na.bai na net.ornl .gov
      o puter ci ence i vi si on and athe ati cs epart ent, ni versi ty of al i forni a, er el ey,              .
 na.de el na net.ornl .gov .

                                                          1

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:8
posted:12/15/2011
language:
pages:18