1SHSEQR(1)             LAPACK driver routine (version 3.1)            SHSEQR(1)
2
3
4

NAME

6       SHSEQR - compute the eigenvalues of a Hessenberg matrix H  and, option‐
7       ally, the matrices T and Z from the Schur decomposition  H = Z T  Z**T,
8       where T is an upper quasi-triangular matrix (the  Schur form), and Z is
9       the orthogonal matrix of Schur vectors
10

SYNOPSIS

12       SUBROUTINE SHSEQR( JOB, COMPZ, N, ILO, IHI, H, LDH,  WR,  WI,  Z,  LDZ,
13                          WORK, LWORK, INFO )
14
15           INTEGER        IHI, ILO, INFO, LDH, LDZ, LWORK, N
16
17           CHARACTER      COMPZ, JOB
18
19           REAL           H(  LDH, * ), WI( * ), WORK( * ), WR( * ), Z( LDZ, *
20                          )
21

PURPOSE

23          SHSEQR computes the eigenvalues of a Hessenberg matrix H
24          and, optionally, the matrices T and Z from the Schur decomposition
25          H = Z T Z**T, where T is an upper quasi-triangular matrix (the
26          Schur form), and Z is the orthogonal matrix of Schur vectors.
27
28          Optionally Z may be postmultiplied into an input orthogonal
29          matrix Q so that this routine can give the Schur factorization
30          of a matrix A which has been reduced to the Hessenberg form H
31          by the orthogonal matrix Q:  A = Q*H*Q**T = (QZ)*T*(QZ)**T.
32
33

ARGUMENTS

35       JOB   (input) CHARACTER*1
36             = 'E':  compute eigenvalues only;
37             = 'S':  compute eigenvalues and the Schur form T.
38
39             COMPZ (input) CHARACTER*1
40             = 'N':  no Schur vectors are computed;
41             = 'I':  Z is initialized to the unit matrix and the matrix  Z  of
42             Schur vectors of H is returned; = 'V':  Z must contain an orthog‐
43             onal matrix Q on entry, and the product Q*Z is returned.
44
45       N     (input) INTEGER
46             The order of the matrix H.  N .GE. 0.
47
48       ILO   (input) INTEGER
49             IHI   (input) INTEGER It is assumed that H is already upper  tri‐
50             angular  in rows and columns 1:ILO-1 and IHI+1:N. ILO and IHI are
51             normally set by a previous call to SGEBAL,  and  then  passed  to
52             SGEHRD  when the matrix output by SGEBAL is reduced to Hessenberg
53             form. Otherwise ILO and IHI should be set  to  1  and  N  respec‐
54             tively.   If  N.GT.0,  then 1.LE.ILO.LE.IHI.LE.N.  If N = 0, then
55             ILO = 1 and IHI = 0.
56
57       H     (input/output) REAL array, dimension (LDH,N)
58             On entry, the upper Hessenberg matrix H.  On exit, if  INFO  =  0
59             and  JOB = 'S', then H contains the upper quasi-triangular matrix
60             T from the Schur decomposition (the Schur form); 2-by-2  diagonal
61             blocks  (corresponding to complex conjugate pairs of eigenvalues)
62             are returned in standard  form,  with  H(i,i)  =  H(i+1,i+1)  and
63             H(i+1,i)*H(i,i+1).LT.0.  If  INFO = 0 and JOB = 'E', the contents
64             of H are unspecified on  exit.   (The  output  value  of  H  when
65             INFO.GT.0 is given under the description of INFO below.)
66
67             Unlike earlier versions of SHSEQR, this subroutine may explicitly
68             H(i,j) = 0 for i.GT.j and j = 1, 2,  ...  ILO-1  or  j  =  IHI+1,
69             IHI+2, ... N.
70
71       LDH   (input) INTEGER
72             The leading dimension of the array H. LDH .GE. max(1,N).
73
74       WR    (output) REAL array, dimension (N)
75             WI     (output)  REAL array, dimension (N) The real and imaginary
76             parts, respectively, of the computed eigenvalues. If  two  eigen‐
77             values  are computed as a complex conjugate pair, they are stored
78             in consecutive elements of WR and WI, say the i-th  and  (i+1)th,
79             with WI(i) .GT. 0 and WI(i+1) .LT. 0. If JOB = 'S', the eigenval‐
80             ues are stored in the same order as on the diagonal of the  Schur
81             form returned in H, with WR(i) = H(i,i) and, if H(i:i+1,i:i+1) is
82             a 2-by-2 diagonal block,  WI(i)  =  sqrt(-H(i+1,i)*H(i,i+1))  and
83             WI(i+1) = -WI(i).
84
85       Z     (input/output) REAL array, dimension (LDZ,N)
86             If  COMPZ = 'N', Z is not referenced.  If COMPZ = 'I', on entry Z
87             need not be set and on exit, if INFO = 0, Z contains the orthogo‐
88             nal matrix Z of the Schur vectors of H.  If COMPZ = 'V', on entry
89             Z must contain an N-by-N matrix Q, which is assumed to  be  equal
90             to  the  unit matrix except for the submatrix Z(ILO:IHI,ILO:IHI).
91             On exit, if INFO = 0, Z contains Q*Z.  Normally Q is the orthogo‐
92             nal  matrix  generated  by  SORGHR after the call to SGEHRD which
93             formed the Hessenberg matrix H.  (The  output  value  of  Z  when
94             INFO.GT.0 is given under the description of INFO below.)
95
96       LDZ   (input) INTEGER
97             The  leading dimension of the array Z.  if COMPZ = 'I' or COMPZ =
98             'V', then LDZ.GE.MAX(1,N).  Otherwize, LDZ.GE.1.
99
100       WORK  (workspace/output) REAL array, dimension (LWORK)
101             On exit, if INFO = 0, WORK(1) returns an estimate of the  optimal
102             value for LWORK.
103
104             LWORK  (input)  INTEGER  The  dimension of the array WORK.  LWORK
105             .GE. max(1,N) is sufficient, but LWORK typically as large as  6*N
106             may  be  required  for optimal performance.  A workspace query to
107             determine the optimal workspace size is recommended.
108
109             If LWORK = -1, then SHSEQR does a workspace query.  In this case,
110             SHSEQR  checks  the  input  parameters  and estimates the optimal
111             workspace size for the given values of N, ILO and IHI.  The esti‐
112             mate  is  returned in WORK(1).  No error message related to LWORK
113             is issued by XERBLA.  Neither H nor Z are accessed.
114
115       INFO  (output) INTEGER
116             =  0:  successful exit
117             value
118             the eigenvalues.  Elements 1:ilo-1 and i+1:n of WR and WI contain
119             those  eigenvalues which have been successfully computed.  (Fail‐
120             ures are rare.)
121
122             If INFO .GT. 0 and JOB = 'E', then on exit, the remaining  uncon‐
123             verged  eigenvalues are the eigen- values of the upper Hessenberg
124             matrix rows and columns ILO through INFO  of  the  final,  output
125             value of H.
126
127             If INFO .GT. 0 and JOB   = 'S', then on exit
128
129       (*)  (initial value of H)*U  = U*(final value of H)
130
131            where  U  is  an orthogonal matrix.  The final value of H is upper
132            Hessenberg and quasi-triangular in rows and columns INFO+1 through
133            IHI.
134
135            If INFO .GT. 0 and COMPZ = 'V', then on exit
136
137            (final value of Z)  =  (initial value of Z)*U
138
139            where U is the orthogonal matrix in (*) (regard- less of the value
140            of JOB.)
141
142            If INFO .GT. 0 and COMPZ = 'I', then on exit (final value of Z)  =
143            U  where  U  is  the orthogonal matrix in (*) (regard- less of the
144            value of JOB.)
145
146            If INFO .GT. 0 and COMPZ = 'N', then Z is not accessed.
147
148
149
150 LAPACK driver routine (version 3.N1o)vember 2006                       SHSEQR(1)
Impressum