Lecture Notes in Computer Science Edited by G. Goos and J. Hartmanis
6 B. T. Smith. J. M. Boyle • J. J. Dongarra B. S. ...
14 downloads
983 Views
19MB Size
Report
This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
Report copyright / DMCA form
Lecture Notes in Computer Science Edited by G. Goos and J. Hartmanis
6 B. T. Smith. J. M. Boyle • J. J. Dongarra B. S. Garbow. Y. Ikebe • V. C. Klema C. B. Moler
Matrix Eigensystem Routines EISPACK Guide Second Edition I I
I
II III
Springer-Verlag Berlin.Heidelberg. New York 1976
Editorial Board P. Brinch Hansen ° D. Gries • C. M o l e r . G. SeegmLiller o J. Stoer N. Wirth
Dr. Brian T. Smith Applied Mathematics Division Argonne National Laboratory 9700 South Cass Avenue Argonne, IL 60439/USA
Library of Congress Cataloging in Publication Data
Main entry under title: Matrix eigensystem r~atines. (Lectures notes in computer science ; 6) includes bibliog#aphi es. i. EZSPACK (Computer program) Z. Smith~ B~ian T. Z L Series. QA193. M57 1976 512.9'43' 0285425 76-2662
A M S Subject Classifications (1970): 15A18, 65F15 CR Subject Classifications (1974): 5.14 ISBN 3-540-07546q 2. Aufiage Springer-Verlag Berlin • Heidelberg • New York ISBN 0-387-07546-1 2nd edition Springer-Verlag New York • Heidelberg • Berlin ISBN 3-540-06710-8 1, Aufiage Springer-Verlag Berlin. Heidelberg. New York ISBN 0-387-06710-8 1st edition Springer-Vedag New York " Heidelberg . Berlin
This work is subject to copyright. All rights are reserved, whether the whole or part of the material is concerned, specifically those of translation, reprinting, re-use of illustrations, broadcasting, reproduction by photocopying machine or similar means, and storage in data banks. Under § 54 of the German Copyright Law where copies are made for other than private use, a fee is payable to the publisher, the amount of the fee to be determined by agreement with the publisher. © by Springer-Vertag Berlin • Heidelberg 1976 Printed in Germany Printing and binding: Beltz Offsetdruck, Hemsbach/Bergstr.
PREFACE TO THE SECOND EDITION
The EISPACK eigensystem package as documented in the first edition of this guide has expanded in both depth and breadth in its second release. A set of subroutines affording additional variants for the six problem classes encompassed in the first release has been added.
Another set of
additional subroutines has extended the applicability of EISPACK to new problem classes; prominent among these are the real symmetric band standard eigenproblem, the symmetric and non-symmetric real generalized eigenproblems, and the singular value decomposition of an arbitrary matrix. The EISPAC control program has also been extended to include most of the newer capability afforded by the additional subroutines in the package. However, except for the documentation of the EISPAC control program, the scope of this edition of the guide is still limited to the original six problem classes and therefore includes additionally only the first of the two sets of newer subroutines added to EISPACK.
Restricting the scope in
this manner has markedly reduced both the time otherwise required to produce the book and its potential size.
It has also enabled timely updating of
the listings and documents of those earlier subroutines that have been improved in this release.
A subsequent volume in this series is planned
that will include the other new subroutines and cover the additional problem classes that can now be handled by the package. EISPACK is a product of the NATS (N_ational Activity to T_est S_oftware) Project ([3],[4],[5]) which has been guided by the principle that the effort to produce high quality mathematical software is justified by the wide use of that software in the scientific community.
EISPACK has been dis-
tributed to several hundred computer centers throughout the world since the package was first released in May, ]972, and now the second release
is available as described in Section 5. Building a systematized collection of mathematical software is necessarily a collaborative undertaking demanding the interplay of a variety of skills; we wish to acknowledge a few whose roles were especially crucial during the preparation of the second release.
J. Wilkinson per-
sisted in his encouragement of the project and his counsel was often sought during his frequent visits to North America.
Organization and direction
came from W. Cowell and J. Pool, utilizing funds provided by the National Science Foundation and the Energy Research and Development Administration. The field testing was carried out at the installations listed in Section 5 through the sustained efforts of M. Berg, A. Cline, D. Dodson, B. Einarsson, S. Eisenstat, I~ Farkas~ P. Fox, C. Frymann, H. Happ, L. Harding, H. Hull, D. Kincaid, P. Messina, M. Overton, R. Raffenetti, J. Stein, J. Walsh, and J. Wang.
Appreciation is also expressed for the very important feedback
received from users not formally associated with the testing effort. Finally, we acknowledge the skill and cooperation of our typist, J. Beumer.
iV
TABLE OF CONTENTS
SECTION INTRODUCTION
1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
i.
Organization
2.
Accuracy
of the guide . . . . . . . . . . . . . . . . . . . . .
of the EISPACK subroutines . . . . . . . . . . . . . . . .
SECTION 2 HOW TO USE EISPACK i.
. . . . . . . . . . . . . . . . . . . . . . . . . .
Recommended basic paths in EISPACK i.i
. . . . . . . . . . . . . . . .
All eigenvalues and corresponding eigenvectors of a complex general matrix . . . . . . . . . . . . . . . . . . .
14
1.2
All eigenvalues
16
1.3
All eigenvalues and selected eigenvectors of a complex general matrix . . . . . . . . . . . . . . . . . . . . . . .
17
All eigenvalues and corresponding eigenvectors of a complex Hermitian matrix . . . . . . . . . . . . . . . . . .
19
1.5
All eigenvalues
21
1.6
Some eigenvalues and corresponding eigenvectors of a c o m p l e x Hermitian matrix . . . . . . . . . . . . . . . . . .
22
1.7
Some eigenvalues
24
1.8
All eigenvalues and corresponding eigenvectors of a real general matrix . . . . . . . . . . . . . . . . . . . . . . .
26
1.9
All eigenvalues
28
i. I0
All eigenvalues and selected eigenvectors of a real general matrix . . . . . . . . . . . . . . . . . . . . . . .
30
All eigenvalues and corresponding eigenvectors of a real symmetric matrix . . . . . . . . . . . . . . . . . . . . . .
32
1.12
All eigenvalues
34
1.13
Some eigenvalues and corresponding eigenvectors of a real symmetric matrix . . . . . . . . . . . . . . . . . . . . . .
35
Some eigenvalues
37
1.4
I.ii
1.14
of a complex general matrix . . . . . . . . .
of a complex Hermitian
matrix . . . . . . . .
of a complex Hermitian
of a real general matrix
matrix
.......
..........
of a real symmetric matrix
.........
of a real symmetric matrix . . . . . . . . .
1.15
All eigenvalues and corresponding eigenvectors of a real symmetric tridiagonal matrix . . . . . . . . . . . . . . . .
39
1.16
All eigenvalues of a real symmetric tridiagonal m a t r i x
41
1.17
Some eigenvalues and corresponding eigenvectors of a real symmetric tridiagonal matrix . . . . . . . . . . . . . . . .
1.19
All eigenvalues and corresponding eigenvectors of a special real tridiagonal m a t r i x . . . . . . . . . . . . . . . . . . .
48
1.20
All eigenvalues
50
1o21
Some eigenvalues and corresponding eigenvectors of a special real tridiagonal matrix . . . . . . . . . . . . . . . . . . .
52
Some eigenvalues
55
Variations
of a special real tridiagonal m a t r i x
. ,
46
Some eigenvalues of a real symmetric tridiagonal matrix.
....
of a special real tridiagonal matrix . . . .
57
of the recommended E I S P A C K paths . . . . . . . . . . . .
59
2.1
N o n - b a l a n c i n g of complex and real general matrices
2.2
Orthogonal reduction transformations to real Hessenberg form . . . . . . . . . . . . . . . . . . . . . . . . . . . .
62
2.3
The implicit and explicit QL algorithms . . . . . . . . . . .
65
2.4
The rational QR algorithm for finding a few extreme eigenvalues . . . . . . . . . . . . . . . . . . . . . . . . .
68
2.5
The use of T S T U R M as an alternate to BISECT-TINVIT
71
2.6
Elementary similarity transformations for complex general matrices . . . . . . . . . . . . . . . . . . . . . .
.....
.....
74
IMTQLV-TINVIT pairing in paths for partial eigensystems.
2.8
Specification of boundary eigenvalue indices to the bisection process . . . . . . . . . . . . . . . . . . . . . .
78
Packed representations of real symmetric and complex Hermitian matrices . . . . . . . . . . . . . . . . . . . . .
80
Additional 3.1
3.2
information and examples . . . . . . . . . . . . . . . .
.
76
2.7
2,9
3.
43
1.18
1.22
2.
. . .
83
Selecting the eigenvectors of real and complex general matrices . . . . . . . . . . . . . . . . . . . . . . . . . .
84
Unpacking the eigenvectors of a real general matrix . . . . .
88
VI
3.3
The EPSI parameter
. . . . . . . . . . . . . . . . . . . . .
91
3.4
Relative efficiencies of computing p a r t i a l and complete eigensystems . . . . . . . . . . . . . . . . . . . . . . . .
95
3.5
D e t e r m i n a t i o n of the signs of the eigenvalues . . . . . . . .
98
3.6
Orthogonal similarity reduction of a real matrix to quasi-triangular form . . . . . . . . . . . . . . . . . . . .
100
3.7
Additional facilities of the EISPAC control program . . . . .
102
3.8
Non-zero values of IERR . . . . . . . . . . . . . . . . . . .
111
3.9
Examples illustrating the use of the EISPACK subroutines and the control program . . . . . . . . . . . . . . . . . . .
115
SECTION 3 VALIDATION OF EISPACK . . . . . . . . . . . . . . . . . . . . . . . . .
124
SECTION 4 EXECUTION TIMES FOR EISPACK . . . . . . . . . . . . . . . . . . . . . .
127
i.
Tables of execution times . . . . . . . . . . . . . . . . . . . . .
128
2.
Repeatability and reliability of the measured execution times.
3.
Dependence of the execution times upon the matrix . . . . . . . . .
178
4.
Extrapolation of timing results to other machines and compilers.
180
5.
The sample matrices
182
for the timing results
. . . . . . . . . . . .
. .
177
SECTION 5 CERTIFICATION AND A V A I L A B I L I T Y OF EISPACK . . . . . . . . . . . . . . .
185
SECTION 6 DIFFERENCES BETWEEN THE EISPACK SUBROUTINES AND THE HANDBOOK ALGOL PROCEDURES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
188
SECTION 7 DOCUMENTATION AFD SOURCE LISTINGS . . . . . . . . . . . . . . . . . . .
194
i.
E I S P A C K subroutines . . . . . . . . . . . . . . . . . . . . . . . .
196
2.
EISPAC control p r o g r a m
524
. . . . . . . . . . . . . . . . . . . . . .
VII
L I S T OF T A B L E S
i.
Sections
2.
ISUBNO EISPAC
3. 4-6.
Summary
describing
the r e c o m m e n d e d
basic
paths
in E I S P A C K
. . .
v a l u e s and p a r a m e t e r n a m e s for s u b r o u t i n e calls from . . . . . . . . . . . . . . . . . . . . . . . . . . . . . of v a l u e s
107
of I E R R . . . . . . . . . . . . . . . . . . . .
112
E x e c u t i o n times on the I B M 3 7 0 / 1 9 5 at A r g o n n e N a t i o n a l Laboratory . . . . . . . . . . . . . . . . . . . . . . . . . . . at U n i v e r s i t y
130
7-9°
Execution
times
on the I B M 360/75
10-12.
Execution
times
on the I B M 3 7 0 / 1 6 8
at U n i v e r s i t y
13-15.
Execution
times
on the I B M 370/165
at The U n i v e r s i t y
16-18.
E x e c u t i o n times on the B u r r o u g h s 6700 at U n i v e r s i t y of C a l i f o r n i a , San D i e g o . . . . . . . . . . . . . . . . . . . . . .
Illinois.
. .
133
of M i c h i g a n
. .
136
of Toronto.
19-21.
Execution
times
on the CDC 6600 at K i r t l a n d
22-24.
Execution
times
on the CDC
25-27.
E x e c u t i o n times on the CDC 7600 at N a t i o n a l C e n t e r for Atmospheric Research . . . . . . . . . . . . . . . . . . . . . .
6600 at N A S A
Langley
Base
Research
142 . . .
Center.
148
151
times
on the CDC
31-33.
Execution
times
on the CDC 6 4 0 0 / 6 5 0 0
at P u r d u e
34-36.
Execution
times
on the CDC
at The U n i v e r s i t y
37-39.
Execution
times
on the H o n e y w e l l
.
163
40-42.
E x e c u t i o n times on the U n i v a c 1110 at The U n i v e r s i t y of Wisconsin . . . . . . . . . . . . . . . . . . . . . . . . . . . .
166
43-45.
Execution
times
on the D E C P D P - 1 0
169
46-48.
Execution
times
on the A m d a h l
6600/6400 6070
University.
University
at U n i v e r s i t y
. . .
154 .
of Texas.
at B e l l L a b o r a t o r i e s
at Y a l e
470V/6
University
145
Execution
50.
at N o r t h w e s t e r n
Force
139
28-30.
49.
6400
Air
of
13
160
......
of M i c h i g a n
157
.
172
E x e c u t i o n times for the E I S P A C K d r i v e r s u b r o u t i n e s over v a r i o u s c o m p u t e r systems . . . . . . . . . . . . . . . . . . . . . . . .
175
E x e c u t i o n times for the E I S P A C c o n t r o l p r o g r a m on the I B M 370/195 at A r g o n n e N a t i o n a l L a b o r a t o r y . . . . . . . . . . .
176
REFERENCES
i°
Wilkinson, J. H. and Reinsch, C., Handbook for Automatic Computation, Volume II, Linear Algebra, Part 2, Springer-Verlag, New York, Heidelberg, Berlin, 1971.
2.
Wilkinson, J. _~., The Algebraic Eigenvalue Problem, Clarendon Press, Oxford, 1965.
3.
Boyle, J. M., Cody, W. J., Cowell, W. R., Garbow, B. S., Ikebe, Y., Moler, C. B°, and Smith, B. T., NATS, A Collaborative Effort to Certify and Disseminate Mathematical Software, Proceedings 1972 National ACM Conference, Volume II, Association for Computing Machinery, New York, 1972, pp. 630-635.
4.
Smith, B. T., The NATS Project, A National Activity to Test Software, SHARE SSD 228, October, 1972, item C-5732, pp. 35-42.
5.
Smith, B. T., Boyle, J. M., Cody, W. J., The NATS Approach to Quality Software, Software for Numerical Mathematics, D. J. Evans, ed., Academic Press, London, New York, 1974, pp. 393-405.
6.
Boyle, J. M. and Grau, A. A., Modular Design of a User-Oriented Control Program for EISPACK, Technical Memorandum No. 242, Applied Mathematics Division, Argonne National Laboratory,
7.
1973.
Garbow, B. S., E!SPACK - A Package of Matrix Eigensystem Routines, Computer Physics Co~nunications, North-Holland, Amsterdam, Vol. 7, 1974, pp. 179-184.
1.0-i
Section i INTRODUCTION
The package of Fortran IV programs given the acronym EISPACK is a systematized collection of subroutines which compute the eigenvalues and/or eigenveetors of six classes of matrices; namely, complex general, complex Hermitian, real general,
real symmetric,
and special real tridiagonal matrices.
real symmetric tridiagonal,
The subroutines are based mainly
upon Algol procedures published in the Handbook series of Springer-Verlag by Wilkinson and Reinsch [i], have been adapted and thoroughly tested on several different machines, and have been certified and are supported by the NATS project [3,4,5].
The machines for which they are certified in-
clude IBM 360-370, CDC 6000-7000, Univac iii0, Honeywell 6070, DEC PDP-10, and Burroughs 6700. This manual is a user guide to EISPACK and to a control program EISPAC available with the IBM version of the package.
It contains pro-
gram segments which illustrate each of the basic computations with EISPACK and discusses variants of these that provide mild tradeoffs of efficiency, storage, and accuracy.
Other sections of the guide discuss the validation
procedures used for testing EISPACK, report execution times of the EISPACK subroutines on several machines, advertise the certified status and availability of EISPACK, and describe the major differences between the published Algol procedures in [i] and their Fortran counterparts.
The final section
includes detailed documentation with Fortran listings of each EISPACK subroutine and the document for the control program.
i.i-I Section !.i ORGANIZATION OF THE GUIDE
This guide is organized for the convenience, hopefully, of the user. Material most pertinent to the basic uses of the package and the control program appears in the early sections and references the more detailed and specific information in later sections.
Here follows a brief descrip-
tion of the organization of the guide. The remaining subsection of this introduction is a general statement with regard to the expected accuracy of the results from EISPACK.
This
statement is based upon the careful and detailed analyses of Wilkinson and others.
Only a brief overview is provided in this subsection and the
interested reader is directed to [I] and [2] for more detailed statements of accuracy. Section 2 is divided into a prologue and three major subsections. The prologue introduces the concept of an EISPACK path, discusses the economies that can be realized with the use of the control program if avail able, and instructs on the selection among the 22 basic paths.
The first
subsection establishes several conventions that are useful in clarifying the discussions of the paths.
It then details the 22 basic paths and
associated control program calls in the form of program segments.
Each
program segment is introduced by a brief description of the problem it solves and any specific considerations needed for the path, and is followed by a summary of array storage requirements for the path and sample execution times on the IBM 370/195 computer.
The next subsection
describes possible variants of the 22 basic paths, focusing on those conditions for which the variants are to be preferred.
The last subsection
provides further information about specific details of EISPACK and the
1.1-2
control program and suggests several additional applications of the package.
Complete sample programs illustrating the use of EISPACK and
EISPAC to solve a specified eigenproblem appear at the end of this subsection. Section 3 outlines the validation procedures for EISPACK that led to the certification of the package.
Section 4 reports sample execution
times of the individual subroutines and of several of the program segments of Section 2 and also discusses such considerations as the dependence of the execution times upon the matrix and the computer.
The statement of
certification for EISPACK, the machines and operating systems on which it has been certified, and its availability appear in Section 5.
Section
6 itemizes the principal differences between the Fortran subroutines and their Algol antecedents published in [I]. Finally, the documentation and Fortran listing for each subroutine appear in edited form in Section 7.
1.2-i
Section 1.2 ACCURACY OF THE EISPACK SUBROUTINES
The most useful statement that can be made with regard to the accuracy of the EISPACK subroutines is that they are based on algorithms which are numerically stable; that is~ for every computed eigenpair (%,z) associated with a matrix A, there exists a matrix E with norm small compared to that of A for which % and z are an exact eigenpair of A+E.
This back-
ward or inverse approach in describing the accuracy of the subroutines is necessitated by the inherent properties of the problem which, in general, preclude the more familiar forward approach.
However, for real symmetric
and complex Hermitian matrices the forward approach also applies, and indeed is a consequence of the backward analysis.
For these matrices the
eigenvalues computed by EISPACK must be close to the exact ones, but a similar claim for the eigenvectors is not possible.
What is true in this
case is that the computed eigenvectors will be closely orthogonal if the subroutines that accumulate the transformations are used. The size of E, of course, is crucial to a meaningful statement of accuracy, and the reader is referred to the detailed error analyses of Wilkinson and others ([1],[2]).
In our many tests of EISPACK, we have
seldom observed an E with norm larger than a small multiple of the product of the order of the matrix A, its norm, and the precision of the machine.
2.0-1
Section 2 HOW TO USE EISPACK
This section is designed to provide, in readily accessible form, the basic information you need to correctly use subroutines from EISPACK to solve an eigenproblem.
The way in which this information is presented
is influenced by the design of the eigensystem package; hence we will first consider briefly the global structure of EISPACK. EISPACK is capable of performing 22 different basic computations, plus several variations of them.
If each of these computations
(and var-
iations) were performed completely within a single EISPACK subroutine, the package would be unwieldy indeed.
It also would be highly redundant,
since the same steps appear in many of the computations.
To avoid these
problems, the subroutines in EISPACK are designed so that each performs a basic step which appears in one or more of the computations. for an introduction to the modularization of EISPACK.)
(See [7]
Consequently,
the redundancy (hence the size) of the package is minimized. Another consequence is that, in general, more than one subroutine from EISPACK is required to perform a given computation.
These subroutines must
of course be called in the correct order and with the proper parameters; in addition, some computations also require certain auxiliary actions, e.g., initializing parameters and testing for errors.
Throughout the re-
mainder of this book such an ordered set of subroutine calls and associated auxiliary actions will be called an EISPACK
path.
As a result of this structure the documentation for the use of EISPACK comprises two main parts:
a description of the basic paths and their var-
iations, and a description of the individual subroutines in EISPACK. information about the paths constitutes the remainder of this section while the subroutine documentation is collected in Section 7.
The
2.0-2
The path descriptions are divided into three parts.
Section 2.1
describes the 22 basic paths and includes a table to facilitate reference to them.
Section 2.2 describes some of the variations of these paths and
suggests when such variations might be useful.
Section 2.3 contains cer-
tain additional information about and examples of the use of EISPACK.
To
keep the descriptions of the basic paths and their variants simple~ we have omitted much of the detailed information (e.g., the meanings of nonzero error indicators and the descriptions of certain parameters) and collected it in Section 2.3.
Detailed information about each subroutine
may be obtained from the documentation for the individual subroutines in Section 7.
We hope, however, that the information given in this section
will be sufficient to permit you to correctly solve most eigenproblems. The detail of path information that you must know to solve certain basic eigenproblems can be reduced by using an appropriate driver subroutine to build the desired path from other EISPACK members.
Applica-
bility of the driver subroutines is limited to those problems where all eigenvalues and eigenvectors or all eigenvalues only are desired.
There
is a driver subroutine for each class of matrices handled by the package; driver subroutine calls corresponding to twelve of the 22 basic paths are given as part of the discussion of the paths in this section. Substantial further reduction in the detail of path information that you must know to solve an eigenproblem, with wider applicability, can be achieved by use of a control program, called EISPAC, which is available with the IBM version of the eigensystem package [6].
(It is
only practical to implement this control program on those computing systems which adequately support execution-time loading of subroutines.) EISPAC accepts a relatively straightforward problem description stated
2.0-3
in terms of the properties of the input matrix and the kinds of results required.
It checks this description for consistency, automatically
selects and executes the appropriate path, and then returns the results to your program.
Thus EISPAC not only simplifies the use of the eigen-
system package, but also enhances its robustness by eliminating the possibility of making errors in transcribing a path. To use EISPAC, you call it with a set of parameters which describes the problem you wish to solve, and which enables EISPAC to choose the appropriate path.
EISPAC calls corresponding to the 22 basic paths (and
most of their variations) are given as a further part of the discussion of the paths in this section.
Note that in order to use EISPAC~ you must
provide system control cards defining the file from which the EISPACK subroutines are to be loaded; this and other detailed information on the use of EISPAC can be found in its subroutine document in Section 7.2.
2.1-I
Section 2.1 RECOMMENDED BASIC PATHS IN EiSPACK
This section describes how to use EISPACK to compute some or all of the eigenvalues, or some or all of the eigenvalues and their corresponding eigenvectors, for the six classes of matrices mentioned in Section I. The paths recommended here provide accurate solutions for their respective eigenproblems using a minimum of storage.
Under some circumstances,
variations of these paths (using different subroutines) may provide slightly more accurate or speedier solutions; these variations are discussed in Section 2.2. To determine the recommended path to solve your particular eigenproblem, consult Table I at the end of this section.
First, decide to
which of the six classes of matrices listed across the top of the table your matrix belongs.
In general, the computation will be more accurate
and efficient if you use any known special properties of the matrix to place it in the most specialized applicable class.
Thus a matrix which
is real symmetric is better classified so, than as real general or complex. On the other hand, some special properties cannot be utilized; for example, a complex matrix, even though known to be symmetric (not Hermitian), must be classified as complex general. Next, determine which of the problem classifications listed down the left side of Table 1 most closely matches the subset of eigenvalues and eigenvectors you wish to find.
The table entry so determined indicates
the subsection which describes the recommended path for your problem. (If variations of the path exist, the subsection will refer you to Section 2.2 for them.)
For example, if you have a full (not tridiagonal)
2.1-2
real symmetric matrix and you wish to find all its eigenvalues and their corresponding eigenvectors, the table directs you to Section 2.1.11. Each subsection to which the table refers provides just the information you need to use the described path correctly.
It begins with a
statement of the problem and an identification of the main input and result variables.
The subroutine calls and auxiliary statements consti-
tuting the path are given and are followed by the corresponding driver subroutine call, if applicable, and the EISPAC call.
Next is a descrip-
tion of additional parameters (if any) appearing in the path and a brief summary of the disposition of the results of the computation.
Dimension
information for the arrays appearing in the path and a summary of the total amount of array storage used is then given. indicative timing results. fully in Section 4.)
These are followed by
(Timing considerations are discussed more
The subsection concludes with references to appli-
cable subsections of Section 2.2. We have employed a few conventions in these subsections to streamline the presentation of information. parameters.
One of these concerns the types of the
Except for SELECT (and TYPE in Section 2.2.4), to which type
LOGICAL applies, all parameters have their Fortran implied type:
those
beginning with I, J, K, L, M, or N are type INTEGER, and the others are what will be called
working preci~on~
which denotes either type REAL or
type DOUBLE PRECISION depending on the version of EISPACK being used. A second convention concerns certain parameters which are used only to pass intermediate results from one subroutine to another.
The roles
of these parameters are not described in the subsections, since only their type and dimension need be known to execute a path correctly.
To facili-
tate recognition of these parameters, they are written in lower case~
2.1-3
employing a systematic nomenclature.
Their names are composed of f or i
to indicate type (working precision or integer), s, v, or m to indicate dimensionality (scalar, vector, or matrix), and a serial number.
fv2
Thus
is used for the first working precision temporary vector to appear
in a given paths A third convention is used to indicate how the array parameters in a path are dimensioned.
It employs two "variables" ~
and ~ ,
which must
be replaced in array declarator statements by Fortran integer constants. The parameters NM and MM communicate the values of these constants to array declarator statements in the EISPACK subroutines; therefore N M m u s t be set to the constant used for ~
and MM set to that used for ~ .
It
is of utmost importance that whenever a path is executed, N and, if used~ M, satisfy N ~ r ~
and M i n ;
otherwise unpredictable errors will occur.
An example may help clarify the use of ~ using the path described in Section 2.1.13.
and ~ .
Suppose you are
Considering only the parameters
Aj W, and Z, the dimension information is stated there as A ( ~ , ~ ) , and Z ( n m , ~ ) .
W(~),
If the largest matrix for which you intend to use this
paah is of order 50, and if you do not expect to compute more than i0 eigenvalues and eigenvectors, you might use the array deelarator statement
DIMENSION A(50,50) ,W(IO) ,Z(50, i0)
together with
NM=
50
MM=
i0
You would, of course~ set N to the actual order of the matrix A for each execution of the path; it must satisfy N ~ 50.
10
Similarly, M will be set
2.1-4
(by the path) to the number of eigenvalues determined; it must satisfy M<
i0. The summary of the total amount of array storage used by a path is
given in terms of the order parameters N and M, rather than in terms of nm
and turn. Thus it represents the minimum array storage required to
execute the path for a given order matrix, achieved when ~ N and ~
is equal to M.
is equal to
Note that when using the EISPAC control program
you need not dimension any parameters which do not appear in the call to EISPAC (i.e., those named according to the second convention above) since it allocates them for you.
This does not, however, reduce the minimum
storage required, which remains as indicated in the summary. A fourth convention relates to the calls to driver subroutines when eigenvalues only are computed.
In such a case the formal parameter(s)
corresponding to the eigenvector matrix Z or (ZR,ZI), although required, is(are) not referenced in the subroutine; the variable name DUMMY will appear instead at the corresponding position(s) in the calling statement. A final convention concerns the handling of execution errors in a path.
Certain EISPACK subroutines may fail to satisfactorily perform
their step of the computation; in this case an error parameter, universally denoted by IERR, is set to a non-zero value indicating the type of error which occurred.
In many cases the execution of a path must not be allowed
to continue after such an error; hence a conditional branch to statement number 99999 is inserted in each path after each subroutine call which may set the parameter IERR. be to print IERR and stop.
Appropriate action at statement 99999 might Each distinct error that can occur in EISPACK
produces one of a unique set of values for IERR.
The possible values of
IERR and their meanings, together with an indication of whether or not any
11
2. i-5
partial results have been correctly computed, are summarized in Section 2.3.8; more detailed information on IERR can be obtained by consulting the documents for the individual subroutines.
If you are using EISPAC~
it will print a message describing any errors which occur and terminate execution, unless you elect to examine !ERR as discussed in Section 2.3.7 and in the EISPAC document. In summary, to select the recommended EISPACK path to solve your eigenproblem, consult Table I and then read the subsection to which it refers in light of the above conventions,
Note that in order to ensure
correct execution of the path, you must, in addition to providing input data and result storage, do the following:
provide arrays for storage of
intermediate or temporary results, call the subroutines in the path in the correct order, pass parameters from one call to the next exactly as described, and perform certain auxiliary actions.
Alternatively, if the
control program EISPAC is included in your version of EISPACK, you may simply call it and let it perform these tasks for you.
12
2.1-6
TABLE 1 SECTIONS DESCRIBING THE RECOMMENDED BASIC PATHS IN EISPACK
lass of X
Real Special Complexl Complex Real Real Symmetric Real GeneraliHemitianGeneral Symmetric Tridiagonali Tridiagonal
Classification~ All Eigenvalues & Corresponding Eigenvectors
2.1.1
2.1.4
2.1.8
2.1.11
2.1.15
2.1.19
All Eigenvalues
2.1.2
2.1.5
2.1.9
2.1.12
2.1.16
2.1.20
All Eigenvalues & Selected Eigenvectors
2.1.3
2.1.10
Some Eigenvalues & Corresponding Eigenvectors
2.1.6
2.1.13
2.1.17
2.1.21
Some Eigenvalues
2.1.7
2.1.14
2. I. 18
2.1.22
13
2.1-7
Section 2.1.i ALL EIGENVALUES AND CORRESPONDING EIGENVECTORS OF A COMPLEX GENERAL MATRIX
To determine all the eigenvalues eigenvectors
(WR,WI) and their corresponding
(ZR,ZI) of a complex general matrix (AR,AI)
of order N, the
recommended E!SPACK path is:
CALL
CBAL(NM,N,AR,AI,isl,is2,fvl)
CALL
CORTH(N~M,N,isl,is2,AR,AI,fv2,fv3)
CALL
COMQR2(NM,N,isl,is2,fv2,fv3,AR,AI,WR,WI,ZR,ZI,IERR)
IF (IERR .NE. 0) GO TO 99999 CALL
CBABK2(NM,N,is!,is2,fvI,N,ZR,ZI)
or, using driver subroutine CG:
CALL CG(NM,N,AR,AI,WR,WI, I,ZR,ZI,fV2
,fv2,fv3 ,IERR)
IF (IERR .NE. 0) GO TO 99999
or, using EISPAC:
CALL EISPAC(NM,N,MATRIX('COMPLEX',AR,AI),VALUES(WR,WI),VECTOR(ZR,
ZI))
This path destroys AR and AI. Suitable dimensions for the arrays are: Wl(r~n), ZR(~,ryn),
Zi(r~m,r~m),
AR(nm,~m), A l ( ~ , n m ) ,
fv1(r~), fv2(~n),
and
WR(nm),
fv3(r~).
The array storage required to execute this path is 4N 2 + 5N working precision words. Indicative execution times for this path (run on an IBM 370/195) are .038,
.24, 1.7, and 13 seconds for sample matrices of order I0, 20, 40, and
80 respectively.
14
2.1-8
Variants of this path omit the balancing of the input matrix or sub stitute elementary for unitary transformations; see Sections 2.2.1 and 2.2.6.
15
2.1-9
Section 2ol.2 ALL EIGENVALUES OF A COMPLEX GENERAL MATRIX
To determine all the eigenvalues
(WR, WI) of a complex general matrix
(AR,A!) of order N, the recommended EISPACK path is:
CALL
CBAL(NM,N,AR,AI,isl,is2,fvl)
CALL
CORTH(I~i,N,isl,is2,AR,AI,fv2,fv3)
CALL
COMQR(NM, N,isl,is2,AR,AI,WR,WI,IERR)
IF (IERR .NE. 0) GO TO 99999
or~ using driver subroutine CG:
CALL
CG(NM,N,AR,AI,WR,WI,O,DUMMY,DUMMY,fvl,fv2,fv3,1ERR)
IF (IERR .NE. 0) GO TO 99999
or, using EiSPAC: CALL EISPAC(NM, N,MATR!X('COMPLEX',AR,AI),VALUES(WR,WI))
This path destroys AR and AI. Suitable dimensions for the arrays are: Wl(nm),
fv1(r~), fv2(nm),
and
AR(z~n,nm), Al(nm,~),
WR(nm),
fv3(nm).
The array storage required to execute this path is 2N 2 + 5N working precision words~ WR and WI for
fv2
(2N working precision words could be saved by using and
fv3;
saved by identifying ~ 1
another N working precision words could be
and
fv2.)
Indicative execution times for this path (run on an IBM 370/195) are .022, .12, °78, and 5.7 seconds for sample matrices of order I0, 20, 40, and 80 respectively. Variants of this path omit the balancing of the input matrix or substitute elementary for unitary transformations;
16
see Sections 2.2.1 and 2.2.6.
2. i-i0
Section 2.1.3 ALL EIGENVALUES AND SELECTED EIGENVECTORS
To determine all the eigenvalues (ZR, ZI) (those corresponding
OF A COMPLEX GENERAL MATRIX
(WR,WI) and certain eigenveetors
to eigenvalues flagged by .TRUE. elements
in the LOGICAL array SELECT) of a complex general matrix (AR,AI) of order N, the reco~ended
EISPACK path is:
CALL
CBAL(NM,N,AR,AI,isl,is2,fvl)
CALL
CORTH(NM, N,isl,is2,AR,AI,fv2,fv3)
DO i00 1 = i, N DO 50 J = I, N fm/(I,J) = AR(I,J) ~m2(l,J) = AI(I,J) 50
CONTINUE
i00 CONTINUE CALL
COMQR(NM,N,isl,i82,~l,fm2,WR,WI,IERR)
IF (IERR .NE. 0) GO TO 99999 CALL
CINVIT(NM, N,~m,AI,WR,WI,SELECT,MM, M, ZR, ZI,IERR,fml,fm2,fv4,fv5)
IF (IERR .NE. 0) GO TO 99999 CALL
CORTB(NM, isl,is2,AR,AI,fv2,fv3,M, ZR, ZI)
CALL
CBABK2(NM,N,isl,is2,fvl,M,ZR,ZI)
or, using EISPAC:
CALL EISPAC(NM,N,MATRIX('COMPLEX',AR,AI),VALUES(WR,WI), VECTOR(ZR,ZI,MM,M, SELECT))
See Section 2.3.1 for a discussion of the SELECT array.
Upon comple
tion of the path, M is set to the number of columns of ZR and ZI used,
17
2.1-11
and provided MM is sufficiently large, the computed eigenvectors corresponding to the flagged eigenvalues are stored in the first M columns of ZR and ZI.
If MM is not sufficiently large, then IERR is set non-zero,
M is set to MM, and only the first M selected vectors are computed provided that the interrupted path is completed. zero if a vector fails to converge.)
This path destroys AR and AI.
Suitable dimensions for the arrays are:
WR(nm),
(IERR is also set non-
AR(~,~),
Wl(nJn), ZR(nm,mm), Zl(nm,mm), SELECT(nm),
fvl(nm), fv2(nm), fv3(n~m), fv4(nm),
AI(~,~),
fml(nm,nm), fm2(nm,nm),
and ~ 5 ( n m ) .
The array storage required to execute this path is 4N 2 + N(2M+7) working precision words and N logical words. Indicative execution times for this path (run on an IBM 370/195), when computing all N eigenvectors, are .040, .22, 1.3, and 9.7 seconds for sample matrices of order i0, 20, 40, and 80 respectively.
Extrapolation
of these execution times for cases where M is less than N is discussed in Section 4. Variants of this path omit the balancing of the input matrix or substitute elementary for unitary transformations; 2.2.6.
18
see Sections 2.2.1 and
2.1-12
Section 2.1.4 ALL EIGENVALUES AND CORRESPONDING EIGENVECTORS OF A COMPLEX HERMITIAN MATRIX
To determine all the eigenvalues W and their corresponding eigenvectors (ZR,ZI) of a complex Hermitian matrix (AR,AI) of order N, the recommended EISPACK path is:
CALL HTRIDI (NM,N,AR,AI
,W,fv2 ,fv l ,fml)
DO i00 1 = I, N DO 50 J = i, N ZR(I,J) = 0.0 50
CONTINUE ZR(I,I) = 1.0
i00 CONTINUE CALL TQL2(NM,N,W,fv2,ZR,IERR) IF (IERR .NE. O) GO TO 99999 CALL HTRIBK(NM,N,AR,AI,fm2,N,ZR,ZI)
or, using driver subroutine CH:
CALL
CH(NM,N,AR,AI,W,I,ZR,ZI,fv2,fvJ,fmI,IERR)
IF (IERR .NE. O) GO TO 99999
or, using EISPAC:
CALL EISPAC(NM,N,MATRIX('COMPLEX',AR,AI,'HERMITIAN'),VALUES(~),VECTOR(ZR,ZI))
This path returns the eigenvalues in ascending order and a set of complex orthonormal eigenvectors; it preserves the full upper triangle of All and the strict upper triangle of AI.
19
2.1-13
Suitable dimensions for the arrays are: ZR(n~n,nm), ZI (nm,nm),
fvl (nm),
and
AR(r~n,~), Al(~,r~n), W ( ~ ) ,
fml(2,nm).
The array storage required to execute this path is 4N 2 . 4N working precision words. Indicative execution times for this path (run on an IBM 370/195) are .011,
.065,
°44, and 3.2 seconds for sample matrices of order i0, 20, 40,
and 80 respectively. Variants of this path substitute the implicit for the explicit QL shift or proceed from a packed form representation of the input matrix; see Sections 2.2.3 and 2.2.9.
20
2.1-14
Section 2.1.5 ALL EIGENVALUES OF A COMPLEX HERMITIAN MATRIX
To determine all the eigenvalues W of a complex Hermitian matrix (AR,AI) of order N, the recommended EISPACK path is:
CALL
HTRIDI(NM, N,AR,AI,W,fvl,fv2,fm2)
CALL
TQLRAT(N,W,fv2,1ERR)
IF (IERR .NE. 0) GO TO 99999
or, using driver subroutine CH:
CALL
CH(NM,N,AR,AI,W,O,DUMMY,DUMMY,fvl,fv2,fmT,IERR)
IF (IERR .NE. O) GO TO 99999
or, using EISPAC:
CALL EISPAC(NM,N,MATRIX('COMPLEX',AR,AI,'HERMITIAN'),VALUES(W))
This path returns the eigenvalues in ascending order; it preserves
the
full upper triangle of AR and the strict upper triangle of AI. Suitable dimensions for the arrays are:
fvl(nm),
AR(n~n,nm), AI(mm,nm), W(nm),
fv2(nm), and fml(2,nm).
The array storage required to execute this path is 2N 2 + 5N working precision words. Indicative execution times for this path (run on an IBM 370/195) are .005, .022, .14, and 1.0 seconds for sample matrices of order I0, 20, 40, and 80 respectively. Variants of this path substitute the explicit or implicit for the rational QL shift or proceed from a packed form representation input matrix; see Sections 2.2.3 and 2.2.9.
2~
of the
2.1-15
Section 2.1.6 SOME EIGENVALUES AND CORRESPONDING EIGENVECTORS OF A COMPLEX HERMiTIAN MATRIX
To determine the eigenvalues W in an interval extending from RLB to RUB, together with their corresponding eigenvectors
(ZR,ZI), of a complex
Hermitian matrix (AR,AI) of order N, the recommended EISPACK path is:
CALL HTRIDI (NM,N ,AR,AI ~ 7
,fv2 ,fv 3 ,fml )
EPSI = 0~0 CALL BISECT (N, EPS 1 ,fvi ,fv2 ,fv3 ,RLB ,RUB ,MM,M ,w,ivl, IERR,fv4
,fvS)
IF (IERR ~NE. 0) GO TO 99999 CALL
TINVIT(NM,N,fvl,fv2,fv3,M,W,ivl ,ZR,!ERR,fv4,fv5,fv6,fv7,fvS)
IF (IERR ~NE. 0) GO TO 99999 CALL HTRIBK(NM,N,AR,AI
,fml ,M,ZR, ZI)
or, using EISPAC:
CALL EISPAC(I~M,N,MATRIX('COMPLEX',AR,AI,'HERMITIANI), VALUES(W,MM,M,RLB,RUB),VECTOR(ZR,ZI))
The parameter EPSI is used to control the accuracy of the eigenvalue computation°
Setting it to zero or calling EISPAC without supplying it
causes the use of a default value suitable for most matrices.
Further in-
formation about the use of EPSI can be found in Section 2.3.3 and in the BISECT and EISPAC documents~
Upon completion of the path, M is set to
the number of eigenvalues determined to lie in the interval defined by RLB and RUB and, provided M ! M M ,
the eigenvalues are in ascending order
in W and their corresponding complex orthonormal eigenvectors are in the first M columns of ZR and ZI.
Note that, should the computed M be greater
than MM, BISECT sets iERR non-zero and does not compute any eigenvalues.
22
2.1-16
This path preserves the full upper triangle of AR and the strict upper triangle of AI. Suitable dimensions for the arrays are: ZR(~w,~),
ZI(~,~),
AR(~,~),
AI(~,r~n), W ( ~ ) ,
fv1(r~), fv2Ozw), fv3(nm), fv4(r~w), fv5(~), fv6(r~n),
fv?(~), fv8(~), fml(2,~),
and
ivl(~).
The array storage required to execute this path is 2N 2 + I0N + M(2N+I) working precision words and M integer words. Indicative execution times for this path (run on an IBM 370/195), when computing all N eigenvalues and eigenvectors, are .023, .I0, .52, and 3.2 seconds for sample matrices of order i0, 20, 40, and 80 respectively. Extrapolation of these execution times for cases where M is less than N is discussed in Section 4. Variants of this path substitute the rational QR method or the implicit QL method for the bisection process, allow the specification of boundary eigenvalue indices instead of an interval to the bisection process, combine the determination of the eigenvalues and eigenveetors of the symmetric tridiagonal form into a single subroutine, or proceed from a packed form representation of the input matrix; see Sections 2.2.4, 2.2.7, 2.2.8, 2.2.5, and 2.2.9.
23
2.1-17
Section 2.1.7 SOME EiGENVALUES OF A COMPLEX HERMITIAN ~ T R I X
To determine the eigenvalues W in an interval extending from RLB to RUB of a complex Hermitian matrix (AR,AI) of order N, the recommended EISPACK path is:
CALL
HTRIDl(mi,N,AR,Al,~1,fv2,fv3,fm2)
EPSI = 0.0 CALL
BISECT(N,EPSI,fv2,fv2,fv3,RLB,RUB,MM,M,W,iv2,1ERR,fv4,fv5)
IF (IERi oNE. 0) GO TO 99999
or, using EISPAC:
CALL EISPAC (NM~N ,MATRIX( ~COMPLEX I ,AR,AI , 'HEP~MITIAN ') ,VALUES (W,~I,M,_R~B ,RUB) )
The parameter EPSI is used to control the accuracy of the eigenvalue computation.
Setting it to zero or calling EISPAC without supplying it
causes the use of a default value suitable for most matrices.
Further infor-
nmtion about the use of EPSI can be found in Section 2.3.3 and in the BISECT and EISPAC documents.
Upon completion of the path, M is set to the number
of eigenvalues determined to lie in the interval defined by RLB and RUB and, provided M ~ M M ,
the eigenvalues are in ascending order in W.
Note
that, should the computed M be greater than MM, BISECT sets IERR non-zero and does not compute any eigenvalues.
This path preserves the full upper
triangle of AR and the strict upper triangle of AI. Suitable dimensions for the arrays are:
AR(nm,nm),
fv1(nm), fv2(nm), fv3(nm), fv4(nm), fv5(nm), fm1(2,nm),
A l ( n m , ~ ) , W(mm), and
ivl(mm).
The array storage required to execute this path is 2N 2 + 7N + M working precision words and M integer words.
24
2.1-18
Indicative execution times for this path (run on an IBM 370/195), when computing all N eigenvalues, are .019, .072, .32, and 1.7 seconds for sample matrices of order i0, 20, 40, and 80 respectively.
Extrapolation of these
execution times for cases where M is less than N is discussed in Section 4. Variants of this path substitute the rational QR method for the bisection process, allow the specification of boundary eigenvalue indices instead of an interval to the bisection process, or proceed from a packed form representation of the input matrix; see Sections 2.2.4, 2.2.8, and 2.2.9.
25
2.1-19
Section 2~1.8 ALL EIGENVALUES AND CORRESPONDING EIGENVECTORS OF A REAL GENERAL MATRIX
To determine all the eigenvalues
(WR,WI) and their corresponding eigen-
vectors Z of a real general matrix A of order N, the recommended EISPACK path is:
CALL BALANC (NM,N ,A,isl
,is2,fvl)
CALL ELMHES (NM,N ,is I ,is 2 ,A,ivl ) CALL ELTRAN(NM,N,isl,is2,A,ivl
,Z)
CALL HQR2 (NM,N ,is I ,is2 ,A,WR,WI, Z, IERR) IF (IERR .NE. 0) GO TO 99999 CALL BALBAK(NM,N,isl ,is2 ,fvl ,N,Z)
or, using driver subroutine RG:
CALL RG(NM,N,A,WR,WI,I,Z,ivl,fvI,IERR) IF (IERR oNE. 0) GO TO 99999
or, using EISPAC:
CALL EISPAC(NM,N,MATRIX('REAL',A),VALUES(WR,WI),VECTOR(Z))
Pairs of complex eigenvalues are stored in consecutive elements of (WR,WI) with that member of the pair with positive imaginary part first.
The corres-
ponding columns of Z contain the real and imaginary parts, respectively, of the eigenvector associated with the eigenvalue of positive imaginary part. See Section 2.3.2 for a discussion of the eigenveetor packing into Z. path destroys A. Suitable dimensions for the arrays are:
Z ( ~ , ~ ) , fvl ( ~ ) , and ivl (nm).
26
A(~n,~),
WR(~),
WI(~),
This
2.1-20
The array storage required to execute this path is 2N 2 + 3N working pre cision words and N integer words. Indicative execution times for this path (run on an IBM 370/195) are .019, .I0, .66, and 4.6 seconds for sample matrices of order I0, 20, 40, and 80 respectively. Variants of this path omit the balancing of the input matrix or substitute orthogonal for elementary reduction transformations; see Sections 2.2.1 and 2.2.2.
27
2.1-21
Section 2.1.9 ALL EIGENVALUES OF A REAL GENERAL MATRIX
To determine all the eigenvalues
(WR,WI) of a real general matrix A of
order N, the recommended EISPACK path is:
CALL BALANC (NM,N ,A,isl ,is2 ,fvl ) CALL ELMHES (NM,N,isl ,is2,A,ivl) CALL HQR(NM,N,isl ,is2 ,A,WR,WI ,IERR) IF (IERR .NE. 0) GO TO 99999
or, using driver subroutine RG:
CALL RG(NM,N,A,WR,WI,O,DUMMY,iVl,fu2,!ERR) IF (IERR .NE. 0) GO TO 99999
or, using EISPAC:
CALL EISPAC (NM,N ,MATRIX ( 'REAL ' ,A) ,VALUES (WR,WI))
Complex eigenvalue pairs are stored in consecutive elements of (WR,WI) with that member of the pair with positive imaginary part first.
This path
destroys A. Suitable dimensions for the arrays are:
A(r~n,r~n), W R ( ~ ) ,
WI(~),
fvl (~), and iv1(~) ° The array storage required to execute this path is N 2 + 3N working precision words and N integer words.
(N working precision words could be saved
by using WR or WI for fvl.) Indicative execution times for this path (run on an IBM 370/195) are .012,
.056, o31, and 1.9 seconds for sample matrices of order I0, 20, 40,
and 80 respectively.
28
2.1-22
Variants of this path omit the balancing of the input matrix or substitute orthogonal for elementary reduction transformations; see Sections 2.2.1 and 2.2.2.
29
2.1-23
Section 2.1.10 ALL EIGENVALUES AND SELECTED EIGENVECTORS OF A REAL GENERAL MATRIX
To determine all the eigenvalues (WR,WI) and certain eigenvectors Z (those corresponding to eigenvalues flagged by .TRUE. elements in the LOGICAL array SELECT) of a real general matrix A of order N, the recommended EISPACK path is:
CALL
BALANC(NM,N,A,is2,is2,fvl)
CALL
ELMHES(NM,N,is2,is2,A,iv2)
DO i00 1 = I, N DO 50 J = I, N
fml(l,J) 50
= A(I,J)
CONTINUE
I00 CONTINUE CALL
HQR(NM,N,isl,is2,fm2,WR,WI,IERR)
IF (IERR ,NE. 0) GO TO 99999 CALL
INVIT(NM,N,A,WR,WI,SELECT,MM,M,Z,IERR,fmi,fv2,fv3)
IF (IERR .NE. 0) GO TO 99999 CALL
ELMBAK(NM,isl,i82,A,iVI,M,Z)
CALL
BALBAK(NM,N,isi,is2,fvl,M,Z)
or, using EISPAC:
CALL EISPAC(NM,N,MATRIX('REAL',A),VALUES(WR,WI),VECTOR(Z,MM,M,SELECT))
Complex eigenvalue pairs are stored in consecutive elements of (WR,WI) with that member of the pair with positive imaginary part first. 2.3.1 for a discussion of the SELECT array.
See Section
Note in particular that if both
elements of SELECT corresponding to a pair of complex (conjugate) eigenvalues
30
2.1-24
are set to .TRUE., the second element will be reset to .FALSE. Upon completion of the path, M is set to the number of columns of Z used, and provided MM is sufficiently large, the computed eigenvectors corresponding to the flagged eigenvalues are stored in the first M columns of Z.
Note that the real and imaginary parts, respectively, of an eigenvector
corresponding to a complex eigenvalue occupy two consecutive columns of Z. If MM is not sufficiently large, then IERR is set non-zero, M is set to MM or MM-I, and only the selected vectors that can be stored in M columns of Z are computed provided that the interrupted path is completed. also set non-zero if a vector fails to converge.) discussion of the eigenvector packing into Z. Suitable dimensions for the arrays are:
Z (~,mm),
SELECT (nm),
(IERR is
See Section 2.3.2 for a
This path destroys A. A(nm,nm), WR(nm), Wl(nm),
fro1(nm,~), fvl (~), fv2 (nm), fv3 (r~m), and iv1 (nm).
The array storage required to execute this path is 2N 2 + N(M+5) working precision words, N logical words, and N integer words. Indicative execution times for this path (run on an IBM 370/195), when computing all possible (M=N) eigenvectors, are .019, .093, .53, and 3.5 seconds for sample matrices of order I0, 20, 40, and 80 respectively. Extrapolation of these execution times for cases where M is less than N is discussed in Section 4. Variants of this path omit the balancing of the input matrix or substitute orthogonal for elementary reduction transformations; see Sections 2.2oi and 2.2.2.
31
2.1-25
Section 2.1.11 ALL EIGENVALUES AND CORRESPONDING EIGENVECTORS OF A REAL SYMMETRIC MATRIX
To determine all the eigenvalues W and their corresponding eigenvectors Z of a full real symmetric matrix A of order N, the recommended EISPACK path is: CALL TRED2(NM,N,A,W,fV2 ,Z) CALL TQL2 (NM,N ,W,fV2 ,Z, IERR) IF (iERR .NE. O) GO TO 99999
or, using driver subroutine RS:
CALL
RS(NM,N,A~W,I,Z,fvi,fv2,1ERR)
IF (IERR oNE. O) GO TO 99999
or, using EISPAC:
CALL EISPAC(NM,N,Y~TRIX('REAL',A,'SYMMETRIC'),VALUES(W),VECTOR(Z))
This path returns the eigenvalues in ascending order and a set of orthonormal eigenvectors; it leaves A unaltered. Suitable dimensions for the arrays are: and
A(nm,nm),
W(r~), Z(~,nm),
fvi (nm)~ The array storage required to execute this path is 2N 2 + 2N working
precision words.
However, for this particular path the eigenvectors can
overwrite the input matrix if the same array parameter is used for both A and Z, thereby reducing the storage required to N 2 + 2N working precision words. Indicative execution times for this path (run on an IBM 370/195) are ~007, ~036, .22, and 1.5 seconds for sample matrices of order i0, 20, 40, and 80 respectively. 32
2.1-26
A variant of this path substitutes the implicit for the explicit QL shift; see Section 2.2.3.
33
2.1-27
Section 2.1.12 ALL EIGENVALUES OF A REAL SYMMETRIC MATRIX
To determine ali the eigenvalues W of a full real symmetric matrix A of order N~ the recommended EISPACK path is:
CALL
TREDI(NM,N,A,W,fvl,fv2)
CALL T Q L R A T ( N , W , ~ , I E R R ) IF (IERR 0NE. 0) GO TO 99999
or, using driver subroutine RS:
CALL
RS(NM, N,A,W,O,DUMMY,fv2,fv2,1ERR)
IF (IERR .NE. 0) GO TO 99999
or, using EISPAC:
CALL EISPAC(NM,N,MATRIX('REAL',A,'SYMMETRIC'),VALUES(W))
This path returns the eigenvalues in ascending order; it preserves the full upper triangle of A~ Suitable dimensions for the arrays are: and
A(~,n~),
W(~),
fvi(nm),
fv2 (rim). The array storage required to execute this path is N 2 + 3N working
precision words~ Indicative execution times for this path (run on an IBM 370/195) are .003, .011, ~055, and .33 seconds for sample matrices of order i0, 20, 40, and 80 respectively. Variants of this path substitute the explicit or implicit for the rational QL shift or proceed from a packed form representation of the input matrix; see Sections 2.2.3 and 2.2.9.
34
2.1-28
Section 2.1.13 SOME EIGENVALUES AND CORRESPONDING EIGENVECTORS OF A REAL SYMMETRIC MATRIX
To determine the eigenvalues W in an interval extending from RLB to RUB, together with their corresponding eigenvectors Z, of a full real symmetric matrix A of order N, the recommended EISPACK path is:
CALL TREDI (NM,N,A,fN2
,fv2 ,fv3)
EPSI = 0.0 CALL
BISECT(N,EPSI,fvl,fv2,fv3,RLB,RUB,MM,M,W,iv2,1ERR,fv4,fv5)
IF (IERR .NE. 0) GO TO 99999 CALL TINVIT (NM,N ,fv2
,fv2 ,fv3 ,M,W ,iv2, Z, IERR ,fv4 ,fv5 ,fv6 ,fvf ,fvS)
IF (IERR .NE. 0) GO TO 99999 CALL
TRBAKI(NM,N,A,fV2,M,Z)
or, using EISPAC:
CALL EISPAC(NM,N,MATRIX('REAL',A,'SYMMETRIC'),VALUES(W,MM,M,RLB,RUB),VECTOR(Z))
The parameter EPSI is used to control the accuracy of the eigenvalue computation.
Setting it to zero or calling EISPAC without supplying it
causes the use of a default value suitable for most matrices.
Further in-
formation about the use of EPSI can be found in Section 2.3.3 and in the BISECT and EISPAC documents.
Upon completion of the path, M is set to the
number of eigenvalues determined to lie in the interval defined by RLB and RUB and, provided M ! M M ,
the eigenvalues are in ascending order in W and
their corresponding orthonormal eigenvectors are in the first M columns of Z.
Note that, should the computed M be greater than MM, BISECT sets IERR
non-zero and does not compute any eigenvalues. full upper triangle of A.
35
This path preserves the
2.1-29
Suitable dimensions for the arrays are:
A(nm,nm), W(m~n), Z(nm,m3n),
fvl(n~n), fv2(nm), fv3(nm), fv4(nm), fv5(nm), ~6(nm), fvF(~n), fv8(nm), and
ivl(~n). The array storage required to execute this path is N 2 + 8N + M(N+I)
working precision words and M integer words. Indicative execution times for this path (run on an IBM 370/195), when computing all N eigenvalues and eigenvectors,
are .020, .075,
.33, and 1.6
seconds for sample matrices of order I0, 20, 40, and 80 respectively. Extrapolation of these execution times for cases where M is less than N is discussed in Section 4. Variants of this path substitute the rational QR method or the implicit QL method for the bisection process,
allow the specification of boundary
eigenvalue indices instead of an interval to the bisection process, the determination of the eigenvalues and eigenvectors form into a single subroutine,
combine
of the tridiagonal
or proceed from a packed form representation
of the input matrix; see Sections 2.2.4, 2.2.7, 2.2.8, 2.2.5, and 2.2.9.
36
2.1-30
Section 2.1.14 SOME EIGENVALUES OF A REAL SYMMETRIC MATRIX
To determine the eigenvalues W in an interval extending from RLB to RUB of a full real symmetric matrix A of order N, the recommended EISPACK path is:
CALL TREDI (NM,N ,A,fvl ,fv2 ,fv3) EPSI = 0.0 CALL BISECT (N,EPS 1 ,fv l ,fv2 ,fv3 ,RLB ,RUB ,MM,M,W ,iVl ,IERR,fv4
,fv5)
IF (IERR .NE. 0) GO TO 99999
or, using EISPAC:
CALL EISPAC(NM,N,MATRIX('REAL',A,'SYMMETRIC'),VALUES(W,MM,M,RLB,RUB))
The parameter EPSI is used to control the accuracy of the eigenvalue computation.
Setting it to zero or calling EISPAC without supplying it
causes the use of a default value suitable for most matrices.
Further
information about the use of EPSI can be found in Section 2.3.3 and in the BISECT and EISPAC documents.
Upon completion of the path, M is set
to the number of eigenvalues determined to lie in the interval defined by RLB and RUB and, provided M ! M M , in W.
the eigenvalues are in ascending order
Note that, should the computed M be greater than MM, BISECT sets
IERR non-zero and does not compute any eigenvalues.
This path preserves
the full upper triangle of A. Suitable dimensions for the arrays are:
fv2(nm), fv3(nm), fv4(nm), fv5(nm),
and
A(nm,rm0, W(mm),
fvl (rim),
ivl(mm).
The array storage required to execute this path is N 2 + 5N + M working precision words and M integer words.
37
2.1-31
Indicative execution times for this path (run on an IBM 370/195), when computing all N eigenvalues, are .017, .061, .24, and 1.0 seconds for sample matrices of order i0, 20, 40, and 80 respectively.
Extrapolation
of these execution times for cases where M is less than N is discussed in Section 4o Variants of this path substitute the rational QR method for the bisection process, allow the specification of boundary eigenvalue indices instead of an interval to the bisection process~ or proceed from a packed form representation of the input matrix; see Sections 2.2.4~ 2.2.8, and 2.2.9.
38
2.1-32
Section 2.1.15 ALL EIGENVALUES AND CORRESPONDING EIGENVECTORS OF A REAL SYMMETRIC TRIDIAGONAL MATRIX
A real symmetric tridiagonal matrix of order N can be presented to EISPACK as a two-column array (or as two N-component vectors), the subdiagonal elements in the last N-I positions of the first column and the diagonal elements in the second column.
The first element in the first
column is arbitrary. To determine all the eigenvalues W and their corresponding eigenvectors Z of a real symmetric tridiagonal matrix A of order N, the recommended EISPACK path is:
DO i00 1 = i, N DO 50 J = i, N Z(l,J) = 0.0 50
CONTINUE Z(I,I) = 1.0 W(1) = A(I,2)
fv2(i)
= A(I,I)
I00 CONTINUE CALL IMTQL2 (NM,N ,W,fv 2, Z, IERR) IF (IERR .NE. 0) GO TO 99999
or, using driver subroutine RST:
CALL RST(NM,N,W,fu2, I,Z,IERR) IF (IERR .NE. 0) GO TO 99999
39
2.1-33
or, using EISPAC:
CALL EISPAC (NM,N ,MATRIX ( vREAL v ,A, TSY~iETRIC ' , 'TR!D!AGONAL ') , VALUES(W),VECTOR(Z))
This path returns the eigenvalues in ascending order and a set of orthonormal eigenvectors.
Copying A into W and
course which would otherwise be destroyed.
fvl
preserves A of
EISPAC, however, preserves
only the second column (diagonal elements) of A. Suitable dimensions for the arrays are: and
A(nm,2), W(nm), Z(nm,nm),
fvl (rim)° The array storage required to execute this path is N 2 + 4N working
precision words.
(2N working precision words could be saved by trans-
mitting the columns of A itself in place of
fvl
and W.
Similarly, A(I,2)
could be transmitted to EISPAC in place of W.) Indicative execution times for this path (run on an IBM 370/195) are .005,
.026, o15, and .97 seconds for sample matrices of order I0, 20, 40,
and 80 respectively. A variant of this path substitutes the explicit for the implicit QL shift; see Section 2.2.3.
40
2.1-34
Section 2.1.16 ALL EIGENVALUES OF A REAL SYMMETRIC TRIDIAGONAL MATRIX
A real symmetric tridiagonal matrix of order N can be presented to EISPACK as a two-column array (or as two N-component vectors), the subdiagonal elements in the last N-I positions of the first column and the diagonal elements in the second column.
The first element in the first
column is arbitrary. To determine all the eigenvalues W of a real symmetric tridiagonal matrix A of order N, the recommended EISPACK path is:
DO i00 1 = i, N W(1) = A(I,2)
fv1(~)
= A(I,I)
i00 CONTINUE CALL IMTQLI(N,W,fv2,1ERR) IF (IERR .NE. 0) GO TO 99999
or, using driver subroutine RST:
CALL RST(NM,N,W,fV2,0,DUMMY,IERR) IF (IERR .NE. 0) GO TO 99999
or, using EISPAC:
CALL EISPAC(NM,N,MATRIX('REAL',A,'SYMMETR!C','TRIDIAGONAL'),VALUES(W))
This path returns the eigenvalues in ascending order. W and
fvl
Copying A into
preserves A of course which would otherwise be destroyed.
EISPAC,
however, preserves only the second column (diagonal elements) of A. Suitable dimensions for the arrays are:
41
A(nm,2), W(nm), and
fv1(nm).
2.1-35
The array storage required to execute this path is 4N working precision words°
(2N working precision words could be saved by transmitting
the columns of A itself in place of
fvl
and W,
Similarly, A(I,2) could
be transmitted to EISPAC in place of W.) Indicative execution times for this path (run on an IBM 370/195) are .003, .011,
.042, and .16 seconds for sample matrices of order i0, 20, 40,
and 80 respectively. Variants of this path substitute the explicit or its rational reformulation for the implicit QL shift; see Section 2.2.3.
42
2.1-36
Section 2.1.17 SOME EIGENVALUES AND CORRESPONDING EIGENVECTORS OF A REAL SYMMETRIC TRIDIAGONAL MATRIX
A real symmetric tridiagonal matrix of order N can be presented to EISPACK as a two-column array (or as two N-component vectors), the subdiagonal elements in the last N-I positions of the first column and the diagonal elements in the second column.
The first element in the first
column is arbitrary. To determine the eigenvalues W in an interval extending from RLB to RUB, together with their corresponding eigenvectors Z, of a real symmetric tridiagonal matrix A of order N, the recommended EISPACK path is:
DO i00 1 = I, N
f~1(1) = A(I,2) IF (I .EQ. i) GO TO i00 fv~(i)
= k(I,1)
fv3(1)
= A(I,I)**2
i00 CONTINUE EPSI = 0.0 CALL BISECT (N ,EPSI ,fVl ,fv2 ,fv3,RLB ,RUB ,MM,M,W,ivl
,IERR,fv4 ,fv5)
IF (IEILR .NE. 0) GO TO 99999 CALL TINVIT (NM,N ,fv 2 ,fv2 ,fv3 ,M,W,ivl
,Z ,IERR,fv4 ,fv5 ,fv6 ,fv7 ,fvS)
IF (IERR .NE. 0) GO TO 99999
or, using EISPAC:
CALL EISPAC(NM,N,MATRIX('REAL',A,'SYMMETRIC','TRIDIAGONAL'), VALUES(W,MM,M,RLB,RUB),VECTOR(Z))
43
2.1-37
The parameter EPSi is used to control the accuracy of the eigenvalue computation.
Setting it to zero or calling EISPAC without supplying it
causes the use of a default value suitable for most matrices.
Further
information about the use of EPSI can be found in Section 2.3.3 and in the BISECT and EISPAC documents.
Upon completion of the path, M is set
to the number of eigenvalues determined to lie in the interval defined by RLB and RUB and, provided M ! ~i, the eigenvalues are in ascending order in W and their corresponding orthonormal eigenvectors are in the first M columns of Z.
Note that, should the computed M be greater than
MM, BISECT sets IERR non-zero and does not compute any eigenvalues.
This
path leaves A unaltered. Suitable dimensions for the arrays are:
A(nm,2), W(mm), Z(nm,~wn),
fvl(nm), fv2(nm), fv3(nm), fv4(n~), fv5(nm), fv6(nm), fvT(nm), fvS(nrn), and
ivi (~)o The array storage required to execute this path is I0N + M(N+I)
working precision words and M integer words.
(2N working precision words
could be saved by transmitting the columns of A itself in place of fvN and fv2, still preserving A.) Indicative execution times for this path (run on an IBM 370/195), when computing all N eigenvalues and eigenvectors, are .017, .059, .22, and .84 seconds for sample matrices of order I0, 20, 40, and 80 respectively. Extrapolation of these execution times for cases where M is less than N is discussed in Section 4. Variants of this path substitute the rational QR method or the implicit QL method for the bisection process, allow the specification of boundary eigenvalue indices instead of an interval to the bisection process, or
44
2.1-38
cosine
the determination of the eigenvalues and eigenvectors of the
matrix into a single s~routine;
see Sections 2.2.4, 2.2.7, 2.2.8, and
2.2.5.
45
2.1-39
Section 2.1o18 SOME EIGENVALb~S OF A REAL SYMMETRIC TRIDIAGONAL .MATRIX
A real symmetric tridiagonal matrix of order N can be presented to EISPACK as a two-column array (or as two N-component vectors), the subdiagonal elements in the last N-I positions of the first column and the diagonal elements in the second column~
The first element in the first
column is arbitrary. To determine the eigenvalues W in an interval extending from RLB to RUB of a real symmetric tridiagonal matrix A of order N, the recommended EISPACK path is:
DO i00 1 = i, N
fvl(1)
= A(I,2)
IF (I .EQ. I) GO TO I00
fv~(1)
= A(~,I)
fv3(I)
= A(I,I)**2
i00 CONTINUE EPSI = 0.0 CALL
BISECT(N,EPSI,fvl,fv2,fv3,RLB,RUB,MM,M,W,iVI,IERR,fv4,fv5)
IF (IERR .NE. 0) GO TO 99999
or, using EISPAC:
CALL EISPAC (NM,N,MATRIX( 'REAL v ,A, 'SYMMETRIC' , 'TRIDIAGONAL' ) ,
VALUES (W ,MM,M,RLB ,RUB) )
The parameter EPSI is used to control the accuracy of the eigenvalue computation.
Setting it to zero or calling EISPAC without supplying it
causes the use of a default value suitable for most matrices.
46
Further
2.1-40
information about the use of EPSI can be found in Section 2.3.3 and in the BISECT and EISPAC documents.
Upon completion of the path, M is set
to the number of eigenvalues determined to lie in the interval defined by RLB and RUB and, provided M ~ M M , order in W.
the eigenvalues are in ascending
Note that, should the computed M be greater than MMj BISECT
sets IERRnon-zero
and does not compute any eigenvalues.
This path
leaves A unaltered. Suitable dimensions for the arrays are:
fv2(n~), fv3(n~m), fv4(nm), fv5(r~),
and
A(~n,2), W(mm), fv2(nm),
ivl (~).
The array storage required to execute this path is 7N + M working precision words and M integer words.
(2N working preciaion words could
be saved by transmitting the columns of A itself in place of
fv2
and
fvl,
still preserving A.) Indicative execution times for this path (run on an IBM 370/195), when computing all N eigenvalues,
are .016, .055,
.20, and .76 seconds
for sample matrices of order I0, 20, 40, and 80 respectively.
Extrapola-
tion of these execution times for cases where M is less than N is discussed in Section 4. Variants of this path substitute the rational QR method for the bisection process or allow the specification of boundary eigenvalue indices instead of an interval to the bisection process; see Sections 2.2.4 and 2.2.8.
47
2.1-41
Section 2.1o19 ALL EIGENVALUES AND CORRESPONDING EIGENVECTORS OF A SPECIAL REAL TRIDIAGONAL MATRIX
A real tridiagona! matrix of order N which, although not symmetric, has the property that products of pairs of corresponding off-diagonal elements are all non-negative~ and zero only when both factors are zero, can be presented to EISPACK as a three-column array.
The subdiagonal
elements are stored in the last N-I positions of the first column, the diagonal elements in the second column, and the superdiagonal elements in the first N-I positions of the third column.
The first element in the
first column and the last element in the third column are arbitrary. To determine all the eigenvalues W and their corresponding eigenvectors Z of such a real tridiagonal matrix A of order N, the recommended EISPACK path is:
CALL FIGI2(NM,N,A,W,fVi,Z,IERR) IF (IERR ~NE. 0) GO TO 99999 CALL
IMTQLe(NM,N,W,fvI,Z,IERR)
IF (IERR .NE. 0) GO TO 99999
or, using driver subroutine RT:
CALL RT(NM,N,A,W,I,Z,~i,IERR) IF (IERR .h~. 0) GO TO 99999
or, using EISPAC:
CALL EiSPAC(NM,N,MATRIX('REAL',A,'TRIDIAGONAL'),VALUES(W),VECTOR(Z))
This path returns the eigenvalues in ascending order and a set of (nonorthonorma!) eigenvectors;
it leaves A unaltered.
48
Note that a non-zero
2.1-42
value of IERR from FIGI2 is indicative of an input matrix which lacks the required property. Suitable dimensions for the arrays are: and
A(nm,3), W(nm), Z(nm,nm),
fvl (rim). The array storage required to execute this path is N 2 + 5N working
precision words. Indicative execution times for this path (run on an IBM 370/195) are .006, .027,
.15, and .97 seconds for sample matrices of order I0, 20, 40,
and 80 respectively. A variant of this path substitutes shift; see Section 2.2.3.
49
the explicit for the implicit QL
2.1-43
Section 2.1.20 ALL EIGENVALUES OF A SPECIAL REAL TRiDIAGONAL MATRIX
A real tridiagonal matrix of order N which, although not symmetric, has the property that products of pairs of corresponding off-diagonal elements are all non-negative, can be presented to EISPACK as a threecolumn array.
The subdiagonal elements are stored in the last N-I
positions of the first column, the diagonal elements in the second column, and the superdiagonal elements in the first N-I positions of the third column.
The first element in the first column and the last element in
the third column are arbitrary. To determine all the eigenvalues W of such a real tridiagonal matrix A of order N, the recommended EISPACK path is:
CALL
FiGI(NM,N,A,W,fv2,fv2,1ERR)
IF (IERR ~NE. 0) GO TO 99999 CALL IP~QLI (N,W,fv2 ,IERR) IF (IERR oNE. O) GO TO 99999
or, using driver subroutine RT:
CALL RT(~I,N,A,W,0,DU~Y,fv2,1ERR) IF (IERR ~NE. 0) GO TO 99999
or, using EISPAC:
CALL El SPAC (NM, N, MATRIX ('REAL ',A ,'TRID IAGONAL ') ,VALUE S (W))
This path returns the eigenvalues in ascending order; it leaves A unaltered.
Note that a non-zero value of IERR from FiGI is indicative
of an input matrix which lacks the required property.
50
2.1-44
Suitable dimensions for the arrays are:
A(rtm,3), W(nm), and
fvl(nm).
The array storage required to execute this path is 5N working precision words. Indicative execution times for this path (run on an IBM 370/195) are .003, .012,
.044, and .16 seconds for sample matrices of order i0, 20, 40,
and 80 respectively. Variants of this path substitute the explicit or its rational reformulation for the implicit QL shift; see Section 2.2.3.
51
2.1-45
Section 2.1.21 SOME EIGENVALUES AND CORRESPONDING EIGENVECTORS OF A SPECIAL REAL TRiDIAGONAL MATRIX
A real tridiagonal matrix of order N which, although not symmetric, has the property that products of pairs of corresponding off-diagonal elements are all non-negative, and zero only when both factors are zero, can be presented to EISPACK as a three-column array.
The subdiagonal
elements are stored in the last N-I positions of the first column, the diagonal elements in the second column, and the superdiagonal elements in the first N-! positions of the third column.
The first element in
the first column and the last element in the third column are arbitrary. To determine the eigenvalues W in an interval extending from RLB to RUB 9 together with their corresponding eigenvectors Z, of such a real tridiagonal matrix A of order N, the recommended EISPACK path is:
CALL
FIGI(NM,N,A,fvl,fv2,fv3,1ERR)
IF (IERR .NE. 0) GO TO 99999 EPSI = 0.0 CALL
BISECT(N,EPSI,ful,f~2,fv3,RLB,RUB,MM,M,W,iVI,IERR,fv4,fv5)
IF (iERR ~NE. O) GO TO 99999 CALL
TINVIT(NM,N,fv2,fu2,fv3,M,w,iv2,Z,IERR,fu4,fv5,fv6,fv?,fvS)
IF (IERR .NE. O) GO TO 99999 CALL BAKVEC(hrM,N,A,fv2,M,Z,IERR) IF (lEER ~NE. 0) GO TO 99999
or, using EISPAC:
CALL EISPAC(NM,N,MATRIX('REAL~,A,'TRIDIAGONALT), VALUES(W,MM,M,RLB,RUB),VECTOR(Z))
52
2.1-46
The parameter EPSI is used to control the accuracy of the eigenvalue computation.
Setting it to zero or calling EISPAC without supplying it
causes the use of a default value suitable for most matrices.
Further
information about the use of EPSI can be found in Section 2.3.3 and in the BISECT and EISPAC documents.
Upon completion of the path, M is set
to the number of eigenvalues determined to lie in the interval defined by RLB and RUB and, provided M ! ~ ,
the eigenvalues are in ascending
order in W and their corresponding (non-orthonormal) eigenvectors are in the first M columns of Z.
Note that, should the computed M be greater
than MM, BISECT sets IERR non-zero and does not compute any eigenvalues. This path leaves A unaltered.
Note that a non-zero value of IERR from
either FIGI or BAKVEC is indicative of an input matrix which lacks the required property. Suitable dimensions for the arrays are:
A(nm,3), W(n~n), Z(nm,mm),
fv1(nm), fv2(nm), fv3(n~), fv4(nm), fv5(nm), fv6(nm), fvT(nm), fv8(nm), and i v l ( ~ ) . The array storage required to execute this path is IIN + M(N+I) working precision words and M integer words. Indicative execution times for this path (run on an IBM 370/195), when computing all N eigenvalues and eigenvectors, are .018, .060, .22, and .84 seconds for sample matrices of order i0, 20, 40, and 80 respectively. Extrapolation of these execution times for cases where M is less than N is discussed in Section 4. Variants of this path substitute the rational QR method or the implicit QL method for the bisection process, allow the specification of boundary eigenvalue indices instead of an interval to the bisection process, or combine the determination of the eigenvalues and eigenvectors
53
2.1-47
of the s~-mmetrized matrix into a single subroutine; 2.2.7, 2.2.8, and 2.2.5.
54
see Sections 2.2.4,
2.1-48
Section 2.1.22 SOME EIGENVALUES OF A SPECIAL REAL TRIDIAGONAL MATRIX
A real tridiagonal matrix of order N which, although not symmetric, has the property that products of pairs of corresponding off-diagonal elements are all non-negative, can be presented to EISPACK as a threecolumn array.
The subdiagonal elements are stored in the last N-I
positions of the first column, the diagonal elements in the second column, and the superdiagonal elements in the first N-I positions of the third column.
The first element in the first column and the last
element in the third column are arbitrary. To determine the eigenvalues W in an interval extending from RLB to RUB of such a real tridiagonal matrix A of order N, the recommended EISPACK path is:
CALL
FIGI(NM,N,A,fvl,fv2,fv3,1ERR)
IF (IERR .NE. 0) GO TO 99999 EPSI = 0.0 CALl.
BISECT(N,EPSI,fv2,fv2,fv3,RLB,RUB,MM,M,W,ivl,IERR,fv4,fv5)
IF (IERR .NE. 0) GO TO 99999
or, using EISPAC:
CALl EISPAC(NM,N,MATRIX('REAL',A,'TRIDIAGONAL'),VALUES(W,MM,M,RLB,RUB))
The parameter EPSI is used to control the accuracy of the eigenvalue computation.
Setting it to zero or calling EISPAC without supplying it
causes the use of a default value suitable for most matrices.
Further
information about the use of EPSI can be found in Section 2.3.3 and in the BISECT and EISPAC documents.
Upon completion of the path, M is set to the
55
2.1-49
number of eigenva!ues determined to lie in the interval defined by RLB and RUB and, provided M ~ M M , in W.
the eigenvalues are in ascending order
Note that, should the computed M be greater than ~ ,
IERRnon-zero and does not compute any eigenvalues. unaltered.
BISECT sets
This path leaves A
Note that a non-zero value of IERR from FIGI is indicative
of an input matrix which lacks the required property. Suitable dimensions for the arrays are:
fv2(~), fv3(nm), fv4(nm), fv5(nm),
and
A(nm,3), W(~v~), fv2(nm),
ivl(mm).
The array storage required to execute this path is 8N + M working precision words and M integer words. Indicative execution times for this path (run on an IBM 370/195), when computing all N eigenvalues, are .016, .055, .20, and °76 seconds for sample matrices of order I0, 20, 40, and 80 respectively.
Extrapolation
of these execution times for cases where M is less than N is discussed in Section 4. Variants of this path substitute the rational QR method for the bisection process or allow the specification of boundary eigenvalue indices instead of an interval to the bisection process; see Sections 2.2.4 and 2.2.8.
58
2.2-I
Section 2.2 VARIATIONS OF THE RECOMMENDED EISPACK PATHS
This section describes variants of the recommended paths given in Section 2.1.
These variants are obtained by modifying one or more of
the call or ancillary statements in the recommended paths; they provide some additional or alternate capability. to considerations of:
The variant paths are related
whether or not complex and real general matrices
should be balanced; the use of orthogonal similarities in place of elementary similarities for reducing a real general matrix to upper Hessenberg form; choosing between the implicit and explicit versions of the QL algorithm for finding all eigenvalues and eigenvectors, or all eigenvalues only, of matrices which can be reduced to real symmetric tridiagonal form; the use of the rational QR algorithm for finding a few extreme eigenvalues of matrices which can be reduced to real symmetric tridiagonal form; the use of the single subroutine TSTURM to find some eigenvalues and their corresponding eigenvectors of matrices which can be reduced to real symmetric tridiagonal form; the use of elementary similarities in place of unitary similarities for a complex general matrix; possible economies realizable with a variant of the implicit QL algorithm when partial eigensystems are determined; specification of boundary eigenvalue indices to the bisection process instead of an interval; and availability of storage economies when algorithms that proceed from packed representations of real symmetric and complex Hermitian matrices are used. Each of the subsections describing these variations discusses the advantages and disadvantages of using the variant instead of the recommended paths and includes an indication of why the routines used in the recommended paths were chosen.
The descriptions of the variant paths
57
2.2-2
differ from those of the recommended paths in Section 2.1 in that the variants are described in terms of modifications to the recommended paths; differences in storage requirements are similarly described.
In
order to illustrate the modifications, one example of the several variant paths is also given in each subsection~
58
2.2-3
Section 2.2.1 NON-BALANCING OF COMPLEX AND REAL GENERAL MATRICES
All of the recommended paths in EISPACK for complex general and real general matrices employ the subroutines CBAL and BALANC, respectively, to "balance" the matrix before computing its eigensystem ([i], pp. 315-326). This operation includes two distinct functions:
Permutation of the rows
and columns of the matrix to display any isolated eigenvalues, and equilibration of the remaining portion of the matrix. The first part of the operation attempts to permute the rows and columns of the matrix in such a way as to render portions of the matrix triangular (column-wise at the top or row-wise at the bottom) so that some eigenvalues are isolated on the diagonal.
Any eigenvalues so iso-
lated are available without further computation and the order of the remaining eigenproblem is reduced. The equilibration process is then applied to the part of the matrix (rows and columns is1 through is2) remaining after any isolated eigenvalues have been displayed.
It consists of exact diagonal similarity
transformations chosen to make the sums of the magnitudes of the elements in corresponding rows and columns more nearly equal.
(Note that real
symmetric and complex Hermitian matrices are by nature balanced.)
This
process may reduce the norm of the matrix thereby placing tighter bounds on the rounding errors that can be made by the routines which follow. The choice of whether to balance or not depends on several factors, some of which are hard to assess a priori. time.
Clearly balancing costs some
However, it is an N 2 process and becomes less significant as N
increases; in no case have we observed it to constitute more than 7% of the time for an entire path (see Section 4.3).
59
It may also happen that
2.2-4
the eigenvalues computed for an already nearly-equilibrated
matrix are
slightly more accurate if balancing is omitted; however, balancing can never increase the error bounds predicted by the backward error analysis. Moreover, balancing obtains isolated eigenvalues exactly whatever be their condition numbers, and their isolation reduces the effective order of the matrix passed to the N 3 algorithms which follow.
Beyond this,
the equilibration process can make dramatic improvements
in the accuracy
of the computed eigenvalues
for certain matrices.
It is for these reasons
that balancing is used in the recommended paths. To use the paths of Sections 2.1.1-2.1.3 and 2.1.8-2.1.10 without balancing the matrix, the calls to CBAL or BALANC should be replaced by the two statements
is1
=
I
is2
= N
Also, calls to B ~ B A K
or CBABK2, which transform the eigenvectors
balanced matrix into eigenvectors moved altogether~
of the original matrix, should be re-
To use the control program EISPAC without balancing,
the keyword parameter METHOD with alphanumeric subparameters 'BALANCE'
of the
vNO~,
should be inserted into the calls to EISPAC given in these
sections. For example (of. Section 2.1.1), to determine all of the eigenvalues (WR,WI) and their corresponding
eigenvectors
matrix (AR,AI) of order N without balancing,
60
(ZR,ZI) of a complex general the EISPACK path is:
2.2-5
isl = 1 is2 = N
CALL C O R T H ( N M , N , i s l , i s 2 , A R , A I , f v 2 , f v 3 ) CALL C O M Q R 2 ( N M , N , i s l , i s 2 , f v 2 , f v 3 , A R , A I , W R , W I , Z R , Z I , I E R R ) IF (IERR .NE. 0) GO TO 99999
or, using EISPAC:
CALL EISPAC(NI4,N,MATRIX('COMPLEX',AR,AI),VALUES(WR,WI), VECTOR(ZR,ZI),METHOD('NO','BALANCE'))
The storage requirements
for each of the paths without balancing is
reduced from that of the corresponding path with balancing by N working precision words (array parameter fv2).
The reduction in computation time
from not balancing has never exceeded 7% of the total path time in our experiments.
On the other hand, a substantial increase in total path
time from not balancing could occur in cases where balancing would isolate some eigenvalues,
since isolation of values reduces the effective
order of the eigensystem to be solved.
61
2.2-6
Section 2.2.2 ORTHOGONAL REDUCTION TRANSFORMATIONS TO REAL HESSENBERG FORM
EISPACK contains two sets of subroutines which transform a real general matrix to upper Hessenberg form~ accumulate the transformations, and backtransform the eigenvectors.
These sets consist of ELMHES,
ELTRAN, and ELMBAK~ which employ elementary similarity transformations, and 0RTHES, ORTRAN, and ORTBAK, which employ orthogonal similarity transformations~ The use of orthogona! similarities to reduce a matrix to upper Hessenberg form may be valuable in two respects.
First, they preserve
the Frobenius norm of the matrix and the condition numbers of the eigenvalues
([i], ppo 339-358), whereas elementary similarities do not.
Thus,
elementary similarities may increase the norm of the reduced matrix, which in turn increases the bounds on the rounding errors that can be made by the eigenvalue-finding routines HQR and HQR2; in this case, use of orthogonal similarities will guarantee a tighter bound on the errors. Matrices for which orthogonal similarities improve the accuracies of the computed eigenvalues, however, occur rarely in practice. A second application of the routines which employ orthogonal similarities is their possible use with a modified version of HQR2 to compute the orthogona! similarity transformation which reduces a real general matrix to quasi-triangular form; this application is discussed in Section 2.3.6. The disadvantage of the routines which implement orthogonal similarities is their longer execution time.
ORTHES requires more than twice as
much time as ELMHES (on the IBM 370/195), and ORTBAK takes about half again as long as ELMBAK.
ORTRAN requires about one-fourth the time of
62
2.2-7
ORTHES, while the time for ELTRAN, never large, becomes negligible with increasing order (see Section 4).
For this reason, elementary similarities
are used in the recommended paths of Sections 2.1.8-2.1.10. that although the orthogonal subroutines individually
Note, however,
take more time, only
a small increase in total path time usually results and occasionally even a decrease in total path time attributable to a decrease in the execution time for HQR or HQR2.
Experiments using orthogonal similarities have
resulted in increases as much as 20% but some decreases of 5% were also observed. To use orthogonal instead of elementary similarities
in these paths,
replace the names ELMIIES, ELTRAN, and ELMBAK with ORTHES, ORTRAN, and ORTBAK, respectively, parameter
fv4
similarities, 'ORTHOGONAL'
for
wherever they appear, substituting the array
ivl.
To use the control program EISPAC with orthogonal
the keyword parameter METHOD with alphanumeric subparameter should be inserted into the calls to EISPAC given in these
sections. For example
(cf. Section 2.1.8), to determine all of the eigenvalues
(WR,WI) and their corresponding eigenvectors Z of a real general matrix A of order N using orthogonal transformations,
CALL
BALANC(NM,N,A,isl,is2,fvl)
CALL
ORTHES(NM, N,isl,is2,A,fv4)
CALL
ORTRAN(NM,N,isl,is2,A,fv4,Z)
CALL
HQR2(NM, N,isi,is2,A,WR,WI,Z,IERR)
IF (IERR .NE. 0) GO TO 99999 CALL
BALBAK(NM,N,is2,is2,fv2,N,Z)
or, using EISPAC:
63
the EISPACK path is:
2.2-8
CALL EISPAC(NM,N,MATRIX('REAL',A),VALUES(WR,WI),VECTOR(Z), METHOD('ORTHOGONALT))
Suitable dimensions for the arrays are as given in Sections 2.1.82.1.10 with
fv4(r~)
replacing iv1(r~).
The array storage requirements
are thus decreased by N integer words and increased by N working precision words.
64
2.2-9
Section 2.2.3 THE IMPLICIT AND EXPLICIT QL ALGORITHMS
EISPACK contains two pairs of subroutines plus one unpaired subroutine which can be used to compute all eigenvalues, or all eigenvalues and eigenvectors, of a matrix which is in real symmetric tridiagonal form. One pair of programs, TQLI and TQL2, is based on the QL algorithm with explicit shifts; the other pair, IMTQLI and IMTQL2, is based on essentially the same algorithm, but with implicit shifts.
Corresponding
members of these pairs are functionally identical and may be substituted for one another in a path without changing either the parameter list or the rest of the path. The unpaired subroutine is TQLRAT, used in the recommended paths that determine all eigenvalues only of a complex Hermitian or real symmetric matrix.
TQLRAT is a rational reformulation of TQLI; it is formally equivalent
to TQLI, employing explicit shifts, but requires many fewer arithmetic operations and, in particular, eliminates the calculation of most of the square roots. Although functionally identical, the subroutines based on the implicit and explicit algorithms do differ, however, in the way rounding errors affect the computed results.
These differences are most pronounced for
matrices whose elements vary in a regular way over several orders of magnitude, and one sometimes wants to compute the small eigenvalues to high accuracy relative to themselves, rather than relative to the norm of the matrix.
To insure that this high accuracy is achieved, the rows and
columns of such matrices should be permuted (if possible) so that the matrix (aij) is "graded increasingly," i.e., so that laij I approximately increases as i and j increase, as in the 7 x 7 tridiagonal matrix:
85
2.2-10
a.~ = !02(i-I), 11 =
ai~i+ 1
=
ai+l, i
i = 1,2,~..,7
10 2i-1,
a.. = 0 lj
i = 1,2,.o.~6 otherwise.
When a tridiagonal matrix is presented so that it is graded increasingly, the routines based on both the implicit and explicit algorithms compute the eigenvalues with high accuracy relative to themselves.
How-
ever, if the matrix is presented so that it is graded decreasingly,
the
routines based on the implicit algorithm may still compute the eigenvalues with fairly high relative accuracy, whereas the routines based on the explicit algorithm will almost certainly produce large relative errors in the smaller eigenvalues.
Examples of the performance of the algorithms
on graded matrices are given in ([i], pp. 227-248).
The paired subroutines
are nearly equal in speed, since the amount of work for a single iteration is essentially the same in both; however, for graded matrices the implicit algorithm may require a few more iterations to obtain its greater accuracy. Because of their more consistent performance on graded matrices, IMTQLI and IMTQL2 are recommended for tridiagonal matrices. What of full complex Hermitian and real symmetric matrices?
It is
not clear that the algorithms which reduce such matrices to tridiagonal form always preserve grading; furthermore, in such matrices they may introduce errors large enough to prevent either the implicit or explicit algorithm from finding the smaller eigenvalues with high relative accuracy. Historically,
the explicit algorithm was introduced first and was con-
siderably faster than early versions of the implicit algorithm; hence it was favored for use in the paths for full matrices.
Although further
testing may show that the implicit algorithm has superior reliability,
66
2.2-11
especially for graded full matrices, the advantage is not yet clear enough to cause replacement of the codes based on the explicit algorithm in the full-matrix paths. The calling sequence for TQLI differs from that of TQLRAT only in
fvl instead of fv2.
transmitting array parameter
This difference
though makes it possible to conserve N working precision words in the path by not allocating
fv2.
For example, to find all the eigenvalues W
of a full real symmetric matrix A of order N using TQLI (compare Section 2.1.12), the EISPACK path is:
CALL
TREDI(NM,N,A,W,~I,fv2)
CALL TQLI(N,W,fV2,1ERR) IF (IERR .NE. 0) GO TO 99999
To interchange QL algorithms in the recommended paths of Sections 2.1.4-2.1.5, 2.1.11-12, 2.1.15-16, and 2.1.19-20 (after formal replacement of TQLRAT by TQLI) you need only interchange the names in the call statements.
For instance, to find all the eigenvalues W of a full real
symmetric matrix A of order N using the implicit QL algorithm (compare with above), the EISPACK path is:
CALL TREDI (NM, N,A,W,fvI
,fvl )
CALL IMTQLI(N,W,fVI,!ERR) IF (IERR .NE. 0) GO TO 99999
It is not possible to interchange QL algorithms when using the control program EISPAC.
Storage requirements for the implicit paths are identical
and indicative timings closely similar (see Section 4) to those for the explicit paths.
67
2.2-12
Section 2.2.4 THE RATIONAL QR ALGORITHM FOR FINDING A FEW EXTREME EIGENVALUES
All of the recommended EISPACK paths that determine a subset of the eigenvalues of a matrix employ subroutine BISECT, which computes those eigenvalues of a real symmetric tridiagonal matrix which lie in an interval determined by the values of the parameters RLB and RUB.
EISPACK
contains an alternate subroutine which can be used, with minor modifications to these paths, in place of BISECT.
This subroutine, called RATQR,
computes a specified number of the smallest or largest eigenvalues.
Be-
cause of this difference in the method of specifying the selected eigenvalues, BISECT and RATQR are not directly interchangeable.
(See Section
2.2.8 for a discussion of another alternate subroutine to BISECT whose capability includes that of RATQR with better stability and which is directly interchangeable with BISECT.) Although R A T Q R m i g h t appear to be easier to use than BISECT when some of the extreme eigenvalues are desired, the accumulation of rounding errors with the determination of each successive eigenvalue may render the later eigenvalues insufficiently accurate for some applications. For instance, this accumulation of error can be particularly troublesome if corresponding eigenvectors are to be computed by subroutine TINVIT, for even when maximum accuracy is requested from RATQR (by setting EPSI = 0.0, see Section 2.3.3), an eigenvalue may not be accurate enough to satisfy TINVIT~s rather strict convergence test for the corresponding eigenvector iteration~
This problem is especially likely to occur if too
many eigenvalues are requested from RATQR, or if some of the requested values are tightly clustered.
68
2.2-13
To use RATQR to compute the M smallest (say) eigenvalues of a matrix which has been reduced to symmetric tridiagonal form, calls to BISECT of the form:
CALL
BISECT(N,EPSI,fv2,fvZ,fv3,RLB,RUB,I~4,M,W,ivl,!ERR,fv4,fv5)
in the recommended paths in EISPACK should be replaced by:
TYPE = .TRUE. IDEF = 0 CALL RATQR(N, EPS 1 ,fvl
,fu2,fu 3,M,W, ivl ,fv4, TYPE, IDEF, IERR)
Here TYPE is a LOGICAL variable which specifies whether the M smallest or M largest eigenvalues are desired, according as it is .TRUE. or .FALSE. IDEF can be used to specify that the matrix is known to be positive or negative definite, according as it is +i or -I; a value of 0 is used to indicate either that the definiteness of the matrix is not known, or that it is not definite.
Specifying the matrix to be definite will save some
computation time when IDEF is +i and TYPE is .TRUE. or when IDEF is -i and TYPE is .FALSE.; however, if later the matrix turns out not to be definite as specified, RATQR will terminate with IERR non-zero and without computing any eigenvalues.
Upon successful return from RATQR, the
computed eigenvalues are to be found in W in increasing order if TYPE is .TRUE. and in decreasing order if TYPE is .FALSE. To request the control program EISPAC to employ RATQR in place of BISECT, modify the illustrated calls for the recommended paths by adding the keyword parameter METHOD with alphanumeric subparameter 'RATQR' and by changing the subparameters to the VALUES keyword to W, M, and 'SMALLEST ~ or 'LARGEST' as desired.
To specify the definiteness of the input matrix,
69
2.2-14
insert the alphanumeric subparameter
'POSITIVE DEFINITE' or 'NEGATIVE
DEFINITE ~ in the IIATRIX keyword anywhere after A (or AI). For exmmple, to determine the M smallest eigenvalues W of a full real symmetric positive definite matrix A of order N, the path of Section 2.1.14 becomes:
CALL TREDI (m~,N
,A,fvl ,fv2 ,fv3)
EPSI = 0.0 TYPE = .TRUE. IDEF = i CALL
RATQR(N,EPSI,fvl,fv2,fv3,M,W,iv2,fv4,TYPE,IDEF,IERR)
IF (IERR .NE. 0) GO TO 99999
or, using EISPAC:
CALL EISPAC(NM,N,MATRIX(~REAL',A,'SYMMETRIC','POSITIVE
DEFINITE'),
VALUES(W,M,'SMALLEST'),METNOD('RATQR'))
fv1(nm),
Suitable dimensions for the arrays are:
A(~m,nm), W(nm),
fv2(~), fv3(r~n), fv4(~),
Note that storage for W and
and
ivl(nm).
iv1
must be of length nm, even though only M eigenvalues are requested, The array- storage required to execute this path is N 2 + 5N working precision words and N integer words. identified with W and
fv4
The arrays
fvl
and
fv3
may be
respectively, thereby reducing the working
precision storage required to N 2 + 3N words.
70
2.2-15
Section 2.2.5 THE USE OF T S T U R M A S
AN ALTERNATE TO BISECT-TINVlT
Those recommended paths of Section 2.1 which at some stage compute some eigenvalues and eigenvectors of symmetric tridiagonal matrices all call subroutine BISECT followed by subroutine TINVIT.
Alternatively,
calls to these two subroutines can be replaced by a single call of subroutine T S T U R M w h i c h
combines their two separate functions.
TSTURM is
the translation of the corresponding Handbook algorithm ([I], pp. 418-439); TINVIT was additionally written to extend the capability of eigenvector determination by inverse iteration to matrices whose eigenvalues have been computed by subroutines other than BISECT. (see Section 2.2.4), I ~ Q L V
Thus paths including RATQR
(see Section 2.2.7), and TRIDIB (see Section
2.2.8) were made available. Substitution of TSTURM for BISECT and TINVIT in the paths has only a negligible effect on execution time.
Three possible differences in the
computed results may occur, however:
The ordering of the eigenvalues
(and
eigenvectors) may differ, there may be tiny differences in the eigenvector components, and the action taken upon the occurrence of an eigenvector convergence failure is different.
The difference in ordering can occur
only if the symmetric tridiagonal matrix breaks into submatrices; TSTURM orders the eigenvalues locally within submatrices, while BISECT orders the eigenvalues globally for the entire matrix.
Differences in the eigenvec-
tors can result only from the different order in which the eigenvectors associated with close eigenvalues are orthogonalized in TSTURM and TINVIT; for such differences to exist there would have to be at least three close eigenvalues within the same submatrix.
Finally, TSTURM returns immediately
upon failure of an eigenvector to converge; in contrast, TINVIT sets the
71
2.2-16
vector to zero and continues.
On balance, it thus appears that there is
really no reason to choose TSTUIhM over BISECT-TINVIT, except that only one subroutine call has to be written instead of two. To use TSTURM to determine the eigenvalues W in an interval extending from RLB to RUB, together with their corresponding eigenvectors Z, of any matrix of order N which can be reduced to a symmetric tridiagonal matrix, the section of coding of the form:
CALL
BISECT(N,EPSI,fvl,fv2,fv3,RLB,RUB,MM,M,W,ivl,IERR,fv4,fv5)
IF (IERR oNE. 0) GO TO 99999 CALL TINVIT
(NM,N,fvl ,fv2 ,fv3,M,W,ivl ,Z,IERR,fv4 ,fv5,fv6 ,fvf ,fvS)
IF (IERR .NE. 0) GO TO 99999
in the recommended paths in EISPACK should be replaced by:
CALL TSTURM(NM,N,EPSI,fv2
,fv2,fv3,RLB,RUB,MM,M,W,Z,iERR,
fv4,fvS ,fv6 ,fv7 ,fv8 ,fv9) IF (iERR .NE. 0) GO TO 99999
Thus, for example, the recommended path of Section 2.1.13 for some eigenvalues and eigenvectors of a real symmetric matrix A of order N using TSTURMbecomes:
CALL TREDI (NM,N,A,fvl
,fv2,fv3)
EPSI = 0.0 CALL TSTURM(NM,N ,EPSI ,fvl ,fv2 ,fv3,RLB ,RUB ,MM,M,W,Z ,IERR,
fv4 ,fvS ,fv6 ,fv7 ,fvS ,fv9 ) IF (IERR ~NE. 0) GO TO 99999 CALL TRBAKI (NM,N ,A,fv2 ,M,Z)
72
2.2-17
The control program EISPAC does not utilize TSTURM. The error parameter IERR from TSTURM combines the separate roles of the error parameters from BISECT and TINVIT. tional working precision array that the integer array
Note that one addi-
fvg, dimensioned fvg(~), is required but
ivl is not required, thus increasing the minimum
storage requirements by N working precision words while releasing M integer words.
73
2.2-18
Section 2.2.6 ELEMENTARY SIMILARITY TRANSFORMATIONS FOR COMPLEX GENERAL MATRICES
EiSPACK contains two sets of subroutines which transform a complex general matrix to upper Hessenberg form, determine all its eigenvalues and eigenvectors or all eigenvalues only and, in the case where only selected eigenvectors of the Hessenberg matrix have been determined, backtransform these eigenvectors.
One set consists of CORTH, COMQR,
COMQR2, and CORTB, which employ unitary similarity transformations, and the other set consists of COMHES, COMLR, COMLR2, and COMBAK, which employ stabilized elementary similarity transformations.
In particular,
COMQR and COMQR2 implement the QR algorithm, while COMLR and COIo~R2 implement the LR algorithm. Elementary transformations are faster than unitary transformations (see Section 4), but their use can increase the norm of the matrix which in turn increases the bounds on the rounding errors that can be made in the determination of the eigenvalues and eigenvectors.
This
increase of norm and rounding errors has been occasionally observed in the LR iterative step; the tendency in these instances has been for the more pronounced growth to occur away from the subdiagonal and diagonal of the (Hessenberg) matrix, causing little o~ no deterioration in the eigenvalues but sometimes substantial loss of accuracy in the eigenvectors.
(The IERR parameter gives no warning unless an eigenva!ue
fails to converge.) Since loss of accuracy, when it occurs, is associated with increase of norm, subroutine CO}~R2 arranges to compute and return the norm of the final reduced (triangular) matrix for inspection by the user.
If
the norm has grown by several orders of magnitude, the user should be wary of possible significant loss of accuracy.
74
2.2-19
To use elementary instead of unitary similarities in these paths, replace the names CORTH, COMQR, COMQR2, and CORTB with COMHES, COMLR, COMLR2, and COMBAK, respectively, wherever they appear, substituting the array parameter
iv2
for the pair
fv2, fv3.
EISPAC with elementary similarities, alphanumeric subparameter
To use the control program
the keyword parameter METHOD with
'ELEMENTARY'
should be inserted into the calls
to EISPAC given in these sections. For example (cf. Section 2.1.1), to determine all the eigenvalues (WR,WI) and their corresponding eigenvectors
(ZR,ZI) of a complex general
matrix (AR,AI) of order N using elementary transformations,
the EISPACK
path is:
CALL
CBAL(NM,N,AR,AI,isl,is2,fvl)
CALL
COMHES(N~.i,N,isT,is2,AR,AI,iv2)
CALL
COMLR2(NM,N,isl,is2,ivl,AR.AI,WR,WI,ZR,ZI,IERR)
IF (IERR .NE. O) GO TO 99999 CALL
CBABK2(NM,N,is2,is2,fV2,N,ZR,ZI)
or, using EISPAC:
CALL EISPAC(NM,N,MATRIX('COMPLEX',AR,AI),VALUES(~,WI), VECTOR(ZR,ZI),METHOD('ELEMENTARY'))
Suitable dimensions for the arrays are as given in Sections 2.1.1 2.1.3 with
iv1(nm)
replacing
fv2(~),fv3(~).
The array storage require-
ments are thus decreased by 2N working precision words and increased by N integer words.
75
2.2-20
Section 2.2.7 IMTQLV-TINVIT PAIRING IN PATHS FOR PARTIAL EIGENSYSTEMS
Each of the recommended paths of Section 2.1 that determine some eigenvalues and corresponding eigenvectors of a matrix that has been reduced to real symmetric tridiagonal form include a pairing of subroutines BISECT and TINVIT, BISECT to determine the eigenvalues and TINVIT to determine the corresponding eigenvectors.
But with the awareness
that the several subroutines in EISPACK based on the QL algorithm can compute all the eigenvalues in about the time required for BISECT to compute 25% of them, it would seem that users could improve efficiency in certain problem situations by computing all the eigenvalues with a faster subroutine and then specifying a subset of eigenvalues for which the corresponding eigenvectors would then be determined with TINVIT. This faster subroutine, however, must additionally be able to detect and communicate possible blocking of the tridiagonal form, as does BISECT, to enable TINVIT to determine independent and orthogonal eigenvectors corresponding to possibly multiple eigenvalues. It turns out that the implicit QL algorithm as implemented in subroutine IMTQLI was readily extendible to detect the blocking, and thus was born subroutine IMTQLV for inclusion in paths that determine the partial eigensystem of a matrix that has been reduced to real symmetric tridiagonal form. For example (cf. Section 2.1.13), to determine the three smallest eigenvalues W, together with their corresponding eigenvectors Z, of a full real symmetric matrix A of order N, one possible EISPACK path is:
76
2.2-21
CALL TREDI CALL
(NM,N,A,fvl,fv2,fv3)
LMTQLV(N,fvl,fv2,fv3,W,ivl,IERR,fv4)
IF (IERR .NE. 0) GO TO 99999 CALL
TINVIT(NM, N,fvl,fv2,fv3,3,W,ivl,Z,IERR,fv4,fv5,fv6,fvF,fv8)
IF (IERR .NE. 0) GO TO 99999 CALL
TRBAKI(NM,N,A,fu2,3,Z)
The control program EISPAC does not utilize IMTQLV. The parameter list to IMTQLV is a subset of the corresponding parameter list to BISECT and, similarly to BISECT and in contrast to IMTQLI, the input tridiagonal matrix is preserved.
The array storage
required to execute this variant path is the same as that for the path of Section 2.1.13.
77
2.2-22
Section 2.2.8 SPECIFICATION OF BOUNDARY EIGENVALUE INDICES TO THE BISECTION PROCESS
All of the recommended paths of Section 2.1 that determine a subset of the eigenvalues of a matrix require the specification of an interval (RLB,RUB) containing the eigenvalues of interest to subroutine BISECT. It may sometimes be preferred to specify the eigenvaiues by their indices in the ordered set; e.g., the three smallest eigenvalues or the second largest eigenvalue. enables this option~
Substitution of subroutine TRIDIB for BISECT
In particular, TRIDiB includes the capability for
which subroutine RATQR was designed (cf. Section 2.2.4); although slower, TRIDIB is numerically stable and is therefore recommended generally in preference to RATQR. The parameter list for TRID!B is the same as that for BISECT with the exception of RLB, RUB, MM, and M.
RLB, RUB, and M are still present
with reversed roles -- M now specifies the number of eigenvalues desired and RLB and RUB are output parameters which define an interval containing exactly the desired eigenvalues.
MM is replaced by MII which specifies
the index of the smallest desired eigenvalue. To request the control program EISPAC to employ TRIDIB in place of BISECT, change the subparameters to the VALUES keyword from (W,MM,M, RLB, RUB) to (W,MII,M). So, for example (cf. Section 2.1.14), to determine exactly M eigenvalues W, starting from the Mll-th smallest one, of a full real symmetric matrix A of order N, the EISPACK path is:
78
2.2-23
CALL TREDI (NM, N,A,fv2,fv2,fv3) EPSI = 0.0 CALL
TRIDIB(N,EPSI,fv2,fv2,fv3,RLB,RUB,MII,M,W,ivI,IERR,fv4,fv5)
IF (IERR .NE. 0) GO TO 99999
or, using EISPAC:
CALL EISPAC(NM,N,MATRIX('REAL',A,'SYMMETRIC'),VALUES(W,MII,M))
Array storage requirements
for paths with TRIDIB are identical to
those for the corresponding paths with BISECT; execution times are very little different
(see Section 4).
79
2.2-24
Section 2.2~9 PACKED REPRESENTATIONS OF REAL SYMMETRIC AND COMPLEX HERMITIAN MATRICES
The algorithms implemented in EISPACK for real symmetric and complex Hermitian matrices access only the full lower triangles of the matrices; in order to best take advantage of the storage savings realizable since the upper triangles are not required, subroutines are included in EISPACK that proceed from packed representations of the input matrices. In the real symmetric case, the lower triangle of the matrix is packed row-wise into a one-dimensional array; subroutines TRED3 and TRBAK3 replace TREDI and TRBAKI, respectively, in the corresponding explicit paths, driver subroutine RSP replaces RS where applicable, or 'PACKED' is specified to EISPAC.
For example (cf. Section 2.1.13), to determine
some eigenvalues W and corresponding eigenvectors Z of a real symmetric matrix A of order N in packed representation, CALL TRED3 (N, NV,A,fvl
the EISPACK path is:
,fv2 ,fv3)
EPSI = 0.0 CALL BISECT(N,EPSI,fvl
,fv2,fu3,RLB,RUB,MM,M,W,iV2 ,IERR,fu4,fv5)
IF (IERR oNE. 0) GO TO 99999 CALL
TINVIT(NM,N,fvl,fv2,fv3,M,W,ivl,Z,IERR,fv4,fv5,fv6,fv7,fvS)
IF (IERR .NE. O) GO TO 99999 CALL TRBAK3 (NM, N, NV,A,M, Z)
or, using EISPAC: CALL EISPAC (NM,N,MATRiX(~ REAL ' ,A, 'SYMMETRIC', 'PACKED' ), VALUES (W,MM,M,RLB, RUB), VECTOR(Z) ) NV communicates the dimension of A and therefore must be at least N (N+I)/2.
80
2.2-25
The array storage required to execute this path is N2/2 + 17N/2 + M(N+I) working precision words and M integer words.
Driver subroutine
RSP can be used with real symmetric matrices in packed representation in the corresponding paths to where RS is used with matrices in standard representation.
Its calling sequence is identical to that of RS except
for the inclusion of NV in the position after N.
But for the case where
all eigenvalues and eigenvectors are determined, RS is preferred because it affords optimal consolidation of storage when the eigenvectors
over-
write the input matrix and, further, implements a more efficient algorithm than does RSP. In the complex Hermitian case, the lower triangle of the matrix is packed into a single two-dimensional array, the real parts of the elements in the full lower triangle and the imaginary parts of the elements in the transposed positions of the strict upper triangle.
Subroutines HTRID3
and HTRIB3 replace HTRIDI and HTRIBK, respectively,
in the corresponding
paths or 'PACKED' is specified to EISPAC.
For example
(cf. Section 2.1.4),
to determine all eigenvalues and corresponding eigenvectors Hermitian matrix in packed representation,
CALL HTRID3 (NM,N,A,W, fv2
,fvl ,fml )
DO i00 I = i, N DO 50 J = I, N ZR(I,J) = 0.0 50
CONTINUE ZR(I,I) = 1.0
I00 CONTINUE CALL TQL2(NM,N,W,fVI,ZR, IERR) IF (IERR .NE. 0) GO TO 99999 CALL
HTRIB3(NM,N,A,fml,N,ZR,ZI) 81
of a complex
the EISPACK path is:
2.2-26
or, using EISPAC:
CALL EISPAC(NM,N,MATRIX('COMPLEX',A,A,'HERMITIAN','PACKED~), VALUES(W)~VECTOR(ZR,ZI))
The array storage required to execute this path is 3N 2 + 4N working precision words. There is no driver subroutine in EISPACK for use with packed complex Hermitian matrices.
Execution times for the packed real
symmetric and complex Hermitian subroutines are not markedly different from those of their standard counterparts; see Section 4.
82
2.3-1
Section 2.3 ADDITIONAL INFORMATION AND EXAMPLES
This section contains additional information about and examples of the use of EISPACK and the control program which are either too detailed to be included in the discussion of a particular path, or which apply to more than one path.
The specific topics covered include the setting of
the LOGICAL vector SELECT used in the paths for computing selected eigenvectors of real and complex general matrices; the packing of the eigenvectors of real general matrices; considerations regarding the usersupplied error tolerance in the computation of the eigenvalues of matrices which can be reduced to real symmetric tridiagonal form; the relative efficiencies of computing partial and complete eigensystems; two special computations: a determination of the number of positive (or negative) eigenvalues of matrices which can be reduced to real symmetric tridiagonal form; and the orthogonal similarity reduction of a real matrix to quasitriangular form; the examination of the IERR parameter and intermediate results when using the control program EiSPAC; and a summary of the possible values of IERR and their meanings.
The section concludes with two
complete example driver programs illustrating the use of EISPACK and the control program EISPAC.
83
2.3-2
Section 2.3.1 SELECTING THE EIGENVECTORS OF REAL AND COMPLEX GENERAL MATRICES
The computation of selected eigenvectors of real and complex general matrices by the subroutines INVIT and CINVIT is controlled by the LOGICAL array parameter SELECT and to some extent by the parameter MM. siderations involved in setting SELECT and determining ~
The con-
(MM = ~ ) ,
the
column dimension of the eigenvector arrays, are discussed separately for real and complex matrices. For complex matrices, the elements of SELECT are in one-to-one correspondence with the computed eigenvalues.
They are examined in order
and the eigenvectors corresponding to the eigenvalues tagged by .TRUE. elements in SELECT are computed.
These complex eigenvectors are stored
in successive columns of the eigenvector arrays ZR and ZI; hence the number of .TRUE. elements in SELECT must not exceed the column dimension rf~ of the arrays ZR and ZI.
The parameter MM communicates this column dimension;
should more than MM columns be required, the computation stops when the arrays are full and IERR is set non-zeros
In any event, when the eigen-
vector subroutine (CINVIT) returns to the calling program, M is set to the number of columns actually used to store the eigenvectors. For real matrices, setting SELECT and determining a suitable value for
ff~a priori are complicated by the convention used to pack the eigenvectors into Z, discussed in detail in Section 2.3.2.
It is assumed that conjugate
pairs of complex eigenvalues are consecutive in WR and WI.
Again, the ele-
ments of SELECT are in one-to-one correspondence with the computed eigenvalues but the number of columns used in the eigenvector matrix Z may be more than the number of .TRUE. elements of SELECT.
84
2.3-3
The elements of SELECT are examined in order and the eigenvectors corresponding to the eigenvalues flagged by .TRUE. elements are computed, except as restricted below.
If a flagged eigenvalue is real, the corres-
ponding real eigenvector is stored in one column of Z.
If the flagged
eigenvalue is complex, and its flagged conjugate does not precede it, the real and imaginary parts of the corresponding eigenvector are stored in two consecutive columns of Z with the real part first.
If the flagged
eigenvalue is complex and its flagged conjugate precedes it, no eigenvector is computed and the corresponding element of SELECT is reset .FALSE.
This
convention guarantees that no more than N columns of Z are required to store the eigenvectors; it is not a serious restriction since the eigenvector corresponding to the conjugate value is the conjugate of the computed eigenvectoro Because of the complicated algorithm for selecting eigenvectors and packing them into Z, the a priori determination of the column dimension ~rl of Z is difficult.
If the number of .TRUE. elements in SELECT is
known, then a safe choice for ~ N.
Again MM must be set to ~
is the smaller of twice this number and and communicates the column dimension of
Z; should more than MM columns be required, the computation in INVlT stops when no more eigenvectors can be stored and IERR is set non-zero.
In any
event, when INVIT returns to the calling program, M is set to the number of columns of Z actually used to store the eigenvectors.
Note that when
MM is too small, the returned value of M can be either MM-I or MM. The chief complication towards setting the elements of SELECT to compute the required eigenvectors is that the eigenvalues of a real or complex general matrix are not generally computed in a predictable order. Hence one cannQt decide a priori which elements of SELECT should be set.
85
2.3-4
Two possibilities exist:
One is to execute the eigenvalues-only path,
examine the computed eigenvalues, set SELECT as required and then (with a further run) execute the path for all eigenvalues and some eigenvectors. The other is to interrupt the all-eigenvalues-some-eigenvectors path after the computation of the eigenvalues, to set SELECT at that point using a program segment, and to resume execution of the path. As an example of this latter possibility, suppose that for a real general matrix you wish to compute the eigenvectors corresponding to those eigenvalues the sum of whose real and imaginary parts is non-negative and you know that there are no more than five such values.
Then the path with
interruption becomes:
CALL
BALANC(NM,N,A,isl,is2,fvl)
CALL
ELMHES(NM,N,isl,is2,A,ivl)
DO 200 I = i, N DO I00 J = I, N ym1(I,J) = A(I,J) i00
CONTINUE
200 CONTINUE CALL
HQR(N~,N,isi,is2,f~2,WR,WI,IERR)
IF (IERR .NEo 0) GO TO 99999 DO 300 I = I, N SELECT(1) = (WR(1)+WI(I)) .GE. 0.0 300 CONTINUE CALL
INVIT(NM, N,A,WR,WI,SELECT,MM,M,Z,IERR,fml,fv2,fv3)
IF (IERR .NE. 0) GO TO 99999 CALL
ELMBAK(NM, isl,is2,A,iv2,M,Z)
CALL
BALBAK(NM,N,isi,is2,fvI,M,Z)
86
2.3-5
An example illustrating the corresponding
interruption of the path
when using EISPAC is given in Section 2.3.7; the unpacking of the eigenvectors in Z is discussed in Section 2.3.2.
Note that in the above
example no attempt is made to avoid flagging both eigenvalues of a complex conjugate pair; as discussed above, INVIT will automatically flag corresponding to the second eigenvalue in the pair.
reset the
Unless it is
known that some of the five possible eigenvalues are real, Z should be dimensioned Z(~,I0)
and MM set to i0.
87
2.3-6
Section 2.3.2 UNPACKING THE EIGENVECTORS OF A REAL GENERAL MATRIX
Since for a real general matrix the complex eigenvalues and their corresponding eigenvectors occur as conjugate pairs and therefore both members of such a pair are determined once the real and imaginary parts of one member are known, only N 2 real numbers are required to recover all the eigenVectors of such a matrix.
The EISPACK routines which com-
pute the eigenvectors of real general matrices take advantage of this fact (and so save storage) by packing both real and complex eigenvectors into one N by N matrix. In order to determine whether a given column of the matrix of eigenvectors represents a real eigenvector,
the real part of a complex eigen-
vector, or the imaginary part of a complex eigenvector,
the imaginary
part of the corresponding eigenvalue must be examined.
In addition, the
flags in the SELECT array must also be taken into account if only some eigenvectors have been computed.
Perhaps the clearest way to describe
how this packing is done is to present program segments which unpack the matrix of eigenvectors into two separate matrices representing the real and imaginary parts of the eigenvectors. First, suppose that you have computed all the eigenvalues and eigenvectors of a real general matrix according to Section 2.1.8.
The following
program segment unpacks the matrix Z of eigenvectors into matrices ZR and ZI, dimensioned Z R ( ~ , n m )
and ZI(r~,nm).
Note that this program segment
utilizes the property of the EISPACK programs that for real general matrices the eigenvalues of each complex conjugate pair are ordered so that the eigenvalue of positive imaginary part appears first in (WR,WI).
88
2.3-7
DO 150 K = i, N IF (WI(K) .NE. 0.0) GO TO ii0 DO I00 J = i, N ZR(J,K) = Z(J,K) ZI(J,K) = 0.0 i00
CONTINUE GO TO 150
ii0
IF (WI(K) .LT. 0.0) GO TO 130 DO 120 J = i, N ZR(J,K) = Z(J,K) ZI(J,K) = Z(J,K+I)
120
CONTINUE GO TO 150
130
DO 140 J = I, N ZR(J,K) = ZR(J,K-I) ZI(J,K) = -ZI(J,K-I)
140
CONTINUE
150 CONTINUE
Note that this program segment has been designed so that Z and ZR can be the same matrix; if they are, then the fourth and tenth statements can be omitted. When only some of the eigenvectors have been computed, the packed form of storage is somewhat more complicated than when all the eigenvectors have been computed because of its interaction with the SELECT array (see Section 2.3.1).
The following program segment illustrates one way to
unpack the eigenvectors from the M columns of Z.
It places each selected
eigenvector into the columns of full square matrices ZR and ZI whose index
89
2.3-8
is that of the corresponding eigenvalue;
the remaining columns are not
set.
I=
i
DO 130 K = I, N IF (.NOT. SELECT(K)) GO TO 130 IF (WI(K) oNE. 0.0) GO TO II0 DO i00 J = !, N ZR(J,K) = Z(J,I) ZI(J,K) = 0.0 i00
CONTINUE I=I+l GO TO 130
ii0
DO 120 J = I, N ZR(J,K) = Z(J,I) ZI(J,K) = Z(J,I+i)
120
CONTINUE I=I+2
130 CONTINUE
Note that if both members of a pair of complex eigenvalues were flagged by .TRUE. elements in SELECT, subroutine INVIT resets the flag corresponding to the second member of the pair to .FALSE.
(see Section 2.3.1);
thus additional program must be supplied to store the eigenvector corres ponding to the second member.
90
2.3-9
Section 2.3.3 THE EPSI PARAMETER
As discussed in Section i, the various versions of the subroutines in EISPACK are designed to provide the best accuracy possible given the working precisions of the particular machines for which they are available.
For most of the subroutines, accuracy is controlled by an internal
variable, MACHEP ("machine epsilon"), whose value reflects the precision of the machine arithmetic and should not be altered.
However, user con-
trol of accuracy is possible with four of the subroutines in EISPACK which are used in those paths that compute some eigenvalues (with or without eigenvectors) of matrices which can be reduced to real symmetric tridiagonal form.
This accuracy control is provided by the parameter
EPSI, which principally affects the precision of the eigenvalues, and thus the eigenvectors as well, but which also has some effect on computation time.
Some of the considerations helpful in choosing EPSI are discussed
briefly below; further information can be found in the respective documents for the subroutines and in the Handbook ([i], pp. 249-256).
Note in the
discussion below that any property described for subroutine BISECT also applies to subroutine TRIDIB. In subroutine BISECT, the computation of an eigenvalue is considered to have converged when the refined interval [XU,X0] known to contain the eigenvalue satisfies the condition:
xo - x~ ! 2 × ~mCHEe × (ix01 +
Ix~I) + EPSl
This condition has the character of a relative accuracy test for eigenvalues whose magnitudes are large with respect to EPSI/>~CHEP, and that of
91
2.3-10
an absolute accuracy test for eigenvalues of small magnitude.
EPSI is
thus an absolute error tolerance. When the input value of EPSI is zero (or negative) as in the recommended paths, BISECT automatically resets it to an appropriate default value for each submatrix; this default value is MACHEP times the larger (in magnitude) Gerschgorin bound for the eigenvalues of that submatrix.
This value prevents the above termination criterion from
requiring ~'unreasonably" high accuracy in the eigenvalues which are near zero.
(In the implementation of BISECT, EPSI is actually set negative
when the default value is requested.
This serves as a flag to cause the
recomputation of the default value for each submatrix; the returned value of EPSI is this negative default value for the final submatrix.) A positive input value for EPSI will not be reset in BISECT.
When
the positive input value of EPSI exceeds the default value, the convergence test is less stringent for eigenvalues of smaller magnitude, and computation time tends to be reduced.
If EPSI is smaller than its default value,
the convergence test becomes more stringent and computation time tends to increase.
Care should be taken, however, not to specify a smaller value
for EPSI unless the small eigenvalues are known to be insensitive to perturbations in the input matrix; otherwise the additional precision will be meaningless.
Although computation time tends to increase with
decreasing EPSI, the exact relationship is highly dependent on the particular matrix. The eigenvalue calculation in subroutine TSTURM is essentially the same as in BISECT~ and EPSI has the same role.
However, choice of an
input value of EPSI larger than the default value may jeopardize the eigenvector calculation~ as discussed below.
92
2.3-11
The role of EPSI in subroutine RATQR is different than in BISECT and TSTURM.
Here the convergence condition is simply
DELTA < EPSI
where DELTA is a byproduct of each iterative step in the computation of the k th eigenvalue and kxEPSI is an estimate for the absolute error in the current estimate of the eigenvalue.
(The factor k in this bound
accounts for the accumulation of error in successive eigenvalues alluded to in Section 2.2.4; see also [I], pp. 257-265.) RATQR also chooses a default value of EPSI.
It varies from iteration
to iteration and is MACHEP times the estimate of the smallest eigenvalue of the current shifted matrix.
If a positive value of EPSI is provided
as input, it will be used as long as it is larger than the default value which represents the maximum relative accuracy reasonably attainable.
An
EPSI larger than the default value may result in fewer iterations and reduced computation time; you should choose it small enough so that you are willing to tolerate an error of kxEPSI in the k th eigenvalue.
(The
value of EPSI actually used for the final eigenvalue computed can be found in EPSI upon return from RATQR.) When eigenvectors are computed by the method of inverse iteration, the success of the computation depends critically on the accuracy of the computed eigenvalues.
Thus, when this method is used in conjunction with
one of the above eigenva!ue finders, as in TSTURM or when TINVIT follows BISECT or RATQR, use of an EPSI larger than the default value may result in failure of the eigenvector calculation to converge.
Such failure
occasionally occurs even with the default value (especially in RATQR, when a large number of eigenvalues is requested); for BISECT and TSTURM
93
2.3-12
only, this may be avoided by choosing an input value of EPSI smaller than its default value. The role of EPSI may be summarized as follows.
All four of the
subroutines discussed employ a convergence criterion which combines a
relative error test using MACHEP and an absolute error test using the specified EPSI (or a default).
In BISECT, TRIDIB, and TSTURM, this combi-
nation is the sum of the two tolerances, while in RATQR it is the maximum. To use a value of EPSI other than the default, the statement
EPSI = 0.0
in the paths should be replaced by a statement setting EPSI to the desired value.
When using the control program EISPAC, EPSI can be supplied for
the recommended paths only by adding EPSI as the last subparameter to the VALUES parameter°
Thus the VALUES parameter becomes:
~..VALUES(W,MM,M,RLB,RUB,EPSI)~...
With EISPAC, the input value of EPSI is not altered, even though the default value may be used in the computation.
2.3-13
Section 2.3.4 RELATIVE EFFICIENCIES OF COMPUTING PARTIAL AND COMPLETE EIGENSYSTEMS
In this section, we compare the paths which compute complete eigensystems with those which compute partial eigensystems. array storage, and accuracy requirements,
Considering timing,
the central issue is when it is
preferable to compute the complete eigensystem even when not required. There are three cases:
Eigenvalue-only paths for matrices that can be
reduced to real symmetric tridiagonal form, eigenvalue-eigenvector for such matrices, and eigenvalue-eigenvector
paths
paths for general real or
complexmatrices. For eigenvalues of matrices reduced to symmetric tridiagonal form, the principal comparison is between subroutines BISECT and TQLRAT (or TQLI).
When the default value of EPSI is used in BISECT, TQLRAT is
faster to the point of computing all the values as fast as BISECT can compute 25% of them.
If less stringent accuracy requirements allow EPSI
to be specified larger (see Section 2.3.3), then the execution time for BISECT decreases; at half accuracy, BISECT would be faster than TQLRAT unless 50% or more of the eigenvalues were desired.
Also, BISECT requires
the larger amount of working array storage (cf. Sections 2.1.16 and 2.1.18).
Note, however,
that the timing and storage d~fferences in these
individual subroutines may be small compared with the total requirements of the path. When eigenvectors
of such matrices are also desired,
then the prin-
cipal comparison is between the subroutine pair BISECT-TINVIT and TQL2. (See Section 2.2.7 for the comparison between BISECT-TINVIT and variant IMTQLV-TINVIT.) machine;
Here a factor in the timing is the identity of the
the parallelism of the IBM 370/195 appears much better suited to
95
2.3-14
the algorithm of TQL2 than to BISECT-TINVIT.
Consultation of the path
times in Section 4 is recommended towards choosing the faster path; generally,
paths with TQL2 are relatively more efficient at lower orders
than paths with BISECT-TINVIT and less efficient at higher orders. storage for a partial set of eigenvectors
is clearly less with TINVIT
than for the complete set of vectors with TQL2. be remembered that working array requirements
However, it must also
for BISECT-TiNVIT exceed
those for TQL2 (of. Sections 2.1.15 and 2.1.17), and further, follows TRED2 for a real symmetric matrix,
Array
that if TQL2
the eigenvectors may overwrite
the input matrix (see Section 2.1.11). The comparisons of the preceding paragraphs involving TQLRAT
(or TQLI)
and TQL2 extend to IMTQLI and IMTQL2 as well, since their performances and storage requirements are so closely similar.
The execution times of
Section 4 also suggest RATQR as a viable replacement for BISECT in the BISECT-TINVIT path.
However,
this is misleading in that the cited TINVIT
times are in paths with BISECT, and the corresponding could be significantly of the eigenvalues
longer.
timings with RATQR
This owes to the generally poorer accuracy
from RATQR, forcing extra, often futile iterations in
TINVIT. Finally for general real and complex (Hessenberg) matrices,
the prin-
cipal comparisons are between HQR-INVIT and HQR2, and between COMQR-CINVIT and COMQR2.
Here considerations
are similar to the symmetric case;
inverse iteration is relatively more efficient with increasing order in comparison to accumulation of transformations,
and array storage compari-
sons depend vitally on the number of selected eigenvectors. requirements
Working array
for the partial eigensystem paths are especially severe (cf.
Sections 2.1.1 and 2.1.3; also 2.1.8 and 2.1.10).
96
2.3-15
With regard to considerations
of accuracy and reliability,
the partial
eigensystem paths fall short of the complete eigensystem paths, but the differences in performance are generally marginal. is the variant RATQR-TINVIT the inaccuracies from T I N V I T m a y
The weakest such path
for real symmetric matrices generally due to
of the eigenvalues
(see Section 2.2.4).
Eigenvectors
fail in their last few digits of being as precisely ortho-
gonal as from TQL2.
Extreme sensitivity to the accuracy of the eigenvalues
ia a shortcoming of these paths, but on the other hand affords an a
posteriori
check on the accuracy of the eigenvalues.
Thus, a recommendation with regard to the best path when only a partial eigensystem is required involves a number of considerations. Generally, we recorm~end the simpler-structured
complete eigensystem paths
unless the penalty in time or storage is severe.
97
2.3-16
Section 2.3.5 DETERMINATION OF THE SIGNS OF THE EIGENVALUES
In the stability analysis of dynamic systems, one is frequently interested in knowing the number of positive (or negative) eigenvalues rather than the eigenvalues themselves.
For real general and complex general
matrices the regular EISPACK paths must be used and the eigenvalues actually computed; however, for nmtrices that can be reduced to real symmetric tridiagonal form, time can be saved in realizing this objective hy judicious choice of the EPSI accuracy-control parameter discussed in Section 2.3.3. This computation is available from the recommended paths for computing some eigenvalues of matrices which can be reduced to real symmetric tridiagonal form as given in Sections 2.1.7, 2.1.14, 2.1.18, and 2.1.22, when P~B~ RUB, and EPSI are set appropriately. erties of subroutine BISECT:
It makes use of two prop-
(I) The first action in BISECT is to deter-
mine the number of eigenvalues in the interval from RLB to RUB and to set M to that number, and (2) as soon as BISECT has determined intervals containing eigenvalues which jointly satisfy the convergence criterion discussed in Section 2.3.3, it terminates.
Since EPSI appears as a term
in the right hand side of this criterion, termination will occur at least as soon as the lengths of the intervals become less than EPSI.
One need
only choose an initial value of EPSI which is as large as the length of the interval from RLB to RUB, and BISECT will return almost immediately with M set to the number of eigenvalues in the interval. For examp!e~ suppose you wish to compute the number of eigenvalues of a real symmetric matrix A of order N which lie on the non-negative real axis and that you know that all the eigenvalues of A are less than
98
2.3-17
1.0 x 1035 .
Then you might use the following path based on that of
Section 2.1.14.
RLB = 0.0 RUB = 1.0E35 EPSI = 1.0E35 CALL TRED 1 (NM,N ,A ,fvl ,fv2 ,fv3) CALL BISECT (N, EPS i ,fvl ,fv2 ,fv3 ,RLB ,RUB ,MM,M,W,ivl, IERR,fv4
,fv5)
Upon completion of the path, the value of M is the number of non-negative eigenvalues.
Note that this number is accurately determined despite the
high "error" tolerance EPSI, since it is obtained from a Sturm sequence count which does not itself involve any convergence test.
99
2.3-18
Section
2.3.6
ORTHOGONAL
SIMILARITY
REDUCTION OF A REAL MATRIX TO QUASI-TRIANGULAR
Schur~s Lemma asserts formation which reduces it may be of interest
the existence
any matrix to triangular
to compute
be carried out without
resort
the m a t r i x of the orthogonal to quasi-triangular form because
form.
it retains
of a unitary
similarity
form.
FORM
trans-
For real matrices,
the part of this transformation which can
to complex arithmetic, transformation
Quasi-triangular
that is, to compute
which reduces
a real matrix
form falls short of triangular
2 × 2 blocks on the main diagonal which correspond
to complex conjugate pairs of eigenvalues. The orthogonal
quasi-triangularization
be used in place of the usual decomposition canonical matrix)
and is faster.
AX+XB
PJP
-I
(where J is a Jordan
As an example of its application,
sider the following problem in control is sought which satisfies
of a real matrix can frequently
theory.
con-
Suppose an m × n matrix X
the equation
= C
where A, B and C are real m x m, n × n and m × n matrices If the orthogonal
(upper) quasi-triangularizations
B = VRV T are computed,
and substituted
respectively.
of A T = uLTu T and
into the equation,
then the simpler
equation for Y
LY + YR = E
results where L and R are respectively matrices
and
X = UYV T and E = uTcv.
100
lower and upper quasi-triangular
2.3-19
The columns of Y can now be determined successively by a process of forward substitution, which is only sli~ntly complicated by the presence of the 2 x 2 blocks on the diagonals of L and R. The quasi-triangularization is carried out on the unbalanced matrix A using the routines for orthogonal similarity reduction discussed in Section 2.2.2 and a modified version of subroutine HQR2.
It begins with
the use of ORTHES to reduce the matrix to upper-Hessenberg form followed by ORTRAN to accumulate the transformations.
The modified version of
HQR2, say HQRORT, completes the orthogonal reduction to quasi-triangular form and accumulates the remaining transformations.
It can be obtained
by changing tile statement labeled 60 in HQR2 (see Section 7) to:
60 IF (EN .LT. LOW) GO TO i001
(The statements beginning with that labeled 340 and ending with that immediately preceding the statement labeled i000 may be deleted, if desired.) The "path" for this computation is then:
isl = 1 is2 = N CALL ORTHES (NM,N,isl ,is2,A,fvl) CALL ORTRAN(NM,N,isl ,is2,A,fvl ,Z) CALL HQRORT(NM,N,isl ,is2,A,WR,WI,Z,IERR)
Upon completion of this path, the eigenvalues are in (WR,WI) and the orthogonal matrix which reduces A to quasi-triangular form is in Z.
2.3-20
Section 2.3.7 ADDITIONAL FACILITIES OF THE EISPAC CONTROL PROGRAM
The EISPAC control program has two facilities which increase its flexibility and range of application.
The first provides the opportunity
to examine the iERR parameter values returned by the EISPACK subroutines; the second provides the opportunity to examine intermediate results as the computation proceeds, much as can be done when the EISPACK subroutines are called explicitly. The facility to examine the value of IERR is invoked by setting an integer variable, say IERROR, to zero and supplying it as the subparameter of the keyword parameter ERROR in the call to EISPAC.
For example, the
path of Section 2.1.9 becomes
IERROR
=
0
CALL EISPAC(NM,N,MATRIX('REAL',A),VALUES(WR,WI),ERROR(IERROR))
To understand the effect of supplying the ERROR keyword, consider the behavior of EiSPAC when it is not supplied.
When one of the subroutines
returns a non-zero value of IERR, EISPAC prints a message describing the error and terminates execution of your program. supplied, EiSPAC behaves instead as follows:
When ERROR(IEPdlOR) is
If no execution errors occur,
EISPAC returns to your program after execution of the path, and IERROR is still equal to zero°
If one of the routines returns a positive value of
IERR (a "fatal '~ error), EISPAC terminates the path, prints the error message (unless suppressed by initializing IERROR to a machine dependent value as described in Section 7.2), and then returns to your program with IERROR equal to IERR~
Finally, if one of the routines returns a negative
value of IERR (a ~'non-fatal" error), EISPAC completes execution of the path
102
2.3-21
in order to produce some useful results, prints the error message, and returns to your program with IERROR equal to IERR.
Thus the principal
use of the IERR examination facility is to enable you to retrieve useful partial results when a non-fatal error occurs; which results are useful is described in the discussion of the particular path in Section 2.1 or 2.2 and is summarized in Table 3 of Section 2.3.8. The EISPAC facility to examine intermediate results is provided by a mode of operation in which EISPAC calls a user-supplied subroutine just before execution of the path begins, and again after execution of each subroutine and auxiliary action in it.
One important application of
this facility occurs in those paths which compute selected eigenvectors of real or complex general matrices, where the facility can be used to examine the computed eigenvalues and to set the elements of the SELECT array controlling which eigenvectors are computed. To use this facility you must first create a subroutine to examine the intermediate results.
You are free to choose the name of the subrou-
tine, say USUB, but the parameter list and declaration statements must correspond to:
SUBROUTINE USUB(ISUBNO,NrM, N,AR,AI,WR,WI,ZR,ZI,MM,M,RLB,RUB,EPSI, X
SELECT,IDEF,TYPE,IERR,LOW, IGH,BND,D,E,E2,IN~,INT,ORT,SCALE,TAU) REAL*8 AR(NM,NM) ,AI(NM,NM) ,WR(NM) ,WI(NM) ,ZR(NM,NM) ,ZI (NM,NM) ,RLB,RUB,
X
EPS i, BND(N) ,D(N) ,E(N) ,E2 (N), ORT (N) ,SCALE(N) ,TAU (2,N) INTEGER ISUBNO,NM,N,MM,M, IDEF,IERR,LOW, iGH,IND(N),INT(N) LOGICAL SELECT(NM),TYPE
In order to avoid Fortran errors it is important that the array parameters be dimensioned as indicated (except that M M m a y
103
be used for the last
2.3-22
dimension of WR and of ZR and ZI, where appropriate), even though some arrays might not appear relevant to a particular path. You inform EISPAC that you wish to use the intermediate result examination facility by inserting the keyword parameter SUBR with subparameter USUB in the EISPAC call.
Note that the statement EXTERNAL USUB
must also appear in your calling program. When USUB is called by EISPAC, the value of the integer parameter ISUBNO is set to indicate which EISPACK subroutine call or auxiliary action has just been completed.
It is zero when USUB is called just before
execution of the path begins.
ISUBNO values in the range 100-299 signify
that the preceding action allocated or freed temporary storage, those in the range 300-499 indicate auxiliary actions (initializing or copying arrays, for example), and those beyond 500 correspond to calls to the EISPACK subroutines as indicated in Table 2.
Thus the value of ISUBNO
indicates where in the execution of a path USUB has been called, and can be used to determine what action USUB is to take in examining the intermediate results.
Table 2 also indicates which of the parameters passed
to USUB appeared in the just-completed call to the EISPACK subroutine. As an example of the use of this facility, suppose you wish to interrupt the path of Section 2.1.10 and use a subroutine SETSEL to examine the eigenvalues computed for a real general matrix and to set the SELECT array to compute the eigenvectors corresponding to those eigenvalues with sum of real and imaginary parts greater than or equal to zero. example corresponds to that in Section 2.3.1.) contain the statements
104
(This
Your driver program must
2.3-23
EXTERNAL SETSEL
CALL EISPAC(NM,N,MATRIX('REAL',A),VALUES(WR,WI),VECTOR(Z,MM,M,
SELECT),
SUBR(SETSEL))
To determine how to write SETSEL, consult the definition of the path in Section 2.1.10 in conjunction with Table 2.
The eigenvalues are available
for examination after HQR and the logical array SELECT must be initialized before INVIT (see Section 2.3.1), so the interruption must be made immediately after the call to HQR.
Table 2 indicates that this call in this
path has an associated ISUBNO of 517, and comparison of the HQR and INVIT calls with those in Section 2.1.10 shows that the eigenvalues are in (WR,WI) and the logical array is parameter SELECT.
Hence the subroutine
might be written as follows:
SUBROUTINE SETSEL(ISUBNO,NM,N,AR,AI,WR,WI,ZR,ZI,MM,M,RLB,RUB,EPSI, X
SELECT,IDEF,TYPE,IERR,LOW, IGH,BND,D,E,E2,1ND,INT,ORT,SCALE~TAU) REAL*8 AR (NM,NM) ,AI (NM,NM) ,WR(NM) ,WI (h~M),ZR(NM,MM), ZI (NM,MM) ,RLB ,RUB,
X
EPS I,BND (N) ,D(N) ,E(N) ,E2 (N) ,ORT(N) ,SCALE(N) ,TAN (2,N) INTEGER ISUBNO,NM,N,MM,M, IDEF,IERR,LOW,IGH,IND(N)~INT(N) LOGICAL SELECT(NM),TYPE IF (ISUBNO .NE. 517) RETURN DO i0 1 = I, N SELECT(l) = (WR(1)+WI(1))
.GE. 0.0DO
i0 CONTINUE RETUPd~ END
105
2.3-24
SETSEL immediately returns after every call from EISPAC except when ISUBNO is 517 (after HQR); then it examines the computed eigenvalues to set SELECT.
(Considerations regarding the setting of SELECT and choice
of MM are discussed in detail in Section 2.3.1.)
106
2.3-25
TABLE 2 ISUBNO VALUES AND PARAMETER NAMES FOR SUBROUTINE CALLS FROM EISPAC ISUBNO Value
Subroutine Call*
532
BAKVEC (NM,N,AR,E,M, ZR,IERR)
509
BALANC (NM,N,AR,LOW,IGH, SCALE)
515
BALBAK (NM,N,LOW, IGH,SCALE,M,ZR)
539
BISECT (N,EPSI,AR(I,2),AR(I,I),E2,RLB,RUB,~I,M,WR, IND, IERR,-,BND) in real symmetric tridiagonal paths (2.1.17, 2.1.18)
526
BISECT (N,EPSI,D,E,E2,RLB,RUB,MM,M,WR, IND,IERR,-,BND) in other paths
504
CBABK2 (IfM,N,LOW,IGH,SCALE,M,ZR,ZI)
501
CBAL (NM,N~AR,AI,LOW,IGH,SCALE)
507
CINVIT (NM,N,AR,AI,WR,WI,SELECT,MM,M,ZR,ZI,IERR,-,-,-,-)
508
COMBAK (NM,LOW, IGH,AR,AI,INT,M,ZR,ZI)
502
COMHES (NM,N,LOW,IGH,AR,AI,INT)
505
COMLR (NM,N,LOW,IGH,AR,AI,WR,WI,IERR) in path for all values, no vectors (2.1.2), modified
506
COMLR (N,N,LOW,IGH,-,-,WR,WI,IERR) in path for all values, selected vectors (2.1.3), modified
503
COMLR2(NM,N,LOW,IGH,INT,AR,AI,WR,WI,ZR,ZI,IERR)
565
COMQR (NM,N,LOW,IGII,AR,AI,WR,WI,IERR) in path for all values, no vectors (2.1.2)
566
COMQR (N,N,LOW,IGH,-,-,WR,WI,IERR) in path for all values, selected vectors (2.1.3)
564
COMQR2 (NM,N,LOW,IGH,ORTR,ORTI,AR,AI,WR,WI~ZR,ZI,IERR)
567
CORTB (NM,LOW, IGH~AR,AI,ORTR,ORTI,M,ZR,ZI)
563
CORTH'(NM,N,LOW~IGH,AR,AI,ORTR,ORTI)
107
2.3-26
TABLE 2 (Contd.) ISUBNO VALUES AND PARAMETER NAMES FOR SUBROUTINE CALLS FROM EISPAC ISUBNO Value
Subroutine Call*
519
ELMBAK (NM,LOW, IGH,AR, INT,M,ZR)
510
ELMHES (NM,N,LOW,!GH,AR, INT)
512
ELTRAN (NM,N,LOW,IGH,AR,INT,ZR)
530
FIGI (NM,N,AR,WR,E,E,IERR) in path for all values, no vectors (2.1.20)
531
F!GI (NM,N,AR,D,E,E2~IERR) in paths for some values (2.1.21, 2.1.22)
529
FIGI2 (NM,N,AR,WR,E,ZR, IERR)
516
HQR (NM,N,LOW,IGH,AR,WR,WI,IERR) in path for all values, no vectors (2.1.9)
517
HQR (N,N~LOW,IGH,-,WR,WI,IERR) in path for all values, selected vectors (2.1.10)
514
HQR2 (NM,N,LOW,IGH,AR,WR,WI,ZR,IERR)
523
HTRIBK (NM~N,AR,AI,TAU,M,ZR,ZI)
553
HTRIB3 (NM,N,AR,TAU,M, ZR,ZI)
521
HTRIDI (NM,N,AR,AI,WR,E,E,TAU) in path for all values and vectors (2.1.4)
525
HTRIDI (h~M,N,AR,AI,D,E,E2,TAU) in paths for some values (2.1.6, 2.1.7)
560
HTRIDI (NM~N,AR,AI,WR,E,E2,TAU) in path for all values, no vectors (2.1.5)
552
HTRID3 (NM, N,AR,WR,E,E,TAU) in path for all values and vectors (2.1.4), modified
554
HTRID3 (NM,N,AR,D,E,E2,TAU) in paths for some values (2.1.6, 2.1.7), modified
108
2.3-27
TABLE 2 (Contd.) ISUBNO VALUES AND PARAMETER NAMES FOR SUBROUTINE CALLS FROM EISPAC Subroutine Call*
ISUBNO Value 561
HTRID3 (NM, N,AR jWR,E ~E2,TAU) in path for all values, no vectors (2.1.5), modified
(not used) 524
IMTQLV IMTQL 1 (N,WR,E, IERR) in certain real tridiagonal path (2.1.20)
538
IMTQLI (N,WR,AR(I, I) ,IERR) in real symmetric tridiagonal path (2. I. 16)
522
IMTQL2 (NM, N, WR, E, ZR, IERR) in certain real tridiagonal path (2.1.19)
537
l~ffQL2 (NM,N,WR,AR(I, I),ZR,IERR) in real symmetric tridiagonal path (2. I. 15)
518
INVIT (NM~N,AR~WR~WI, S E L E C T ~ M M , M 9 ZR~ IERR~ -,-,-)
520
ORTBAK (NM,LOW, IGH, AR, ORTR, M, ZR)
511
ORTHES (NM,N,LOW, IGH~AR,ORTR)
513
ORTRAN (NM, N, LOW, IGH,AR, ORTR, ZR)
540
RATQR (N,EPSI,AR(I, 2) ,AR(I, I) ,E2,M,WR, IND,BND,TYPE,IDEF,IERR) in real symmetric tridiagonal paths (2. i. 17, 2. I. 18), modified
527
RATQR (N, EPS I,D, E, E2,M,WR, IND, BND, TYPE, IDEF, IERR) in other paths
541
TINVlT (NM,N,AR(I,2),AR(I,I),E2,M, WR,IND,ZR, IERR, , , , ,BND) in real symmetric tridiagonal path (2.1.17)
528
TINVIT (NM,N~D~E~E2,MjWR~IND~ZR~IERR, in other paths
543 (not used)
TQLRAT (N,WR, E2, IERR) TQLI
109
, , , ~BND)
2.3-28
TABLE 2 (Contd.) !SUBNO VALUES AND PARAMETER NAMES FOR SUBROUTINE CALLS FROM EISPAC ISUBNO Value
Subroutine Call*
542
TQL2 (NM,N,WR,E,ZR, IERR)
536
TRBAKI
557
TRBAK3 (NM,N,NV,AR,M, ZR)
534
TREDI (NM, N,AR,WR,E,E2)
(NM,N,AR,E,M, ZR)
in path for all values, no vectors 535
TREDI (NM,N,AR, D,E,E2) in paths for some values
533
TRED2 (NM,N,AR,WR,E,ZR)
555
TRED3 (N,NV,AR,WR,E,E)
(2.1.13, 2.1.14)
in path for all values and vectors 556
(2.1.13, 2.1.14), modified
TRED3 (N,NV,AR,WR,E,E2) in path for all values, no vectors
559
(2.1.12), modified
TRIDIB (N,EPSI,AR(I,2),AR(I,I),E2,RLB,RUB,MII,M,WR, in real symmetric tridiagonal paths
558
(2.1.11), modified
TRED3 (N,NV,AR,D,E,E2) in paths for some values
562
(2.1.12)
TRIDIB
IND,IERR,BND,-)
(2.1.17, 2.1.18), modified
(N,EPSI,D,E,E2,RLB,RUB,MII,M,WR, IND,IERR, BND,-)
in other paths (not used)
TSTURM
* A dash at some position in a parameter list indicates a temporary storage array which is not passed to the user subroutine by EISPAC.
1t0
2.3-29
Section 2.3.8 NON-ZERO VALUES OF IERR
This section summarizes the non-zero values of the error parameter IERR that can be returned by the EISPACK subroutines, either directly or via the control program (see Section 2.3.7), when an execution error is detected.
Such execution errors are classified into two categories:
first, path-terminating errors, indicated by positive values of IERR and signifying that although some possibly useful results have been obtained~ continued execution of the path is meaningless; second, non-terminating errors, indicated by negative values of IERR and signifying that although errors have already occurred, some further meaningful results may be obtained if the remaining part of the path is executed.
Each distinct error
that can occur in EISPACK corresponds to one of a unique set of values for IERR, that one being a function of the order of the matrix. The non-zero values of IERR are summarized in Table 3 at the end of this section.
To determine the significance of a particular value of
IERR, scan the column headed IERR for the expression with the value of your particular error.
The name of the subroutine that set the error
parameter is included in the list to the right; also given is the EISPAC error message number and a brief description of the significance of the error.
More detailed information may be obtained from the documentation
for the particular subroutine in Section 7.
111
2.3- 30
TABLE 3 SUM21~RY OF VALUES OF IERR
IERR
SUBROUTINES
EISPAC MESSAGE
i, INi~N
CG,CH,COMLR~ COMLR2,COMQR, COMQR2,HQR, HQR2,1MTQLV, IMTQLI,IMTQL2, RG,RS,RSP,RST, RT,TQLRAT, TQLI,TQL2
00
N+i, 2AiSN
FIGI,FIGI2
Ol
SIGNIFICANCE
OF THE ERROR
th The calculation of the i eigenvalue failed to converge. If CG, COMLR, COMLR2, COMQR, COMQR2, HQR, HQR2, or RG was being used, the eigenvalues i+l,i+2,...,N should be correct; otherwise, the eigenvalues 1,2,...,i-i should be correct. In neither case are any eigenvectors correct. For a real non-symmetric tridiagonal matrix (aij), the product of ai,i_ 1 and ai_l, i is negative, violating the restriction for special tridiagonal matrices discussed in Sections 2.1.19-2.1.22. No useful results are produced.
2N+i, 2~iAN
BAKVEC, FIGI2
For a real non-symmetric tridiagonal matrix (aij) , one but
02
not both of ai,i_ 1 and ai_l, i are zero. If FIGI2 was being used, no useful results are produced. If BAKVEC was being used, the eigenvalues computed earlier are correct, but the eigenvectors are not correct. 3N+I
BISECT, TRIDIB, TSTURM
If BISECT or T S T U R M w a s being used, the parameter MM specified insufficient storage to hold all the eigenvalues in the interval (RLB,RUB). The only useful result is M, which is set to the number of eigenvalues in this interval. If TRIDIB was being used, it is not possible to compute exactly M eigenvalues (starting from the Mll-th) because of exact multiplicity at index MII. No useful results are produced.
03
I12
2.3-31
TABLE 3 (Contd.) SUMMARY OF VALUES OF IERR
IERR
SUBROUTINES
EISPAC MESSAGE
SIGNIFICANCE OF THE ERROR
3N+2
TRIDIB
4N+i, l~i~N
TSTURM
5N+i, l~i_<M
RATQR
05
The calculation of one or more of the eigenvalues including the i th value failed to converge. All eigenvalues probably have some accuracy, but no stronger statement can be made.
6N+I
RATQR
06
The input matrix was specified as positive or negative definite (IDEF=±I) but the subroutine does not find it so; the subroutine should be re-entered specifying IDEF=0. No useful results are produced.
-i, l~i~N
CINVIT, INVIT, TINVIT
50
The calculation of one or more of the eigenvectors including the i th vector failed to converge; these vectors are set to zero. These failures may be caused by insufficient accuracy of the corresponding eigenvalues. All non-zero eigenvectors and their corresponding eigenvalues should be correct.
-N-i, l~i-
C INV IT, INVIT
04
It is not possible to compute exactly M eigenvalues (starting from the Mll-th) because of exact multiplicity at index MII+M-I. No useful results are produced. The calculation of the i th eigenvector failed to converge. The eigenvalues 1,2,...,i-i and corresponding eigenvectors should be correct.
50,52
113
Both the error above (nonconvergence) and the error below (insufficient storage) occurred with their respective results.
2.3-32
TABLE 3 (Contd.) SUMMARY OF VALUES OF IERR
IERR
SUBROUTINES
-2N-I
CINVIT, INVIT
-3N-i, 2~i~N
FIGI
EISPAC MESSAGE
SIGNIFICANCE OF THE ERROR The parameter MM specified insufficient columns to hold the selected eigenvectors. All eigenvalues and the first M columns of (ZR, ZI) or of Z should be correct.
52
For a real non-symmetric tridiagonal matrix (aij), one but not both of ai,i_ 1 and ai_l, i are zero.
This
does not jeopardize the calculation of the eigenva!ues but invalidates any eigenvectors computed in this path. The error~ therefore~ acts here as a warning but becomes a path-terminating error in BAKVEC if it is subsequently called. (No error message is triggered here from EISPAC, but error message no. 02 will finally result if the VECTOR parameter has been supplied.)
I14
2.3-33
Section 2.3.9 EXAMPLES ILLUSTRATING THE USE OF THE EISPACK SUBROUTINES AND THE CONTROL PROGRAM
We illustrate the use of Section 2 in preparing two programs to solve the same eigenproblems, one program calling the EISPACK subroutines directly and the other using the control program EISPAC.
The problems are to find the
eigenvalues in the interval (0,3) and the corresponding eigenvectors of two real symmetric matrices of orders 3 and 4, chosen to exhibit, respectively, normal and abnormal path termination.
The purpose of choosing these problems
is to illustrate the use of this publication in following a somewhat complicated path; in practice, for such low order matrices, it is probably easier to use the paths that compute the complete eigensystem. The two sample programs are complete in that they contain input and output statements; the data for each case and the computed results accompany the program listing.
For both programs, it is assumed that the EISPACK subroutines
are available in compiled form and that appropriate control cards are provided. Note that the EISPAC sample program also assumes that the compiled form of EISPAC is available, and may require additional control statements that point to EISPAC and the EISPACK subroutines. The EISPACK sample program is written in standard single precision Fortran IV, while the EISPAC sample program is written in IBM's long precision Fortran IV.
Both programs use Fortran logical unit 5 for input and Fortran
logical unit 6 for output. For these sample programs, we assume more generally that the order of the input matrix will not exceed 20 and that the number of eigenvalues in the interval (0,3) will not exceed 3.
Thus the integer constants ~
cussed in Section 2.1 have the values 20 and 3 respectively.
115
and ~
dis-
2.3-34
Given the above eigenproblems, we are directed by Table 1 to Section 2.1.13.
There, the appropriate calls to the EISPACK subroutines and to
EISPAC are displayed. grams depend upon ~
Dimensions for the array variables in the sample proand
mm
and hence from the above discussion, the
declaration statements must be
workir~precision
A(20,20),W(3),Z(20,3)
working precision
FVI(20),FV2(20),FV3(20),FV4(20),FV5(20),FV6(20), FV7(20),FVS(20)
INTEGER
IV1(3)
To communicate these dimensions to the EISPACK subroutines and to EISPAC, the parameters NM and MM are set to 20 and 3 respectively.
Finally, variables
RLB and RUB are set to 0.0 and 3.0 respectively, specifying the interval to be searched for the eigenvalues° The matrices are read row-wise from unit 5 and printed row-wise on unit 6.
The first sample matrix has one eigenvalue in the interval (0,3), which
with its corresponding eigenvector are printed on unit 6.
The second sample
matrix has more than three eigenvalues in (0,3) and the path is terminated after BISECT with IERR set to 13 = 3N+I.
For this matrix, the EISPACK sample
program distinguishes this error at statement 99999 from other possible errors~ prints the appropriate message on unit 6 and continues execution (until a matrix of order zero is specified on unit 5).
The EISPAC sample
program also distinguishes this error value from other possible error values, prints a message numbered 03 on unit 6 and terminates execution.
(See
Section 2.3.7 for use of the ERROR keyword parameter to continue execution.)
116
2.3-35
LISTING OF THE EISPACK SAMPLE PROGRAM
SAMPLE PROGRAM ILLUSTRATING THE USE OF THE EISPACK SUBROUTINES. THIS PROGRAM READS A REAL SYN~METRIC MATRIX A FROM FORTRAN LOGICAL UNIT 5 AND COMPUTES EIGENVALUES W IN THE Z. INTERVAL (0,3) AND THE ASSOCIATED ORTHONORMAL EIGENVECTORS SEE SECTION 2.1.13. REAL SYMMETRIC MATRIX Aj NO LARGER THAN ORDER 20. REAL EIGENVALUES W, AT MOST 3 OF THEM. ORTHONORMAL EIGENVECTORS Z, AT MOST 3 OF THEM. REAL REAL
A(20,20),W(3),Z(20,3) RLB, RUB, EPS1
TEMPORARY STORAGE ARRAYS. REAL +
FVI(20),FV2(20),FV3(20),FV4(20),FV5(20),FV6(20), FV7(20),FV8(20) INTEGER IV1(3)
ROW AND COLUMN DIMENSION PARAMETERS ASSIGNED. NM = 20 MM= 3 C C C
READ IN THE REAL SYMMETRIC MATRIX OF ORDER
N
ROW-WISE.
10 READ(5,20) N 20 FORMAT(I4) IF (N .LE. 0) STOP C DO 40 I = i, N READ(5, 30) (A(I,J),J=I,N) 30 FORMAT(4Ei6.8) 40 CONTINUE WRITE(6,50) N 50 FORMAT(///23H ORDER OF THE MATRIX IS, 14//16H MATRIX ELEMENTS) C DO 70 I = I, N WRITE(6,60) (A(I,J),J=I,N) 60 FORMAT(1X, 1P4E16.8) 70 CONTINUE INITIALIZE THE INTERVAL (RLB, RUB). RLB = 0.0 RUB = 3.0
117
2.3-36
LISTING OF THE EISPACK SAMPLE PROGRAM (Contd.)
THE FOLLOWING PATH IS COPIED FROM SECTION 2.1.13. CALL TREDI(NM, N,A, FV1, FV2, FV3) EPSI : 0.0 CALL BISECT(N, EPSIp FVI, FV2, FV3, RLB, RUB, MM, M, W, IVl, IERR, FV4, FV5) IF (IERR .NE. 0) GO TO 99999 CALL TINVIT(NM, N~ FV1, FV2, FV3,M, W, IV1, Z, IERR, FV4, FV5, FV6, FV7, FVS) IF (IERR .ME. 0) GO TO 99999 CALL TRBAK I(NM, N, A, FV2, M, Z) PRINT THE M EIGENVALUES AND CORRESPONDING EIGENVECTORS. IF (M .EQ. 0) GO TO 88888 WRITE(6,90) M 90 FORMAT(/47H NUMBER OF EIGENVALUES IN THE INTERVAL (0,3) IS,14) DO ii0 I = i, M WRITE(6,100) W ( I ) , ( Z ( J , I ) , J = I , N ) 100 FORNAT(/11HEIGENVALUE/1X,1PE16.8//14H CORRESPONDING, + 12H EIGENVECTOR/(1X,3E16.8)) 110 CONTINUE GO TO 10 C THERE ARE NO EIGENVALUES IN (0,3). C C 88888 WRITE(6,88100) 88100 FORMAT(43HONO EIGENVALUES OF A IN THE INTERVAL (0,3).) GO TO i0 C HANDLING OF IERR PARAMETER C C 99999 IF (IERR .GT. 0) GO TO 99200 IERR = -IERR WRITE(6,99100) IERR 99100 FORMAT(52HOAT LEAST ONE EIGENVECTOR FAILED TO CONVERGE, NAMELY, 15) GO TO 10 C 99200 WRITE(6,99300) M 99300 FORMAT(/35H NOT ENOUGH SPACE ALLOCATED FOR THE, 14, + 35H EIGENVALUES IN THE INTERVAL (0,3).) GO TO 10 END
1t8
2.3-37
LISTING OF THE EISPAC SAMPLE PROGRAM
SAMPLE PROGRAM ILLUSTRATING THE USE OF THE CONTROL PROGRAM EISPAC. THIS PROGRAM READS A REAL SYMMETRIC MATRIX A FROM FORTRAN LOGICAL UNIT 5 AND COMPUTES EIGENVALUES W IN THE INTERVAL (0,3) AND THE ASSOCIATED ORTHONORMAL EIGENVECTORS Z. SEE SECTION 2.1.13. REAL SYMMETRIC MATRIX A, NO LARGER THAN ORDER 20. REAL EIGENVALUES W, AT MOST 3 OF THEM. ORTHONORMAL EIGENVECTORS Z, AT MOST 3 OF THEM.
REAL*8 A(20,20),W(3),Z(20,3) REAL*8 RLB,RUB~EPS1 ROW AND COLUMN DIMENSION PARAMETERS ASSIGNED. NM=20 MM=3 READ IN THE REAL SYMMETRIC MATRIX OF ORDER
N
ROW-WISE.
10 REJ~D(5,20) N 20 FORMAT(I4) IF (N .LE. 0) STOP DO 40 I = 1, N
READ(5,30) (A(I,J),J=I,N) 30 FORMAT(4D16.8) 40 CONTINUE WRITE(6,50) N 50 FORMAT(///23H ORDER OF THE MATRIX IS,14//16H MATRIX ELEMENTS) DO 70 1 = 1, N
WRITE(6,60) (A(I,J),J=I,N) 60 FORMAT(1X, 1P4D16.8) 70 CONTINUE INITIALIZE THE INTERVAL (RLB,RUB). RLB = 0.0D0 RUB = 3.0D0 THE FOLLOWING CALL IS COPIED FROM SECTION 2.1.13. CALL +
EISPAC(NM, N, MATRI X( 'REAL ',A, 'SYMMETRIC '), VALUES(W,MM, M, RLB, RUB),VECTOR(Z))
119
2.3-38
LISTING OF THE EISPAC SAMPLE PROGRAM (Contd.)
C C C C C
PRINT THE M EIGENVALUES AND CORRESPONDING ARE THERE ANY EIGENVALUES
EIGENVECTORS.
IN (0,3)?
IF (M oNE. 0) GO TO 90 C C C
NO. WRITE(6,80) FORMAT(43HONO GO TO 10
80 C C C
EIGENVALUES OF A IN THE INTERVAL (0,3).)
YES. 90 WRITE(6pI00) M 100 FORMAT(/47H NUMBER OF EIGENVALUES
IN THE INTERVAL (0,3) IS,14)
C DO 120 I=1, M WRITE(6,110) W ( 1 ) , ( Z ( J , I ) , J = I , N ) 110 FORMAT(/11H EIGENVALUE/1X, 1PD16.8//14H CORRESPONDING, + 12H EIGENVECTOR/(1X,3D16.8)) 120 CONTINUE
C GO TO i0 END
120
2,3-39 DATA FOR THE SAMPLE PROGRAMS READ FROM UNIT 5
3 -i.0 1.0 -I.0 4 1.875 -0.5 0.375 -0.25 0
1.0 1.0 -i.0
-i.0 -i.0 1.0
-0.5 2.25 -0.25 -0.375
0.375 -0.25 2.125 -0.125
121
-0.25 -0. 375 -0.125 2. 125
3
4
6.57192290E-01
1
NOT ENOUGH SPACE ALLOCATED FOR THE
4 EIGENVALUES IN THE INTERVAL (0,3).
MATRIX ELEMENTS 1.87500000E 00 -5.00000000E-01 3.75000000E-01 -2.50000000E-01 -5.00000000E-01 2.25000000E 00 -2.50000000E-01 -3.75000000E-01 3.75000000E-01 -2.50000000E-01 2.12500000E 00 -1.25000000E-01 -2.50000000E-01 -3.75000000E-01 -1.25000000E-01 2.12500000E 00
ORDER OF THE MATRIX IS
CORRESPONDING EIGENVECTOR -3.69047642E-01 -6.57192111E-01
EIGENVALUE 2.56154823E 00
NUMBER OF EIGENVALUES IN THE INTERVAL (0,3) IS
MATRIX ELEMENTS -1.00000000E 00 1.00000000E 00 -I.00000000E 00 1.00000000E 00 1.00000000E 00 -I.00000000E 00 -1.00000000E 00 -1.00000Q00E 00 1.00000000E 00
ORDER OF THE MATRIX IS
OUTPUT FROM THE EISPACK SAMPLE PROGRAM PRINTED ON UNIT 6
O
GQ !
CO
3
4
6.57192300D-01
EXECUTION TERMINATED.
EISPAC EXECUTION PHASE ERROR(S)... 03 PARAMETER MM SPECIFIED INSUFFICIENT STORAGE TO HOLD ALL EIGENVALUES IN THE INTERVAL LB TO UB.
MATRIX ELEMENTS 1.87500000D 00 -5.00000000D-01 3.75000000D-01 -2.50000000D-01 -5.00000000D-01 2.25000000D 00 -2.50000000D-01 -3.75000000D-01 3.75000000D-01 -2.50000000D-01 2.12500000D 00 -1.25000000D-01 -2.50000000D-01 -3.75000000D-01 -1.25000000D-01 2.12500000D 00
ORDER OF THE MATRIX IS
CORRESPONDING EIGENVECTOR -3.69048184D-01 -6.57192300D-01
EIGENVALUE 2.56155281D 00
NUMBER OF EIGENVALUES IN THE INTERVAL (0,3) IS
MATRIX ELEMENTS -I.00000000D 00 1.00000000D 00 -1.00000000D 00 1.00000000D 00 1.00000000D 00 -1.00000000D 00 -I.00000000D 00 -1.00000000D 00 1.00000000D 00
ORDER OF THE MATRIX IS
OUTPUT FROM THE EISPAC SAMPLE PROGRAM PRINTED ON UNIT 6
I
3.0-1
Section 3 VALIDATION OF EISPACK
As part of its original development, EISPACK was subjected to thorough testing designed to exercise every statement in each subroutine and path in the package°
Before a version of EISPACK is declared certified, however,
it must also be validated at one or more test sites not involved in the adaptation.
This validation has two important goals.
One is to insure
that the adaptation has been carried out successfully and that EISPACK performs as anticipated on that computer system.
The second has been of
major importance in the development of EISPACK; it is to provide feedback on the ease of use of EISPACK and its documentation.
The procedures
included in and the philosophy behind this validation are discussed in further detail in ([3],[5]). Thus~ validation at test sites includes two kinds of testing.
The
first employs tes~ drivers and a collection of 82 matrices supplied with EISPACK; its purpose is to verify that the subroutines have been adapted to the machine and system properly, and to obtain data which can later be used as a check at other locations having the same computer system.
These
test drivers and matrices are included on the tape from the distribution center as described in Section 5. The second kind of testing is the more informal; it seeks to employ EISPACK in actual scientific computations to measure the ease of use of the routines and their documentation.
By its very nature, of course, this
informal testing is not repeatable. In order to simplify the communication of the results of the formal testing, a measure of performance for EISPACK, based on the backward error analysis of Wilkinson and Reinsch ([1],[2]), was defined.
124
It is computed as:
3.0-2
11Azi = max iNi!N
-
Xizill
10.N.~.llAl[.llzill
where each pair %'i and z i is an eigenvalue and corresponding eigenvector computed by EISPACK for the matrix A of order N, and where e is the precision of arithmetic on the test machine (called MACHEP in the subroutines). The factor i0 in the formula for ~ was chosen empirically to obtain the following criterion for the performance of EISPACK: If ~ is less than i, EISPACK has performed satisfactorily (as well as can be expected according to the backward error analysis for the particular precision of arithmetic). deemed poor.
If ~ is greater than i00, the performance is
Finally, if ~ is between 1 and I00, the performance is pro-
gressively marginal, and further investigation might be in order to verify that no error has occurred. This measure of performance is also useful as a check on the correct installation of EISPACK; the residuals Az i - %izi are very sensitive to small perturbations in I i and zi, and hence so is ~.
~ may thus reflect
small changes in the performance of EISPACK caused either by changes in the subroutines themselves or by the hardware, operating system, compiler, or library with which they are used.
Hence it provides an excellent "quick
check" of the correct installation of E~SPACK on a hardware-software system. If the values of ~ obtained from the test cases exactly duplicate those obtained at the test site, it is virtually certain that EISPACK has been correctly installed.
If, however, the values of ~ differ, an error may
have occurred in the transmission or implementation of EISPACK, or the hardware-software system may differ from that on which it was tested; such differences should probably be investigated.
125
3.0-3
The collection of 82 test matrices has been accumulated from various sources and provides a wide spectrum of test cases from trivial to pathological.
Most values of the performance index ~ for these test cases
were less than i for the systems on which EISPACK has been certified.
The
weaker performances were generally observed in the paths where some eigenvectors were computed; that is, where the inverse iteration subroutines (INVIT, CINVIT, TINVIT) were called.
126
4.0-I
Section 4 EXECUTION TIMES FOR EISPACK
In this section we display approximate execution times of the individual subroutines and various paths in EISPACK measured with sample matrices on many of the computer systems for which the subroutines have been certified.
The elements of the sample matrices are random numbers
sampled from uniform distributions.
Tables of execution times appear
in the first subsection, and considerations regarding the reliability of the timing measurements, their dependence upon the elements of the matrices, and the extrapolation of these results to other machines are discussed in later subsections.
The section concludes with listings of
the program segments that generate the sample matrices.
127
4.1-1
Section 4.1 TABLES OF EXECUTION TIMES
For each of 15 computer systems there follow three tables displaying sample execution times respectively for complex general matrices, real general matrices~ and those matrices that can be reduced to real symmetric tridiagonal form.
A further table follows comparing the performances of
the computer systems with each other.
Finally, one additional table is
included reporting path timings on the IBM 370/195 when the control program EISPAC is used. The tables report execution times both for the individual subroutines and for many of the recommended paths. for a matrix of different order.
Each column of a table reports times
The entries in any column are expressed
as multiples of the time unit that appears at the head of the column.
The
time unit chosen is the absolute time for subroutine COMHES, ELMHES, or TREDI as appropriate.
A dash appears in place of an entry representing
an execution time too small to be measured within the resolution of the clock. For a subroutine that computes some eigenvalues or eigenvectors, the tabulated time represents that required for the subroutine to compute all eigenvalues or eigenvectors.
The times for the eigenvector subroutines
INVIT~ CINVIT, and TINVIT are measured when the eigenvalues are provided by the subroutines HQR, COMLR, and BISECT respectively; these times could be significantly longer if less accurate eigenvalue subroutines were substituted. For paths where a driver subroutine exists, the time for the actual call of the driver subroutine is recorded.
For other paths, the entries
are built by summing the times for the separate suhroutines.
128
The entries
4.1-2
for those paths that compute partial eigensystems are expressed as the sum of two terms:
the first term is the base time for the path and the
second term is that part which depends upon the number of eigenvalues and eigenvectors computed.
For complex general matrices, this latter
term is the product of the estimated time to compute one eigenvector and M, the number of eigenvectors computed.
For real general matrices, it
is the product of the estimated time to compute one column of the eigenvector matrix and M, the number of columns required to store the requested eigenvectors.
For matrices that can be reduced to real symmetric tri-
diagonal form, it is either the product of the estimated time to compute one eigenvalue-eigenvector pair and M, the number of pairs computed, or the product of the estimated time to compute one eigenvalue and M, the number of eigenvalues computed.
Program segments that generate the
sample matrices are listed in Section 4.5.
129
4.1-3
TABLE 4 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR COMPLEX GENERAL MATRICES MACHINE: IBM 370/195, Fortran H, OPT=2 ARGONNE NATIONAL LABORATORY
ORDER OF MATRIX SUBROUTINE
N=I0
N=20
N=40
N=60
N=80
Time Unit (See)
.002
.014
.099
.33
°86
17 II
.07 .05
.03 .03
.02 .02
~01 .01
i .46
i .53
i .61
1 .66
I .91
CBAL CBABK2 COMHES COMBAK
o
.
CORTH CORTB
2.3 i,I
2.6 1.3
3,0 1.4
3.0 1.5
2.8 1.3
COMQR2 COMLR2
15 ii
14 i0
!4 9.3
14 9,1
13 8.0
COMQR COMLR
7.7 6.9
5.8 4.9
4.8 3.5
4.4 3.1
3.8 2.6
CINVIT
7.4
5.5
4.3
3.7
3.4
CG (CBAL,CORTH,COMQR2,CBABK2)
18
17
17
17
15
CG (CBAL,CORTH,COMQR)
i0
8.5
7.8
7.5
6.7
PATHS
CBAL,CORTH,COMQR,CINVIT, CORTB~CBABK2
I0+.86M
130
8.5+o34M 7.8+.14M 7.5+.09M 6.6+.06M
4. I-4
TABLE 5 SUMMARY OF EXECUTION TIM~S FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR REAL GENERAL MATRICES MACHINE: IBM 370/195, Fortran H, OPT=2 ARGONNE NATIONAL LABORATORY
ORDER OF MATRIX SUBROUTINE
N= i0
N=20
N=40
N=60
N=80
Time Unit (Sec)
.001
.006
.047
.15
.36
BALANC BALBAK
.40 .17
.13 .07
.05 .03
.03 .02
.02 .02
ELMHES ELTRAN ELMBAK
1 .28 .63
1 .13 .59
i .06 .60
1 .04 .60
i .03 .64
ORTHES ORTRAN ORTBAK
2.6 .72 1.0
2.7 .60 .91
2.7 .54 .83
2.6 .52 .79
2.6 .51 .78
HQR2
19
15
13
12
12
HQR
12
7.9
5.4
4.7
4.2
INVIT
6.3
5.2
4.3
3.9
3.7
RG (BALANC, ELMHES, ELTRAN, HQR2, BALBAK) RG (BALANC,ELMHES,HQR)
20
17
14
14
13
13
9.0
6.6
5.8
5.2
BALANC, ELMHES, HQR, INVIT, ELMBAK ~BALBAK
13+.71M
PATHS
131
9 .0+. 29M 6 .5+. 12M 5.8+. 08M 5.3+. 05M
4. I-5
TABLE 6 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS THAT REDUCE FULL MATRICES TO REAL SYMMETRIC TRIDIAGONAL FORM MACHINE: IBM 370/195, Fortran H, OPT=2 ARGONNE NATIONAL LABORATORY
SUBROUTINE
N=IO
ORDER OF MATRIX N=20 N=40 N=60
Time Unit (Sec)
.001
,007
.041
.12
N=80
.27
TREDI TRED2 TRED3 TRBAKI TRBAK3
1
1
1
1
1
1.6 ,98 1.2 .85
1.8 i.i 1.4 I.i
2.0 i.I 1.6 1.3
2.1 1.2 1.7 1.5
2.2 1.2 1.8 1.5
HTRIDI HTRID3 HTRIBK HTRIB3
2.1 2.2 2.3 2.6
2.6 2.8 3.4 4.0
3.0 3.3 4.3 5.1
3.2 3.6 4.9 5.7
3.4 3.8 5.1 6,0
FIGI FIGI2 BAKVEC
13 18 I0
~05 .i0 .05
°02 ~05 ~03
TQL2 IMTQL2
3.4 3,8
3.5 3.8
3.3 3.7
TQLRAT TQLI IMTQLI
1.2 2.1 2.2
.67 1.5 1.6
°36 ,94 1.0
BISECT TRIDiB IMTQLV RATQR
12 12 2.4 2.6
8.1 7.7 1.7 2.2
TINVIT TSTURM
.95 13
5.0 2.2
.01 .03 .02 3.2 3.5
°00 ,02 .01 3.2 3.5
.24 .66 ,73
,18 ,52 ,57
4.9 4.6 I. 1 1.5
3.5 3.3 .77 1.2
2.7 2.5 .60 .93
,64 8.6
~40 5.3
.30 3.8
.30 3.0
5.3 1.7
5.3 1.3
5.3 1.2 I+. 0 9 M I+. 06M
5.3 1.2 i+. 06M i+. 03M
PATHS RS (TRED2,TQL2) RS (TREDI,TQLRAT) TREDI,BISECT,TINVIT,TRBAKI TREDI,BISECT CH (HTRIDI,TQL2,HTRIBK) CH (HTRIDI,TQLRAT) HTRIDI,BISECT,TINVIT~HTRiBK HTRIDI,BISECT
I+i .4 M
i+. 5 IM
I+. 17M
i+i. 2M
i+. 40M
I+. 12M
9.5 Ii II 12 3.3 3.3 3.3 3.5 3.6 2.1+1.5M 2.6+.61M 3.0+.24M 3.2+.15M 3.4+.IOM 2.1+1.2M 2.6+.40M 3.0+.12M 3.2+.06M 3.4+.03M 8.1
132
4.1-6
TABLE 7 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR COMPLEX GENERAL MATRICES MACHINE:
IBM 360/75, Fortran H, OPT=2 UNIVERSITY OF ILLINOIS
ORDER OF MATRIX SUBROUTINE
N=20
Time Unit (See)
.20
N=40
N=60
N=80
1.6
5.2
12
CBAL CBABK2
.04 .05
.02 .01
.01 .01
.01 .01
COMIIES COMBAK
1 .48
i .52
i .55
1 .55
CORTH CORTB
2.2 1.2
2.3 1.2
2.3 1.2
2.4 1.3
COMQR2 COMLR2
15 7.7
14 6.6
14 6.5
14 6.3
COMQR COMLR
5.7 3.5
4.7 2.4
4.5 2.3
4.4 2.1
CINVlT
3.2
2.4
2.2
2.1
CG (CBAL, CORTH, COMQR2, CBABK2 )
17
17
16
16
CG (CBAL, CORTH, COMQR)
7.9
7.1
6.8
6.7
PATHS
CBAL, CORTH, COMQR, CINVlT, CORTB, CBABK2
7.9+.22M 7.1+.09M 6.8+.06M 6.7+.04M
133
4.1-7
TABLE 8 Sb~MARY OF EXECUTION TIMES FOR THE E!SPACK SUBROUTINES INCLUDED IN THE PATHS FOR HEAL GENERAL MATRICES MACHINE:
IBM 360/75, Fortran H, OPT=2 UNIVERSITY OF ILLINOIS
ORDER OF MATRIX SUBROUTINE
N=20
N=40
Time Unit (Sec)
.063
.49
II ~03
.04 .02
.02 .02
.02 °01
ELMHES ELTRAN ELMBAK
I .05 .65
1 .03 .60
1 .02 .61
i .01 .60
ORTHES ORTRAN ORTBAK
2.5 .78 I.i
2.4 .69 i.i
2.3 .68 I.i
2.3 .67 1.0
HQR2
17
14
14
13
HQR
8.0
5.8
5.2
4.6
INVIT
3.7
3.1
2.9
2.7
18
15
15
14
9.1
6.8
6.2
5.7
BALANC BALBAK
.
N=60
N=80
1.6
3.9
PATHS RG (BALANC,ELMIIES ,ELTRAN, NQR2, BALBAK) RG (BALANC, ELMHES, HQR)
9.1+.22M 6.8+.09M 6.2+.06M 5.7+.04M
BALANC, ELMHES, HQR, INVIT, ELMBAK, BALBAK
134
4. i-8
TABLE 9 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS THAT REDUCE FULL MATRICES TO REAL SYMMETRIC TRIDIAGONAL FORM MACHINE:
IBM 360/75, Fortran H, OPT=2 UNIVERSITY OF ILLINOIS
SUBROUTINE
ORDER OF MATRIX N=20 N=40 N=60
N=80
Time Unit (See)
.072
.48
1.6
3.5
TRED 1 TRED2 TRED3 TRBAKI TRBAK3
1 1.8 .96 1.3 1.2
1 1.9 .93 1.5 1.3
1 1.9 1.0 1.5 1.4
1 2.0 1.0 1.5 1.4
HTRIDI HTRID3 HTRIBK HTRIB3
2.9 3.0 4.1 4.4
3.2 3.3 4.6 5.0
3.4 3.6 5.0 5.5
3.5 3.7 5.1 5.6
FIGI FIGI2 BAKVEC
.01 .01 .02
TQL2 IMTQL2
4.9 5.0
TQLRAT TQLI IMTQLI
.58 1.3 1.2
BISECT TRIDIB IMTQLV RATQR
4.9 5.2 1.3 2.2
TINVIT TSTURM
5.5
• 49
5.0 5.0
4.8 4.9
.00 .01 .01 4.8 4.9
.32 .70 .71
.21 .47 .50
.15 .36 .38
2.7 2.8 .75 1.4
1.8 1.9 .49 .99
1.4 1.5 .38 .79
.34
3.1
.25
2.2
.28
1.7
PATHS RS (TRED2,TQL2) RS (TREDI, TQLRAT) TREDI,BISECT,TINVIT,TRBAKI TREDI,BISECT
6.7 1.4 i+. 33M i+. 24M
CH (HTRIDI,TQL2,HTRIBK) CH (HTRIDI,TQLRAT) HTRIDI,BISECT,TINVlT,HTRIBK HTRIDI,BISECT
6.9 1.3 I+. 1 IM I+. 07M
6.8 1.2 i+. 06M I+. 03M
6.8 i.I I+. 04M I+. 02M
12 12 13 13 3.5 3.5 3.6 3.7 2.9+.47M 3.2+.19M 3.4+.12M 3.5+.09M 2.9+.24M 3.2+.07M 3.4+.03M 3.5+.02M
~85
4. i-9
TABLE i0 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR COMPLEX GENERAL MATRICES MACHINE:
IBM 370/168, Fortran H, OPT=2 UNIVERSITY OF MICHIGAN
ORDER OF MATRIX SUBROUTINE
N=I0
N=20
N=40
Time Unit (Sec)
.008
°070
.57
CBAL CBABK2 COMHES COMBAK
N=60
N=80
2.0
4.7
.08
.03
.01
.01
.01
•07
.03
~01
.01
.01
!
1
1
1
1
• 47
.52
,54
.55
,58
CORTH CORTB
2.3
2.3
2.2
2.2
2.2
1.3
1.3
1.2
1.2
1.2
COMQR2 COMLR2
19 9.1
16 7.7
15 6.5
14 6.3
14 6.1
COMQR COMLR
8.1 4.9
5.9 3.3
4.8 2.3
4.6 2.1
4.3 1.9
CINVIT
4.5
3.0
2.2
2.0
1.9
CG (CBAL, CORTH~COMQR2,CBABK2)
21
19
17
17
16
CG (CBAL,CORTH,COMQR)
Ii
8.1
7.0
6.7
6.4
PATHS
CBAL,CORTH,COMQR,CINVIT, CORTB~CBABK2
1 i+. 58M
136
8.2+.21M 7~O+.09M 6.7+.05M 6o4+.04M
4.1-10
TABLE Ii SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR REAL GENERAL MATRICES MACHINE:
IBM 370/168, Fortran H, OPT=2 UNIVERSITY OF MICHIGAN
ORDER OF MATRIX SUBROUTINE
N=I0
N=20
N=40
N=60
Time Unit (Sec)
.003
.020
.16
.56
BALANC BALBAK
.20 .14
.07 .06
.03 .03
.02 .02
.01 .01
ELMHES ELTRAN ELMBAK
i 12 .56
1 .05 .58
i .02 .59
I .01 .59
1 .01 .60
ORTHE S ORTRAN ORTBAK
2.7 .87 1.4
2.5 .81 1.3
2.4 .78 1.2
2.3 .77 1.2
2.3 .76 1.2
HQR2
23
18
15
15
14
HQR
13
8.8
6.1
5.5
4.9
INVIT
4.7
3.6
2.8
2.6
2.4
25
19
16
16
15
14
9.8
7.2
6.5
5.9
•
N=80 1.4
PATHS RG (BALANC~ELMIIES~ELTRAN~ HQR2,BALBAK) RG (BALANC,ELMHES,HQR) BAL~NC,ELMHES,HQR~INVlT~ ELMBAK, BALBAK
14+.54M
137
9.8+.21M 7.2+.09M 6.5+.05M 5.9+.04M
4.1-11
TABLE 12 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS THAT REDUCE FULL MATRICES TO REAL SYMMETRIC TRIDIAGONAL FORM MACHINE:
IBM 370/168, Fortran H, OPT=2 UNIVERSITY OF MICHIGAN
SUBROUTINE
N=I0
ORDER OF MATRIX N=20 N=40 N=60
N=80
Time Unit (See)
~004
.023
1,2
TRED 1 TRED2 TRED3 TRBAKI TRBAK3
1 1,6 .98 i.i .99
I 1.8 °99 1.3 1.2
i 1.9 1.0 1.5 1.4
1 2.0 1.0 1.5 1.5
i 2.0 1.0 1,5 1.5
HTRIDI HTRID3 HTRIBK HTRIB3
2.8 2.7 3.3 3.4
3.1 3.1 4.3 4.5
3.4 3.5 5.0 5.2
3.6 3.6 5.2 5.4
3.7 3.7 5.3 5.5
FiGI FIGI2 BAKVEC
.09 ,12 .i0
.03 .04 .05
TQL2 IMTQL2
5.4 5.4
5.8 5.5
TQLRAT TQLI IMTQLI
1.2 2,3 2,3
.66 1.4 1.5
BISECT TRIDIB IMTQLV RATQR
8.0 8.4 2.4 2.8
TINVIT TSTUPd<
.16
.01 .02 .03 5.7 5.6
.50
.00 ,01 .02 5.6 5.3
,00 .01 .02 5.4 5.3
.34 .81 .83
.22 .55 .56
.16 ,42 .42
4.9 5.0 1.5 2,1
2.7 2.7 .85 1.4
1.8 1.8 .57 1.0
1.4 1.4 .44 ,80
.86 8,8
.54 5.3
.31 2.9
.23 2.0
°26 1.6
7.0 2.2 I+I.0M I+. 80M
7.6 1,7 i+. 34M I+. 24M
7.6 1.3 i+. IIM i+. 07M
7.6 1.2 I+.06M I+. 03M
7.4 1.2 1+. 04M I+. 02M
PATHS RS (TRED2,TQL2) RS (TREDI,TQLRAT) TREDI,BISECT,TINVIT,TRBAKI TREDI,BISECT CH (HTRIDI,TQL2,HTRIBK) CH (HTRIDI,TQLRAT) HTRIDI,BISECT,TINVIT~HTRIBK HTRIDI,BISECT
ii 13 14 14 14 4.1 3.8 3.8 3.8 3.8 2.8+1.2M 3.1+.48M 3.4+.20M 3.6+,12M 3.7+.09M 2.8+.80M 3.1+,24N 3.4+.07M 3.6+.03M 3.7+.02M
138
4.1-12
TABLE 13 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR COMPLEX GENERAL MATRICES MACHINE:
IBM 370/165, Fortran H Extended, OPTIMIZE(2) THE UNIVERSITY OF TORONTO
ORDER OF MATRIX SUBROUTINE
N=I0
N=20
N=40
N=60
N=80
Time Unit (Sec)
.006
.043
.39
1.5
4.0
.06
.03 .02
.02 .02
.01
1 .62
1 .71
1 .98
CBAL CBABK2
-
COMHES COMBAK
1 1
CORTH CORTB
2 1
2.2 1.2
2.0 I. 1
1.9 .95
1.7 .85
COMQR2 COMLR2
17 ii
16 9.3
13 7.5
12 6.5
i0 5.9
COMQR COMLR
8 6
5.9 4.1
4.3 2.7
3.7 2.2
3.2 1.9
CINVIT
7
4.8
3.3
2.6
2.5
-
-
1 .53
.01
PATHS CG (CBAL,CORTH,COMQR2,CBABK2)
20
18
15
13
12
CG (CBAL,CORTH,COMQR)
ii
8.2
6.4
5.6
4.9
CBAL,CORTH,COMQR,CINViT, CORTB,CBABK2
10+.8M
139
8.2+.30M 6.4+.IIM 5.6+.06M 4.9+.04M
4.1-13
TABLE 14 SUMY~RY OF EXECUTION TIMES FOR THE E!SPACK SUBROUTINES INCLUDED IN THE PATHS FOR REAL GENERAL MATRICES MACHINE:
IBM 370/165, Fortran H Extended, OPTIMIZE(2) THE UNIVERSITY OF TORONTO
ORDER OF MATRIX SUBROUTINE
N=20
N=40
N=60
Time Unit (Sec)
.016
.12
.43
-
.05
.03
.02
-
.03
.02
.02
BALANC BALBAK
N=80 i.i
1
1
1
1
-
.07
.04
.03
.62
.63
.66
.80
ORTHES ORTRAN ORTBAK
2.3 •83 1.2
2.4 .75 I.i
2.2 .71 i.i
2.1 .64 .95
HQR2
16
15
13
ii
HQR
8.5
5.9
4.9
4.1
INVIT
4,2
3.7
3.1
2,8
18
16
14
12
9.1
6.8
5.9
5.1
ELMHES ELTRAN ELMBAK
PATHS RG (BALANC, ELMHES, ELTRAN, HQR2, BALBAK) RG (BALANC, ELMHES, HQR)
9.5+.24M 7.0+.IIM 5.9+.06M 5.1+.05M
BALANC, ELMHES, HQR, INVIT, ELMBAK, BALBAK
140
4.1-14
TABLE 15 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS THAT REDUCE FULL MATRICES TO REAL SYMMETRIC TRIDIAGONAL FORM MACHINE:
IBM 370/165, Fortran H Extended, OPTIMIZE(2) THE UNIVERSITY OF TORONTO
SUBROUTINE
N=I0
ORDER OF MATRIX N=20 N=40 N=60
Time Unit (Sec)
.003
.017
TREDI TRED2 TRED3 TRBAKI TRBAK3
i 2 I i i
i 1.7 .92 1.5 i.i
i 1.9 1.0 1.6 1.3
i 2.0 1.0 1.7 1.3
1 2.0 1.0 1.6 1.3
HTRIDI HTRID3 HTRIBK HTRIB3
2 3 3 4
2.7 2.7 3.7 4.0
3.1 3.2 4.7 5.1
3.6 3.4 5.0 5.1
4.1 3.5 5.5 5.1
FIGI FIGI2 BAKVEC
.ii
-
.04 .03
TQL2 IMTQL2
4 4
4.8 4.9
TQLRAT TQLI IMTQLI
2 2 2
.80 1.5 1.7
BISECT TRIDIB IMTQLV RATQR
i0 9 3 2
TiNVIT TSTURM
i i0
4.7 4.8
.35
.01 .03 .02 4.8 4.7
N=80 .84
.00 .02 .02 4.4 4.6
.42 .92 .96
.27 .61 .63
.19 .46 .47
6.7 6.5 1.7 2.3
3.9 3.8 .98 1.6
2.6 2.6 .64 i.i
1.9 1.9 .48 .86
.76 7.3
.42 4.2
.30 2.9
.30 2.2
6.8 1.8 i+. 45M i+. 34M
6.6 1.4 I+. 15M i+. 10M
6.7 1.3 i+. 08M i+. 04M
6.3 1.2 i+. 05M i+. 02M
PATHS RS (TRED2,TQL2) RS (TRED i, TQLRAT) TREDI,BISECT,TINVIT,TRBAKI TREDI,BISECT
6 3 i+ 1 .2M I+i. 0M
CH (HTRIDI,TQL2,HTRIBK) CH (HTRIDI,TQLRAT) HTRIDI,BISECT,TINVIT~HTRIBK HTRIDI,BISECT
ii 4 4+i. 4M 4+1.0M
141
ii 13 13 14 3.4 3.6 3.9 4.3 2.7+.56M 3.1+.22M 3.6+.13M 4.1+.IOM 2.7+.34M 3.1+.IOM 3.6+.04M 4.1+.02M
4.1-15
TABLE 16 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR COMPLEX GENERAL MATRICES MACHINE: Burroughs 6700, Fortran IV (2.6) UNIVERSITY OF CALIFORNIA~ SAN DIEGO
ORDER OF MATRIX SUBROUTINE
N=I0 .27
Time Unit (Sec)
N=20
N=40
N=60
2.1
17
59
CBAL CBABK2
. i0
.04 .02
°02 .01
.01
.05
COMHES COMBAK
i .58
1 .56
1 .59
I .59
CORTH CORTB
1.7 .92
1.6 1.0
1.6 .99
1.6 .94
COMQR2 COMLR2
13 8.6
Ii 7.9
i0 6.8
9.6 6.8
COMQR COMLR
5.0 4.3
3.9 3.1
3.3 2.4
3.1 2.3
CINVlT
3.3
2.6
2.3
2.2
CG (CBAL~CORTH,COMQR2,CBABK2)
14
13
12
Ii
CG (CBAL,CORTH, COMQR)
6.7
5.6
4.9
4.6
.01
PATHS
CBAL~CORTH,COMQR~CINVIT, CORTB~CBABK2
6.8+. 43M 5.5+. 18M 4.9+. 08M 4.8+. 05M
142
4.1-16
TABLE 17 SIIMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR REAL GENERAL MATRICES MACHINE: Burroughs 6700, Fortran IV (2.6) UNIVERSITY OF CALIFORNIA, SAN DIEGO
ORDER OF MATRIX SUBROUTINE
N=I0
N=20
Time Unit (Sec)
.095
.79
BALANC BALBAK
.18 .08
.06 .04
.03 .02
.02 .01
ELMHES ELTR2uN ELMBAK
1 .17 •57
1 .07 .58
i .04 .59
1 .03 .60
ORTHES ORTRAN ORTBAK
1.7 .83 i.i
1.7 .70 .99
1.6 .66 .94
1.7 .66 1.0
HQR2
12
9.9
8.9
8.8
HQR
6.3
4.3
3.6
3.1
INVIT
3.1
2.4
2.1
2.1
14
11
I0
9.9
7.8
5.4
4.5
4.3
N=40
N=60
6.3
20
PATHS RG (BALANC,ELMHES,ELTRAN, HQR2,BALBAK) RG (BALANC, ELMHES, HQR) BALANC, ELMHES, HQR, INVIT ELMBAK, BALBAK
7.5+. 38M 5.4+. 15M 4.6+. 07M 4. i+. 04M
143
4.1-17
TABLE 18 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS THAT REDUCE FULL MATRICES TO REAL SYMMETRIC TRIDIAGONAL FORM MACHINE: Burroughs 6700, Fortran IV (2.6) UNIVERSITY OF CALIFORNIA, SAN DIEGO ORDER OF MATRIX N=20 N=40 N=60
SUBROUTINE
N=IO
Time Unit (Sec)
.093
~56
TRED i TRED2 TRED3 TRBAKI TRBAK3
i 1.6 .77 I.I I.i
HTRIDI HTRID3 HTRIBK HTRIB3
2.5 2.4 3.5 3.7 .05 .12 .09
FIGI FIGI2 BAKVEC TQL2 IMTQL2
4.2 4.4
TQLRAT TQLI IMTQLI
.77 i.I 1.2
BISECT TRIDIB IMTQLV
HATQR
3.7 4.1 i. 1 1.4
TINVlT TSTURM
5.0
.68
4.1
13
1 1.9 .82 1.5 1.4
1 2.0 .76 1.6 1,5
I 2.2 .80 1.8 1.6
2.9 2.8 4.6 4.9
3.1 3.0 5.1 5.1
3.1 3.1 5.3 5.3
.01 ,05 .06 4,7 5.1
.00 .03 .03 4.6 4.8
.00 .02 .02 4.7 5.2
.38 .68 .69
.19 .36 .37
.13 .25 .25
2.1 2.5 .61 I.I
I.I 1.2 .31 .62
,73 .83 .22 ,46
o43
3.0
.24
1.5
.19
i.I
PATHS RS (TRED2,TQL2) RS (TREDI,TQLRAT) TREDI,BISECT,TINVlT,TRBAKI TREDI~BISECT CH (HTRIDI,TQL2,HTRiBK) CH (HTRIDI,TQLRAT) HTRIDI,BISECT,TINVIT,HTRIBK HTRIDI,BISECT
5.8 1.5 I+. 55M I+. 37M
6.9 1.3 i+. 20M i+. IIM
6.6 i.I I+. 07M i+. 03M
6.9 i.i I+. 04M I+.01M
ii 12 13 13 3.2 3.2 3.3 3,3 2.5+.79M 2,9+.35M 3.1+.16M 3.1+.IOM 2.5+.37M 2.9+.IIM 3.1+.03M 3.1+.OIM
144
4.1-18
TABLE 19 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR COMPLEX GENERAL MATRICES MACHINE:
CDC 6600, FTN (4.2) Compiler KIRTLAND AIR FORCE BASE
ORDER OF MATRIX SUBROUTINE Time Unit (Sec)
N=40 .52
N=50
N=60
N=70
N=80
1.0
1.8
2.8
4.2
CBAL CBABK2 COMHES COMBAK
1 .72
1 .57
1 .55
1 .56
1 .56
CORTH CORTB
2.8 1.0
2.6 .96
2.7 .93
2.7 .95
2.7 .97
COMQR2 COMLR2
14 7.5
12 6.9
12 6.6
12 6.5
12 6.6
COMQR COMLR
4.9 3.1
4.5 2.7
4.3 2.5
4.2 2.4
4.2 2.4
CINVIT
2.6
2.3
2.2
2.2
2.2
CC (CBAL,CORTH,COMQR2,CBABK2)
16
15
15
14
15
CC (CBAL,CORTH,COMQR)
7.8
7.1
6,9
6.8
7.0
PATHS
CBAL,CORTH,COMQR,CINVIT, CORTB,CBABK2
7.7+.09M 7.1+.07M 6.9+.05M 6.8+.04M 6.9+.04M
145
4.1-19
TABLE 20 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR REAL GENERAL MATRICES MACHINE:
CDC 6600, FTN (4.2) Compiler KIRTLAND AIR FORCE BASE
ORDER OF MATRIX N=40
N=50
N=60
N=70
N=80
.25
.49
.80
1.4
2.0
ELMHES ELTRAN ELMBAK
1
1
1
1
1
.46
.59
°59
.61
°58
0RTHES ORTRAN ORTBAK
2.6
2.6 •81 1.2
2.5
1.2
2.6 .81 1.2
1.2
1.2
HQR2
12
12
12
ii
i0
HQR
5.1
4.9
4.6
4.0
3.8
INVIT
2.8
2.7
2.7
2.5
2.4
13
13
13
12
12
6.1
5.7
5.7
5.0
4.7
SUBROUTINE Time Unit (Sec) BALANC BALBAK
•9 2
.76
2.5 .75
PATHS RG (BALANC, ELMHES, ELTRAN, HQR2, BALBAK) RG (BALANC, ELMHES, HQR) BALANC, ELMHES ,HQR, INVIT, ELMBAK, BALBAK
6.1+.08M 5.8+.07M 5.6+.05M 5.0+.04M 4.8+.04M
146
4.1-20
TABLE 21 Sb~MMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS THAT REDUCE FULL MATRICES TO REAL SY~fl~ETRIC TRIDIAGONAL FORM MACHINE:
CDC 6600, FTN (4.2) Compiler K I R T L A N D A I R FORCE BASE
SUBROUTINE Time Unit (Sec)
N=40 .19
ORDER OF MATRIX N=50 N=60 N=70 .37
.60
.92
N=80 1.3
TRED 1 TRED2 TRED3 TRBAKI TRBAK3
1 2.2 1.8 1.7 1.9
1 2ol 1.8 1.7 1.9
1 2.1 1.7 1.7 2.0
1 2.2 1.8 1.8 2.1
1 2.2 1.7 1.8 2.0
HTRIDI HTRID3 HTRIBK HTRIB3
2.2 1.9 3.4 3.0
1.9 2.1 3.0 3.1
2.2 2.2 3.5 3.4
2.3 2.3 3.7 3.6
2.1 2.0 3.3 3.4
4.2 4.5
4.0 4.3
4.0 4.4
4.2 4.4
4.0 4.4
FIGI FIGI2 BAKVEC TQL2 IMTQL2 TQLRAT TQLI IMTQLI
.39 •63 .68
.28 .49 .56
.25 .42 .50
.21 .37 .44
.19 .32 .38
BISECT TRIDiB IMTQLV RATQR
6.2 6.0 .76 2.0
4.9 4.8 .62 1.6
4.2 4.2 .54 1.4
3.7 3.6 .47 1.3
3.2 3.2 .42 i.i
TINViT TSTURM
.52 6.6
.40 5.3
.39 4.6
.36 4.1
.40 3.7
6.3 1.4 I+.21M i+. 16M
6.0 1.3 I+. 14M i+. IOM
6.1 1.2 I+. IIM I+. 07M
6.2 1.2 I+.08M i+. 05M
6.2 1.2 I+.07M i+. 04M
PATHS RS (TRED2,TQL2) RS (TREDI,TQLRAT) TREDI,BISECT,TINVIT,TRBAKI TREDI,BISECT CH (HTRIDI,TQL2,HTRIBK) CH (H~RIDI, TQLRAT) HTRIDI,BISECT,TINVIT,HTRIBK HTRIDI,BISECT
8.8 8.9 9.7 i0 9.2 2.1 2.3 2.5 2.6 2.3 2.2+.25M 2 . ~ . 1 5 M 2.1+.11M 2.3+.09M 2.I+.07M 2.2+.16M 2 . ~ . I O M 2.1+.07M 2 . ~ . 0 5 M 2.1+.04M
147
4.1-21
TABLE 22 SUMMARY OF EXECUTION TIMES FOR ~IE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR COMPLEX GENERAL MATRICES MACHINE:
CDC 6600, FTN 4.3+P393 Compiler, OPT=I NASA LANGLEY RESEARCH CENTER
ORDER OF MATRIX SUBROUTINE
N=I0
N=20
N=40
Time Unit (Sec)
°009
.063
.54
N=60 1.8
CBAL CBABK2
.24
. i0
.04
.03
• 12
. 04
.01
.01
COMHES COMBAK
I °47
1 .60
1 .62
1 .64
CORTH CORTB
1.8 .88
1.6 .90
1.6 .84
1.6 .79
COMQR2 COMLR2
16 9.9
15 8.0
13 6.9
13 7.0
COMQR COF~R
7.4 5.5
5.9 3.9
4.5 2.8
4.3 2.8
CINVIT
3.8
2.8
2.2
2.1
CG (CBAL,CORTH,COMQR2,CBABK2)
18
17
14
14
CG (CBAL,CORTH,COMQR)
9.5
7.6
6.2
5.9
PATHS
CBAL,CORTH,COMQR,CINVIT, CORTB,CBABK2
9.4+.48M 7.6+.19M 6.2+.08M 5.9+.05M
148
4.1-22
TABLE 23 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR REAL GENERAL MATRICES MACHINE:
CDC 6600, FTN 4.3+P393 Compiler, OPT=I NASA LANGLEY RESEARCH CENTER
ORDER OF MATRIX SUBROUTINE
N--10
N=20
N=40
N=60
Time Unit (Sec)
.006
.032
.24
.77
.27
.17
.07
.05
-
.05
• 03
.02
ELMHES ELTRAN ELMBAK
1
1
1
• 18
°06
.04
.55
.58
.61
1 . 02 .61
ORTHE S ORTRAN ORTBAK
1.8 .91 i.I
2.0 .73 1.3
2.2 .85 1.3
2.2 .82 1.3
HQR2
13
14
14
12
HQR
6.9
6.7
6.2
4.8
INVIT
3.6
3.3
3.1
2.9
14
15
15
13
8.5
7.7
7.2
5.9
BALANC BALBAK
PATHS RG (BALANC,ELMHES,ELTRAN, HQR2,BALBAK) RG (BALANC,ELMHES,HQR) BALANC, E LMHE S, HQR, INVIT, ELMBAK, BALBAK
8.2+.41M 7.9+.20M 7.2+.09M 5.8+.06M
149
4.1-23
TABLE 24 SVMMARY OF EXECUTION TIMES FOR THE EiSPACK SUBROUTINES INCLUDED IN THE PATHS THAT REDUCE FULL MATRICES TO HEAL SYMMETRIC TRIDIAGONAL FORM MACHINE:
CDC 6600, FTN 4.3+P393 Compiler, OPT=I NASA LANGLEY RESEARCH CENTER
SUBROUTINE
N=I0
ORDER OF MATRIX N=20 N=40 N=60
Time Unit (Sec)
.006
,030
TREDI TRED2 TRED3 TRBAKI TRBAK3
1 1.6 1.2 1.2 1.2
1 1.8 1.5 1.4 1.5
i 2.0 1.7 1.6 1.8
1 2.0 1.8 1.7 1.7
HTRIDI HTRID3 HTRIBK HTRIB3
1.7 1.8 1.9 1.9
2.1 2.3 2.7 2.7
2.4 2.6 3.2 3.2
2.5 2.6 3.5 3.2
.03 .07 .05
FIGI FIGI2 BAKVEC TQL2 IMTQL2
3.6 3.8
3.8 4.0
TQLRAT TQLI IMTQLI
1.0 1.5 1.6
.58 .95 i.I
BISECT TRIDIB iMTQLV RATQR
15 14 1.5 3.6
TINVIT TSTURM
.19
.01 .02 .04 4.! 4.4
.58
.00 ,01 .02 4.1 4.7
.32 .55 .68
.25 .42 .51
9.2 9.1 1.2 2.8
5.5 5.5 .74 2.0
3.9 3.9 .53 1.5
.91 15
.67 9.7
.44 5.8
.32 4.3
5.5 2.0 I+I.7M I+I.5M
5.8 1.6 I+.56M ~.46M
6.1 1.4 I+.IgM I+.I4M
6.1 1.2 I+.IOM I+.06M
PATHS RS (TREDZ,TQL2) RS (TREDI,TQLRAT) TREDI,BISECT~TINVIT,TRBAKI TREDI,BISECT CH (HTRIDi,TQL2,HTRIBK) CH (HTRIDI,TQLRAT) HTRIDI,BISECT,TINVIT,HTRIBK HTRIDI~BISECT
7.2 8.8 9.9 i0 2.6 2.7 2.7 2.6 1.7+1.7M 2.1+.63M 2,4+.23M 2.5+.13M I. 7+1.5M 2. I+. 46M 2.4+. 14M 2.5+. 06M
150
4.1-24
TABLE 25 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR COMPLEX GENERAL MATRICES MACHINE: CDC 7600, Local Compiler NATIONAL CENTER FOR ATMOSPHERIC RESEARCH
ORDER OF MATRIX SUBROUTINE
N=I0
N--20
N=40
N=60
N=80
Time Unit (Sec)
.002
.015
.ii
.38
.89
CBAL CBABK2
-
. i0
.05
.03
.02
-
.05
.01
.01
.01
COMHES COMBAK
1 i
I .57
i .60
1 .61
1 .62
CORTH CORTB
2 1
2.3 i.i
2.3 i.i
2.3 I.i
2.3 i.i
COMQR2 COMLR2
15 i0
15 8.1
13 6.9
13 6.7
13 6.4
COMQR COMLR
7 6
5.8 3.9
4.7 2.8
4.4 2.5
4.3 2.3
CINVlT
4
3.0
2.3
2.2
2.1
18
17
16
15
15
9
8.0
7.1
6.7
6.6
PATHS CG (CBAL,CORTH,COMQR2,CBABK2) CG (CBAL,CORTH,COMQR) CBAL,CORTH,COMQR,CINVIT, CORTB,CBABK2
9+. 5M
151
8.2+. 21M 7. i+. 09M 6.8+. 05M 6.6+. 04M
4.1-25
TABLE 26 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR REAl, GENERAL MATRICES MACHINE: CDC 7600, Local Compiler NATIONAL CENTER FOR ATMOSPHERIC RESEARCH
ORDER OF MATRIX SUBROUTINE
N=I0
N=20
N=40
N=60
N=80
Time Unit (Sec)
• 001
.007
.050
.16
.38
.07 .02
.05 .01
.04 .01
i
BALANC BALBAK
-
-
-
-
ELMHES ELTRAN ELMBAK
1
i
1
1
-
-
.04
.02
.02
I
.55
.60
.60
,60
ORTHES ORTRAN ORTBAK
2 1 1
2.4 .81 1.3
2.5 .78 1.2
2.5 .78 1.2
2.5 .77 1,2
HQR2
18
16
15
14
14
HQR
i0
7.4
5.8
5.2
4.8
4
3.4
3.0
2.8
2.7
20
17
16
15
15
ii
8.6
6.9
6.3
5.8
INVIT
PATHS RG (BALANC, ELMHES, ELTRAN, HQR2, BALBAK) RG (BALANC, ELMHES ,HQR) BALANC~ELMHES,HQR, INVIT, ELMBAK~BALBAK
II+.5M
152
8.4+.20M 6.9+.09M 6.3+.06M 5.8+.04M
4.1-26 TABLE 27 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS THAT REDUCE FULL MATRICES TO REAL SYMMETRIC TRIDIAGONAL FORM MACHINE: CDC 7600, Local Compiler NATIONAL CENTER FOR ATMOSPHERIC RESEARCH
SUBROUTINE
N = I0
ORDER OF MATRIX N=20 N=40 N=60
Time Unit (Sec)
.001
.007
.040
.12
N=80 .28
TREDI TRED 2 TRED3 TRBAKI TRBAK3
i 2 2 I 2
1 1.7 1.8 1.3 1.6
i 1.9 2.8 1.5 2.7
I 2.0 3.2 1.5 3.0
1 2.0 3.4 1.6 3.2
HTRIDI HTRID3 HTRIBK HTRIB3
2 2 2 2
2.1 2.2 2.5 2.6
2.4 2.5 3.1 3.2
2.6 2.6 3.3 3.4
2.6 2.7 3.4 3.5
FIGI FIGI2 BAKVEC
-
.02 .03
TQL2 IMTQL2
3 4
3.4 3.5
TQLRAT TQLI IMTQLI
1
2 2
.69 1.0 1.2
BISECT TRIDIB IMTQLV RATQR
18 17 2 3
TINVIT TSTURM
1 18
3.6 3.8
.01 .01 .02 3.6 3.8
.00 .01 .01 3.5 3.8
.40 .65 .77
.28 .46 .55
.21 .36 .43
II Ii 1.3 2.7
7.0 6.6 .82 1.9
5.0 4.7 .58 1.5
3.9 3.6 .45 1.2
.62 ii
.42 7.2
.32 5.2
.33 4.1
5.1 1.6 i+. 65M i+. 56M
5.5 1.4 i+. 22M i+. 17M
5.6 1.3i+. 11M I+. 08M
5.5 1.2 i+. 07M i+. 05N
PATHS RS (TRED2,TQL2) RS (TREDI,TQLRAT) TREDI~BISECT,TINVIT,TRBAKI TREDI,BISECT
5 2 1+2.0M i+i. 8M
CH (HTRIDI,TQL2,HTRIBK) CH (HTRIDI, TQLRAT) HTRIDI~BISECT,TINVIT,HTRIBK HTRIDI~BISECT
8 4 2+2. IM 2+i .8M
153
7.9 9.1 9.4 9.6 2.8 2.8 2.8 2.8 2.1+.71M 2.4+.26M 2.6+.14M 2.6+,09M 2.1+.56M 2.4+.17M 2.6+.08M 2.6+.05M
4.1-27
TABLE 28 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR COMPLEX GENERAL MATRICES MACHINE:
CDC 6400, FTN 3.0 Compiler, OPT=2 NORTHWESTERN UNIVERSITY
ORDER OF MATRIX SUBROUTINE
N=I0
N=20
Time Unit (Sec)
.036
.29
19 .08
.07 .03
~03 .01
.02 .01
i .51
1 .54
1 .57
1 .58
CBAL CBABK2 COMHES COMBAK
o
N=40
N=60
2.2
7.5
CORTH CORTB
2.5 1.2
2.4 1.2
2.4 1.2
2.4 1.2
COMQR2 COMLR2
18 9.7
16 7.9
15 6.5
14 6.5
COMQR COMLR
8~.3 5.3
6.2 3.5
5.2 2.5
4.9 2.3
CINVIT
4.1
2.8
2.2
2.0
CG (CBAL,CORTH,COMQR2,CBABK2)
21
19
17
17
CG (CBAL,CORTH,COMQR)
ii
8.7
7.6
7.3
PATHS
CBAL,CORTH,COMQR,CINVIT, CORTB,CBABK2
II+.54M
154
8.7+.20M 7.6+.09M 7.3+.05M
4.1-28
TABLE 29 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES I N C L ~ E D IN THE PATHS FOR REAL GENERAL MATRICES MACHINE:
CDC 6400, FTN 3.0 Compiler, OPT=2 NORTHWESTERN UNIVERSITY
ORDER OF MATRIX SUBROUTINE
N=IO
N=20
N=40
Time Unit (Sec)
.016
.ii
.83
BALANC BALBAK
.31
.14 .05
.06 .02
.04 .01
.03 .01
ELMHES ELTRAN ELMBAK
1
1 .06 .54
1 .03 .57
1 .02 .57
1
15 •53
ORTHES ORTRAN ORTBAK
2.7 .83 1.3
2.8 .77 1.2
2.9 .77 1.2
3.0 .77 1.2
3.0 .77 1.2
HQR2
17
15
14
13
13
HQR
i0
7.2
5.6
5.1
4.7
INVIT
4.2
3.2
2.8
2.6
2.5
RG (BALANC, EI~MHES, ELTRAN, HQR2, BALBAK) RG (BALANC,ELMHES ,HQR)
19
16
15
14
14
Ii
8.3
6.7
6.1
5.7
BALANC, ELMHES, HQR, INVIT, ELMBAK, BALBAK
114-.48M
• 15
•
N=60
N=80
2.7
6.3
.01
.58
PATHS
155
8 .3+. I£M 6.7+. 08M 6. I+. 05M 5.7+. 04M
4.1-29 TABLE 30 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS THAT REDUCE FULL MATRICES TO REAL SYMMETRIC TRIDIAGONAL FORM MACHINE:
CDC 6400, FTN 3.0 Compiler, OPT=2 NORTHWESTERN UNIVERSITY
SUBROUTINE
N=I0
Time Unit (Sec)
•019
ORDER OF MATRIX N=20 N=40 N=60 .ii
.69
2.1
N=80 4.9
TRED 1 TRED2 TILED3 TRBAKI TRBAK3
I
1
i
i
1
1.7 1.2 I.i I.i
1.8 1.3 1.3 1.3
1.9 1.5 1.5 1.5
2.0 1.6 1.5 1.6
2.0 1.6 1.5 1.7
HTRIDI HTRID3 HTRIBK HTRIB3
2.4 2.4 2.6 2.6
2.7 2.7 3.4 3.4
3.0 2.9 4.0 4.0
3.1 3.0 4.3 4.2
3.2 3.1 4.5 4.4
FiGI FIGI2 BAKVEC
.07 .12 .ii
.03 .05 °06
TQL2 !MTQL2
4.2 4.4
4.5 4.7
TQLRAT TQLI !MTQLI
I.i 1.7 2.0
°66 1o2 1.3
BISECT TRIDIB IMTQLV RATQR
9.8 i0 2.0 3.1
TINVIT TSTURM
.01 .02 °03 4.7 4.9
.00 .01 .02 4.7 4.9
.00 °01 .02 4.7 4.9
.36 ~68 .77
.24 .48 .54
.19 .37 .41
6.2 6°2 1.3 2.4
3.5 3.6 °79 1.6
2.5 2.5 .56 1.2
1.9 1.9 .43 .97
.94 II
.61 6.7
.37 3.9
.28 2.8
.31 2.2
5.9 2.1 i+i .2M I+. 98M
6.3 1.7 i+. 40M i+. 31M
6.6 1.4 I+. 13M i+. 09M
6.7 1.2 I+.07M i+. 04M
6.7 1.2 I+.05M i+. 02M
PATHS RS (TRED2,TQL2) RS (TREDI,TQLRAT) TREDI,BISECT,TINVIT,TRBAKI TREDI,BISECT CH (HTRIDI,TQL2,HTRIBK) CH (HTRIDI,TQLRAT) HTRIDI~BISECT,TiNVIT~HTRIBK HTRIDI~BISECT
9.2 i0 ii 12 12 3.5 3.4 3.4 3.4 3.4 2o4+1.3M 2.7+.51M 3.0+.20M 3.1+.12M 3.2+.08M 2.4+.98M 2.7+.31M 3.0+.09M 3.1+.04M 3.2+°02M
156
4.1-30
TABLE 31 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR COMPLEX GENERAL MATRICES MACHINE:
CDC 6400/6500, FUN Compiler PURDUE UNIVERSITY
ORDER OF MATRIX SUBROUTINE
N=IO
N=20
N=40
N=60
N=80
Time Unit (Sec)
.045
.35
2.7
9.2
22
CBAL CBABK2
• 13
.05 .03
.02 .01
.01
°01
•07
.01
.01
COMHES COMBAK
1
1
i
1
1
•5 8
.62
.64
•6 5
.66
CORTH CORTB
2.7 1.4
2.7 1.3
2.7 1.3
2.7 1.3
2.7 1.3
COMQR2 COMLR2
20 ii
18 8.7
16 7.4
16 7.1
16 6.7
COMQR COMLR
9.5 5.7
7.4 3.8
6.4 2.7
6.2 2.4
5.8 2.2
CINVIT
3.9
2.9
2.4
2.2
2.2
CG (CBAL, CORTH,COMQR2,CBABK2)
23
20
19
19
18
CG (CBAL,CORTH,COMQR)
12
i0
9.1
8.9
8.5
12+.54M
IO+.21M
PATHS
CBAL,CORTH,COMQR,CINVlT, CORTB,CBABK2
157
9. I+.09M 8.9+.06M 8.5+.04M
4.1-31
TABLE 32 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR REAL GENERAL MATR!CES MACHINE:
CDC 6400/6500, FUN Compiler PUF~UE UNIVERSITY
ORDER OF MATRIX SUBROUTINE
N=I0
N=20
N=40
Time Unit (Sec)
.018
.12
.90
•25 14
• I0 .06
.05 .03
.03 .02
.02 .01
EL~ES ELTRAN EL~b~K
i 17 .55
I .07 .60
1 ,03 .61
i ,02 .62
1 .02 ,63
ORTHES ORTRAN ORTBAK
2.6 .91 1.4
2.7 .83 1.3
2.7 .81 1.3
2,8 .81 1.3
2.8 ,81 1.2
HQR2
33
31
30
30
29
HQR
18
14
12
II
!0
INVIT
5.1
4.9
4.6
4.6
4.6
35
32
31
31
30
19
15
13
12
ii
BALANC BALBAK
•
N=60
N=80
3.0
6.9
PATHS RG (BALANC,ELMIIES,ELTRAN, HQR2,BALBAK) RG (BALANC,ELMHES,HQR) BALANC,ELMHES,HQR, INViT, ELMBAK, BALBAK
19+.58M
158
15+.28M
13+.13M
12+.09M
II+.06M
4.1-32 TABLE 33 SLrMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS THAT REDUCE FULL MATRICES TO REAL SY~METRIC TRIDIAGONAL FORM MACHINE:
CDC 6400/6500, FUN Compiler PURDUE UNIVERSITY
SUBROUTINE
N= i0
Time Unit (Sec)
.024
ORDER OF MATRIX N=20 N=40 N=60 .13
.81
N=80
2.5
5.6
TRED I TRED2 TRED3 TRBAKI TRBAK3
1 1.7 .92 I.I i.i
1 1.8 I.i 1.3 1.4
I 1.9 1.2 1.5 1.6
I 2.0 1.2 1.6 1.7
I 2.0 1.2 1.6 1.7
HTRIDI HTRID3 HTRIBK HTRIB3
2.4 2.6 2.8 3.0
2.8 3.1 3.7 4.0
3.2 3.5 4,5 4.9
3.4 3.7 4.9 5.3
3.5 3.9 5.1 5.5
FIGI FIGI2 BAKVEC
•06
.02
.O l
.0 0
.O 0
. Ii
.05 .05
.02 .03
.01 .02
.01 .02
.09
TQL2 IMTQL2
3.8
4.2
4.4
4.6
4,6
4.0
4.2
4.5
4.5
4.6
TQLRAT TQLI IMTQLI
•83 1.4 1.5
.51 .92 1.0
BISECT TRIDIB IMTQLV RATQR
9.4 9ol 1.7 2.9
TINViT TSTIYRM
.28 .56 .62
.19 .39 .44
.15 .30 .34
6.1 5.9 i.I 2,3
3.6 3.5 .70 1,6
2.5 2.5 .50 1.2
2.0 1.9 .39 .98
.97 i0
.68 6.7
.43 4.0
.33 2.9
.37 2.3
5.4 1.9 i+i. 2M i+. 94M
6,0 1.5 i+. 40M i+. 30M
6.4 1,3 I+. 14M i+. 09M
6.6 1.2 i+. 07M I+. 04M
6.6 I.i i+. 05M i+. 02M
PATHS RS (TRED2,TQL2) RS (TREDI,TQLRAT) TREDI,BISECT,TINVIT,TRBAKI TREDI,BISECT CH (HTRIDI,TQL2,HTRIBK) CH (HTRIDI,IQLRAT) HTRIDI,BISECT,TINVIT,HTRIBK HTRIDI~BISECT
9.0 i0 12 13 13 3.3 3.3 3.5 3.6 3.6 2.4+1.3M 2.8+.52M 3.2+.21M 3.4+.13M 3.5+.09M 2.4+.94M 2,8+.30M 3.2+.09M 3,4+.04M 3.5+.02M
159
4.1-33
TABLE 34 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR COMPLEX GENERAL MATRICES MACHINE: CDC 6600/6400, RUN Compiler THE UNIVERSITY OF TEXAS
ORDER OF MATRIX SUBROUTINE
N=I0
N=20
N=40
Time Unit (See)
.015
.084
.69
~17
.05 .02
I .64
i .64
CBAL CBABK2 COlliES COMBAK
-
-
1 -
-
CORTH CORTB
2.1 I.i
3.0 1.4
2.9 1.3
COMQR2 COMLR2
17 9.5
19 9.8
17 7.8
COMQR COMLR
8.9 5.5
8.9 4.6
7.4 3.1
CINVIT
4.2
3.9
2.9
CG (CBAL,CORTR,COMQR2,CBABK2)
19
22
20
CG (CBAL,CORTH,CO~R)
12
12
i0
19+.53M
12+.26M
10+.IIM
PATHS
CBAL,CORTH,COMQR, CINVIT, CORTB~CBABK2
160
4.1-34
TABLE 35 SITMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR REAL GENERAL MATRICES MACHINE: CDC 6600/6400, RUN Compiler THE UNIVERSITY OF TEXAS
ORDER OF MATRIX SUBROUTINE
N=20
N=40
N=60
Time Unit (Sec)
.045
.24
.78
BALANC BALBAK
-
ELMHES ELTRAN ELMBAK
.06 -
i
1
-
-
.06
N = 8 0
1.8
.02
.05 .02 1 .03 .73
.36
.73
1 .04 .70
ORTHES ORTRAN ORTBAK
2.5 .73 .71
3.5 .79 1.3
3.5 .77 1.2
3.6 .77 1.2
HQR2
28
45
36
36
HQR
12
18
13
13
INVIT
4.7
6.0
6.2
6.4
29
46
37
37
13
19
14
14
13+.25M
19+.17M
14+.12M
14+.09M
PATHS RG (BALANC, ELMHES, ELTRAN, HQR2, BALBAK) RG (BALANC, ELMHES, HQR) B~C,
EI~IHES, HQR, INVIT, ELMBAK, BALBAK
161
4.1-35 TABLE 36 SUMMARY OF EXECUTION TIMES FOR THE EiSPACK SUBROUTINES ~ C L U D E D IN THE PATHS THAT REDUCE FULL MATRICES TO HEAL SYMMETRIC TRIDIAGONAL FORM MACHINE: CDC 6600/6400, RUN Compiler THE UNIVERSITY OF TEXAS
SUBROUTINE
ORDER OF MATRIX N=20 N=40 N=60
N=80
Time Unit (Sec)
°033
1.4
.21
.63
TRED i TRED2 TRED3 TRBAKI TRBA-K3
1 1.9 1.8 1.7 2.0
1 2.1 1.6 1.8 2.1
i 2.1 1.7 1.8 2.2
1 2.1 1.7 1.9 2.3
HTRIDI HTRID3 HTRIBK HTRIB3
2.9 3.5 3.7 4.2
3.1 3.5 4.5 4.9
3.3 3.7 4.8 5.3
3.4 3.9 5.1 5.6
FIGi FiGI2 BAKVEC
-
-
.02
°02
-
-
-
TQL2 IMTQL2
4.4 4.6
4.3 4.8
4.2 4.8
TQLRAT TQLI IMTQL 1
.90 1.2 1.7
BISECT TRIDIB IMTQLV RATQR
12 12 2.3 3.6
TINVIT TSTURM
i.i 13
.39 .84 .92
~02
4.2 4.5
.29 .60 .70
.21 °44 .53
6.8 6.8 I.I 2.5
4.9 4.8 °79 1.9
3.8 3.8 .59 1.5
.64 7.6
.51 5.5
.47 4.3
6.3 1.5 i+. 23M i+. 17M
6.3 1.3 I+. 12M i+. 08M
6.3 1.2 l+. 08M i+. 05M
PATHS 6.5 2.0 i+. 73M i+. 59M
RS (TRED2,TQL2) RS (TREDI, TQLRAT) TREDIgBISECT~TINV!T,T~AKI TREDI,BISECT
Ii 12 12 13 3.8 3.6 3.5 3.6 2.9+.83M 3.1+.30M 3.3+.17M 3.4+.12M 2.9+.59M 3.1+.17M 3.3+.08M 3.4+.05M
CH (HTRIDI,TQL2,HTRIBK) CH (HTRIDI,TQLRAT) HTRIDI,BISECT,T!NVlT,HTRIBK HTRIDI,BISECT
162
4.1-36
TABLE 37 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR COMPLEX GENERAL MATRICES MACHINE:
Honeywell 6070 Fortran-Y(SR-F) Optimized BELL LABORATORIES
ORDER OF MATRIX SUBROUTINE
N=I0
N=20
Time Unit (Sec)
.041
.31
CBAL CBABK2
.16 .07
.07 .03
.03 .01
.'02 .01
.02 .01
COMHES COMBAK
i .46
i .54
i .56
1 .55
1 .55
N=40
N=60
N=80
2.5
8.6
20
CORTH CORTB
2.4 I.i
2.5 i.i
2.6 1.2
2.5 I.i
2.5 i.I
COMQR2 COMLR2
14 8.2
13 6.7
ii 5.7
U 5.7
ii 5.4
COMQR COMLR
6.2 4.5
4.7 2.9
3.7 2.1
3.5 2.0
3.4 1.8
CINVIT
4.3
3.1
2.4
2,3
2.2
CG (CBAL,CORTH,COMQR2,CBABK2)
17
15
14
14
13
CG (CBAL,CORTH,COMQR)
8.8
7.3
6.3
6.0
6.0
PATHS
CBAL,CORTH,COMQR, CINVIT, CORTB,CBABK2
8.7+.54M 7.3+.22M 6.3+.09M 6.1+.06M 5.9+.04M
163
4.1-37
TABLE 38 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR REAL GENERAL MATRICES MACHINE:
Honeywell 6070 Fortran-Y(SR-F) Optimized BELL LABORATORIES
ORDER OF MATRIX SUBROUTINE
N=I0
N=20
N=40
Time Unit (Sac)
.009
.070
.54
BALANC BALBAK
.32 . 15
.12 .06
.06 °03
.04 .02
.03
ELMHES ELTRAN ELMBAK
i
1 .07 .54
1 .03 .56
i .02 .56
i
16 ~52
0RTHES ORTRAN ORTBAK
2.9 .86 1.2
3.0 .81 1.2
3.1 .80 1.2
3.1 .79 1.2
3.1 .79 I~2
HQR2
15
12
Ii
i0
i0
HQR
8.6
6.1
4.3
3.9
3.5
INVlT
4.6
3.6
3.0
2.7
2.6
16
14
12
ii
II
i0
7.2
5.4
5.0
4.5
.
N=60
N=80
1.8
4.3
.01
.01
.56
PATHS RG (BALANC, ELMI~ S, ELTRAN, HQR2, BALBAK) RG (BALANC,ELMHES ,HQR) BALANC, ELMHES, HQR, INVIT, ELMBAK ~BALBAK
I0+.53M
7.2+.21M 5.4+.09M 5.0+.05M 4.5+.04M
4.1-38 TABLE 39 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS THAT REDUCE FULL MATRICES TO HEAL SYMMETRIC TRIDIAGONAL FORM MACHINE:
Honeywell 6070 Fortran-Y(SR-F) Optimized BELL LABORATORIES
SUBROUTINE
N=IO
ORDER OF MATRIX N=20 N=40 N=60
N=80
Time Unit (Sec)
.013
.078
1.6
3.6
TREDI TRED2 TRED3 TRBAKI TRBAK3
1 1.4 I.i .87 1.0
1 1.8 1.2 i.i 1.3
1 1.9 1.2 1.3 1.5
1 2.0 1.2 1.4 1.6
1 2.0 1.3 1.4 1.6
HTRIDI HTRID3 HTRIBK HTRIB3
2.6 2.7 2.9 2.9
3.0 3.1 3.8 3.8
3.3 3.5 4.5 4.5
3.4 3.6 4.7 4.8
3.5 3.7 4.9 4.9
FIGI FIGI2 BAKVEC
.i0 .14 .12
.03 .05 .06
TQL2 IMTQL2
4.1 4.2
4.4 4.6
TQLRAT TQLI IMTQLI
I.i 1.7 1.8
.60 i.I 1.2
BISECT TRIDIB
IMTQLV RATQR
5.2 5.3 1.9 3.0
TINVIT TSTURM
1.0 6.2
.53
.01 .02 .03 4.2 4.6
.00 .01 .02 4.3 4.6
.00 .01 .02 4.2 4.6
.29 .59 .65
.21 .42 .46
.15 .32 .34
3.1 3.2 i.i 2.1
1.6 1.6 .65 1.4
i.i I.i .45 1.0
.84 .81 .35 .82
.67 3.9
.39 2.0
.31 1.4
.33 1.2
6.4 1.6 i+. 24M i+. 15M
6.0 1.3 i+. 08M i+. 04M
6.4 1.2 I+. 05M i+. 02M
6.2 i.i i+. 03M i+. OIM
PATHS RS (TRED2,TQL2) RS (TREDI,TQLRAT) TREDI,BISECT,TINVIT,TRBAKI TREDI,BISECT CH (HTRIDI,TQL2,HTRIBK) CH (HTRIDI,TQLRAT) HTRIDI,BISECT,TINVIT,HTRIBK HTRIDI,BISECT
5.5 2.0 i+. 7 IM I+. 52M
9.9 ii 12 12 13 3.7 3.6 3.6 3.6 3.6 2.6+.91M 3.0+.38M 3.3+.16M 3.4+.IOM 3.5+.08M 2.6+.52M 3.Ot.15M 3.3+.04M 3.4+.02M 3.5+.01M
165
4.1-39
TABLE 40 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR COMPLEX GENERAL MATRICES MACHINE:
Univac iii0, Fortran V(9) Compiler THE UNIVERSITY OF WISCONSIN
ORDER OF MATRIX SUBROUTINE
N=I0
N=20
Time Unit (Sec)
°025
.18
CBAL CBABK2
16 .08
.08 .03
.04 .01
.02 .01
.02 ~01
COMHES COMBAK
1 .48
1 .53
1 .57
1 .58
1 °58
.
N=40
N=60
N=80
1.3
4.4
I0
CORTH CORTB
2.3 1.0
2.6 I.i
2.8 i.i
2.8 1.2
2.9 1.2
COMQR2 COMLR2
13 9.4
12 7.5
ii 6.3
ii 6.3
II 6.1
COMQR COMLR
6.2 5.5
4.8 3.6
3.9 2.5
3.9 2.4
3.6 2.2
CINVIT
4.7
3.4
2.7
2.4
2,3
CG (CBAL,CORTH, COMQR2,CBABK2)
16
15
14
14
14
CG (CBAL,CORTH,COMQR)
8.7
7.4
6.7
6.7
6.5
PATHS
CBAL,CORTH,COMQR,CINVIT, CORTB~CBABK2
8.7+.58M 7.4+.23M 6.7+.IOM 6.7+.06M 6.6+.04M
166
4.1-40
TABLE 41 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR REAL GENERAL MATRICES MACHINE:
Univac IIi0, Fortran V(9) Compiler THE UNIVERSITY OF WISCONSIN
ORDER OF MATRIX SUBROUTINE
N=I0
N=20
N=40
Time Unit (Sec)
.009
.062
.45
BALANC BALBAK
.39 .Ii
.17 .05
.08 .02
.05 .02
.04 .01
ELMI{ES ELTRAN ELM~AK
1 .16 .54
i .08 .57
1 .03 .58
1 .02 .59
1 .02 .59
ORTHES ORTRAN ORTBAK
3.2 .72 1.1
3.6 .74 1.1
3.8 .76 1.2
4.0 .77 1.2
4.0 .78 1.2
HQR2
15
13
Ii
ii
ii
HQR
8.5
6.3
4.7
4.3
3.9
INVIT
5.6
4.6
4.0
3.8
3.7
L6
14
13
12
12
9.9
7.5
5.8
5.4
4.9
N=60
N=80
1.5
3.4
PATHS RG (BALANC, ELMHES, ELTRAN, HQR2, BALBAK) RG (BALANC, ELMHES, HQR) BALANC, ELMHES, HQR, INVIT, ELMBAK, BALBAK
9.9+.63M 7.5+.26M 5.8+.12M 5.4+.07M 4.9+.05M
167
4.1-41 TABLE 42 S~RY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS THAT REDUCE FULL MATRICES TO REAL SYMMETRIC TRIDIAGONAL FORM MACHINE:
Un±vac Iii0, Fortran V(9) Compiler THE UNIVERSITY OF WISCONSIN
SUBROUTINE
N=I0
ORDER OF MATRIX N=20 N=40 N=60
N=80
Time Unit (Sec)
.012
.065
1.2
2.7
TRED 1 TRED2 TRED3 TRBAKI TRBAK3
! 1.5 1.3 .81 1.4
1 1.7 1.7 I.I 2.0
i 1.9 2.0 1.3 2.5
1 1.9 2.2 1.4 2.7
1 2.0 2.3 1.5 2.9
HTRIDI HTRID3 HTRIBK HTRIB3
2.3 2.1 2.2 2.2
2.5 2.4 3.0 3.1
2.7 2.7 3.8 3.8
2.9 2.8 4.1 4.1
2.9 2.9 4.3 4.3
FIGI FIGI2 BAKVEC
,08 ,09 .08
.02 ,04 °05
TQL2 IMTQL2
3.4 3.6
3.8 4.0
TQLRAT TQLI IMTQLI
.99 1.4 1.5
.63 .96 1.0
BISECT TRIDIB IMTQLV RATQR
6.3 6.2 1.6 3.3
TINVIT TSTURM
1.2 7.4
.40
.01 ,02 ,03 4.0 4.4
,00 .01 .02 4.1 4.4
.00 .01 .01 4.2 4.3
.36 .58 .64
.26 .41 .45
.19 .31 ,34
3.9 3.8 i. i 2.7
2.2 2.2 .67 1.8
1.6 1.5 .47 1.4
1.2 I.I .35 1.2
.82 4.6
.51 2.7
.39 1.9
.38 !.6
5.5 1.6 i+. 29M i+. 19M
5.8 1.4 i+. IOM i+. 06M
6.0 1.2 i+. 06M I+. 03M
6.2 1.2 i+. 04M i+. OIM
PATHS RS (TRED2,TQL2) RS (TREDI,TQLRAT) TREDI,BISECT,TINVIT,TRBAKI TREDI,BISECT CH (HTRIDI,TQL2,HTRIBK) CH (HTRIDI,TQLRAT) HTRIDI,BISECT,TINVIT,HTRIBK HTRIDI,BISECT
4.9 2.0 I+. 83M I+. 63M
8.1 9.3 Ii Ii Ii 3.3 3.1 3.1 3.1 3.1 2.3+.97M 2.5+.39M 2.7+.16M 2.9+.IOM 2.9+,07M 2.3+.63M 2.5+,19M 2.7+.06M 2.9+.03M 2.9+.01M
168
4.1-42
TABLE 43 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR COMPLEX GENERAL MATRICES MACHINE:
DEC PDP-10, F40 Compiler YALE UNIVERSITY
ORDER OF MATRIX SUBROUTINE
N=I0 .29
Time Unit (Sec)
N=20
N=30
N=40
2.4
8.3
20
CBAL CBABK2
.16 .05
.07 .03
.05 .01
.04 .01
COMHES COMBAK
i •57
1 .57
i .58
1 .59
CORTH CORTB
2.0 I.I
1.9 I.i
2.0 I.I
2.0 i.i
COMQR2 COMLR2
13 8.8
ii 7.6
ii 7.2
ii 6.7
COMQR COMLR
5.1 4.3
3.7 3.1
3.4 2.6
3.2 2.3
CINVlT
3.4
2.7
2.6
2.5
CG (CBAL,CORTH,COMQR2,CBABK2)
15
13
13
13
CG (CBAL,CORTH,COMQR)
7.2
5.7
5.4
5.2
PATHS
CBAL,CORTH,COMQR,CINVIT, CORTB,CBABK2
7.2+.46M 5.7+.19M 5.4+.12M 5.2+.09M
169
4.1-43
TABLE 44 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR REAL GENERAL MATRICES MACHINE:
DEC PDP-10, F40 Compiler YALE UNIVERSITY
ORDER OF MATRIX SUBROUTINE
N=I0
N=20
.i0
.80
BALA_NC BALBAK
~27 .12
. 12 °04
,08 .03
.06 .02
ELegIES ELTRAN EI/iBAK
I ,21 °54
I .08 ,58
1 ,06 ,59
i .04 .59
ORTHES ORTRAN ORTBAK
1.8 .75 i.i
1.9 .73 i.i
1.9 .73 i.i
1.9 .72 I.i
HQR2
12
ii
9.9
9.7
HQR
6.7
5.0
4.1
3.8
INVIT
3.5
2.9
2.7
2.6
14
12
ii
II
7.9
6.2
5.2
4.9
Time Unit (Sec)
N=30
N=40
2.7
6°2
PATHS RG (BALANC~ELMHES~ELTRAN, HQR2,BALBAK) RG (BALANC,ELMHES,HQR) BALANC, ELMIIES, HQR, INVIT, EI2LBAK, BALBAK
8.0+.42M 6.2+.17M 5.2+.IIM 4.9+.08M
170
4.1-44 TABLE 45 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS THAT REDUCE FULL MATRICES TO REAL SYMMETRIC TRIDIAGONAL FORM MACHINE:
DEC PDP-10, F40 Compiler YALE UNIVERSITY
SUBROUTINE
N=I0
Time Unit (Sec)
ORDER OF MATRIX N=20 N=30 N=40
.i0
.64
TREDI TRED2 TRED3 TRBAKI TRBAK3
1 1.8 .85 1.2 i.i
HTRIDI HTRID3 HTRIBK HTRIB3
3.2 2.6 4.4 4.4
FIGi FIGI2 BAKVEC
.09 .09 .12
TQL2 IMTQL2
3.7 3.9
TQLRAT TQLI IMTQLI
.73 1.0 i.i
BISECT TRIDIB IMTQLV RATQR TINVIT TSTURM
2.0
4.7
1 2.0 .87 1.5 1.4
i 2.0 .88 1.6 1.5
1 2.1 .88 1.7 1.5
3.6 3.1 5.5 5.5
3.7 3.2 5.9 5.9
3.8 3.3 6.2 6.2
.01 .05 .07 4.2 4.5
.01 .03 .04 4.1 4.2
.01 .02 .03 4.0 4.3
.42 .65 .75
.26 .42 .48
.20 .33 .39
3.9 3.9 1.2 2.1
2.1 2.1 .79 1.4
1.4 1.3 .51 i.i
1.0 .99 .41 .87
1.2 5.0
.70 2.8
.50 1.8
.39 1.4
6.2 1.4 I+. 22M 1+. IOM
6.2 1.3 i+. 12M I+. 05M
6.1 1.2 i+. 08M i+. 03M
PATHS RS (TRED2,TQL2) RS (TREDI,TQLRAT) TREDI,BISECT~TINVIT,TRBAKI TREDI~BISECT CH (HTRIDI,TQL2,HTRIBK) CH (HTRIDI,TQLRAT) HTRIDI~BISECT~TINVIT~HTRIBK HTRIDI,BISECT
5.5 1.8 i+. 62M i+. 39M
12 13 14 14 3.9 4.0 4.0 4.0 3.2+.94M 3.6+.41M 3.7+.26M 3.8+.19M 3.2+.39M 3.6+.IOM 3.7+.05M 3.8+.03M
171
4.1-45
TABLE 46 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR COMPLEX GENERAL MATRICES MACHINE:
Amdahl 470V/6, Fortran H, OPT=2 UNIVERSITY OF MICHIGAN
ORDER OF MATRIX SUBROUTINE
N=I0
N=20
N=40
Time Unit (Sec)
.005
.040
.33
CBAL CBABK2
.12 .07
.05 .03
.02 .02
.01 .01
.01 .01
COMHES COMBAK
1 .46
1 .50
i .54
I .58
i .60
N=60
N=80
i. 1
2.8
CORTH CORTB
2.4 1.3
2.3 1.3
2.2 1.2
2.2 1.2
2.1 i.i
COMQR2 COMLR2
18 9.4
15 8.1
13 6.7
13 6.5
12 6.2
COMQR COMLR
8.0 5.1
5.7 3.4
4.5 2.4
4.2 2.2
3.9 2.0
CINVIT
4.8
3.3
2.5
2.2
2.3
CG (CBAL,CORTH,COMQR2,CBABK2)
20
18
16
15
14
CG (CBAL,CORTH,COMQR)
ii
8.1
6.7
6.4
6.0
PATHS
CBAL,CORTH,COMQR,CINVIT, CORTB,CBABK2
II+.62M
172
8.1+.23M 6.7+.09M 6.4+.06M 6.0+.04M
4.1-46
TABLE 47 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS FOR REAL GENERAL MATRICES MACHINE:
Amdahl 470~/6, Fortran H, OPT=2 UNIVERSITY OF MICHIGAN
ORDER OF MATRIX SUBROUTINE
N=I0
N=20
N=40
N=60
N=80
Time Unit (Sec)
.002
.014
.12
.41
.98
BALANC BALBAK
.24 .12
.09 .05
.04 .02
.02 .02
.02 .01
ELMHES ELTRAN ELMBAK
1 .16 .54
1 .07 .57
1 .03 .57
i .02 .58
I .02 .59
ORTHES ORTRAN ORTBAK
2.4 .81 1.2
2.2 .71 I.i
2.1 .65 .98
2.0 .62 .93
1.9 .60 .90
HQR2
20
16
12
12
II
HQR
12
7.7
5.2
4.5
3.9
INVlT
4.5
3.4
2.7
2.4
2.3
RG (BALANC, ELMHES, ELTRAN, HQR2, BALBAK) RG (BALANC, ELMHES, HQR)
21
17
14
13
12
13
8.8
6.2
5.5
4.9
BALANC, ELMHES, HQR, INVIT, ELMBAK~ BALBAK
13+.51M
PATHS
173
8.8+.20M 6.3+.08M 5.5+.05M 5.0+.04M
4.1-47 TABLE 48 SUMMARY OF EXECUTION TIMES FOR THE EISPACK SUBROUTINES INCLUDED IN THE PATHS THAT REDUCE FULL MATRICES TO REAL SYMMETRIC TRIDIAGONAL FORM MACHINE:
Amdahl 470V/6, Fortran H, OPT=2 UNIVERSITY OF MICHIGAN
SUBROUTINE
N=IO
ORDER OF MATRIX N=20 N=40 N=60
Time Unit (Sec)
.002
.013
.090
TREDI TRED2 TRED3 TRBAKI TRBAK3
i 1.6 .99 1.2 1.0
1 1.8 .98 1.4 1.2
HTRIDI HTRID3 HTRIBK HTRIB3
2.7 2.6 3.3 3.5
3.1 3.1 4.4 4.6
FIGI FiGI2 BAKVEC
•09 .15 .I0
.03 ,06 .06
TQL2 IMTQL2
4.9 5.0
5.3 5.2
TQLRAT TQLI IMTQLI
1.4 2.3 2.3
.81 1.5 1.5
BISECT TRIDIB IMTQLV RATQR
ii Ii 2.4 3.4
TINVIT TSTURM
1.0 12
N=80
,29
°70
i 2.0 1.0 1.6 1.4
1 2.0 .98 1.6 1.4
i 2.0 .96 1.6 1.4
3.4 3.4 5.1 5.3
3.6 3.6 5.4 5.5
3.7 3.6 5.5 5.5
.01 .03 .03 5.1 5.3
.00 .02 .02 5.0 5.0
.00 .01 .02 4.6 4.8
.42 .86 .88
.27 .57 .58
.19 .42 .43
6.8 7.0 1.6 2.6
3.7 3.8 .89 1.7
2.5 2.6 .59 1.2
1.8 1.9 .43 .93
.67 7.5
.40 4.2
.29 2.9
.30 2.2
7.1 1.8 I+. 44M I+ .34M
7.1 1.4 I+. 14M I+. 09M
7.0 1.3 i+. 07M i+. 04M
6.7 1.2 I+. 05M I+ .02M
PATHS RS (TRED2,TQL2) RS (TREDI,TQLRAT) TREDI,BISECT,TINVIT,TRBAKI TREDI,BISECT CH (HTRIDI,TQL2,HTRIBK) CH (HTRIDI,TQLRAT) HTRIDI,BISECT,TINVIT,HTRIBK HTRIDI,BISECT
6.5 2.4 I+i. 3M I+ i. IM
ii 12 13 14 14 4.2 3.9 3.8 3.9 3.9 2.7+1.5M 3.1+.59M 3.4+.23M 3.6+.14M 3.7+.IOM 2.7+I.IM 3.1+.34M 3.4+.09M 3.6+.04M 3.7+.02M
174
4.1-48 TABLE 49 EXECUTION TIMES FOR SELECTED EISPACK DRIVER SUBROUTINES OVER VARIOUS COMPUTER SYSTEMS MEASVRED ON MATRICES OF ORDER 40 BOTH WITH EIGENVECTOR~ COMPUTED (I) AND WITHOUT (0)
MACHINE Time Unit (Sec)
CG(1) CG(O) RG(1) RG(O) RS(1) RS(O) CH(1)CH(~) .77
.66
.31
.22
i
i
1
i
1
IBM 360/75 (UNIVERSITY OF ILLINOIS)
16
15
ii
Ii
IBM 370/168 (UNIVERSITY OF MICHIGAN)
5.8
5.2
3.9
IBM 370/165 (THE UNIVERSITY OF TORONTO)
3.5
3.2
IBM 370/195 (ARGONNE NATIONAL LABORATORY)
BURROUGHS 6700 (UNIVERSITY OF CALIFORNIA, SAN DIEGO) CDC 6600 (KIRTLAND AIR FORCE BASE)
1.7
118
108
.44
.14
1
i
1
15
12
13
12
3.7
5.6
3.9
5.0
4.5
2.9
2.6
3.3
2.9
3.2
2.9
95
92
125
.055
82
122
i00
5.0
5.3
4.9
4.9
5.5
5.0
3.7
3.0
CDC 6600 (NASA LANGLEY RESEARCH CENTER)
4.5
4.3
5.5
5.6
5.3
5.0
4.2
3.8
CDC 7600 (NATIONAL CENTER FOR ATMOSPHERIC RESEARCH) CDC 6400 (NORTHWESTERN UNIVERSITY)
i.i
1.0
1.2
I.i
1.0
I.i
22
22
19
18
21
18
17
17
CDC 6400/6500 (PURDUE UNIVERSITY)
31
32
42
38
24
20
22
21
CDC 6600/6400 (THE UNIVERSITY OF TEXAS)
8.2
8.9
17
15
6.1
5.9
5.6
5.6
HONEYWELL 6070 (BELL LABORATORIES)
21
20
9.9
9.4
15
13
14
14
UNIVAC III0 (THE UNIVERSITY OF WISCONSIN)
Ii
II
8.9
8.4
ii
ii
9.8
9.2
155
135
132
106
DEC PDP-IO (YALE UNIVERSITY) AMDAHL 470V/6 (UNIVERSITY OF MICHIGAN)
3.1
2.9
175
104
2.4
98
2.3
2.9
2.4
.81
146
2.7
.83
139
2.6
4.1-49 TABLE 50 SUMMARY OF EXECUTION TIMES FOR SELECTED PROBLEMS USING THE EISPAC CONTROL PROGRAM MACHINE: IBM 370/195, Fortran H, OPT=2 ARGONNE NATIONAL LABORATORY
Time Unit:
1 second ORDER OF MATRIX
EIGENVALUES
EIGENVECTORS
TRANSFORMATIONS
N=I0
N=20
N=40
N=60
N=80
CG
All
All
Unitary
.044
.25
1.7
5.7
13
CG
All
Some(M=N)
Unitary
.047
.22
1.3
4.2
9.6
CG
All
All
Elementary
.032
.16
1.0
3.3
7.6
CG
All
Some(M=N)
Elementary
.041
.17
,92
2.7
6.7
RG
All
All
Elementary
.023
.i0
.63
2.0
4.5
RG
All
Some(M=N)
Elementary
.024
.095
.51
1.5
3.4
RG
All
All
Orthogonal
.026
.12
.72
2.3
5.2
RG
All
Some(M=N)
Orthogonal
,026
.i0
.59
1.8
4.0
RS
All
All
,011
,040
.22
.65
RS
All
None
,007
.016
.059
.15
RS
Some(M=N)
Some(M=N)
,025
.080
.33
,81
1.6
RS
Some(M=N)
None
.022
.066
.24
.56
1.0
CH
All
All
.016
.07
.44
CH
All
None
.009
.026
.14
CH
Some(M=N)
Some(M=N)
.029
.ii
.52
CH
Some(M=N)
.023
.08
.33
PROBLEM CLASS
None
176
1.4 .42 1.5 .83
1.5 .33
3.4 1.0 3.3 1.8
4.2-1
Section 4.2 REPEATABILITY AND RELIABILITY OF THE MEASURED EXECUTION TIMES
In the multi-program environment of modern computers, it is often very difficult to reliably measure the execution time of a program.
Sig-
nificant variations can occur depending on the load on the machine and the amount of I/O interference.
For the EISPACK subroutines in particular,
allowance has to be made also for the dependence of execution times upon the matrix (see Section 4.3). Towards improving the usefulness of the timing information for the various machines, each subroutine was run a number of times on different matrices and the average time reported.
Also, the timing programs were
structured to perform no output until all the timings had been collected. For the most part, the timing routines used to measure execution time factor out external interrupts which may occur.
The reported times, there-
fore, although not to be interpreted as absolute bounds, should be useful in giving a feeling for the execution time required by the individual subroutines or paths.
177
4.3-1
Section 4.3 DEPENDENCE OF THE EXECUTION TIMES UPON THE MATRIX
To characterize the dependence of the execution times of the EISPACK subroutines upon the matrix, it is helpful to divide the subroutines into three categories:
first, the non-iterative reduction and back transforma-
tion subroutines; second, the iterative reduced-form eigenvalue-eigenvector subroutines; and third, the semi-iterative subroutines which balance a mmtrix and back transform the eigenvectors of the balanced matrix. For the first category of subroutines, the execution times for all non-sparse matrices of a given order are approximately constant, close to those given in the tables of Section 4.1.
For sparse matrices, some of
the reduction transformations may be skipped and the arithmetic unit may consume less time to manipulate the many zero operands; however, except for special sparse matrices, the decrease in execution time of these subroutines is marginal. For the second category of subroutines, their execution times depend greatly upon the structure of the input matrix (e.g., diagonally dominant, blocked, sparse), the closeness of the eigenvalues, and the defectiveness of the matrix.
Based upon our experiments on the IBM 370/195, random
matrices tend to produce slower execution of category two subroutines, and therefore the execution times given in the tables of Section 4.1 appear to be near the maximum for these subroutines. For the third category of subroutines, their execution times are somewhat variable but, in general, are negligible compared with the execution times of paths in which they are included.
For example, the algorithms
BALANC and BALBAK together require about 0.3% of the execution time in the path BALANC-ELMHES-ELTRAN-HQR2-BALBAK used to find the complete eigensystem
178
4.3-2
of the order 80 real general matrix of Table 5, and CBAL and CBABK2 together require an even smaller percentage of the time for the corresponding complex matrix of Table 4.
In contrast, we have contrived a matrix for which the
combination of BALANC and BALBAK requires 7% of the normal path time, but this matrix represents an extreme case.
More commonly, the execution
times for these subroutines are only a few percent of the total path times.
179
4.4-I
Section 4.4 EXTRAPOLATION OF TIMING RESULTS TO OTHER MACHINES AND COMPILERS
The extrapolation of timing results to other machines and compilers may appear straightforward but can be grossly inaccurate if characteristics of the particular machines and compilers are not carefully considered. To illustrate this point, we make two comparisons:
first, the execution
times of EISPACK on an IBM 360/75 and 370/195, and second, the execution times of EISPACK compiled with the CDC 6600 Fortran RUN and FTN, OPT=I compilers. The eigensystems of several random matrices of order 80 were determined using identical object modules on the IBM 360/75 and 370/195.
The ratios
of the IBM 360/75 times to the 370/195 times show large variations from subroutine to subroutine (compare Tables 4-6 with Tables 7-9).
Many of
the ratios are between ii and 14, but at opposite extremes the ratio for BISECT is 6.7 whereas for TQL2, 19.4. These large variations in the ratios of execution times among the subroutines are attributable to the special architecture of the IBM 370/195; namely, the buffered or two-level memory, the pipe line or parallel arithmetic units, and the instruction stack.
Some of the EISPACK subroutines
are able to take advantage of these special features of the 370/195 better than others. The compiler can also affect the relative efficiencies of EISPACK subroutines.
On two comparable CDC 6600 computers, one employing the
RUN compiler and the other the FTN, OPT=I compiler, the ratios of the execution times for the EISPACK subroutines were determined (compare Tables 22-24 with Tables 34-36).
Many of the ratios are close to i, but
extremes as large as 2.2 for INVIT, 2.7 for HQR, and 3.0 for HQR2 obtain
180
4.4-2
for real general matrices of order 60. It is clear from these examples that the relative efficiency of an algorithm can be very machine and compiler dependent, and hence that the extrapolation of our timing results to other systems must necessarily include these nonsiderations.
181
4.5-1
Section 4.5 THE SAMPLE MATRICES FOR THE TIMING RESULTS
In this section, Fortran listings of the program segments which generate the sample matrices for the timing results are provided.
The matrix elements
are pseudo-random integers sampled from a uniform distribution on the interval (-215,+215).
A listing of the auxiliary subroutine RANDOM which generates
the random integers is also provided.
482
4.5-2 COMPLEX GENERAL MATRIX
I0 20
DO 20 I = I,N DO i0 d = I,N CALL RANDOM (INIT, AR(I,J)) CALL RANDOM (INIT, AI(I,J)) CONTINUE CONTINUE
COMPLEX HERMITIAN MATRIX
10 20 30
IF (N .EQ. 1) GO TO 30 DO 20 I = 2,N CALL RANDOM (INIT, AR(I-Ij I-l)) AI(I-I,I-1) = 0.0 DO 10 J = I,N CALL RANDOM (INIT, AR(I-I,J)) AR(J, I-1) = AR(I-1,J) CALL RANDOM (INIT, AI(I-1,J)) AI(J,I-1) = -AI(I-1,J) CONT INUE CONT INUE CALL RANDOM (INIT, AR(N,N)) AI(N,N) = 0.0
COMPLEX HERMITIAN PACKED MATRIX
i0 20
C C
DO 20 i = I,N DO i0 d = I,N CALL RANDOM (INIT, A(I,J)) CONTINUE CONTINUE
REAL GENERAL MATRIX
10 20
D O 2 0 I = I,N DO I0 J = I,N CALL RANDOM (INIT, A(I,J)) CONTINUE CONT INUE
REAL SYMMETRIC MATRIX DO20
I=
I,N
DO i0 a = I,N
I0 20
CALL RANDOM (INIT, A(I,J)) A(J,I) = A(I,J) CONTI NUE CONTI NUE
183
4.5-3 REAL SYMMETRIC PACKED MATRIX
10
NNN = N*(N+I)/2 DO I0 I = I,NNN CALL RANDOM (INIT, A(1)) CONTINUE
REAL SYMMETRIC TRIDIAGONAL MATRIX
10 20 30
CALL RANDOM (INIT, A(I,2)) IF (N .EQ. 1) GO TO 30 DO 20 I = 2,N DO 10 J = 1,2 CALL RANDOM (INIT, A(I,J)) CONTINUE CONTINUE CONTINUE
SPECIAL REAL NON-SYMMETRIC TRIDIAGONAL MATRIX
10 20
30 40
DO 20 I = I,N DO I0 J = 1,3 CALL RANDOM (INIT, A(I,J)) CONTINUE CONTINUE IF (N .EQ. i) GO TO 40 DO 30 I = 2,N
A ( I , 1 ) = SIGN(A(I,1), A ( I - 1 , 3 ) ) CONTINUE CONTINUE
Subroutine R~NDOM: SUBROUTINE RANDOM (INIT, X) REAL X INIT = MOD(3125*INIT, 65536) X = INIT - 32768 RETURN END Subroutine RANDOM produces pseudo-random integer elements X between -215 and 215 from a starting integer INIT.
It was designed
so that it could be implemented in Fortran and would produce the same set of pseudo-random numbers on different machines.
As a result it
has some shortcomings as a random number generator, including a rather short period of 214 numbers.
184
5.0-I Section 5 CERTIFICATION ;aND AVAII~ILITY OF EISPACK Under the auspices of the NATS Project, the subroutines constituting Release 2 of EISPACK have been tested on and are certified for the following computer systems and working precisions (test site names are indicated in parentheses): MACHINE
OPERATING SYSTEM
COMPILER
WORKING PRECISION
IBM 370/195
0S/360 (21.7) FTN IV G,H(21.7),WATFIV (ARGONNE NATIONAL LABORATORY)
LONG
IBM 360/75
0S/360 (21.7) FTN IV H(21.7) (UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN)
LONG
IBM 370/168
MTS FTN IV G,H (UNIVERSITY OF MICHIGAN)
LONG
IBM 360/75
OS/360 (21.7) FTN IV H EXTENDED(2.1) (STOCKHOLM DATA CENTER)
LONG
IBM 370/165
0S/360 (21.7) FTN IV H EXTENDED(2.1) (THE UNIVERSITY OF TORONTO)
LONG
BURROUGHS 6700
MCP 2.6 FORTRAN IV(2.6) (UNIVERSITY OF CALIFORNIA, SAN DIEGO)
SINGLE
CDC 6600
SCOPE 3.4.2 FTN(4.2) (KIRTLAND AIR FORCE BASE/AF~rL)
SINGLE
CDC 6600
KRONOS 2.1 RUN(2.3) (ICASE/NASA LANGLEY RESEARCH CENTER)
SINGLE
CDC 7600
(LOCAL) (LOCAL) (NATIONAL CENTER FOR ATMOSPHERIC RESEARCH)
SINGLE
CDC 6400
SCOPE 3.3 RUN(2.3) ,FTN(3.0) (NORTHWESTERN UNIVERSITY)
SINGLE
CDC 6400/6500
(LOCAL) FUN (PURDUE UNIVERSITY)
SINGLE
CDC 6600/6400
UT2D-85 RUN (60.2), MNF, RUh~/ (THE UNIVERSITY OF TEXAS AT AUSTIN)
SINGLE
HONEYWELL 6070
GECOS SR-F FORTRAN-Y (SR-F) (BELL LABORATORIES AT MURRAY HILL)
SINGLE
UNIVAC Iii0
EXEC-8 (31. 244) FORTRAN V(9) (THE UNIVERSITY OF WISCONSIN)
SINGLE
DEC PDP-IO
TOPS-10 (506B) FORTRAN F40 (YALE UNIVERSITY)
SINGLE
185
5.0-2
The control program EISPAC has been tested on and is certified for the IBM systems at Argonne~ Illinois, Stockholm, and Toronto listed above. Additional testing of EISPACK was carried out at Stanford University, Harvard University, and on the Amdahl 470V/6 machine at University of Michigan. Certification implies the full support of the NATS project in the sense that reports of poor or incorrect performance on at least the computer system~ listed above will be examined and any necessary corrections made. This support holds only when the software is obtained through the channels indicated below and has not been modified; it will continue to hold throughout the useful life of EISPACK or until, in the estimation of the developers, the package is superseded or incorporated into other supported, widelyavailable program libraries.
The following individual serves as a contact
for information about EISPACK~ accepting reports from users concerning performance: Burton S. Garbow Applied Mathematics Division Argonne National Laboratory Argonne, Illinois 60439 U.S.A. Phone: 312-739-7711 x4342 EISPACK is distributed from the Argonne Code Center.
Versions exist
for IBM 360-370, CDC 6000-7000, Univac iii0, Honeywell 6070, DEC PDP-IO, and Burroughs 6700 machines~
Fortran source decks, documentation, and
testing aids will be transmitted as card images on a tape supplied by the requester.
The tape should have a rating of at least 800 bpi and be a
full 2400 feet long. version.
The requester should specify the desired machine
The tape should be mailed to: Argonne Code Center Bldg. 221 Argonne National Laboratory Argonne, Illinois 60439 U.S.A.
186
5.0-3
The tape will be returned parcel post unless the Code Center is requested otherwise.
It will be returned by air mail collect if the Code Center is
so authorized in writing and the postal service procedures permit such shipment. Certain international agreements pertain to the distribution of EISPACK outside the United States by the Argonne Code Center.
Information concern-
ing such distribution may be obtained from the Code Center.
187
6.0-!
Section 6 DIFFERENCES BETWEEN THE EISPACK SUBROUTINES AND THE HANDBOOK ALGOL PROCEDURES
This section describes,
subroutine by subroutine,
the major differ-
ences between the EiSPACK subroutines and their Algol antecedents in the Handbook
[I].
These differences
of several errors,
fall into four categories:
2) minor algorithmic improvements,
consideration of Fortran language efficiency,
I) correction
3) changes based on
and finally, 4) changes to
better unify the individual programs into a package. Some of the changes apply to EISPACK as a whole. i)
The base B of the floating point representation on the machine and
the machine precision MACHEP have become internally set variables in the Fortran programs rather than parameters. 2)
The orthogonaiity
threshold parameter TOL has been removed from
the Householder reduction subroutines by substituting technique discussed in the "Organisational
the alternate scaling
and Notational Details" section
of the Handbook, Contribution 11/2, p. 221. 3)
The procedure CDIV called to perform complex division in the
Handbook procedures has been replaced by ordinary division operations with complex-mode Fortran operands.
The procedures CABS and CSQRT called to
perform complex modulus and complex square-root operations have been replaced by references to corresponding members of the Fortran library which use complex-mode 4) process,
operands.
The Handbook procedure-calls
for row interchange in the balancing
for determination of Sturm counts in the bisection process, and
for selection of new trial vectors in the inverse iteration process have been replaced by in-line Fortran coding.
] 88
6.0-2
Specific changes to individual members of EISPACK are as follows.
BALANC - IGH=I rather than IGH=0 is returned when the matrix can be permuted to triangular form; IGH is used as an array declarator subscript in other subroutines and must not be "0".
TRED 1
-
Unnecessary operations in the last reduction step that can introduce roundoff error into the first diagonal element have been skipped, enabling the resultant tridiagonal form to more literally duplicate that from TRED2.
TRED 2
Also see TRED2 below.
- The arithmetic operation G*(Z/H) is computed instead as (G/H)*Z, enabling the resultant tridiagonal form to more literally duplicate that from TREDI.
The tridiagonal forms from TREDI and TRED2
are now identical (on most machines) except possibly for the sign of the first subdiagonal element.
This property in turn ensures
that TQLI and TQL2, or IMTQLI and IMTQL2, produce identical eigenvalues in most cases.
TRED3
- As for TREDI.
TRBAKI - Instead of back transforming eigenvectors M1 through M2 as is done in the Handbook, TRBAKI transforms eigenvectors i through M.
(The MI, M2 form of specification would be more natural if
subroutine BISECT were patterned after the Handbook BISECT rather than the Handbook TSTURM.)
TRBAK3 - As for TRBAKI.
HQR
- Provision for recognition of balancing parameters LOW and IGH has been made.
Also see HQR2 below.
189
6.0-3
HQR2
Roots of a quadratic equation with discriminant zero are now
-
classified as real rather than complex as in the Handbook.
This
change corrects an error which may otherwise be made in determining the corresponding eigenvectors.
For consistency the
change has been made to HQR also.
- The last component of complex vectors of the reduced form is initialized to (0,i) rather than (I,0), rendering the vector matrix of the reduced form strictly triangular and thereby simplifying the final transformation to the eigenvectors of the original matrix.
INVIT
- The complex eigenvector corresponding to either member of a pair of conjugate complex eigenvalues may be obtained, not just the one corresponding to the value with positive imaginary part. However, if both are requested, only the eigenvector corresponding to the eigenvalue with positive imaginary part is computed.
- The eigenvector growth requirement has been relaxed by a factor of !0, reducing the number of convergence failures.
TSTURM
Small subdiagonal entries of the tridiagonal form are treated as
-
zeros in the computation but are not replaced by zeros in storage. The subdiagonal array is required in TRBAKI and modification of any of its elements by TSTURM introduces errors in the back transformation.
-
The input interval (RLB,RUB) is refined making use of Gerschgorin bounds, thereby reducing the computation time of the bisection process.
190
6.0-4
-
The logical array INT has been eliminated by making use instead of information present in the reduced triangular form and input subdiagonal array.
BISECT - The bisection process of TSTURM is used instead of that in the Handbook BISECT procedure.
They differ primarily in the specifi-
cation of the subset of the eigenvalues to be computed.
- The eigenvalues are strictly ordered, rather than locally ordered within submatrices as in TSTURM; they are tagged with their submatrix associations by use of the array IND.
TRIDIB - As for BISECT except that the bisection process of the Handbook BISECT procedure is used.
COMLR
- Provision for recognition of balancing parameters LOW and IGH has been made.
CINVIT - The vector growth requirement has been relaxed by a factor of I0, reducing the number of convergence failures.
RATQR
-
The largest as well as the smallest eigenvalues can be requested. The specification of "NEGATIVE DEFINITE"
(when proper) improves
the determination of the largest values in the same way as uPOSITIVE DEFINITE" does the smallest.
- An error return has been provided for an incorrectly specified definiteness parameter.
- The incidence of underflow has been markedly reduced by replacement of tiny squared subdiagonal elements by zeros at each iteration. 191
6.0-5
- The eigenvalues are tagged with their submatrix associations by use of the array IND.
A further modification that saves the
input matrix makes it possible to link R A T Q R w i t h
TINVIT to
compute the corresponding eigenvectors.
A number of the EISPACK subroutines which have no Handbook antecedents are patterned closely after existing Handbook procedures.
CBAL is a complex analogue of BALANC, CBABK2 is a complex analogue of BALBAK, CORTH is a complex analogue of ORTHES, CORTB is a complex analogue of ORTBAK, COMQR is a unitary analogue of COMLR, COMQR2 is a unitary analogue of COMLR2, HTRIDI is a complex analogue of TREDi, HTRIBK is a complex analogue of TRBAKI, HTRID3 is a complex analogue of TRED3, HTRIB3 is a complex analogue of TRBAK3, IMTQLV is an extension of IMTQLI that tags the eigenvalues with their submatrix associations as in BISECT, TQLRAT is a rational variant of TQLI, and TINVIT is that part of T S T U R M w h i c h
determines the eigenvectors after
the eigenvalues have been found.
Subroutines FIGI, FIGI2, and BAKVEC provide the EISPACK capability for special nonsymmetric tridiagonal matrices not present in the Handbook procedures.
They may be considered analogous to TREDI, TRED2, and TRBAKI
respectively.
192
6.0-6
Finally, various minor textual changes have been nmde to render the first of each of the following pairs of subroutines a virtual subset of the second:
(COMLR,COMLR2), (HQR,HQR2), (TQLI,TQL2),
(BISECT,TSTURM).
193
(IM~QLI,IMTQL2), and
7.0-i
Section 7 DOCUMENTATION AN~ SOURCE LISTINGS
This section contains the documentation and source listings for the EISPACK subroutines and the documentation for the control program EISPAC. The subroutines appear in alphabetical order in Section 7.1 with the source listing for each subroutine following its document.
Section 7.2
contains the document for EISPAC, but because of its size and machine dependencies the listing is not included. Both the subroutine documents and source listings have been systematically edited for this publication to eliminate duplicate text; they therefore differ from the nmterial distributed to requesters of EISPACK. The statement of certification of item 6 has been removed from the individual documents and appears here in Section 5.
The reference to
this publication which appears in item 4 and the brief discussian of testing that appears in items 5.A and 5.C of the distributed documents have been removed; the latter has been replaced by a pointer to the more extensive discussion of testing here in Section 3. Two modifications have been made to the subroutine listings published here.
First, ~hey have been shortened by eliminating com~ents related to
usage, calling sequence, and error exits which basically duplicate text in the documents,
Second, statements initializing variables to machine-
dependent constants, which in each distributed version of EISPACK are completed to contain the appropriate numerical values of these constants, appear here as MACHEP = ? RADIX = #
194
7.0-2
(The correct value for MACHEP is the smallest positive working precision floating point number which, when added to 1.0 using the working precision addition operation on your machine, gives a number larger than 1.0; that for RADIX is the floating point constant representing the base of the floating point arithmetic on your machine.)
Appropriate values of MACHEP
and RADIX for several machines are summarized in the following table.
MACHINE
MACHEP
RADIX
Burroughs 6700
2.**(-37)
8.
CDC 6000 and 7000 Series
2.**(-47)
2.
DEC PDP-10
2.**(-26)
2.
Honeywell 6070
2°**(-26)
2.
Univac iii0
2.**(-26)
2.
Except for the statements initializing MACHEP and RADIX, the published listings are ANSI Fortran.
The double precision version certified for
IBM equipment employs non-standard Fortran to the extent of using REAL*8 declarations and a small amount of complex double precision arithmetic. For this version, the appropriate values of MACHEP and RADIX are 16.D0"*(-13) and 16.D0.
195
7.1-!
NATS
E!GENSYSTEM
PROJECT
SUBROUTINE F281-2
PACKAGE
(EISPACK)
BAKVEC
A F o r t r a n IV S u b r o u t i n e to B a c k T r a n s f o r m the E i g e n v e c t o r s of that S y m m e t r i c T r i d i a g o n a l M a t r i x D e t e r m i n e d by FIGIo
May, July,
1972 1975
I. P U R P O S E The F o r t r a n IV s u b r o u t i n e BAKVEC f o r m s the e i g e n v e c t o r s of a certain real non-symmetric t r i d i a g o n a l m a t r i x f r o m the e i g e n v e c t o r s of that s y m m e t r i c t r i d i a g o n a l m a t r i x d e t e r m i n e d by F I G I (F280).
2.
USAGE. A.
Calling The
Sequence~
SUBROUTINE SUBROUTINE
statement
is
BAKVEC(NM~N,T,E,M,Z,IERR)
T h e p a r a m e t e r s are d i s c u s s e d b e l o w and the i n t e r p r e t a t i o n of w o r k i n g p r e c i s i o n for v a r i o u s m a c h i n e s is g i v e n in the s e c t i o n d i s c u s s i n g c e r t i f i c a t i o n . NM
is an i n t e g e r i n p u t v a r i a b l e set e q u a l to the r o w d i m e n s i o n of the t w o - d i m e n s i o n a l arrays T and Z as s p e c i f i e d in the D I M E N S I O N s t a t e m e n t s for T and Z in the calling program°
N
is an i n t e g e r i n p u t v a r i a b l e the o r d e r of the m a t r i x T. greater than NM.
set e q u a l to N m u s t be n o t
is a w o r k i n g p r e c i s i o n r e a l i n p u t twod i m e n s i o n a l v a r i a b l e w i t h row d i m e n s i o n NM and c o l u m n d i m e n s i o n at l e a s t 3. T c o n t a i n s the n o n - s y m m e t r i c tridiagonal m a t r i x of o r d e r N in its f i r s t t h r e e columns. The s u b d i a g o n a l e l e m e n t s are s t o r e d in the last N-I p o s i t i o n s of the
196
7.1-2
f i r s t column. The d i a g o n a l e l e m e n t s are s t o r e d in the s e c o n d c o l u m n . The s u p e r d i a g o n a l e l e m e n t s are s t o r e d in the first N-I p o s i t i o n s of the t h i r d column. Elements T(I,I) and T(N,3) are arbitrary. is a w o r k i n g p r e c i s i o n r e a l o n e - d i m e n s i o n a l v a r i a b l e of d i m e n s i o n at l e a s t N. On input, the last N-I p o s i t i o n s in this a r r a y c o n t a i n the s u b d i a g o n a l e l e m e n t s of the s y m m e t r i c t r i d i a g o n a l m a t r i x . E(1) is arbitrary. N o t e that BAKVEC destroys E. M
is an i n t e g e r the n u m b e r of transformed.
input variable c o l u m n s of Z
set e q u a l to to be b a c k
is a w o r k i n g p r e c i s i o n r e a l t w o - d i m e n s i o n a l variable with row dimension NM and c o l u m n d i m e n s i o n at l e a s t M. On input, the f i r s t M c o l u m n s of Z c o n t a i n the e i g e n v e c t o r s to be b a c k t r a n s f o r m e d . On o u t p u t , these c o l u m n s of Z c o n t a i n the t r a n s f o r m e d eigenvectors. The t r a n s f o r m e d e i g e n v e c t o r s are not n o r m a l i z e d . IERR
B.
Error
is an i n t e g e r o u t p u t v a r i a b l e set e q u a l an error c o m p l e t i o n code d e s c r i b e d in s e c t i o n 2B. The n o r m a l c o m p l e t i o n code zero.
Conditions
and
to is
Returns.
If E(1) is zero but e i t h e r T(I,I) or T(I-I,3) is not zero, BAKVEC terminates with IERR set to 2*N+I and w i t h no e i g e n v e c t o r s b a c k t r a n s f o r m e d . In this case, the t r a n s f o r m a t i o n by FIGI was not a s i m i l a r i t y transformation. If the a b o v e set to zero.
C. A p p l i c a b i l i t y
error
and
condition
does
not
occur,
IERR
is
with
the
Restrictions.
This s u b r o u t i n e s h o u l d be subroutine FIGI (F280).
197
used
in c o n j u n c t i o n
7.1-3
3. D I S C U S S I O N
OF M E T H O D
AND
ALGORITHM.
S u p p o s e that the n o n - s y m m e t r i c tridiagonal matrix T b e e n t r a n s f o r m e d to the t r i d i a g o n a l s y m m e t r i c m a t r i x the s i m i l a r i t y t r a n s f o r m a t i o n
has P by
-i F = V
TV
where V is the d i a g o n a l m a t r i x d e f i n e d in Then, g i v e n an a r r a y Z of c o l u m n v e c t o r s , the m a t r i x p r o d u c t VZ. If the e i g e n v e c t o r s c o l u m n s of the a r r a y Z, then BAKVEC forms of T in their place. This s u b r o u t i n e is an i m p l e m e n t a t i o n of d i s c u s s e d in d e t a i l by W i l k i n s o n (i).
4.
algorithm
REFERENCES° i)
5.
the
F I G I (F280). BAKVEC computes of F are the e i g e n v e c t o r s
W i l k i n s o n , J.H., Oxford, Clarendon
The A l g e b r a i c E i g e n v a l u e P r e s s , 3 3 5 - 3 3 7 (1965).
Problem,
CHECKOUT. A.
Test
Cases.
See the certain
section discussing real n o n - s y m m e t r i c
t e s t i n g of the codes for tridiagonal matrices.
B. A c c u r a c y . The a c c u r a c y of BAKVEC can b e s t be d e s c r i b e d in terms of its role in those p a t h s of EISPACK w h i c h find e i g e n v a l u e s and e i g e n v e c t o r s of c e r t a i n r e a l n o n symmetric tridiagonal matrices. In these paths, this s u b r o u t i n e is n u m e r i c a l l y s t a b l e (I). This s t a b i l i t y c o n t r i b u t e s to the p r o p e r t y of these p a t h s that the c o m p u t e d e i g e n v a l u e s are the exact e i g e n v a l u e s of a m a t r i x c l o s e to the o r i g i n a l m a t r i x and the c o m p u t e d e i g e n v e c t o r s are c l o s e (but not n e c e s s a r i l y equal) to the e i g e n v e c t o r s of that m a t r i x .
198
7.1-4
SUBROUTINE
BAKVEC(NM,N,T,E,M,Z,IERR)
INTEGER I,J,M,N,NM,IERR REAL T(NM,3),E(N),Z(NM,M) IERR = 0 IF (M .EQ. E(1) = 1.0 IF (N .EQ. DO
TO
i001
i) GO
TO
i001
=
120
J =
DO 120 Z(I,J) CONTINUE
* E(I)
i000 I001
.NE.
0.0)
/ r(I-l,3)
i, M I = 2, N = Z ( I , J ) * E(I)
GO TO i 0 0 1 **********
C C
80 T(I-I,3)
1.0
GO TO I00 E(I) = E ( I - I ) CONTINUE DO
120
GO
i00 1 = 2, N IF (E(1) .NEo 0.0) GO TO IF ( T ( I , I ) .NE. 0.0 .OR. E(I)
80 100
0)
SET E R R O R -- E I G E N V E C T O R S CANNOT F O U N D BY T H I S P R O G R A M * * * * * * * * * * IERR = 2 * N + I RETURN END
199
BE
GO TO
i000
7~i-5
NATS
EIGENSYSTEM
PROJECT
SUBROUTINE F269-2
A Fortran
IV
Subroutine
PACKAGE
BALANC
to B a l a n c e
May, July,
(EISPACK)
a Real
General
Matrix.
1972 1975
i. P U R P O S E . T h e F o r t r a n IV s u b r o u t i n e BALANC balances a real general m a t r i x and i s o l a t e s e i g e n v a l u e s w h e n e v e r p o s s i b l e . Sums of the m a g n i t u d e s of e l e m e n t s in c o r r e s p o n d i n g rows and c o l u m n s are m a d e n e a r l y e q u a l by exact s i m i l a r i t y t r a n s f o r m a t i o n s , and e i g e n v a l u e s are i s o l a t e d by p e r m u t a t i o n s i m i l a r i t y transformations. B a l a n c i n g r e d u c e s the 1 - n o r m of the o r i g i n a l m a t r i x w h e n e v e r sums of the m a g n i t u d e s of e l e m e n t s in some row and c o r r e s p o n d i n g c o l u m n are m a r k e d l y d i f f e r e n t , w h i l e at the same time l e a v i n g the e i g e n v a l u e s u n c h a n g e d . R e d u c i n g the n o r m in this way can i m p r o v e the a c c u r a c y of the computed eigenvalues and/or eigenvectors.
2.
USAGE. Ao
Calling The
Sequence.
SUBROUTINE SUBROUTINE
statement
is
BALANC(NM,N,A,LOW, IGH,SCALE)
T h e p a r a m e t e r s are d i s c u s s e d b e l o w and the i n t e r p r e t a t i o n of w o r k i n g p r e c i s i o n for v a r i o u s m a c h i n e s is g i v e n in the s e c t i o n d i s c u s s i n g c e r t i f i c a t i o n ° NM
is an i n t e g e r i n p u t v a r i a b l e set e q u a l to the r o w d i m e n s i o n of the t w o - d i m e n s i o n a l array A as s p e c i f i e d in the D I M E N S I O N s t a t e m e n t for A in the c a l l i n g p r o g r a m . is an i n t e g e r i n p u t v a r i a b l e the o r d e r of the m a t r i x A. greater than NM.
200
set e q u a l to N m u s t be not
7 .I-6
is a w o r k i n g p r e c i s i o n r e a l t w o - d i m e n s i o n a l variable with row dimension NM and c o l u m n d i m e n s i o n at l e a s t N. On input, A c o n t a i n s the m a t r i x of o r d e r N to be balanced. On o u t p u t , A c o n t a i n s the transformed matrix.
A
LOW, IGH are i n t e g e r o u t p u t v a r i a b l e s i n d i c a t i n g the b o u n d a r y i n d i c e s for the b a l a n c e d m a t r i x . See s e c t i o n 3 for the d e t a i l s . SCALE
B.
Error
is a w o r k i n g p r e c i s i o n real o u t p u t oned i m e n s i o n a l v a r i a b l e of d i m e n s i o n at l e a s t N c o n t a i n i n g i n f o r m a t i o n a b o u t the similarity transformations. See s e c t i o n 3 for the d e t a i l s .
Conditions
and
Returns.
None.
C. A p p l i c a b i l i t y
and
Restrictions.
It is p a r t i c u l a r l y a d v a n t a g e o u s to use BALANC whenever the sums of the m a g n i t u d e s of e l e m e n t s in some row and corresponding column are quite different. Additionally, the e x e c u t i o n time for BALANC is s m a l l c o m p a r e d w i t h the e x e c u t i o n time for the r o u t i n e s w h i c h d e t e r m i n e the eigenvalues and/or eigenvectors. H e n c e it is r e c o m m e n d e d that BALANC be u s e d g e n e r a l l y . The s u b r o u t i n e B A L B A K (F270) s h o u l d be used to r e t r i e v e the e i g e n v e c t o r s of the o r i g i n a l m a t r i x a f t e r the e i g e n v e c t o r s of the t r a n s f o r m e d m a t r i x h a v e b e e n determined.
3.
DISCUSSION
OF M E T H O D
First BALANC m a t r i c e s such
AND
ALGORITHM.
determines that
PAP
=
a product
( T
X
(0
B
Z)
(0
0
R)
P
of p e r m u t a t i o n
Y )
where T and R are u p p e r t r i a n g u l a r m a t r i c e s and B is a s q u a r e m a t r i x s i t u a t e d in rows and c o l u m n s LOW through IGH w i t h no zero o f f - d i a g o n a l rows or columns. X, Y, and Z are r e c t a n g u l a r m a t r i c e s of a p p r o p r i a t e d i m e n s i o n s . The
201
7.1-7
d i a g o n a l e l e m e n t s of T and R are the i s o l a t e d e i g e n v a l u e s of A. In the e x c e p t i o n a l c a s e w h e r e B is empty, LOW = 1 and IGH = 0 -- h o w e v e r , i is r e t u r n e d as the o u t p u t v a l u e of IGH. Next, the s u b r o u t i n e BALANC singular diagonal matrix D
determines iteratively a nonof o r d e r IGH-LOW+I s u c h that
-I D
BD
is a b a l a n c e d m a t r i x in the s e n s e that the a b s o l u t e sums of the m a g n i t u d e s of e l e m e n t s in c o r r e s p o n d i n g r o w s and c o l u m n s of -i D
BD
are n e a r l y equal° The d i a g o n a l the r a d i x of the f l o a t i n g p o i n t
e l e m e n t s of D are p o w e r s a r i t h m e t i c of the m a c h i n e .
of
U p o n c o m p l e t i o n of B A L A N C , the v e c t o r a r r a y SCALE contains the i n f o r m a t i o n a b o u t P and D n e c e s s a r y for BALBAK to r e t r i e v e the e i g e n v e c t o r s of the o r i g i n a l m a t r i x f r o m the e i g e n v e c t o r s of the t r a n s f o r m e d m a t r i x . The i n f o r m a t i o n is e n c o d e d as f o l l o w s . I. The J-th and SCALE(J)-th rows and c o l u m n s of the o r i g i n a l m a t r i x h a v e b e e n p e r m u t e d for J = 1,2,...,LOW-I,IGH+I,IGH+2,...,N. 2. SCALE(J) is the (J-LOW+l)-th d i a g o n a l e l e m e n t of D for J = LOW,LOW+I,...,IGH. U p o n c o m p l e t i o n of B A L A N C , the o u t p u t m a t r i x is ( T ( 0
XD -I D BD
( 0
0
Y -i D
) Z )
R
).
This s u b r o u t i n e is a t r a n s l a t i o n of the A l g o l p r o c e d u r e BALANCE w r i t t e n and d i s c u s s e d in d e t a i l by P a r l e t t and R e i n s c h (I).
4.
REFERENCES.
i)
P a r l e t t , B.N. and R e i n s c h , C., B a l a n c i n g a M a t r i x for C a l c u l a t i o n of E i g e n v a l u e s and E i g e n v e c t o r s , Num. Math. 1 3 , 2 9 3 - 3 0 4 (1969). ( R e p r i n t e d in H a n d b o o k for A u t o m a t i c C o m p u t a t i o n , V o l u m e II, L i n e a r A l g e b r a , J. H. W i l k i n s o n - C. R e i n s e h , C o n t r i b u t i o n Ii/ii, 315-326, Springer-Verlag, 1971.)
202
7.1-8
5.
CHECKOUT. A.
Test
Cases.
See the s e c t i o n d i s c u s s i n g real general matrices.
B.
testing
of
the c o d e s
for
Accuracy. BALANC i n t r o d u c e s no r o u n d i n g e r r o r s (on a m a c h i n e at l e a s t one g u a r d digit) s i n c e its only a r i t h m e t i c s c a l i n g the input m a t r i x by p o w e r s of the radix.
203
with is
7.1-9
SUBROUTINE
BALANC(NM,N,A,LOW,
IGH,SCALE)
INTEGER I,J,K,L,M,N,JJ,NM,!GH,LOW, REAL A(NM,N),SCALE(N) REAL C,F,G,R,S,B2,RADIX REAL ABS LOGICAL NOCONV **********
RADIX
=
A MACHINE DEPENDENT PARAMETER OF THE MACHINE FLOATING POINT
#
B2 = RADIX K = 1 L = N GO TO i00 • ********* 20
RADIX IS THE BASE
IEXC
* RADIX
IN-LINE PROCEDURE FOR ROW COLUMN EXCHANGE ********~* SCALE(M) = J IF (J .EQ. M) G O T O 5 0
AND
DO
30
3 0 I = I, L F = A(I,J) A(I,J) = A(I,M) A(I,M) = F CONTINUE
DO
40
4 0 1 = K, N F = A ( J , I) A(J,I) = A(M,I) A ( M , I) = F CONTINUE
C 50 C C 80 C i00
G O T O (80, 1 3 0 ) , ! E X C ********** SEARCH FOR ROWS ISOLATING AN EIGENVALUE AND PUSH THEM DOWN ********** IF (L .EQ. i) G O T O 2 8 0 L = L - i ********** F O R J = L S T E P -I U N T I L 1 D O -- * * * * * * * * * * D O 1 2 0 J J = i, L J = L + i - JJ DO
ii0
120
I i 0 I = i, IF (! .EQ. IF ( A ( J , I ) CONTINUE
L J) G O T O i i 0 .NE. 0 . 0 ) G O
TO
M = L !EXC = 1 GO TO 20 CONTINUE
204
120
SPECIFYING REPRESENTATION.
7.1-10
GO TO 140 ********** 130
K
140
DO
=
K + 170
SEARCH FOR COLUMNS AND PUSH THEM LEFT
170
180 190
AN
EIGENVALUE
1 J
= K,
L
DO
150 I = K, IF (I .EQ. IF ( A ( I , J ) CONTINUE
150
ISOLATING **********
L J) G O T O 1 5 0 .NE. 0.0) GO
TO
170
M = K IEXC = 2 GO TO 20 CONTINUE ********** NOW BALANCE THE SUBMATRIX IN R O W S DO 1 8 0 I = K, L SCALE(I) = 1.0 ********** ITERATIVE LOOP FOR NORM REDUCTION NOCONV = .FALSE. DO
270 C = R=
1 = K, 0.0 0.0
K
TO
L
**********
**********
L
DO
200 C
210
220 230
2 0 0 J = K, L IF (J .EQ. I) G O T O 2 0 0 C = C + ABS(A(J,I)) R = R + ABS(A(I,J)) CONTINUE ********** GUARD AGAINST ZERO IF (C .EQ. 0 . 0 .OR. R .EQ. G = R / RADIX F=I.0 S = C + R IF (C .GE. G) G O T O 2 2 0 F = F * RADIX C = C * B 2 GO T O 2 1 0 G = R * RADIX IF (C .LT. G) G O T O 2 4 0 F = F / RADIX C
C 240
250
=
C
/
C OR 0.0)
TO UNDERFLOW 270
B2
GO TO 230 ********** NOW BALANCE ********** IF ((C + R) / F .GE. 0 . 9 5 * S) G=I.O/F SCALE(l) = SCALE(l) * F NOCONV = .TRUE. DO 250 A(I,J)
R DUE GO TO
J
=
K,
= A(I,J)
N
* G
205
GO
TO
270
**********
7.1-11
DO 260 A(J,I)
260 270
= I, L A(J,I)
* F
CONTINUE IF
280
J =
(NOCONV)
GO
TO
190
LOW = K IGH = L RETURN END
206
7.1-12
NATS
EIGENSYSTEM
PROJECT
SUBROUTINE F270-2
PACKAGE
(EISPACK)
BALBAK
A F o r t r a n IV S u b r o u t i n e to B a c k T r a n s f o r m the E i g e n v e c t o r s of that R e a l M a t r i x T r a n s f o r m e d by BALANC.
May, July,
1972 1975
i. P U R P O S E . The F o r t r a n IV s u b r o u t i n e BALBAK forms the e i g e n v e c t o r s of a r e a l g e n e r a l m a t r i x f r o m the e i g e n v e c t o r s of that m a t r i x t r a n s f o r m e d by B A L A N C (F269).
2. U S A G E . A.
Call~ng The
Sequence.
SUBROUTINE SUBROUTINE
statement
is
B A L B A K ( N M , N , L O W , IGH, S C A L E , M , Z )
The p a r a m e t e r s are d i s c u s s e d b e l o w and the i n t e r p r e t a t i o n of w o r k i n g p r e c i s i o n for v a r i o u s m a c h i n e s is g i v e n in the s e c t i o n d i s c u s s i n g c e r t i f i c a t i o n . NM
is an i n t e g e r i n p u t v a r i a b l e set e q u a l to the r o w d i m e n s i o n of the t w o - d i m e n s i o n a l array Z as s p e c i f i e d in the D I M E N S I O N s t a t e m e n t for Z in the c a l l i n g p r o g r a m .
N
is an i n t e g e r i n p u t v a r i a b l e set e q u a l to the n u m b e r of c o m p o n e n t s of the v e c t o r s in the a r r a y Z. N m u s t be not g r e a t e r than NM.
LOW, IGH are i n t e g e r i n p u t v a r i a b l e s i n d i c a t i n g the b o u n d a r y i n d i c e s for the b a l a n c e d m a t r i x . See s e c t i o n 3 of F269 for the d e t a i l s . SCALE
is a w o r k i n g p r e c i s i o n real i n p u t oned i m e n s i o n a l v a r i a b l e of d i m e n s i o n at least N c o n t a i n i n g i n f o r m a t i o n a b o u t the transformations. See s e c t i o n 3 of F269 for the d e t a i l s .
207
7.1-13
is an i n t e g e r i n p u t v a r i a b l e the n u m b e r of c o l u m n s of Z transformed.
set e q u a l to to b e b a c k
is a w o r k i n g p r e c i s i o n r e a l t w o - d i m e n s i o n a l variable with row dimension NM and c o l u m n d i m e n s i o n at l e a s t M. On input, the f i r s t M c o l u m n s of Z c o n t a i n the r e a l and i m a g i n a r y p a r t s of the e i g e n v e c t o r s to be back transformed. On o u t p u t , t h e s e M c o l u m n s of Z c o n t a i n the r e a l and i m a g i n a r y p a r t s of the t r a n s f o r m e d eigenvectors.
B.
Error
Conditions
and
Returns.
None°
C.
Applicability
and
Restrictions.
This s u b r o u t i n e s h o u l d be u s e d subroutine B A L A N C (F269).
3. D I S C U S S I O N
OF M E T H O D
AND
in c o n j u n c t i o n
with
the
ALGORITHM.
U s i n g the n o t a t i o n of F269, t r a n s f o r m e d i n t o the m a t r i x transformation
the o r i g i n a l m a t r i x C by the s i m i l a r i t y
A
is
-I C = G
PAPG
where G is the d i a g o n a l m a t r i x w h o s e d i a g o n a l e l e m e n t s a r e 1.0 in p o s i t i o n s 1 to LOW-I, 1.0 in p o s i t i o n s IGH+I to N, and are the d i a g o n a l e l e m e n t s of D in p o s i t i o n s LOW to IGH. G i v e n an a r r a y Z of v e c t o r s , the s u b r o u t i n e BALBAK c o m p u t e s the m a t r i x p r o d u c t PGZ. If the r e a l and i m a g i n a r y p a r t s of the e i g e n v e c t o r s of C are c o l u m n s of the array Z, t h e n BALBAK f o r m s the e i g e n v e c t o r s of A in their p l a c e . The i n f o r m a t i o n a b o u t P and D is e n c o d e d in the a r r a y SCALE. See s e c t i o n 3 of F269 for the d e t a i l s . This subroutine BALBAK written R e i n s c h (I).
is a t r a n s l a t i o n of the A l g o l p r o c e d u r e and d i s c u s s e d in d e t a i l by P a r i e t t and
208
7.1-14
4. REFERENCES.
1)
Parlett, B.N. and Reinsch, C., Balancing a Matrix for C a l c u l a t i o n of Eigenvalues and Eigenvectors, Num. Math. 13,293-304 (1969). (Reprinted in H a n d b o o k for A u t o m a t i c Computation, Volume II, Linear Algebra, J. H. W i l k i n s o n - C. Reinsch, C o n t r i b u t i o n II/Ii, 315-326, S p r i n g e r - V e r l a g , 1971.)
5. CHECKOUT. A.
Test
Cases.
See the section discussing real general matrices.
testing
of
the codes
for
B. Accuracy. BALBAK introduces no rounding errors (on a m a c h i n e with at least one guard digit) since its only arithmetic is scaling the e i g e n v e c t o r m a t r i x by powers of the radix.
209
7.1-15
SUBROUTINE
BALBAK(NM,N,LOW,
INTEGER I~J,K,M,N,II,NM, REAL SCALE(N),Z(NM,M) REAL S IF IF
(M ,EQ. 0) G O TO 2 0 0 ( I G H .EQ. L O W ) G O T O
IGH, S C A L E , M , Z )
IGH,LOW
120
DO
I00 ii0
120
Ii0 i = L O W , I G H S = SCALE(l) ********** LEFT HAND EIGENVECTORS ARE IF T H E F O R E G O I N G STATEMENT S=I.O/SCALE(1). ***~****** DO i 0 0 J = i, M Z(I,J) = Z(I,J) * S CONTINUE ********-
DO
FOR I=LOW-I IGH+I STEP = i, N
S T E P -I U N T I L i~ 1 UNTIL N D O -- * * * * * * * * * *
1 4 0 ii ! = II IF (I .GE. L O W . A N D . I .LE. I G H ) IF (I .LT. L O W ) I = L O W - II K = SCALE(l) IF (K .EQ. I) G O T O 1 4 0 DO
130
1 3 0 J = i~ M S = Z(I,J) Z(I,J) = Z(K,J) Z(K,J) = S CONTINUE
140
CONTINUE
200
RETURN END
BACK TRANSFORMED IS R E P L A C E D BY
210
GO
TO
140
7.1-16
NATS
EIGENSYSTEM
SUBROUTINE F294
A Fortran
PROJECT
PACKAGE
(EISPACK)
BISECT
IV S u b r o u t i n e to D e t e r m i n e of a S y m m e t r i c T r i d i a g o n a l
May,
Some E i g e n v a l u e s Matrix.
1972
I. P U R P O S E . The F o r t r a n IV s u b r o u t i n e BISECT determines e i g e n v a l u e s of a s y m m e t r i c t r i d i a g o n a l m a t r i x interval using Sturm sequencing.
those in a s p e c i f i e d
2. USAGE. A.
Calling The
Sequence.
SUBROUTINE SUBROUTINE
statement
is
BISECT(N,EPSI,D,E,E2,LB,UB, MM,M,W,IND,IERR,RV4,RV5)
The p a r a m e t e r s are d i s c u s s e d b e l o w and the interpretation of w o r k i n g p r e c i s i o n for v a r i o u s m a c h i n e s is g i v e n in the s e c t i o n d i s c u s s i n g c e r t i f i c a t i o n . N
is an i n t e g e r input v a r i a b l e the order of the matrix.
EPSI
is a w o r k i n g p r e c i s i o n r e a l v a r i a b l e . On input, it s p e c i f i e s an a b s o l u t e error t o l e r a n c e for the c o m p u t e d e i g e n v a l u e s . If the input EPSI is n o n - p o s i t i v e , it is r e s e t to a d e f a u l t v a l u e d e s c r i b e d in s e c t i o n 2C.
D
is a w o r k i n g p r e c i s i o n r e a l input oned i m e n s i o n a l v a r i a b l e of d i m e n s i o n at least N c o n t a i n i n g the d i a g o n a l e l e m e n t s of the s y m m e t r i c t r i d i a g o n a l matrix.
E
is a w o r k i n g p r e c i s i o n real input oned i m e n s i o n a l v a r i a b l e of d i m e n s i o n at least N c o n t a i n i n g , in its last N-I positions, the s u b d i a g o n a l e l e m e n t s of the s y m m e t r i c t r i d i a g o n a l matrix. E(1) is a r b i t r a r y .
211
set
equal
to
7.1-17
E2
is a w o r k i n g p r e c i s i o n r e a l o n e - d i m e n s i o n a l v a r i a b l e of d i m e n s i o n at l e a s t N. On i n p u t s the last N-I p o s i t i o n s in this a r r a y c o n t a i n the s q u a r e s of the s u b d i a g o n a l e l e m e n t s of the s y m m e t r i c t r i d i a g o n a l matrix. E2(1) is a r b i t r a r y . On o u t p u t , E2(1) is set to zero. If any of the e l e m e n t s in E are r e g a r d e d as n e g l i g i b l e , the c o r r e s p o n d i n g e l e m e n t s of E2 are set to zero, and so the m a t r i x s p l i t s into a d i r e c t s u m of s u b m a t r i c e s .
LB,UB
are w o r k i n g p r e c i s i o n r e a l i n p u t v a r i a b l e s s p e c i f y i n g the l o w e r and u p p e r e n d p o i n t s , r e s p e c t i v e l y , of the i n t e r v a l to b e s e a r c h e d for the e i g e n v a l u e s . If LB is not less than UB, BISECT c o m p u t e s no e i g e n v a l u e s . See s e c t i o n 2C for f u r t h e r d e t a i l s .
MM
is an i n t e g e r i n p u t v a r i a b l e set e q u a l to an u p p e r b o u n d for the n u m b e r of e i g e n v a l u e s in the i n t e r v a l (LB,UB).
M
is an i n t e g e r o u t p u t v a r i a b l e set e q u a l the n u m b e r of e i g e n v a l u e s d e t e r m i n e d to in the i n t e r v a l (LB,UB).
to lie
is a w o r k i n g p r e c i s i o n real o u t p u t oned i m e n s i o n a l v a r i a b l e of d i m e n s i o n at l e a s t MM c o n t a i n i n g the M e i g e n v a l u e s of the s y m m e t r i c t r i d i a g o n a l m a t r i x in the i n t e r v a l (LB,UB). The e i g e n v a l u e s are in a s c e n d i n g o r d e r in W. IND
is an i n t e g e r o u t p u t o n e - d i m e n s i o n a l v a r i a b l e of d i m e n s i o n at l e a s t MM c o n t a i n i n g the s u b m a t r i x i n d i c e s a s s o c i a t e d w i t h the c o r r e s p o n d i n g M e i g e n v a l u e s in W. E i g e n v a l u e s b e l o n g i n g to the f i r s t submatrix have index I, t h o s e b e l o n g i n g to the s e c o n d s u b m a t r i x h a v e i n d e x 2, etc.
IERR
is an i n t e g e r o u t p u t v a r i a b l e set e q u a l an e r r o r c o m p l e t i o n code d e s c r i b e d in s e c t i o n 2B. The n o r m a l c o m p l e t i o n code zero.
RV4,RV5
to is
are w o r k i n g p r e c i s i o n r e a l t e m p o r a r y oned i m e n s i o n a l v a r i a b l e s of d i m e n s i o n at l e a s t N u s e d to h o l d the l o w e r and u p p e r b o u n d s for the e i g e n v a l u e s in the b i s e c t i o n process.
212
7. 1-18
B. Error
Conditions
and
Returns.
If M exceeds MM, BISECT t e r m i n a t e s w i t h no e i g e n v a l u e s c o m p u t e d , and IERR is set to 3*N+I. Upon this error exit, M c o n t a i n s the n u m b e r of e i g e n v a l u e s d e t e r m i n e d to lie in (LB,UB). If
M
does
C. A p p l i c a b i l i t y
not
exceed
MM,
and
Restrictions.
IERR
is set
to zero.
To d e t e r m i n e s o m e of the e i g e n v a l u e s of a full s y m m e t r i c matrix, BISECT s h o u l d be p r e c e d e d by TREDI (F277) to p r o v i d e a s u i t a b l e s y m m e t r i c t r i d i a g o n a l m a t r i x for BISECT. To d e t e r m i n e some of the e i g e n v a l u e s of a c o m p l e x Hermitian matrix, BISECT should be p r e c e d e d by HTRIDI (F284) to p r o v i d e a s u i t a b l e real s y m m e t r i c t r i d i a g o n a l m a t r i x for BISECT. Some of the e i g e n v a l u e s of c e r t a i n n o n - s y m m e t r i c t r i d i a g o n a l m a t r i c e s can be c o m p u t e d u s i n g the c o m b i n a t i o n of FIGI (F280) and BISECT. See F280 for the d e s c r i p t i o n of this s p e c i a l class of m a t r i c e s . For these m a t r i c e s , BISECT s h o u l d be p r e c e d e d by FIGI to p r o v i d e a s u i t a b l e s y m m e t r i c m a t r i x for BISECT. To d e t e r m i n e e i g e n v e c t o r s a s s o c i a t e d w i t h the c o m p u t e d eigenvalues, BISECT s h o u l d be f o l l o w e d by TINVIT (F223) and the a p p r o p r i a t e b a c k t r a n s f o r m a t i o n s u b r o u t i n e -T R B A K I (F279) after TREDI, HTRIBK (F285) after HTRIDI, or B A K V E C (F281) after FIGI. The s u b r o u t i n e s TQLI (F289) and IMTQLI (F291) d e t e r m i n e all the e i g e n v a l u e s of a s y m m e t r i c t r i d i a g o n a l m a t r i x f a s t e r than BISECT determines 25 p e r c e n t of them. Hence, if m o r e than 25 p e r c e n t of them are d e s i r e d , it is r e c o m m e n d e d that TQLI or IMTQLI be used. The i n t e r v a l (LB,UB) is f o r m a l l y h a l f - o p e n , not i n c l u d i n g the upper e n d p o i n t UB. H o w e v e r , b e c a u s e of r o u n d i n g e r r o r s , the true e i g e n v a l u e s v e r y close to the e n d p o i n t s of the i n t e r v a l may be e r r o n e o u s l y c o u n t e d or missed. The input i n t e r v a l (LB,UB) m a y be r e f i n e d i n t e r n a l l y to a s m a l l e r i n t e r v a l k n o w n to c o n t a i n all the e i g e n v a l u e s in (LB,UB). This i n s u r e s that BISECT w i l l not p e r f o r m u n n e c e s s a r y b i s e c t i o n steps to d e t e r m i n e the e i g e n v a l u e s in (LB,UB).
213
7,1-19
The p r e c i s i o n of the c o m p u t e d e i g e n v a l u e s is c o n t r o l l e d t h r o u g h the p a r a m e t e r EPSI. To o b t a i n e i g e n v a l u e s a c c u r a t e to w i t h i n a c e r t a i n a b s o l u t e error, EPSI s h o u l d be set to that error. In p a r t i c u l a r , if MACHEP d e n o t e s the r e l a t i v e m a c h i n e p r e c i s i o n , then to o b t a i n the e i g e n v a l u e s to an a c c u r a c y c o m m e n s u r a t e w i t h s m a l l r e l a t i v e p e r t u r b a t i o n s of the o r d e r of MACHEP in the m a t r i x e l e m e n t s , it is e n o u g h for m o s t t r i d i a g o n a l m a t r i c e s that EPSI be a p p r o x i m a t e l y MACHEP times a n o r m of the m a t r i x . But some m a t r i c e s r e q u i r e a s m a l l e r EPSI for this a c c u r a c y 9 p e r h a p s as s m a l l as MACHEP times the e i g e n v a l u e of s m a l l e s t m a g n i t u d e in (LB,UB). N o t e , h o w e v e r , that if EPSI is s m a l l e r than r e q u i r e d , BISECT w i l l p e r f o r m u n n e c e s s a r y b i s e c t i o n steps to d e t e r m i n e the e i g e n v a l u e s . For f u r t h e r d i s c u s s i o n of EPSI, see r e f e r e n c e (I). If the i n p u t EPSI is n o n - p o s i t i v e , BISECT r e s e t s it, for each s u b m a t r i x , to -MACHEP t i m e s the 1 - n o r m of the s u b m a t r i x and uses its m a g n i t u d e . This v a l u e is t e n t a t i v e l y c o n s i d e r e d a d e q u a t e for c o m p u t i n g the e i g e n v a l u e s to an a c c u r a c y c o m m e n s u r a t e w i t h s m a l l r e l a t i v e p e r t u r b a t i o n s of the o r d e r of MACHEP in the matrix elements.
3.
DISCUSSION
OF M E T H O D
AND
ALGORITHM.
The e i g e n v a l u e s are d e t e r m i n e d a p p l i e d to the S t u r m s e q u e n c e .
by
the m e t h o d
of b i s e c t i o n
The c a l c u l a t i o n s p r o c e e d as f o l l o w s . First, the s u b d i a g o n a l e l e m e n t s are t e s t e d for n e g l i g i b i l i t y . If an e l e m e n t is c o n s i d e r e d n e g l i g i b l e , its s q u a r e is set to zero, and so the m a t r i x s p l i t s into a d i r e c t s u m of s u b m a t r i c e s . Then, the S t u r m s e q u e n c e for the e n t i r e m a t r i x is e v a l u a t e d at UB and LB g i v i n g the n u m b e r of e i g e n v a l u e s of the m a t r i x less t h a n UB and LB respectively. The d i f f e r e n c e is the n u m b e r of e i g e n v a l u e s in (LB,UB). Next, a s u b m a t r i x is e x a m i n e d for its e i g e n v a l u e s in the interval (LB,UB). T h e G e r s c h g o r i n i n t e r v a l , k n o w n to c o n t a i n all the e i g e n v a l u e s , is d e t e r m i n e d and u s e d to r e f i n e the i n p u t i n t e r v a l (LB,UB). If the i n p u t EPSI is n o n p o s i t i v e , it is r e s e t to the d e f a u l t v a l u e d e s c r i b e d in s e c t i o n 2C~ Then, s u b i n t e r v a l s , e a c h e n c l o s i n g an e i g e n v a l u e in (LB,UB), are s h r u n k u s i n g a b i s e c t i o n p r o c e s s u n t i l the e n d p o i n t s of e a c h s u b i n t e r v a l are c l o s e e n o u g h to be a c c e p t e d as an e i g e n v a l u e of the s u b m a t r i x . H e r e the e n d p o i n t s of each s u b i n t e r v a l are c l o s e e n o u g h w h e n they d i f f e r by less than MACHEP times t w i c e the s u m of the m a g n i t u d e s of the e n d p o i n t s plus the a b s o l u t e e r r o r t o l e r a n c e EPSI.
214
7.1-20
The s u b m a t r i x eigenvalues are then merged with previously found eigenvalues into an ordered set. The above steps are repeated eigenvalues in the interval
on each submatrix until all the (LB,UB) are computed.
This subroutine is a subset (except for the section merging eigenvalues of submatrices) of the Fortran subroutine TSTURM (F293), which is a translation of the Algol procedure TRISTURM w r i t t e n and discussed in detail by Peters and W i l k i n s o n (2). A similar Algol procedure BISECT is discussed in detail by Barth, Martin, and W i l k i n s o n (i).
4. REFERENCES.
i)
Barth, W., Martin, R.S., and Wilkinson, J.H., Calculation of the Eigenvalues of a Symmetric Tridiagonal Matrix by the Method of Bisection, Num. Math. 9,386-393 (1967).
2)
Peters, G. and Wilkinson, J.H., The Calculation of Specified Eigenvectors by Inverse Iteration, H a n d b o o k Automatic Computation, Volume II, Linear Algebra, J. H. W i l k i n s o n - C. Reinsch, Contribution 11/18, 418-439, Springer-Verlag, 1971.
for
5. CHECKOUT. A. Test Cases. See the section discussing testing of the codes for complex Hermitian, real symmetric, real symmetric tridiagonal, and certain real n o n - s y m m e t r i c tridiagonal matrices.
B. Accuracy. The subroutine BISECT is n u m e r i c a l l y stable (1,2); that is, the computed eigenvalues are close to those of the original matrix. In addition, they are the exact eigenvalues of a matrix close to the original real symmetric tridiagonal matrix.
215
7.1-21
SUBROUTINE
BISECT(N,EPSI,D,E,E2,LB,UB,MM,M,W,
IND,IERR,RV4,RV5)
INTEGER !,J,K)L,M,N,P,Q,R,S,II)MM,MI,M2,TAG,!ERR,ISTURM REAL D(N))E(N) ,E2(N),W(MM) ,RV4(N),RV5(N) REAL U,V)LB,TI,T2,UB,XU,X0,XI,EPSI,MACHEP REAL ABS,AMAXI,AMiNI,FLOAT INTEGER IND(MM) C C C C C
**********
MACHEP
C
C C
=
MACHEP IS A THE RELATIVE
MACHINE DEPENDENT PARAMETER SPECIFYING PRECISION OF FLOATING POINT ARITHMETIC.
?
IERR = 0 TAG = 0 TI = LB T2 = UB ********** LOOK FOR SMALL SUB-DIAGONAL ENTRIES ********** D O 4 0 I = i) N I F (I .EQ. i) G O T O 20 IF ( A B S ( E ( 1 ) ) .GT. M A C H E P * (ABS(D(1)) + ABS(D(I-I)))) X GO TO 40 20 E2(1) = 0.0 40 C O N T I N U E ********** DETERMINE THE NUMBER OF EIGENVALUES IN THE INTERVAL ********** P = ! q
60
80
=
N
XI = UB ISTURM = I GO TO 320 M = S XI = LB ISTURM = 2 GO TO 320 M = M - S I F (M . G T . M M ) Q
=
R = 0 **********
C C
i00
GO
TO
ESTABLISH INTERVAL IF (R .EQ. M) G O T O TAG = TAG + I P = Q + I XU = D(P)
xo U
=
=
980
0
AND PROCESS NEXT BY THE GERSCHGORIN I001
D(P) 0.0
216
SUBMATRIX, REFINING BOUNDS **********
7.1-22
DO
Ii0
120
1 2 0 Q = P, N X1 = U U = 0.0 V = 0.0 IF (Q .EQ. N) G O T O i i 0 U = ABS(E(Q+I)) V = E2(Q+I) XU = AMINI(D(Q)-(XI+U),XU) X0 = AMAXI(D(Q)+(XI+U),X0) IF (V °EQ. 0 . 0 ) G O T O 1 4 0 CONTINUE
140
X1 = AMAXI(ABS(XU),ABS(X0)) * MACHEP I F ( E P S I .LE. 0 . 0 ) E P S I = - X I IF (P .NE. Q) G O T O 1 8 0 C ********** CHECK FOR ISOLATED ROOT WITHIN INTERVAL IF (rl .GT. D ( P ) .OR. D ( P ) .GE. T2) G O T O 9 4 0 M1 = P M2 = P RVS(P) = D(P) GO TO 9O0 1 8 0 XI = X I * F L O A T ( Q - P + 1 ) LB = AMAXI (TI,XU-XI) UB = AMINI(T2,X0+XI) X1 = LB ISTURM = 3 GO TO 320 200 MI = S + 1 XI = UB ISTURM = 4 GO TO 320 220 M2 = S IF (MI . G T . M 2 ) G O T O 9 4 0 C ********** FIND ROOTS BY BISECTION ********** XO = UB ISTURM = 5
250
240 I = MI, M2 RVS(I) = UB R V 4 (I) = L B CONTINUE ********** LOOP FOR K-TH EIGENVALUE FOR K=M2 STEP -i UNTIL MI (-DO- NOT USED TO LEGALIZE K = M2 XU = LB
260
********** F O R I = K S T E P -I U N T I L M 1 D O 2 6 0 II = M I , K I = M 1 + K - II IF ( X U .GE. R V 4 ( 1 ) ) GO TO 260 XU = RV4(1) GO TO 280 CONTINUE
**********
DO
240 C C C
217
DO -COMPUTEE-GO-TO)
DO
--
**********
**********
7,1-23
280
IF (X0 **********
xl
300
:
oGT. R V 5 ( K ) ) X0 NEXT BISECTION
(xu + x0)
RVS(K) STEP **********
=
* 0.5
IF
( ( X 0 - X U ) .LE, ( 2 . 0 * M A C H E P * X (ABS(XU) + ABS(X0)) + ABS(EPSI))) ********** IN-LINE PROCEDURE FOR STURM 320 S = P - I U=I.0
GO TO 420 SEQUENCE **********
DO
3 4 0 1 = P, Q IF (U .NE. 0 . 0 ) G O T O 3 2 5 V = ABS(E(1)) / MACHEP GO TO 330 V = E2(1) / U U = D(1) - Xl - V I F (U .LT. 0 . 0 ) S = S + ! CONTINUE
325 330 340
360
380
400
420
900
GO TO (60,80,200,220,360), ISTURM ********** REFINE INTERVALS ********** I F (S .GE. K) G O T O 4 0 0 XU = XI IF (S .GE. M I ) G O T O 3 8 0 RV4(MI) = XI GO TO 300 RV4 (S+I) = XI IF (RV5(S) .GT. E l ) R V 5 ( S ) = XI GO TO 300 X0 = X1 GO TO 300 ********** K-TH EIGENVALUE FOUND ********** RV5(K) = El K = K - i IF (K ,GE. M I ) G O T O 2 5 0 ********** ORDER EIGENVALUES TAGGED WITH THEIR SUBMATRIX ASSOCIATIONS ********** S = R R = R + M2 - MI + i J = i K = MI
C DO
9 2 0 L = i, IF (J .GT. IF (K . G T . IF ( R V 5 ( K )
R S) G O T O 9 1 0 M2) GO TO 940 .GE. W ( L ) ) GO
DO
905
9 0 5 Ii = J, S I = L + S - !! W(I+1) = W(I) IND(I+I) = IND(1) CONTINUE
218
TO
915
7.1-24
910
915 920 940
W(L) = RVS(K) I N D (L) = T A G K = K + I GO TO 920 J = J + I CONTINUE IF (Q .LT. GO TO i001 *****~***~
980 IERR = 3 I001LB = TI UB = T2 RETURN END
N)
GO
TO
I00
SET ERROR -- UNDERESTIMATE OF NUMBER EIGENVALUES IN INTERVAL ********** * N + 1
219
OF
7. 1-25
NATS
EIGENSYSTEM
PROJECT
SUBROUTINE F272-2
PACKAGE
(EISPACK)
CBABK2
A F o r t r a n IV S u b r o u t i n e to B a c k T r a n s f o r m the E i g e n v e c t o r s of that C o m p l e x M a t r i x T r a n s f o r m e d by CBAL.
May, July,
1972 1975
I~ P U R P O S E s The F o r t r a n IV s u b r o u t i n e CBABK2 a c o m p l e x g e n e r a l m a t r i x f r o m the t r a n s f o r m e d by CBAL (F271).
f o r m s the e i g e n v e c t o r s of e i g e n v e c t o r s of that m a t r i x
2. U S A G E . A.
Calling The
Sequencer
SUBROUTINE SUBROUTINE
statement
is
C B A B K 2 ( N M , N , L O W , IGH, S C A L E , M , Z R , Z I )
The p a r a m e t e r s are d i s c u s s e d b e l o w and the interpretation of w o r k i n g p r e c i s i o n for v a r i o u s m a c h i n e s is g i v e n in the s e c t i o n d i s c u s s i n g c e r t i f i c a t i o n . NM
is an i n t e g e r i n p u t v a r i a b l e set e q u a l to the row d i m e n s i o n of the t w o - d i m e n s i o n a l arrays ZR and ZI as s p e c i f i e d in the D I M E N S I O N s t a t e m e n t s for ZR and ZI in the c a l l i n g p r o g r a m .
N
is an i n t e g e r i n p u t v a r i a b l e set e q u a l to the n u m b e r of c o m p o n e n t s of the v e c t o r s in the a r r a y Z = (ZR,ZI). N m u s t be not greater than NM.
LOW,!GH
are i n t e g e r i n p u t v a r i a b l e s i n d i c a t i n g the b o u n d a r y i n d i c e s for the b a l a n c e d m a t r i x . See s e c t i o n 3 of F271 for the d e t a i l s .
SCALE
is a w o r k i n g p r e c i s i o n r e a l i n p u t oned i m e n s i o n a l v a r i a b l e of d i m e n s i o n at l e a s t N c o n t a i n i n g i n f o r m a t i o n a b o u t the transformations. See s e c t i o n 3 of F271 for the d e t a i l s .
220
7.1-26
B.
Error
M
is an i n t e g e r i n p u t v a r i a b l e set e q u a l the n u m b e r of c o l u m n s of Z = (ZR,ZI) back transformed.
ZR,ZI
are w o r k i n g p r e c i s i o n r e a l t w o - d i m e n s i o n a l variables with row dimension NM and c o l u m n d i m e n s i o n at l e a s t M. On input, the f i r s t M c o l u m n s of ZR and ZI c o n t a i n the r e a l and i m a g i n a r y parts, r e s p e c t i v e l y , of the e i g e n v e c t o r s to be b a c k t r a n s f o r m e d . On output, these M c o l u m n s of ZR and ZI c o n t a i n the real and i m a g i n a r y p a r t s of the transformed eigenvectors.
Conditions
and
to to be
Returns.
None.
C. A p p l i c a b i l i t y
and
Restrictions.
This s u b r o u t i n e s h o u l d be subroutine CBAL (F271).
3. D I S C U S S I O N
OF M E T H O D
AND
used
in c o n j u n c t i o n
with
the
ALGORITHM.
U s i n g the n o t a t i o n of F271, t r a n s f o r m e d into the m a t r i x transformation
the o r i g i n a l m a t r i x C by the s i m i l a r i t y
A
is
-i C = G
PAPG
where G is the d i a g o n a l m a t r i x w h o s e d i a g o n a l e l e m e n t s are 1.0 in p o s i t i o n s I to LOW-l, 1.0 in p o s i t i o n s IGH+I to N, and are the d i a g o n a l e l e m e n t s of D in p o s i t i o n s LOW to IGH. G i v e n an a r r a y Z of v e c t o r s , the s u b r o u t i n e CBABK2 c o m p u t e s the m a t r i x p r o d u c t PGZ. If the e i g e n v e c t o r s of C are c o l u m n s of the a r r a y Z, then CBABK2 f o r m s the e i g e n v e c t o r s of A in their place. The information about P and D is e n c o d e d in the a r r a y SCALE. See s e c t i o n 3 of F271 for the d e t a i l s . This s u b r o u t i n e is a t r a n s l a t i o n of the A l g o l p r o c e d u r e CBABK2 w h i c h is the a n a l o g u e for c o m p l e x m a t r i c e s of the procedure BALBAK w r i t t e n and d i s c u s s e d in d e t a i l by P a r l e t t and R e i n s c h (I).
221
7.1-27
4. REFERENCES~
i)
5,
Parlett~ B.N. and Reinsch~ C., Balancing a M a t r i x for C a l c u l a t i o n of E i g e n v a l u e s and Eigenvectors, Num. Math. 13,293-304 (1969). (Reprinted in H a n d b o o k for A u t o m a t i c Computation, V o l u m e II, Linear Algebra, J. H. W i l k i n s o n - C. Reinsch, C o n t r i b u t i o n II/ll, 315-326, S p r i n g e r - V e r l a g , 1971.)
CHECKOUT~ A.
Test
Cases°
See the section c o m p l e x general
discussing matrices.
testing
of the
codes
for
B. Accuracy° CBABK2 introduces no rounding errors (on a m a c h i n e with at least one guard digit) since its only arithmetic is scaling the e i g e n v e c t o r m a t r i x by powers of the radix.
222
7.1-28
SUBROUTINE
CBABK2(NM,N,LOW,
IGH, S C A L E , M , Z R , Z I )
INTEGER I,J,K,M,N,II,NM,IGH,LOW REAL SCALE(N),ZR(NM,M),ZI(NM,M) REAL S IF IF
(M .EQ. 0) G O T O 2 0 0 (IGH
.EQ.
LOW)
GO
TO
120
DO
i00 ii0
120
II0 1 = LOW, IGH S = SCALE(l) ********** LEFT HAND EIGENVECTORS ARE IF T H E F O R E G O I N G STATEMENT S=I.0/SCALE(1). ********** DO i 0 0 J = I, M ZR(I,J) = ZR(I,J) * S ZI(I,J) = ZI(I,J) * S CONTINUE
CONTINUE ********** DO
FOR I=LOW-I S T E P -i U N T I L i, I G H + I S T E P 1 U N T I L N D O -- * * * * * * * * * * = i, N
1 4 0 II I = II IF (I .GE. L O W . A N D . I .LE. I G H ) IF (I .LT. L O W ) I = L O W - II K = SCALE(l) IF (K .EQ. I) G O T O 1 4 0 DO
130
1 3 0 J = i, M S = ZR(I,J) ZR(I,J) = ZR(K,J) ZR(K,J) = S S = ZI(I,J) ZI(I,J) = ZI(K,J) ZI(K,J) = S CONTINUE
140
CONTINUE
200
RETURN END
BACK TRANSFORMED IS R E P L A C E D BY
223
GO
TO
140
7. 1-29
NATS
EiGENSYSTEM
PROJECT
SUBROUTINE F271-2
A Fortran
IV
Subroutine
PACKAGE
CBAL
to B a l a n c e
May, July,
(EISPACK)
a Complex
General
Matrix.
1972 i975
i. P U R P O S E . The F o r t r a n IV s u b r o u t i n e CBAL balances a complex general m a t r i x and i s o l a t e s e i g e n v a l u e s w h e n e v e r p o s s i b l e . Sums of the m a g n i t u d e s of e l e m e n t s in c o r r e s p o n d i n g rows and c o l u m n s are m a d e n e a r l y e q u a l by exact s i m i l a r i t y t r a n s f o r m a t i o n s , and e i g e n v a l u e s are i s o l a t e d by p e r m u t a t i o n s i m i l a r i t y transformations. B a l a n c i n g r e d u c e s the 1 - n o r m of the o r i g i n a l m a t r i x w h e n e v e r sums of the m a g n i t u d e s of e l e m e n t s in s o m e r o w and c o r r e s p o n d i n g c o l u m n are m a r k e d l y d i f f e r e n t , w h i l e at the s a m e time l e a v i n g the e i g e n v a l u e s u n c h a n g e d . R e d u c i n g the n o r m in this w a y can i m p r o v e the a c c u r a c y of the computed eigenvalues and/or eigenvectors.
2. U S A G E . A.
Calling The
Sequence.
SUBROUTINE SUBROUTINE
statement
is
CBAL(NM,N,AR,AI,LOW,IGH,SCALE)
The p a r a m e t e r s are d i s c u s s e d b e l o w and the i n t e r p r e t a t i o n of w o r k i n g p r e c i s i o n for v a r i o u s m a c h i n e s is g i v e n in the s e c t i o n d i s c u s s i n g c e r t i f i c a t i o n . NM
is an i n t e g e r i n p u t v a r i a b l e set equal to the row d i m e n s i o n of the t w o - d i m e n s i o n a l arrays AR and AI as s p e c i f i e d in the D I M E N S I O N s t a t e m e n t s for AR and AI in the c a l l i n g p r o g r a m .
N
is an i n t e g e r i n p u t v a r i a b l e set e q u a l the o r d e r of the m a t r i x A = (AR,AI). m u s t be n o t g r e a t e r than NM.
224
to N
7.1-30
AR,AI
are w o r k i n g p r e c i s i o n r e a l t w o - d i m e n s i o n a l variables with row dimension NM and c o l u m n d i m e n s i o n at l e a s t N. On input, AR and AI c o n t a i n the real and i m a g i n a r y parts, r e s p e c t i v e l y , of the c o m p l e x m a t r i x of o r d e r N to be b a l a n c e d . On o u t p u t , AR and AI c o n t a i n the real and i m a g i n a r y p a r t s of the transformed matrix.
LOW, IGH are i n t e g e r o u t p u t v a r i a b l e s i n d i c a t i n g the b o u n d a r y i n d i c e s for the b a l a n c e d m a t r i x . See s e c t i o n 3 for the d e t a i l s . SCALE
B.
Error
is a w o r k i n g p r e c i s i o n r e a l o u t p u t oned i m e n s i o n a l v a r i a b l e of d i m e n s i o n at l e a s t N c o n t a i n i n g i n f o r m a t i o n a b o u t the similarity transformations. See s e c t i o n 3 for the d e t a i l s .
Conditions
and
Returns.
None.
C. A p p l i c a b i l i t y
and
Restrictions.
It is p a r t i c u l a r l y a d v a n t a g e o u s to use CBAL whenever the sums of the m a g n i t u d e s of e l e m e n t s in some row and c o r r e s p o n d i n g c o l u m n are q u i t e d i f f e r e n t . Additionally, the e x e c u t i o n time for CBAL is s m a l l c o m p a r e d w i t h the e x e c u t i o n time for the r o u t i n e s w h i c h d e t e r m i n e the eigenvalues and/or eigenvectors. H e n c e it is r e c o m m e n d e d that CBAL be used g e n e r a l l y . The s u b r o u t i n e C B A B K 2 (F272) s h o u l d be u s e d to r e t r i e v e the e i g e n v e c t o r s of the o r i g i n a l m a t r i x a f t e r the e i g e n v e c t o r s of the t r a n s f o r m e d m a t r i x h a v e b e e n determined. In this i m p l e m e n t a t i o n , throughout.
3. D I S C U S S I O N
OF M E T H O D
First CBAL s u c h that
AND
is
real
ALGORITHM.
determines
PAP
the a r i t h m e t i c
a product
=
P
(T
X
(0
B
Z)
(0
0
R)
225
Y)
of p e r m u t a t i o n
matrices
7.1-31
where T and R are u p p e r t r i a n g u l a r m a t r i c e s and B is a s q u a r e m a t r i x s i t u a t e d in r o w s and c o l u m n s LOW through IGH w i t h no zero o f f - d i a g o n a l r o w s or c o l u m n s . X, Y, and Z are r e c t a n g u l a r m a t r i c e s of a p p r o p r i a t e d i m e n s i o n s . The d i a g o n a l e l e m e n t s of T and R are the i s o l a t e d e i g e n v a l u e s of A. In the e x c e p t i o n a l c a s e w h e r e B is empty, LOW = 1 and IGH = 0 -- h o w e v e r , I is r e t u r n e d as the o u t p u t v a l u e of IGH. N e x t , the s u b r o u t i n e non-singular diagonal that
CBAL determines iteratively a real matrix D of o r d e r IGH-LOW+I such
-i D
BD
is a b a l a n c e d m a t r i x in the s e n s e that the sums of the m a g n i t u d e s of e l e m e n t s in c o r r e s p o n d i n g rows and c o l u m n s
of
-i D
BD
are n e a r l y equal° The d i a g o n a l the r a d i x of the f l o a t i n g p o i n t
e l e m e n t s of D are p o w e r s a r i t h m e t i c of the m a c h i n e .
U p o n c o m p l e t i o n of CBAL, the v e c t o r a r r a y SCALE contains the i n f o r m a t i o n a b o u t P and D n e c e s s a r y for CBABK2 to r e t r i e v e the e i g e n v e c t o r s of the o r i g i n a l m a t r i x f r o m the e i g e n v e c t o r s of the t r a n s f o r m e d m a t r i x . T h e i n f o r m a t i o n is e n c o d e d as f o l l o w s . I. The J-th and SCALE(J)-th rows and c o l u m n s of the o r i g i n a l m a t r i x h a v e b e e n p e r m u t e d for J = 1,2,...,LOW-I,IGH+I,IGH+2,...,N. 2. SCALE(J) is the (J-LOW+l)-th d i a g o n a l e l e m e n t of D for J = LOW,LOW+I,...,IGH. U p o n c o m p l e t i o n of CBAL, the o u t p u t m a t r i x is
( T ( 0
xo -1 D BD
( 0
0
Y
)
-1 D
Z ) R
).
This s u b r o u t i n e is a t r a n s l a t i o n of the A l g o l p r o c e d u r e CBALANCE w h i c h is the a n a l o g u e for c o m p l e x m a t r i c e s of procedure BALANCE w r i t t e n and d i s c u s s e d in d e t a i l by P a r l e t t and R e i n s c h (i).
226
the
of
7.1-32
4. REFERENCES.
~)
Parlett, B.N. and Reinsch, C., Balancing a M a t r i x for C a l c u l a t i o n of Eigenvalues and Eigenvectors, Num. Math. 13,293-304 (1969). (Reprinted in H a n d b o o k for Automatic Computation, Volume II, Linear Algebra, J. H. W i l k i n s o n - C. Reinsch, C o n t r i b u t i o n II/ll, 315-326, S p r i n g e r - V e r l a g , 1971.)
5. CHECKOUT. A.
Test
Cases.
See the section complex general
discussing matrices.
testing
of the codes
for
B. Accuracy. CBAL introduces no rounding errors (on a machine with at least one guard digit) since its only arithmetic is scaling the input matrix by powers of the radix.
227
7~ 1 - 3 3
SUBROUTINE
CBAL(NM,N,AR,AI,LOW,iGH,SCALE)
INTEGER !,J,K,L,M,N,JJ,NM,IGH,LOW,IEXC REAL AR(NM,N),AI(NM,N),SCALE(N) REAL C,F,G,R,S,B2,RADIX REAL ABS LOGICAL NOCONV **********
RADIX
=
A MACHINE DEPENDENT PARAMETER OF THE MACHINE FLOATING POINT
SPECIFYING REPRESENTATION.
#
B2 = RADIX K = 1 L = N GO TO i00 • ********* 20
RADIX IS THE BASE
* RADIX
IN-LINE PROCEDURE FOR ROW COLUMN EXCHANGE ********** SCALE(M) = J I F (J . E Q ~ M ) G O T O 5 0
AND
DO
30
3 0 I = i, L F = AR(I,J) AR(I,J) = AR(I,M) AR(I,M) = F F = AI(I,J) AI(I,J) = AI(I,M) AI(I,M) = F CONTINUE
DO
40
40 1 = K, N F = AR(J,I) AR(J,I) = AR(M,I) AR(M,I) = F F = AI(J,I) AI(J,I) = AI(M,I) A I (M, I) = F CONTINUE
C 50 C C 80 C i00
GO TO (80,130), IEXC ********** SEARCH FOR ROWS ISOLATING AN EIGENVALUE AND PUSH THEM DOWN ********** IF (L .EQ. i) G O T O 2 8 0 L = L - I ********** FOR J=L STEP -I UNTIL i DO -- ********** D O 1 2 0 J J = i, L J = L + i - JJ DO
ii0
i i 0 i = I, L IF (I .EQ. J) G O IF ( A R ( J , I ) .NE. CONTINUE
TO ii0 0.0.0R~
228
AI(J,I)
.NE.
0.0)
GO
TO
120
7.1-34
120
M = L IEXC = 1 GO TO 20 CONTINUE
C GO TO 140 **********
C C 130
K
= K +
140
DO
170
SEARCH FOR COLUMNS AND PUSH THEM LEFT
ISOLATING **********
AN
EIGENVALUE
1
C J = K,
L
C DO
1 5 0 1 = K, L IF (I .EQ. J) G O IF ( A R ( I , J ) .NE. CONTINUE
150
170
180 190
TO 150 0 . 0 .OR.
AI(I,J)
.NE.
M = K IEXC = 2 GO TO 20 CONTINUE ********** NOW BALANCE THE SUBMATRIX IN ROWS D O 1 8 0 I = K, L SCALE(l) = 1.0 ********** ITERATIVE LOOP FOR NORM REDUCTION NOCONV = .FALSE. DO
2 7 0 1 = K, C=0.0 R=0.0
0.0)
GO
K
L
TO
TO
170
**********
**********
L
DO
200
210
220 230
2 0 0 J = K, L IF (J .EQ. I) G O T O 2 0 0 C = C + ABS(AR(J,I)) + ABS(AI(J,I)) R = R + ABS(AR(I,J)) + ABS(AI(I,J)) CONTINUE ********** GUARD AGAINST ZERO C OR R DUE IF (C .EQ. 0 . 0 .OR. R .EQ. 0 . 0 ) G O T O G = R / RADIX F = 1.0 S = C +R I F (C .GE. G) G O T O 2 2 0 F = F * RADIX C = C * B2 GO TO 210 G = R * RADIX IF (C .LT. G) G O T O 2 4 0 F = F / RADIX
C=C/B2 GO TO 230
229
TO UNDERFLOW 270
**********
7. 1 - 3 5
240
********** NOW BALANCE ********** IF ((C + R) / F .GE. 0 . 9 5 * S) G = 1.0 / F SCALE(I) = SCALE(I) * F NOCONV = ~TRUE. DO
2 5 0 J = K~ N AR(I,J) = AR(I,J) iI(I,J) = AI(I,J) CONTINUE
250
2 6 0 J = i, L AR(J,I) = AR(J,I) AI(J,I) = AI(J,I) CONTINUE
* G * G
DO
260 270
CONTINUE IF
280
* F * F
(NOCONV)
GO
TO
190
LOW = K IGH = L RETURN END
230
GO
TO
270
7.1-36
NATS
EIGENSYSTEM
PROJECT
SUBROUTINE F301
A Fortran
PACKAGE
(EISPACK)
CG
IV D r i v e r S u b r o u t i n e to D e t e r m i n e the E i g e n v a l u e s E i g e n v e c t o r s of a C o m p l e x G e n e r a l M a t r i x .
July,
and
1975
i. P U R P O S E . The F o r t r a n IV s u b r o u t i n e CG c a l l s the r e c o m m e n d e d s e q u e n c e of s u b r o u t i n e s f r o m the e i g e n s y s t e m s u b r o u t i n e p a c k a g e EISPACK to d e t e r m i n e the e i g e n v a l u e s and e i g e n v e c t o r s (if d e s i r e d ) of a c o m p l e x g e n e r a l m a t r i x .
2.
USAGE. A.
Calling The
Sequence.
SUBROUTINE SUBROUTINE
statement
is
CG(NM,N,AR,AI,WR,WI,MATZ, ZR,ZI,FVI,FV2,FV3,1ERR)
T h e p a r a m e t e r s are d i s c u s s e d b e l o w and the i n t e r p r e t a t i o n of w o r k i n g p r e c i s i o n for v a r i o u s m a c h i n e s is g i v e n in the s e c t i o n d i s c u s s i n g c e r t i f i c a t i o n . NM
is an i n t e g e r i n p u t v a r i a b l e set e q u a l to the row d i m e n s i o n of the t w o - d i m e n s i o n a l arrays AR, AI, ZR, and ZI as s p e c i f i e d in the D I M E N S I O N s t a t e m e n t s for AR, AI, ZR, and ZI in the c a l l i n g p r o g r a m . is an i n t e g e r i n p u t v a r i a b l e set e q u a l the o r d e r of the m a t r i x A = (AR,AI). m u s t not be g r e a t e r than NM.
AR,AI
to N
are w o r k i n g p r e c i s i o n r e a l t w o - d i m e n s i o n a l v a r i a b l e s w i t h row d i m e n s i o n NM and c o l u m n d i m e n s i o n at l e a s t N. On input, AR and AI c o n t a i n the r e a l and i m a g i n a r y parts, r e s p e c t i v e l y , of the c o m p l e x g e n e r a l m a t r i x of o r d e r N w h o s e e i g e n v a l u e s and e i g e n v e c t o r s are to be found. On o u t p u t , AR and AI have been destroyed.
231
7.1-37
WR,WI
are w o r k i n g p r e c i s i o n r e a l o u t p u t oned i m e n s i o n a l v a r i a b l e s of d i m e n s i o n at l e a s t N c o n t a i n i n g the r e a l and i m a g i n a r y p a r t s , r e s p e c t i v e l y , of the e i g e n v a l u e s of the complex general matrix.
MATZ
is an i n t e g e r i n p u t v a r i a b l e set e q u a l to zero if o n l y e i g e n v a l u e s are d e s i r e d ; o t h e r w i s e it is set to any n o n - z e r o i n t e g e r for b o t h e i g e n v a l u e s and e i g e n v e c t o r s .
ZR,ZI
are, if MATZ is n o n - z e r o , w o r k i n g precision real output two-dimensional variables with row dimension NM and c o l u m n d i m e n s i o n at l e a s t N c o n t a i n i n g the r e a l and i m a g i n a r y p a r t s , r e s p e c t i v e l y , of the eigenvectors. T h e e i g e n v e c t o r s a r e not normalized. If MATZ is zero, ZR and ZI are not r e f e r e n c e d and can be d u m m y variables.
FVI,FV2,FV3 are w o r k i n g dimensional N. IERR
B. E r r o r
precision variables
t e m p o r a r y oneof d i m e n s i o n at
is an i n t e g e r o u t p u t v a r i a b l e set e q u a l an e r r o r c o m p l e t i o n c o d e d e s c r i b e d in s e c t i o n 2B. The n o r m a l c o m p l e t i o n c o d e zero.
Conditions
subroutine
If m o r e t h a n 30 i t e r a t i o n s are r e q u i r e d an e i g e n w a l u e , the s u b r o u t i n e t e r m i n a t e s e q u a l to the i n d e x of the e i g e n v a l u e for failure occurs. The e i g e n v a l u e s in the a r r a y s s h o u l d be c o r r e c t for i n d i c e s I E R R + I , I E R R + 2 , . . . , N , b u t no e i g e n v e c t o r s If all the e i g e n v a l u e s are d e t e r m i n e d iterations, IERR is set to zero.
Applicability
and
to is
and R e t u r n s .
If N is g r e a t e r t h a n NM, the with IERR set e q u a l to 10*N.
C.
least
terminates
to d e t e r m i n e with IERR set w h i c h the WR and WI are
within
computed. 30
Restrictions.
T h i s s u b r o u t i n e can be u s e d to f i n d all the e i g e n v a l u e s and all the e i g e n v e c t o r s (if d e s i r e d ) of a c o m p l e x general matrix.
232
7. 1 - 3 8
3. D I S C U S S I O N
OF M E T H O D
AND
ALGORITHM.
This s u b r o u t i n e calls the r e c o m m e n d e d s e q u e n c e of s u b r o u t i n e s from EISPACK to find the e i g e n v a l u e s and e i g e n v e c t o r s of a c o m p l e x g e n e r a l matrix. To
find
e i g e n v a l u e s only, the s e q u e n c e is the f o l l o w i n g . to b a l a n c e a c o m p l e x g e n e r a l m a t r i x , CORTH to r e d u c e the b a l a n c e d m a t r i x to an upper Hessenberg matrix using unitary transformations. COMQR - to d e t e r m i n e the e i g e n v a l u e s of the o r i g i n a l m a t r i x f r o m the H e s s e n b e r g matrix. C B A L
To find e i g e n v a l u e s and e i g e n v e c t o r s , the s e q u e n c e is the following. C B A L to b a l a n c e a c o m p l e x g e n e r a l matrix. CORTH - to r e d u c e the b a l a n c e d m a t r i x to an u p p e r Hessenberg matrix using unitary transformations. COMQR2 - to d e t e r m i n e the e i g e n v a l u e s and e i g e n v e c t o r s of the b a l a n c e d m a t r i x f r o m the H e s s e n b e r g matrix. C B A B K 2 to b a c k t r a n s f o r m the e i g e n v e c t o r s to those of the o r i g i n a l m a t r i x .
4.
REFERENCES. i)
5.
G a r b o w , B.S. April, 1974.
and
Dongarra,
J.J.,
EISPACK
Path
Chart,
CHECKOUT. A.
Test
Cases.
See the complex
section general
discussing matrices.
testing
of
the
codes
for
B. A c c u r a c y . The a c c u r a c y of CG can be b e s t d e s c r i b e d in terms of its r o l e in those paths of E I S P A C K (I) w h i c h find e i g e n v a l u e s and e i g e n v e c t o r s of c o m p l e x g e n e r a l matrices. In these paths, this s u b r o u t i n e is n u m e r i c a l l y stable. This s t a b i l i t y c o n t r i b u t e s to the p r o p e r t y of these paths that each c o m p u t e d e i g e n v a l u e and its c o r r e s p o n d i n g e i g e n v e c t o r are exact for a m a t r i x c l o s e to the o r i g i n a l m a t r i x .
233
7. 1-39
SUBROUTINE
CG(NM,N,AR,AI,WR~WI,MATZ,ZR,ZI,FVI,FV2,FV3,1ERR)
INTEGER N,NM,ISI,IS2,1ERR,MATZ REAL A R ( N M , N ) , A I ( N M , N ) , W R ( N ) , W I ( N ) , Z R ( N M , N ) , Z I ( N M , N ) , $ FVI(N),FV2(N),FV3(N) IF ( N o L E . !ERR = i 0 GO TO 50
NM) *
GO TO
I0
N
I0 CALL CBAL(NM, N,AR,AI,ISI,IS2,FVI) CALL CORTH(NM,N,ISI,IS2,AR,AI,FV2,FV3) IF (MATZ .RE. 0) GO TO 20 * * * * * * * * * * F I N D E I G E N V A L U E S ONLY * * * * * * * * * * CALL C O M Q R ( N M , N , I S I , I S 2 , A R , A I , W R , W I , IERR) GO TO 50 * * * * * * * * * * F I N D B O T H E I G E N V A L U E S AND E I G E N V E C T O R S ********** 20 CALL COMQR2(NM~N, ISI,IS2,FV2,FV3~AR~AI~WR,WI,ZR,ZI,IERR) IF (IERR .RE. 0) GO TO 50 CALL CBABK2(NM~N,ISI,IS2~FVI,N,ZR,ZI) 50 R E T U R N END
234
7.1-40
NATS
EIGENSYSTEM
PROJECT
SUBROUTINE F302
A Fortran
PACKAGE
(EISPACK)
CH
IV D r i v e r S u b r o u t i n e to D e t e r m i n e the E i g e n v a l u e s E i g e n v e c t o r s of a C o m p l e x H e r m i t i a n M a t r i x .
July,
and
1975
i. P U R P O S E . The F o r t r a n IV s u b r o u t i n e CH calls the r e c o m m e n d e d s e q u e n c e of s u b r o u t i n e s f r o m the e i g e n s y s t e m s u b r o u t i n e p a c k a g e EISPACK to d e t e r m i n e the e i g e n v a l u e s and e i g e n v e e t o r s (if d e s i r e d ) of a c o m p l e x H e r m i t i a n m a t r i x .
2. USAGE. A.
Calling The
Sequence.
SUBROUTINE SUBROUTINE
statement
is
CH(NM,N,AR,AI,W,MATZ, ZR,ZI,FVI,FV2,FMI,IERR)
T h e p a r a m e t e r s are d i s c u s s e d b e l o w and the i n t e r p r e t a t i o n of w o r k i n g p r e c i s i o n for v a r i o u s m a c h i n e s is g i v e n in the s e c t i o n d i s c u s s i n g c e r t i f i c a t i o n . NM
is an i n t e g e r i n p u t v a r i a b l e set e q u a l to the row d i m e n s i o n of the t w o - d i m e n s i o n a l arrays AR, AI, ZR, and ZI as s p e c i f i e d in the D I M E N S I O N s t a t e m e n t s for AR, AI, ZR, and ZI in the c a l l i n g p r o g r a m . is an i n t e g e r i n p u t v a r i a b l e set e q u a l the order of the m a t r i x A = (AR,AI). m u s t not be g r e a t e r than NM.
AR,AI
to N
are w o r k i n g p r e c i s i o n real t w o - d i m e n s i o n a l variables with row dimension NM and c o l u m n d i m e n s i o n at l e a s t N. On input, AR and AI c o n t a i n the r e a l and i m a g i n a r y p a r t s , r e s p e c t i v e l y , of the c o m p l e x H e r m i t i a n m a t r i x of o r d e r N w h o s e e i g e n v a l u e s and
235
7. 1-41
e i g e n v e c t o r s are to be f o u n d . O n l y the f u l l l o w e r t r i a n g l e of AR and the s t r i c t lower t r i a n g l e of AI n e e d be s u p p l i e d . On o u t p u t , the f u l l u p p e r t r i a n g l e of AR and the s t r i c t u p p e r t r i a n g l e of Ai are unaltered.
B.
Error
W
is a w o r k i n g p r e c i s i o n r e a l o u t p u t oned i m e n s i o n a l v a r i a b l e of d i m e n s i o n at l e a s t N c o n t a i n i n g the e i g e n v a l u e s of the c o m p l e x H e r m i t i a n m a t r i x in a s c e n d i n g order.
MATZ
is an i n t e g e r i n p u t v a r i a b l e set e q u a l to zero if o n l y e i g e n v a l u e s are d e s i r e d ; o t h e r w i s e it is set to any n o n - z e r o i n t e g e r for b o t h e i g e n v a l u e s and e i g e n v e c t o r s .
ZR,ZI
are, if MATZ is n o n - z e r o , w o r k i n g precision real output two-dimensional variables with row dimension NM and c o l u m n d i m e n s i o n at l e a s t N c o n t a i n i n g the r e a l and i m a g i n a r y p a r t s , r e s p e c t i v e l y , of the eigenvectors. The e i g e n v e c t o r s are orthonormal. If MATZ is zero, ZR and ZI are n o t r e f e r e n c e d and can be d u m m y variables.
FVI,FV2
are w o r k i n g dimensional N.
precision variables
temporary oneof d i m e n s i o n at
least
FMI
is a w o r k i n g p r e c i s i o n t e m p o r a r y twod i m e n s i o n a l v a r i a b l e w i t h row d i m e n s i o n and c o l u m n d i m e n s i o n at l e a s t N.
!ERR
is an i n t e g e r o u t p u t v a r i a b l e set e q u a l an e r r o r c o m p l e t i o n code d e s c r i b e d in s e c t i o n 2B. The n o r m a l c o m p l e t i o n code zero.
Conditions
to is
and R e t u r n s .
If N is g r e a t e r t h a n NM, the with IERR set e q u a l to 10*N.
subroutine
terminates
If m o r e t h a n 30 i t e r a t i o n s are r e q u i r e d to d e t e r m i n e an e i g e n v a l u e , the s u b r o u t i n e t e r m i n a t e s w i t h IERR set e q u a l to the i n d e x of the e i g e n v a l u e for w h i c h the failure occurs. The e i g e n v a l u e s in the W array should be c o r r e c t for i n d i c e s 1 , 2 , . . . , I E R R - I , but no e i g e n v e c t o r s are c o m p u t e d .
236
7.1-42
If a l l the e i g e n v a l u e s are d e t e r m i n e d iterations, IERR is set to zero.
C. A p p l i c a b i l i t y
within
30
and R e s t r i c t i o n s .
This s u b r o u t i n e can be u s e d to find all the e i g e n v a l u e s and all the e i g e n v e c t o r s (if d e s i r e d ) of a c o m p l e x Hermitian matrix.
3. D I S C U S S I O N
OF M E T H O D
AND
ALGORITHM.
T h i s s u b r o u t i n e calls the r e c o m m e n d e d s e q u e n c e of s u b r o u t i n e s from EISPACK to find the e i g e n v a l u e s and e i g e n v e c t o r s of a complex Hermitian matrix. To
find e i g e n v a l u e s only, the s e q u e n c e is the f o l l o w i n g . HTRIDI to r e d u c e a c o m p l e x H e r m i t i a n m a t r i x to a r e a l symmetric tridiagonal matrix using unitary transformations. T Q L R A T - to d e t e r m i n e the e i g e n v a l u e s of the o r i g i n a l m a t r i x f r o m the real s y m m e t r i c t r i d i a g o n a l matrix. -
To find e i g e n v a l u e s and e i g e n v e c t o r s , the s e q u e n c e is the following. HTRIDI to r e d u c e a c o m p l e x H e r m i t i a n m a t r i x to a r e a l symmetric tridiagonal matrix using unitary transformations. TQL2 - to d e t e r m i n e the e i g e n v a l u e s and e i g e n v e e t o r s of the real s y m m e t r i c t r i d i a g o n a l m a t r i x . HTRIBK to b a c k t r a n s f o r m the e i g e n v e c t o r s to those of the o r i g i n a l m a t r i x . -
-
4.
REFERENCES. i)
5.
G a r b o w , B.S. A p r i l , 1974.
and
Dongarra,
J.J.,
EISPACK
Path
Chart,
CHECKOUT. A.
Test
Cases.
See the s e c t i o n d i s c u s s i n g t e s t i n g complex Hermitian matrices. B. A c c u r a c y .
237
of
the
codes
for
7. 1-43
The a c c u r a c y of CH can b e s t b e d e s c r i b e d in terms of its r o l e in t h o s e p a t h s of E I S P A C K (I) w h i c h find e i g e n v a l u e s and e i g e n v e c t o r s of c o m p l e x H e r m i t i a n matrices. In t h e s e p a t h s , this s u b r o u t i n e is numerically stable. This s t a b i l i t y c o n t r i b u t e s to the p r o p e r t y of t h e s e p a t h s that the c o m p u t e d e i g e n v a l u e s are the e x a c t e i g e n v a l u e s of a m a t r i x c l o s e to the o r i g i n a l m a t r i x and the c o m p u t e d e i g e n v e c t o r s are c l o s e (but not n e c e s s a r i l y equal) to the e i g e n v e c t o r s of that matrix,
238
7.1-44
SUBROUTINE
CN(NM~N,AR,AI,W~MATZ,ZR,ZI,FVI,FV2,FMI,IERR)
INTEGER I,J,N,NM,IERR,MATZ REAL AR(NM,N),AI(NM,N),W(N),ZR(NM,N),ZI(NM,N), $ FVI(N),FV2(N),FMI(2,N) IF (N .LE. NM) I E R R = i0 * N GO TO 50
GO TO
i0
C i0 C A L L HTRIDI(NM,N,AR,AI,W,FVI,FV2,FMI) IF ( M A T Z .NE. 0) GO TO 20 ********** FIND EIGENVALUES ONLY ********** CALL TQLRAT(N,W,FV2,1ERR) GO TO 50 ********** FIND BOTH EIGENVALUES AND EIGENVECTORS 20 DO 40 I = i, N DO 30
30 J = i, N Z R ( J , I ) = 0.0 CONTINUE
ZR(I,I) 40
= 1.0
CONTINUE
CALL TQL2(NM,N,W,FVI,ZR,IERR) IF ( I E R R .NE. 0) GO TO 50 CALL HTR!BK(NM,N,AR,AI,FMI,N,ZR,ZI) 50 R E T U R N END
239
**********
7.1-45
NATS
EIGENSYSTEM
PROJECT
SUBROUTINE F297-2
PACKAGE CINVIT
A F o r t r a n IV S u b r o u t i n e to D e t e r m i n e T h o s e Upper Hessenberg Matrix Corresponding
May, July,
(EISPACK)
Eigenvectors to S p e c i f i e d
of a C o m p l e x Eigenvalues.
1972 1975
i. P U R P O S E . The F o r t r a n IV s u b r o u t i n e CINVIT c o m p u t e s the e i g e n v e c t o r s of a c o m p l e x upper H e s s e n b e r g m a t r i x c o r r e s p o n d i n g to s p e c i f i e d e i g e n v a l u e s using i n v e r s e i t e r a t i o n .
2. USAGE. A.
Calling The
Sequence.
SUBROUTINE SUBROUTINE
statement
is
CINVlT(NM, N,AR,A!,WR,WI,SELECT, MM,M,ZR,ZI,IERR,RMI,RM2,RVI,RV2)
The p a r a m e t e r s are d i s c u s s e d b e l o w and the interpretation of w o r k i n g p r e c i s i o n for v a r i o u s m a c h i n e s is g i v e n in the s e c t i o n d i s c u s s i n g c e r t i f i c a t i o n . NM
is an i n t e g e r input v a r i a b l e set equal to the row d i m e n s i o n of the t w o - d i m e n s i o n a l arrays AR, AI, ZR, and ZI as s p e c i f i e d in the D I M E N S I O N s t a t e m e n t s for AR, AI, ZR, and ZI in the c a l l i n g p r o g r a m .
N
is an i n t e g e r input v a r i a b l e set equal the order of the m a t r i x A = (AR,AI). m u s t be not g r e a t e r t h a n NM.
AReAl
are w o r k i n g p r e c i s i o n real input twod i m e n s i o n a l v a r i a b l e s w i t h row d i m e n s i o n NM and c o l u m n d i m e n s i o n at least N containing the r e a l and i m a g i n a r y parts 3 r e s p e c t i v e l y ~ of the c o m p l e x u p p e r H e s s e n b e r g matrix.
240
to N
7.1-46
WR,WI
are working precision real o n e - d i m e n s i o n a l v a r i a b l e s of d i m e n s i o n at least N. On input, they contain the real and imaginary parts, respectively, of the eigenvalues of the H e s s e n b e r g matrix. The eigenvalues need not be ordered, except that eigenvalues of any submatrix of the input H e s s e n b e r g m a t r i x must have indices in WR,WI w h i c h lie between the b o u n d a r y indices for that submatrix. These ordering constraints are satisfied by the output eigenvalues from COMLR (F295). On output, the eigenvalues are unaltered, except that the real parts of close eigenvalues may be perturbed slightly in an attempt to obtain i n d e p e n d e n t eigenvectors.
SELECT
is a logical input o n e - d i m e n s i o n a l v a r i a b l e of dimension at least N whose true elements flag those eigenvalues whose eigenvectors are desired.
MM
is an integer input variable set equal to an upper bound for the number of columns required to hold the desired eigenvectors.
M
is an integer output v a r i a b l e set equal to the number of columns actually used to store the eigenvectors.
ZR,ZI
are working p r e c i s i o n real output twod i m e n s i o n a l variables with row d i m e n s i o n NM and column d i m e n s i o n at least MM containing the real and imaginary parts, respectively, of the eigenvectors c o r r e s p o n d i n g to the flagged eigenvalues. The eigenvectors are packed into the columns of ZR and ZI starting at the first columns.
IERR
is an integer output variable set equal an error completion code described in section 2B. The normal completion code zero.
RMI,RM2
to is
are w o r k i n g p r e c i s i o n real temporary array variables of dimension at least N*N. These arrays holds the triangularized form of the upper H e s s e n b e r g m a t r i x used in the inverse iteration process.
241
7.1-47
RVI,RV2
B.
Error
are w o r k i n g p r e c i s i o n r e a l t e m p o r a r y o n e d i m e n s i o n a l v a r i a b l e s of d i m e n s i o n at l e a s t N. T h e y h o l d the a p p r o x i m a t e e i g e n v e c t o r s d u r i n g the i n v e r s e i t e r a t i o n p r o c e s s .
Conditions
and
Returns~
If m o r e than MM e i g e n v e c t o r s are r e q u e s t e d , CINVIT terminates with IERR set to -(2*N+I) and w i t h the In first MM e i g e n v e c t o r s in the a r r a y s ZR and ZI. this c a s e , M = MM. If n o n e of the i n i t i a l v e c t o r s for the i n v e r s e i t e r a t i o n p r o c e s s p r o d u c e s an a c c e p t a b l e a p p r o x i m a t i o n to an eigenvector, CINVIT t e r m i n a t e s the c o m p u t a t i o n for t h a t e i g e n v e c t o r and sets IERR to -K where K is the i n d e x of the a s s o c i a t e d e i g e n v a l u e . If this f a i l u r e o c c u r s for m o r e t h a n one e i g e n v a l u e , the last o c c u r r e n c e is r e c o r d e d in IERR. T h e c o l u m n s of ZR and ZI c o r r e s p o n d i n g to f a i l u r e s of the a b o v e sort are set to zero v e c t o r s . If b o t h of the a b o v e e r r o r c o n d i t i o n s o c c u r , CINVIT terminates with IERR set to -(N+K) where K is the i n d e x of the last e i g e n v a l u e w h o s e i n v e r s e i t e r a t i o n process failed. The c o l u m n s of ZR and ZI c o r r e s p o n d i n g to f a i l u r e s in the i n v e r s e i t e r a t i o n p r o c e s s are set to z e r o v e c t o r s , and in this case, M = MM. If n e i t h e r sets IERR
C. A p p l i c a b i l i t y
of the a b o v e to zero.
and
error
conditions
occurs,
CINVIT
Restrictions.
To d e t e r m i n e e i g e n v e c t o r s c o r r e s p o n d i n g to some of the e i g e n v a l u e s of a c o m p l e x g e n e r a l m a t r i x , CINVlT should be p r e c e d e d by C O M H E S (F282) and C O M L R (F295). COMHES provides a suitable complex upper Hessenberg m a t r i x for CINVIT and COMLR d e t e r m i n e s the e i g e n v a l u e s of this H e s s e n b e r g m a t r i x . CINVIT should t h e n be f o l l o w e d by C O M B A K (F283) to b a c k t r a n s f o r m the e i g e n v e c t o r s f r o m CINVIT into t h o s e of the original matrix. Note: the u p p e r H e s s e n b e r g m a t r i x m u s t be s a v e d b e f o r e COMLR, since COMLR d e s t r o y s this p a r t of A = (AR,AI). It is r e c o m m e n d e d in g e n e r a l t h a t C B A L (F271) be u s e d before COMHES in w h i c h c a s e C B A B K 2 (F272) m u s t be used after COMBAK.
242
7.1-48
In this i m p l e m e n t a t i o n , the a r i t h m e t i c t h r o u g h o u t e x c e p t for c o m p l e x d i v i s i o n a b s o l u t e value.
3. D I S C U S S I O N
OF M E T H O D
AND
is r e a l and c o m p l e x
ALGORITHM.
The e i g e n v e c t o r s are d e t e r m i n e d by i n v e r s e i t e r a t i o n . In CINVIT, this is a p r o c e s s w h e r e b y a v e c t o r XI satisfying the m a t r i x l i n e a r e q u a t i o n U ' X 1 = X0 is c o m p u t e d , w h e r e X0 is an i n i t i a l v e c t o r and U is the u p p e r t r i a n g u l a r f a c t o r in the LU d e c o m p o s i t i o n of the m a t r i x B-W*I with partial pivoting. W is an a p p r o x i m a t e e i g e n v a l u e of a leading submatrix B of the H e s s e n b e r g m a t r i x in A. The vector X1 is a c c e p t e d as an e i g e n v e c t o r of B if the n o r m of XI is s u f f i c i e n t l y l a r g e r than the n o r m of X0. This e i g e n v e c t o r of B is t r a n s f o r m e d to an e i g e n v e c t o r of A by s i m p l y a p p e n d i n g zero c o m p o n e n t s to it. The r e a l and i m a g i n a r y p a r t s of U are s t o r e d in the two real a r r a y s RMI and RM2 respectively. Internally, RMI and RM2 are t r e a t e d as t w o - d i m e n s i o n a l NxN arrays. T h e a c c e p t a n c e c r i t e r i o n for X1 is a g r o w t h test of its norm. If MACHEP d e n o t e s the r e l a t i v e m a c h i n e p r e c i s i o n , then c u r r e n t l y , XI is r e j e c t e d as an e i g e n v e c t o r if SQRT(UK)*!!B!!*MACHEP*!!XI!!
.LT.
!!X0!!/10.0
where UK is the order of the s u b m a t r i x B whose e i g e n v e c t o r is b e i n g c o m p u t e d and the n o r m !! !! is the i n f i n i t y norm. At m o s t UK orthogonal initial vectors XO are t r i e d to o b t a i n the r e q u i r e d growth. If no v e c t o r is a c c e p t e d , the p a r a m e t e r IERR is set to i n d i c a t e this f a i l u r e and CINVIT p r o c e e d s to c o m p u t e the n e x t eigenvector. The r e a l p a r t s of close or i d e n t i c a l e i g e n v a l u e s w h o s e e i g e n v e c t o r s are d e s i r e d m a y be p e r t u r b e d s l i g h t l y in an a t t e m p t to o b t a i n i n d e p e n d e n t e i g e n v e c t o r s (if they exist). If r e q u i r e d , s u c h p e r t u r b a t i o n s are p o s i t i v e and s m a l l m u l t i p l e s of MACHEP*I!B!!. This s u b r o u t i n e is a t r a n s l a t i o n of the A l g o l p r o c e d u r e CX I N V I T w r i t t e n and d i s c u s s e d in d e t a i l by P e t e r s and W i l k i n s o n (i).
243
7. 1-49
4. REFERENCE$~
1)
Peters, G. and Wilkinson, J.H., The C a l c u l a t i o n of S p e c i f i e d E i g e n v e c t o r s by Inverse Iteration, H a n d b o o k A u t o m a t i c C o m p u t a t i o n , V o l u m e II, Linear Algebra, J. H. W i l k i n s o n - C. Reinsch, C o n t r i b u t i o n 11/18, 418-439, S p r i n g e r - V e r l a g , 1971.
for
5. CHECKOUT. Ao Test
Cases°
See the section c o m p l e x general
discussing matrices~
testing
of the
codes
for
Bo Accuracy° The accuracy of CINVIT can best be described in terms of its role in those paths of EISPACK which find e i g e n v a l u e s and e i g e n v e c t o r s of complex upper H e s s e n b e r g matrices. In these paths, this s u b r o u t i n e is n u m e r i c a l l y stable (i). This stability c o n t r i b u t e s to the p r o p e r t y of these paths that each computed e i g e n v a l u e and its c o r r e s p o n d i n g e i g e n v e c t o r are exact for a m a t r i x close to the original upper H e s s e n b e r g matrix~
244
7 • 1-50
SUBROUTINE
CINVIT(NM,N,AR,AI,WR,WI,SELECT,MM,M,ZR,ZI, IERR,RMI,RM2,RVI,RV2)
X
INTEGER I,J,K,M,N,S,II,MM,MP,NM,UK, IPI,ITS,KMI,IERR REAL AR(NM,N),AI(NM,N),WR(N),WI(N),ZR(NM,MM),ZI(NM,MM), X RMI(N,N),RM2(N,N),RVI(N),RV2(N) REAL X,Y,EPS3,NORM,NORMV,GROWTO,ILAMBD,MACHEP,RLAMBD,UKROOT REAL SQRT,CABS,ABS,FLOAT LOGICAL SELECT(N) C O M P L E X Z3 COMPLEX CMPLX REAL REAL,AIMAG **********
MACHEP
=
M A C H E P IS A M A C H I N E D E P E N D E N T PARAMETER SPECIFYING THE RELATIVE PRECISION OF F L O A T I N G POINT ARITHMETIC.
?
IERR = 0 UK = 0 S = I DO
C
C C
9 8 0 K = i, N IF ( . N O T . S E L E C T ( K ) ) GO TO 980 IF (S .GT. MM) GO TO i 0 0 0 IF (UK .GE. K) G O TO 2 0 0 ********** CHECK FOR POSSIBLE SPLITTING ********** DO 120 U K = K, N IF (UK .EQ. N) G O TO 140 IF ( A R ( U K + I , U K ) .EQ. 0 . 0 .AND. A I ( U K + I , U K ) .EQ. X GO T O 140 120 CONTINUE ********** C O M P U T E I N F I N I T Y N O R M OF L E A D I N G U K BY U K (HESSENBERG) MATRIX ********** 140 N O R M = 0.0 MP = I DO
160
180 X =
I = 0.0
i,
0.0)
UK
DO 160 J = MP, U K X = X + CABS(CMPLX(AR(I,J),AI(I,J)))
C
180
IF (X °GT. N O R M ) N O R M = X MP = I CONTINUE ********** EPS3 REPLACES Z E R O P I V O T IN D E C O M P O S I T I O N AND CLOSE ROOTS ARE MODIFIED BY E P S 3 * * * * * * * * * * IF ( N O R M .EQ. 0.0) N O R M = 1.0 EPS3 = MACHEP * NORM
245
7.1-51
C
200
C C 220 C 240
260
********** GROWTO IS T H E C R I T E R I O N FOR GROWTH ********** UKROOT = SQRT(FLOAT(UK)) GROWTO = I,OE-I / UKROOT RLAMBD = WR(K) ILAMBD = WI(K) IF (K .EQ. i) G O T O 2 8 0 KMI = K - 1 GO TO 240 ********** PERTURB EIGENVALUE IF IT IS C L O S E TO ANY PREVIOUS EIGENVALUE ********** RLAMBD = RLAMBD + EPS3 ********** FOR I=K-I STEP -I UNTIL 1 DO -- ********** D O 2 6 0 II = i~ K M I I = K - II I F (SELECT(I) . A N D . A B S ( W R ( I ) - R L A M B D ) .LT. E P S 3 .AND. ABS(WI(I)-ILAMBD) .LT. E P S 3 ) G O T O 2 2 0 X CONTINUE
C WR(K) = RLAMBD ********** FORM UPPER HESSENBERG (AR,AI)-(RLAMBD,ILAMBD)*I AND INITIAL COMPLEX VECTOR ********** MP = I
C C 280 C
DO
320
I =
i,
UK
C DO
300 J = MP, UK RMI(i,J) = AR(I,J) RM2(I,J) = AI(I,J) CONTINUE
300
RMI(I,I) = RMI(I,I) - RLAMBD RM2(I,I) = RM2(I,I) - ILAMBD MP = I RVI(1) = EPS3 CONTINUE ********** TRIANGULAR DECOMPOSITION REPLACING ZERO PIVOTS BY I F ( U K oEQ. I) G O T O 4 2 0
320
DO
X
4 0 0 ! = 2, U K MP = I - 1 IF ( C A B S ( C M P L X ( R M I ( I , M P ) , R M 2 ( ! , M P ) ) ) CABS(CMPLX(RMI(MP,MP),RM2(MP,MP)))) DO
340
WITH EPS3
340 J = MP, UK Y = RMI(I,J) R M I (I, J) = R M I (MP, J) RMI(MP,J) = Y Y = RM2(I,J) R M 2 (I, J) = R M 2 (MP, J) R M 2 (MP, J) = Y CONTINUE
246
INTERCHANGES, **********
.LE. GO
TO
360
7.1-52
IF
(RMI(MP,MP) .EQ. 0 . 0 . A N D . R M 2 ( M P , M P ) .EQ. RMI(MP,MP) = EPS3 Z3 = C M P L X ( R M I ( I , M P ) , R M 2 ( I , M P ) ) / CMPLX(RMI(MP,MP),RM2(MP,MP)) X = REAL(Z3) Y = AIMAG(Z3) IF (X .EQ. 0 . 0 . A N D . Y .EQ. 0 . 0 ) G O T O 4 0 0
360 X X
DO
380 J = RMI(I,J) RM2(I,J) CONTINUE
380 400
680 J X = X Y = Y CONTINUE
680
* RM2(MP,J) * RMI(MP,J)
IPI, UK - RMI(I,J) - RMI(I,J)
=
* RVI(J) * RV2(J)
+ RM2(I,J) - RM2(I,J)
Z3 = C M P L X ( X , Y ) / CMPLX(RMI(I,I),RM2(I,I)) RVI(1) = REAL(Z3) RV2(1) = AIMAG(Z3) CONTINUE ********** ACCEPTANCE TEST FOR EIGENVECTOR AND NORMALIZATION ********** ITS = I T S + 1 NORM = 0.0 NORMV = 0.0 DO
760 780
+ Y - Y
(RMI(UK,UK) .EQ. 0 . 0 . A N D . R M 2 ( U K , U K ) .EQ. 0 . 0 ) RMI(UK,UK) = EPS3 ITS = 0 ********** BACK SUBSTITUTION F O R I--UK S T E P -i U N T I L 1 DO -- * * * * * * * * * * D O 720 II = i, U K I = U K + 1 - II X = R V I (I) Y = 0.0 IF (I .EQ. U K ) G O T O 7 0 0 IPI = I + i DO
720
* RMI(MP,J) * RM2(MP,J)
IF
X
700
- X - X
CONTINUE
420
660
I, U K = RMI(I,J) = RM2(I,J)
0.0)
7 8 0 1 = i, U K X = CABS (CMPLX(RVI IF ( N O R M V .GE. X) NORMV = X J = I NORM = NORM + X CONTINUE IF
(NORM
.LT.
GROWTO)
(I), R V 2 ( I ) ) ) G O TO 7 6 0
GO
247
TO
840
* RV2(J) * RVI(J)
7.1-53
********** ACCEPT X = R V I (J) Y = R V 2 (J)
VECTOR
**********
DO
8 2 0 i = i, U K Z3 = CMPLX(RVI(1),RV2(1)) ZR(I,S) = REAL(Z3) ZI(I,S) = AIMAG(Z3) CONTINUE
820
840
I F ( U K .EQ. N) G O T O 9 4 0 J = UK + 1 GO TO 900 ********** IN-LINE PROCEDURE FOR A NEW STARTING VECTOR I F ( I T S .GE. U K ) G O T O 8 8 0 X = UKROOT Y = E P S 3 / (X + 1 . 0 ) RVI(1) = EPS3 DO
860
860
1 =
RVI(I)
=
2,
/ CMPLX(X,Y)
CHOOSING **********
UK
Y
920
J = UK - ITS + 1 RVI(J) = RVI(J) - EPS3 * X GO TO 660 • ********* SET ERROR -- UNACCEPTED EIGENVECTOR J = I IERR = -K • ********* SET REMAINING VECTOR COMPONENTS TO D O 9 2 0 I = J, N ZR(I,S) = 0.0 Zi(I,S) = 0.0 CONTINUE
940 980
S = S + CONTINUE
880
900
I000
IF IF
(IERR (IERR I001M = S - i RETURN END
ZERO
1
GO TO i001 **********
C C
**********
SET ERROR -- UNDERESTIMATE SPACE REQUIRED ********** .NE. 0) I E R R = I E R R - N oEQ. 0) I E R R = - ( 2 * N + i)
248
OF
EIGENVECTOR
**********
7.1-54
NATS
EIGENSYSTEM
PROJECT
SUBROUTINE F283-2
A Fortran of that
PACKAGE
(EISPACK)
COMBAK
IV S u b r o u t i n e to B a c k T r a n s f o r m the E i g e n v e c t o r s U p p e r H e s s e n b e r g M a t r i x D e t e r m i n e d by COMHES.
May, July,
1972 1975
I. P U R P O S E . The F o r t r a n IV s u b r o u t i n e COMBAK forms the e i g e n v e c t o r s of a c o m p l e x g e n e r a l m a t r i x f r o m the e i g e n v e c t o r s of that u p p e r ~ e s s e n b e r g m a t r i x d e t e r m i n e d by COMHES (F282).
2. USAGE. A.
Calling The
Sequence.
SUBROUTINE SUBROUTINE
statement
is
COMBAK(NM,LOW, IGH,AR,AI,INT,M,ZR,ZI)
The p a r a m e t e r s are d i s c u s s e d b e l o w and the interpretation of w o r k i n g p r e c i s i o n for v a r i o u s m a c h i n e s is g i v e n in the s e c t i o n d i s c u s s i n g c e r t i f i c a t i o n . NM
is an i n t e g e r input v a r i a b l e set equal to the row d i m e n s i o n of the t w o - d i m e n s i o n a l arrays AR, AI, ZR, and ZI as s p e c i f i e d in the D I M E N S I O N s t a t e m e n t s for AR, AI, ZR, and ZI in the c a l l i n g program.
LOW, IGH
are i n t e g e r input v a r i a b l e s i n d i c a t i n g the b o u n d a r y i n d i c e s for the b a l a n c e d matrix. See s e c t i o n 3 of F271 for the details. If the m a t r i x is not b a l a n c e d , set LOW to i and IGH to the order of the matrix.
AR,AI
are w o r k i n g p r e c i s i o n real input twod i m e n s i o n a l v a r i a b l e s w i t h row d i m e n s i o n NM and c o l u m n d i m e n s i o n at least IGH. Their lower t r i a n g l e s b e l o w the s u b d i a g o n a l c o n t a i n the m u l t i p l i e r s w h i c h w e r e u s e d in
249
7.1-55
the r e d u c t i o n to the H e s s e n b e r g form. The r e m a i n i n g u p p e r p a r t s of AR and AI are arbitrary. See s e c t i o n 3 of F282 for the details.
B.
Error
INT
is an i n t e g e r i n p u t o n e - d i m e n s i o n a l v a r i a b l e of d i m e n s i o n at l e a s t IGH. INT identifies the rows a n d c o l u m n s i n t e r c h a n g e d d u r i n g the r e d u c t i o n by COMHES. See s e c t i o n 3 of F282 for the d e t a i l s .
M
is an i n t e g e r input v a r i a b l e set e q u a l the n u m b e r of c o l u m n s of Z = (ZR,ZI) back transformed.
ZR,ZI
are w o r k i n g p r e c i s i o n r e a l t w o - d i m e n s i o n a l v a r i a b l e s w i t h row d i m e n s i o n NM and c o l u m n d i m e n s i o n at l e a s t M. On i n p u t , the f i r s t M c o l u m n s of ZR and ZI c o n t a i n the r e a l and i m a g i n a r y p a r t s , r e s p e c t i v e l y , of the e i g e n v e c t o r s to be b a c k t r a n s f o r m e d . On output, these M c o l u m n s of ZR and ZI c o n t a i n the r e a l and i m a g i n a r y p a r t s of the transformed eigenvectors.
Conditions
and
to to be
Returns.
None.
C.
Applicability
and
Restrictions.
This s u b r o u t i n e s h o u l d be u s e d subroutine C O M H E S (F282).
3.
DISCUSSION
OF M E T H O D
AND
in c o n j u n c t i o n
with
the
ALGORITHM.
C (say) has b e e n r e d u c e d to the S u p p o s e that the m a t r i x s t o r e d in A by the s i m i l a r i t y upper Hessenberg form F transformation -i F = G
CG
where G is a p r o d u c t of the p e r m u t a t i o n and e l e m e n t a r y m a t r i c e s e n c o d e d in INT a n d in a l o w e r t r i a n g l e of A under F respectively. Then, g i v e n an a r r a y Z of c o l u m n vectors, COMBAK c o m p u t e s the m a t r i x p r o d u c t GZ. If the e i g e n v e c t o r s of F are c o l u m n s of the a r r a y Z, then COMBAK f o r m s the e i g e n v e c t o r s of C in their place.
250
7.1-56
This subroutine COMBAK written W i l k i n s o n (I).
is a translation of the Algol p r o c e d u r e and discussed in detail by M a r t i n and
4. REFERENCES.
1)
Martin, R.S. and Wilkinson, J.H., Similarity Reduction of a General M a t r i x to H e s s e n b e r g Form, Num. Math. 12,349-368 (1968). (Reprinted in H a n d b o o k for Automatic Computation, Volume II, Linear Algebra, J. H. W i l k i n s o n - C. Reinsch, C o n t r i b u t i o n 11/13, 339-358, S p r i n g e r - V e r l a g , 1971.)
5. CHECKOUT. A. Test
Cases.
See the section complex general
discussing matrices.
testing
of the codes
for
B. Accuracy. The accuracy of COMBAK can best be described in terms of its role in those paths of EISPACK which find eigenvalues and eigenvectors of complex general matrices. In these paths, this s u b r o u t i n e is, in practice, n u m e r i c a l l y stable (i). This stability contributes to the property of these paths that each computed eigenvalue and its c o r r e s p o n d i n g eigenvector are exact for a matrix usually close to the original matrix.
251
7.1-57
SUBROUTINE
COMBAK(NM,LOW,
IGH,AR,A!,INT,M,ZR,ZI)
INTEGER I,J,M,LA,MM,MP,NM,IGH,KPI,LOW,MPI REAL AR(NM,IGH),AI(NM, IGH),ZR(NM,M),ZI(NM,M) REAL XR,XI INTEGER !NT(IGN) IF (M oEQ. 0) G O T O 2 0 0 LA = IGH - 1 KPI = LOW + 1 IF ( L A .LT. K P I ) G O T O 2 0 0 ********** FOR MP=IGH-I STEP DO 140 M M = K P I , L A MP = LOW + IGH - MM MPI = MP + i DO
ii0 I = M P I , IGH XR = AR(I,MP-I) Xi = A I ( I , M P - I ) IF (XR .EQ. 0 . 0 . A N D . DO
i00 J = ZR(I,J) Zl(l,J) CONTINUE
i00
i, M = ZR(I,J) = ZI(I,J)
XI
+ +
C Ii0
CONTINUE
C I = !NT(MP) IF (! .EQ. M P )
GO
TO
140
DO
130
1 3 0 J = i, M XR = ZR(I,J) ZR(I,J) = ZR(MP,J) ZR(MP,J) = XR XI = Zl(l,J) ZI(I,J) = ZI(MP,J) ZI(MP,J) = XI CONTINUE
140
CONTINUE
200
RETURN END
-i
252
XR XR
UNTIL
.EQ.
LOW+I
0.0)
* ZR(MP,J) * ZI(MP,J)
GO
DO
--
TO
ii0
- XI + Xl
**********
* ZI(MP,J) * ZR(MP,J)
7.1-58
NATS
EIGENSYSTEM
PROJECT
SUBROUTINE F282-2
A Fortran
PACKAGE
(EISPACK)
COMHES
IV S u b r o u t i n e to R e d u c e a C o m p l e x G e n e r a l to C o m p l e x U p p e r H e s s e n b e r g F o r m U s i n g Elementary Transformations.
May, July,
Matrix
1972 1975
i. P U R P O S E . The F o r t r a n IV s u b r o u t i n e COMHES reduces a complex general m a t r i x to c o m p l e x upper H e s s e n b e r g f o r m u s i n g s t a b i l i z e d elementary similarity transformations. This r e d u c e d f o r m is u s e d ' b y o t h e r s u b r o u t i n e s to f i n d the e i g e n v a l u e s a n d / o r e i g e n v e c t o r s of the o r i g i n a l matrix. See s e c t i o n 2C for the specific routines.
2. USAGE. A.
Calling The
Sequence.
SUBROUTINE SUBROUTINE
statement
is
COMHES(NM,N,LOW~IGH,AR,AI,INT)
The p a r a m e t e r s are d i s c u s s e d b e l o w and the interpretation of w o r k i n g p r e c i s i o n for v a r i o u s m a c h i n e s is g i v e n in the s e c t i o n d i s c u s s i n g c e r t i f i c a t i o n . NM
is an i n t e g e r input v a r i a b l e set e q u a l to the row d i m e n s i o n of the t w o - d i m e n s l o n a l arrays AR and AI as s p e c i f i e d in the D I M E N S I O N s t a t e m e n t s for AR and AI in the c a l l i n g program. is an i n t e g e r input v a r i a b l e set e q u a l the order of the m a t r i x A = (AR,AI). m u s t be not g r e a t e r than NM.
LOW,IGH
to N
are integer input v a r i a b l e s i n d i c a t i n g the b o u n d a r y i n d i c e s for the b a l a n c e d matrix. See s e c t i o n 3 of F271 for the details. If the m a t r i x is not b a l a n c e d , set LOW to 1 and IGH to N.
253
7.1-59
B°
Error
AR,A!
are w o r k i n g p r e c i s i o n r e a l t w o - d i m e n s i o n a l v a r i a b l e s w i t h row d i m e n s i o n NM and c o l u m n d i m e n s i o n at least N. On input, AR and AI c o n t a i n the real and i m a g i n a r y parts, respectively, of the c o m p l e x m a t r i x of o r d e r N to be r e d u c e d to H e s s e n b e r g form. On output, AR and AI c o n t a i n the real and i m a g i n a r y p a r t s of the upper H e s s e n b e r g m a t r i x as w e l l as the m u l t i p l i e r s u s e d in the r e d u c t i o n . See s e c t i o n 3 for the details.
INT
is an i n t e g e r o u t p u t o n e - d i m e n s i o n a l v a r i a b l e of d i m e n s i o n at least IGH i d e n t i f y i n g the rows and c o l u m n s i n t e r c h a n g e d d u r i n g the r e d u c t i o n . See s e c t i o n 3 for the d e t a i l s . Only components LOW+I through IGH-I are a c t u a l l y u s e d by COMHES.
Conditions
and
Returns.
None°
C. A p p l i c a b i l i t y
and
Restrictions.
If all the e i g e n v a l u e s of the o r i g i n a l m a t r i x are d e s i r e d , this s u b r o u t i n e s h o u l d be f o l l o w e d by COMLR (F295). If all the m a t r i x are by COMLR2
e i g e n v a l u e s and e i g e n v e c t o r s of the o r i g i n a l d e s i r e d , this s u b r o u t i n e should be f o l l o w e d (F296)o
If some of the e i g e n v a l u e s and e i g e n v e c t o r s of the o r i g i n a l m a t r i x are d e s i r e d , this s u b r o u t i n e s h o u l d be f o l l o w e d by C O M L R (F295), C I N V I T (F297), and COMBAK (F283). In this i m p l e m e n t a t i o n , the a r i t h m e t i c is r e a l t h r o u g h o u t e x c e p t for c o m p l e x d i v i s i o n .
3. D I S C U S S I O N Suppose
OF M E T H O D that
AND
ALGORITHM.
the m a t r i x
A
=
has ( T (0 (0
254
the X B 0
form
Y ) Z) R)
7.1-60
where T and R are upper t r i a n g u l a r m a t r i c e s , B is a s q u a r e m a t r i x s i t u a t e d in rows and c o l u m n s LOW through IGH, and X, Y, and Z are r e c t a n g u l a r m a t r i c e s of the appropriate dimensions. T h e n the s u b r o u t i n e COMHES p e r f o r m s p e r m u t a t i o n and e l e m e n t a r y s i m i l a r i t y transformations to r e d u c e B to H e s s e n b e r g form. The H e s s e n b e r g r e d u c t i o n is p e r f o r m e d in the f o l l o w i n g way. Starting with J=LOW, a p e r m u t a t i o n s i m i l a r i t y t r a n s f o r m a t i o n is p e r f o r m e d to s t a b i l i z e the s u c c e e d i n g e l e m e n t a r y transformations in the J-th c o l u m n of A. Next, each n o n zero e l e m e n t b e l o w the s u b d i a g o n a l in the J-th c o l u m n of A is e l i m i n a t e d u s i n g e l e m e n t a r y s i m i l a r i t y t r a n s f o r m a t i o n s . The p e r m u t a t i o n s i m i l a r i t y t r a n s f o r m a t i o n is d e t e r m i n e d by s e a r c h i n g for the e l e m e n t of m a x i m u m m o d u l u s in the J-th c o l u m n b e l o w the s u b d i a g o n a l . This e l e m e n t is p l a c e d into the s u b d i a g o n a l p o s i t i o n by a row i n t e r c h a n g e and the corresponding c o l u m n i n t e r c h a n g e is m a d e to c o m p l e