2
SUBROUTINE COMHES (NM, N, LOW, IGH, AR, AI, INT)
3
C***BEGIN PROLOGUE COMHES
4
C***PURPOSE Reduce a complex general matrix to complex upper Hessenberg
5
C form using stabilized elementary similarity
7
C***LIBRARY SLATEC (EISPACK)
9
C***TYPE COMPLEX (ELMHES-S, COMHES-C)
10
C***KEYWORDS EIGENVALUES, EIGENVECTORS, EISPACK
11
C***AUTHOR Smith, B. T., et al.
14
C This subroutine is a translation of the ALGOL procedure COMHES,
15
C NUM. MATH. 12, 349-368(1968) by Martin and Wilkinson.
16
C HANDBOOK FOR AUTO. COMP., VOL.II-LINEAR ALGEBRA, 339-358(1971).
18
C Given a COMPLEX GENERAL matrix, this subroutine
19
C reduces a submatrix situated in rows and columns
20
C LOW through IGH to upper Hessenberg form by
21
C stabilized elementary similarity transformations.
25
C NM must be set to the row dimension of the two-dimensional
26
C array parameters, AR and AI, as declared in the calling
27
C program dimension statement. NM is an INTEGER variable.
29
C N is the order of the matrix A=(AR,AI). N is an INTEGER
30
C variable. N must be less than or equal to NM.
32
C LOW and IGH are two INTEGER variables determined by the
33
C balancing subroutine CBAL. If CBAL has not been used,
34
C set LOW=1 and IGH equal to the order of the matrix, N.
36
C AR and AI contain the real and imaginary parts, respectively,
37
C of the complex input matrix. AR and AI are two-dimensional
38
C REAL arrays, dimensioned AR(NM,N) and AI(NM,N).
42
C AR and AI contain the real and imaginary parts, respectively,
43
C of the upper Hessenberg matrix. The multipliers which
44
C were used in the reduction are stored in the remaining
45
C triangles under the Hessenberg matrix.
47
C INT contains information on the rows and columns
48
C interchanged in the reduction. Only elements LOW through
49
C IGH are used. INT is a one-dimensional INTEGER array,
50
C dimensioned INT(IGH).
52
C Calls CDIV for complex division.
54
C Questions and comments should be directed to B. S. Garbow,
55
C APPLIED MATHEMATICS DIVISION, ARGONNE NATIONAL LABORATORY
56
C ------------------------------------------------------------------
58
C***REFERENCES B. T. Smith, J. M. Boyle, J. J. Dongarra, B. S. Garbow,
59
C Y. Ikebe, V. C. Klema and C. B. Moler, Matrix Eigen-
60
C system Routines - EISPACK Guide, Springer-Verlag,
62
C***ROUTINES CALLED CDIV
63
C***REVISION HISTORY (YYMMDD)
65
C 890831 Modified array declarations. (WRB)
66
C 890831 REVISION DATE from Version 3.2
67
C 891214 Prologue converted to Version 4.0 format. (BAB)
68
C 920501 Reformatted the REFERENCES section. (WRB)
69
C***END PROLOGUE COMHES
71
INTEGER I,J,M,N,LA,NM,IGH,KP1,LOW,MM1,MP1
72
REAL AR(NM,*),AI(NM,*)
76
C***FIRST EXECUTABLE STATEMENT COMHES
79
IF (LA .LT. KP1) GO TO 200
88
IF (ABS(AR(J,MM1)) + ABS(AI(J,MM1))
89
1 .LE. ABS(XR) + ABS(XI)) GO TO 100
96
IF (I .EQ. M) GO TO 130
97
C .......... INTERCHANGE ROWS AND COLUMNS OF AR AND AI ..........
115
C .......... END INTERCHANGE ..........
116
130 IF (XR .EQ. 0.0E0 .AND. XI .EQ. 0.0E0) GO TO 180
122
IF (YR .EQ. 0.0E0 .AND. YI .EQ. 0.0E0) GO TO 160
123
CALL CDIV(YR,YI,XR,XI,YR,YI)
128
AR(I,J) = AR(I,J) - YR * AR(M,J) + YI * AI(M,J)
129
AI(I,J) = AI(I,J) - YR * AI(M,J) - YI * AR(M,J)
133
AR(J,M) = AR(J,M) + YR * AR(J,I) - YI * AI(J,I)
134
AI(J,M) = AI(J,M) + YR * AI(J,I) + YI * AR(J,I)