Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic...

44
SPARSE MATRIX TECHNOLOGY electronic edition Sergio Pissanetzky

Transcript of Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic...

Page 1: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

SPARSE MATRIXTECHNOLOGY

electronic edition

Sergio Pissanetzky

Page 2: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

Sparse Matrix Technology

electronic edition

Sergio Pissanetzky

Page 3: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

Copyright c© 2007 by Sergio Pissanetzky and SciControls.com. All rights reserved. Nopart of the contents of this book can be reproduced without the written permission of thepublisher.

Professionally typeset by LATEX. This work is in compliance with the mathematical typeset-ting conventions established by the International Organization for Standardization (ISO).

Dr. Pissanetzky retired after a rewarding career as an Entrepreneur, Professor, Research Scientistand Consultant. He was the founder of Magnus Software Corporation, where he focused on develop-ment of specialized applications for the Magnetic Resonance Imaging (MRI) and the High EnergyParticle Accelerator industries. He has served as Member of the International Editorial Board ofthe “International Journal for Computation in Electrical and Electronic Engineering”, as a Memberof the International Advisory Committee of the International Journal “Metodos Numericos paraCalculo y Diseno en Ingenierıa”, and as a member of the International Committee for Nuclear Res-onance Spectroscopy, Tokyo, Japan. Dr. Pissanetzky has held professorships in Physics at TexasA&M University and the Universities of Buenos Aires, Cordoba and Cuyo, Argentina. He has alsoheld positions as a Research Scientist with the Houston Advanced Research Center, as Chairman ofthe Computer Center of the Atomic Energy Commission, San Carlos de Bariloche, Argentina, andas a Scientific Consultant at Brookhaven National Laboratory. Dr. Pissanetzky holds several USand European patents and is the author of two books and numerous peer reviewed technical papers.Dr. Pissanetzky earned his Ph.D. in Physics at the Balseiro Institute, University of Cuyo, in 1965.Dr. Pissanetzky has 35 years of teaching experience and 30 years of programming experience inlanguages such as Fortran, Basic, C and C++. Dr. Pissanetzky now lives in a quite suburbanneighborhood in Texas.

Website: http://www.SciControls.com

ISBN 978-0-9762775-3-8

Page 4: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

iv

Page 5: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

Contents

Preface xiii

Introduction 1

1 Fundamentals 51.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51.2 Storage of arrays, lists, stacks and queues . . . . . . . . . . . . . . . . . . . . . . . . 51.3 Storage of lists of integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.4 Representation and storage of graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . 101.5 Diagonal storage of band matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121.6 Envelope storage of symmetric matrices . . . . . . . . . . . . . . . . . . . . . . . . . 141.7 Linked sparse storage schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151.8 The sparse row-wise format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191.9 Ordered and unordered representations . . . . . . . . . . . . . . . . . . . . . . . . . . 201.10 Sherman’s compression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221.11 Storage of block-partitioned matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . 241.12 Symbolic processing and dynamic storage schemes . . . . . . . . . . . . . . . . . . . 261.13 Merging sparse lists of integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281.14 The multiple switch technique . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291.15 Addition of sparse vectors with the help of an expanded real accumulator . . . . . . 301.16 Addition of sparse vectors with the help of an expanded integer array of pointers . . 321.17 Scalar product of two sparse vectors with the help of an array of pointers . . . . . . 33

2 Linear Algebraic Equations 352.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352.2 Some definitions and properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372.3 Elementary matrices and triangular matrices . . . . . . . . . . . . . . . . . . . . . . 402.4 Some properties of elementary matrices . . . . . . . . . . . . . . . . . . . . . . . . . 412.5 Some properties of triangular matrices . . . . . . . . . . . . . . . . . . . . . . . . . . 422.6 Permutation matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

v

Page 6: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

vi

2.7 Gauss elimination by columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452.8 Gauss elimination by rows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492.9 Gauss-Jordan elimination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502.10 Relation between the elimination form of the inverse and the product form of the

inverse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522.11 Cholesky factorization of a symmetric positive definite matrix . . . . . . . . . . . . . 532.12 Practical implementation of Cholesky factorization . . . . . . . . . . . . . . . . . . . 552.13 Forward and backward substitution . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562.14 Cost considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572.15 Numerical examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

3 Numerical Errors in Gauss Elimination 633.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633.2 Numerical errors in floating point operations . . . . . . . . . . . . . . . . . . . . . . 653.3 Numerical errors in sparse factorization . . . . . . . . . . . . . . . . . . . . . . . . . 683.4 Numerical errors in sparse substitution . . . . . . . . . . . . . . . . . . . . . . . . . . 733.5 The control of numerical errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773.6 Numerical stability and pivot selection . . . . . . . . . . . . . . . . . . . . . . . . . . 783.7 Monitoring or estimating element growth . . . . . . . . . . . . . . . . . . . . . . . . 823.8 Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

4 Ordering for Gauss Elimination: Symmetric Matrices 854.1 Introduction: Statement of the problem . . . . . . . . . . . . . . . . . . . . . . . . . 854.2 Basic notions of graph theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 874.3 Breadth-first search and adjacency level structures . . . . . . . . . . . . . . . . . . . 934.4 Finding a pseudoperipheral vertex and a narrow level structure of a graph . . . . . . 954.5 Reducing the bandwidth of a symmetric matrix . . . . . . . . . . . . . . . . . . . . . 964.6 Reducing the profile of a symmetric matrix . . . . . . . . . . . . . . . . . . . . . . . 984.7 Graph-theoretical background of symmetric Gauss elimination . . . . . . . . . . . . 1014.8 The minimum degree algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1044.9 Tree partitioning of a symmetric sparse matrix . . . . . . . . . . . . . . . . . . . . . 1094.10 Nested dissection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1134.11 Properties of nested dissection orderings . . . . . . . . . . . . . . . . . . . . . . . . . 1184.12 Generalized nested dissection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1214.13 One-way dissection of finite element problems . . . . . . . . . . . . . . . . . . . . . . 1224.14 Orderings for the finite element method . . . . . . . . . . . . . . . . . . . . . . . . . 1274.15 Depth-first search of an undirected graph . . . . . . . . . . . . . . . . . . . . . . . . 1324.16 Lexicographic search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1364.17 Symmetric indefinite matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140

Page 7: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

vii

5 Ordering for Gauss Elimination: General Matrices 1435.1 Introduction: Statement of the problem . . . . . . . . . . . . . . . . . . . . . . . . . 1435.2 Graph theory for unsymmetric matrices . . . . . . . . . . . . . . . . . . . . . . . . . 1465.3 The strong components of a digraph . . . . . . . . . . . . . . . . . . . . . . . . . . . 1485.4 Depth-first search of a digraph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1515.5 Breadth-first search of a digraph and directed

adjacency level structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1555.6 Finding a maximal set of vertex disjoint paths in an acyclic digraph . . . . . . . . . 1575.7 Finding a transversal: the algorithm of Hall . . . . . . . . . . . . . . . . . . . . . . . 1585.8 Finding a transversal: the algorithm of Hopcroft and Karp . . . . . . . . . . . . . . 1615.9 The algorithm of Sargent and Westerberg

for finding the strong components of a digraph . . . . . . . . . . . . . . . . . . . . . 1675.10 The algorithm of Tarjan for finding the strong components of a digraph . . . . . . . 1685.11 Pivoting strategies for unsymmetric matrices . . . . . . . . . . . . . . . . . . . . . . 1725.12 Other methods and available software . . . . . . . . . . . . . . . . . . . . . . . . . . 175

6 Sparse Eigenanalysis 1776.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1776.2 The Rayleigh quotient . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1806.3 Bounds for eigenvalues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1826.4 The bisection method for eigenvalue calculations . . . . . . . . . . . . . . . . . . . . 1846.5 Reduction of a general matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1856.6 Reduction of a symmetric band matrix to tridiagonal form . . . . . . . . . . . . . . . 1886.7 Eigenanalysis of tridiagonal and Hessenberg matrices . . . . . . . . . . . . . . . . . . 1896.8 Direct and inverse iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1906.9 Subspaces and invariant subspaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1936.10 Simultaneous iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1966.11 Lanczos algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1996.12 Lanczos algorithm in practice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2036.13 Block Lanczos and band Lanczos algorithms . . . . . . . . . . . . . . . . . . . . . . . 2066.14 Trace minimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2086.15 Eigenanalysis of hermitian matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2096.16 Unsymmetric eigenproblems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210

7 Sparse Matrix Algebra 2117.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2117.2 Transposition of a sparse matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2137.3 Algorithm for the transposition of a general sparse matrix . . . . . . . . . . . . . . . 2157.4 Ordering a sparse representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2167.5 Permutation of rows or columns of a sparse matrix: First procedure . . . . . . . . . 217

Page 8: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

viii

7.6 Permutation of rows or columns of a sparse matrix: Second procedure . . . . . . . . 2187.7 Ordering of the upper representation of a sparse symmetric matrix . . . . . . . . . . 2187.8 Addition of sparse matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2197.9 Example of addition of two sparse matrices . . . . . . . . . . . . . . . . . . . . . . . 2207.10 Algorithm for the symbolic addition of two sparse matrices with N rows and M columns2227.11 Algorithm for the numerical addition of two sparse matrices with N rows . . . . . . 2237.12 Product of a general sparse matrix by a column vector . . . . . . . . . . . . . . . . . 2247.13 Algorithm for the product of a general sparse matrix by a full column vector . . . . 2257.14 Product of a row vector by a general sparse matrix. . . . . . . . . . . . . . . . . . . 2267.15 Example of product of a full row vector by a general sparse matrix. . . . . . . . . . . 2267.16 Algorithm for the product of a full row vector by a general sparse matrix. . . . . . . 2277.17 Product of a symmetric sparse matrix by a column vector. . . . . . . . . . . . . . . . 2287.18 Algorithm for the product of a symmetric sparse matrix by a full column vector . . . 2297.19 Multiplication of sparse matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2307.20 Example of product of two matrices which are stored by rows. . . . . . . . . . . . . . 2317.21 Algorithm for the symbolic multiplication of two sparse matrices given in row-wise

format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2337.22 Algorithm for the numerical multiplication of two sparse matrices given in row-wise

format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2347.23 Triangular factorization of a sparse symmetric matrix given in row-wise format . . . 2357.24 Numerical triangular factorization of a sparse symmetric matrix given in row-wise

format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2387.25 Algorithm for the symbolic triangular factorization of a symmetric sparse matrix A . 2407.26 Algorithm for the numerical triangular factorization of a symmetric positive definite

sparse matrix A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2427.27 Example of forward and backward substitution . . . . . . . . . . . . . . . . . . . . . 2457.28 Algorithm for the solution of the system UT DUx = b . . . . . . . . . . . . . . . . . 246

8 Connectivity and Nodal Assembly 2498.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2498.2 Boundary conditions for scalar problems . . . . . . . . . . . . . . . . . . . . . . . . . 2518.3 Boundary conditions for vector problems . . . . . . . . . . . . . . . . . . . . . . . . . 2528.4 Example of a connectivity matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2568.5 Example of a nodal assembly matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . 2578.6 Algorithm for the symbolic assembly of a symmetric nodal assembly matrix . . . . . 2598.7 Algorithm for the numerical assembly of an element matrix and vector into the nodal

assembly matrix A and right-hand vector b: Symmetric case . . . . . . . . . . . . . . 2618.8 Algorithm for the numerical assembly of an element matrix and vector into the nodal

assembly matrix A and right-hand vector b: General case . . . . . . . . . . . . . . . 264

Page 9: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

ix

9 General Purpose Algorithms 2679.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2679.2 Multiplication of the inverse of a lower triangular matrix by a general matrix . . . . 2689.3 Algorithm for the symbolic multiplication of the inverse of a lower triangular matrix

U−T by a general matrix B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2699.4 Algorithm for the numerical multiplication of the inverse of a lower triangular matrix

U−T by a general matrix B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2709.5 Algorithm for the multiplication of the inverse of an upper triangular unit diagonal

matrix U by a full vector x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2729.6 Algorithm for the multiplication of the transpose inverse of an upper triangular unit

diagonal matrix U by a full vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2739.7 Solution of linear equations by the Gauss-Seidel iterative method . . . . . . . . . . . 2749.8 Algorithm for the iterative solution of linear equations by the Gauss-Seidel method 2759.9 Checking the representation of a sparse matrix . . . . . . . . . . . . . . . . . . . . . 2769.10 Printing and displaying a sparse matrix . . . . . . . . . . . . . . . . . . . . . . . . . 2779.11 Algorithm for transforming a RR(C)U of a symmetric matrix into a RR(U)U of the

same matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2789.12 Algorithm for the pre-multiplication of a sparse matrix A by a diagonal matrix D . . 2799.13 Algorithm for copying a sparse matrix from IA, JA, AN to IB, JB, BN . . . . . . . 279

Bibliography and Index 281

Page 10: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

x

Page 11: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

Preface to the Electronic Edition

This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky,originally published in English by Academic Press, London, in 1984, and later translated intoRussian and published by MIR, Moscow, in 1988. The electronic edition has been typed from theoriginal, with only minor changes of format where dictated by electronics.

xi

Page 12: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

xii

Page 13: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

Preface

As computers grow in power and speed, matrices grow in size. In 1968, practical productioncalculations with linear algebraic systems of order 5,000 were commonplace, while a “large” systemwas one of order 10,000 or more.a

In 1978, an over determined problem with 2.5 million equations in 400,000 unknowns wasreported;b in 1981, the magnitude of the same problem had grown: it had 6,000,000 equations, stillin 400,000 unknowns.c The matrix of coefficients had 2.4×1012 entries, most of which were zero: itwas a sparse matrix. A similar trend toward increasing size is observed in eigenvalue calculations,where a “large” matrix is one of order 4,900 or 12,000.d Will matrix problems continue to groweven further? Will our ability to solve them increase at a sufficiently high rate?

But this is only one side of the question. The other side concerns the microcomputer explosion.Microcomputers now have about the same power as large computers had two decades ago. Areusers constrained to solving matrix problems of the same size as those of twenty years ago?

The owner of a microcomputer may not care too much about the cost of computation; the maindifficulty is storage. On a large machine, the cost of solving a matrix problem increases rapidlyif the size of the problem does, because both storage and labor grow. The overall cost becomes aprimary consideration. How can such cost be minimized for a given problem and installation?

Answers to these and other related questions are given in this book for the following classes ofmatrix problems: direct solution of sparse linear algebraic equations, solution of sparse standardand generalized eigenvalue problems, and sparse matrix algebra. Methods are described which rangefrom very simple yet surprisingly effective ideas to highly sophisticated algorithms. Sparse matrixtechnology is now a well established discipline, which was defined as “the art of handling sparsematrices”.e It is composed of a beautiful blend of theoretical developments, numerical experienceand practical considerations. It is not only an important computational tool in a broad spectrum

aIn the Preface, the pertinent references are given as footnotes, because this enhances clarity. The fulllist of references is given at the end of the book. Tinney, 1969,237 p.28; Willoughby, 1971,250 p.271.

bKolata, 1978.144

cGolub and Plemmons, 1981, 106 p.3.d Cullum and Willoughby, 1981,42 p. 329; Parlett, 1980,175 p. XIII.eHarary, 1971.124

xiii

Page 14: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

xiv

of computational areas,f but also is in itself a valuable contribution to the general developmentof computer software. The new ideas developed during the last fifteen years were used to devisenearly optimum algorithms for a variety of matrix problems. Research in the field is currently veryactive and the spectrum of applications broadens continuously. Sparse matrix technology is hereand will stay.

The concept expressing the nature of our concern is contained in the title of the book. Tech-nology is applied science, the science or study of the practical or industrial arts.g The phrase“sparse matrix technology” was an everyday saying in the early nineteen seventies at the IBM T. J.Watson Research Center.h Nowadays it seems to be in desuetude. The material for the book wasselected from the several Symposia and Congresses on large matrix problems regularly held since1968.i Major sources of inspiration were: an advanced course with four review articles,j excellentsurvey articlesk and books,l a collection of papers,m and many publications which are cited wherepertinent. Several basic ideas can be found in the literature published before 1973.n No attempt ismade, however, to cover such an important amount of material. Rather, the fundamental methodsand procedures are introduced and described in detail, the discussion reaching the point where thereader can understand the specialized literature on each subject. A unified treatment is providedwhenever possible, although, like any field of human knowledge which grows fast, sparse matrixtechnology has grown unevenly. Some areas are well developed, while other areas lack furtherresearch. We have not included proofs of all the theorems, except when they are closely related topractical techniques which are used subsequently. The concepts and methods are introduced at anelementary level, in many cases with the help of simple examples. Many fundamental algorithmsare described and carefully discussed. Ready-to-use very efficient and professional algorithms aregiven in Fortran. The reader is assumed to be familiar with this popular language. The algorithms,however, are explained so clearly that even a person with a limited knowledge of Fortran can under-stand them and eventually translate them into other languages. Linear algebra and graph theoryare used extensively in the book. No particular acquaintance with these subjects is necessary be-cause all definitions and properties are introduced from the beginning, although some preparation

fRose and Willoughby, 1972.198

gWebster’s Dictionary, second edition, 1957.hWilloughby, 1971;250 Rose and Willoughby, 1972,198 Preface; Willoughby, 1972;251 Hachtel, 1976,117 p.

349.iWilloughby, 1969;249 Reid, 1971a;187 Rose and Willoughby, 1972;198 Bunch and Rose, 1976;28 Duff and

Stewart, 1979;68 Duff, 1981b.61 The Proceedings of the Symposium held at Fairfield Glade, Tennessee, in1982, will be published as a special issue of the SIAM Journal on Scientific and Statistical Computing, andpossibly other SIAM journals, to appear in 1983. The Software Catalog prepared in conjunction with theSymposium is available (Heath, 1982.126)

jBarker, 1977.10

kDuff, 1977,55 1982.62

lWilkinson, 1965;247 Parlett, 1980;175 George and Liu, 1981.97mBjorck et al. 1981 16

nBrayton et al. 1970; 19 Willoughby, 1972;251 Tewarson, 1973.235

Page 15: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

xv

may be helpful. An extensive bibliography and a survey of the relevant literature are included inmany sections. The book fills the gap between books on the design of computer algorithms andspecialized literature on sparse matrix techniques, on the one side, and user needs and applicationoriented requirements on the other.

The purpose of the book is to bring sparse matrix technology within reach of engineers, pro-grammers, analysts, teachers and students. This book will be found helpful by everyone who wishesto develop his own sparse matrix software, or who is using it and wishes to understand better howit operates, or who is planning to acquire a sparse matrix package and wishes to improve his under-standing of the subject. Teachers who need an elementary presentation of sparse matrix methodsand ideas and many examples of application at a professional level, will find such material in thisbook.

Chapter 1 covers all fundamental material such as storage schemes, basic definitions and com-putational techniques needed for sparse matrix technology. It is very convenient to read at leastSections 1 to 9 and Section 12 of Chapter 1 first. The first reading may, however, be superficial.The reader will feel motivated to examine this material in more detail while reading other chaptersof the book, where numerous references to sections of Chapter 1 are found.

Chapters 2 to 5 deal with the solution of linear algebraic equations. They are not independent.The material in Chapter 2 is rather elementary, but its form of presentation serves as an introductionfor Chapters 4 and 5, which contain the important material. Chapter 3 deals with numerical errorsin the case where the linear system is sparse, and also serves as an introduction to Chapters 4and 5. This material is not standard in the literature. Sparse matrix methods and algorithms forthe direct solution of linear equations are presented in Chapters 4 and 5. Chapter 4 deals withsymmetric matrices, and Chapter 5 with general matrices.

The calculation of eigenvalues and eigenvectors of a sparse matrix, or of a pair of sparse matricesin the case of a generalized eigenvalue problem, is discussed in Chapter 6. Chapter 6 can be readindependently, except that some references are made to material in Chapters 1 and 7.

Chapters 7, 8 and 9 deal with sparse matrices stored in row-wise format. Algorithms foralgebraic operations, triangular factorization and back substitution are explicitly given in Fortranand carefully discussed in Chapter 7. The material in Chapter 1 is a prerequisite, particularlySections 8, 9 and 10 and 12 to 17. In addition, Chapter 2 is a prerequisite for Sections 23 to28 of Chapter 7. Chapter 8 covers the sparse matrix techniques associated with mesh problems,in particular with the finite element method, and in Chapter 9 we present some general purposeFortran algorithms.

Sparse matrix technology has been applied to almost every area where matrices are employed.Anyone interested in a particular application may find it helpful to read the literature wherethe application is described in detail, in addition to the relevant chapters of this book. A listof bibliographical references sorted by application was publishedo and many papers describing a

oDuff, 1977,55 p. 501.

Page 16: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

xvi

variety of applications can be found in the Proceedings of the 1980 IMA Conferencep and in otherpublicationsq

Good, robust sparse matrix software is now commercially available. The Sparse Matrix SoftwareCatalogr lists more than 120 programs. Many subroutines are described in the Harwell Catalogues

and two surveys have also been published.t Producing a good piece of sparse matrix softwareis not an easy task. It requires expert programming skills. As in any field of engineering, thesoftware designer must build a prototype, test it carefullyu and improve it before the final productis obtained and mass production starts. In software engineering, mass production is equivalentto obtaining multiple copies of a program and implementing them in many different installations.This requires transportability. From the point of view of the user, the software engineer mustassume responsibility for choosing the right program and file structures and installing them intothe computer. For the user, the product is not the program but the result. The desirable attributesof a good program are not easily achieved.v In this book, the characteristics and availability ofsoftware for each particular application are discussed in the corresponding sections.

I would like to acknowledge the collaboration of Neil Callwood. He has read the manuscriptseveral times, correcting many of my grammatical infelicities, and is responsible for the “Britishflavour” that the reader may find in some passages. I would also like to acknowledge the patienceand dedication Mrs. Carlota R. Glucklich while typing the manuscript and coping with our revi-sions.

Sergio Pissanetzky January [email protected]

pDuff, 1981b.61

qBunch and Rose, 1976;28 Duff and Stewart, 1979. 68

rHeath, 1982.126

sHopper, 1980.130

tDuff, 1982;62 Parlett, 1983. 176

uDuff, 1979;57 Eisenstat et al. 1979;75 Duff et al. 1982.69vGentleman and George, 1976;87 Silvester, 1980.215

Page 17: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

FUNDAMENTALS 19

1 2 3 4 5

1 |A11 A13 A14 |2 | A22 A25 |3 | A33 A35 |4 | A44 |5 | A55 |

A =

symmetric

head 1

head 2

head 3

head 4

head 5

A11 0 • A13 0 • A14 0 0

A22 0 • A25 0 0

A33 • • A35 • 0

A44 • 0

A55 • 0

Figure 1.4: Larcombe’s version of Knuth’s storage scheme for symmetric matrices withno zero elements on the diagonal.

1.8 The sparse row-wise format

The sparse row-wise format (Chang, 1969;29 Curtis and Reid, 1971b;46 Gustavson, 1972112) tobe described here is one of the most commonly used storage schemes for sparse matrices. Thescheme has minimal storage requirements and at the same time it has proved to be very convenientfor several important operations such as addition, multiplication, permutation and transpositionof sparse matrices, the solution of linear equations with a sparse matrix of coefficients by eitherdirect or iterative methods, etc. In this scheme, the values of the nonzero elements of the matrixare stored by rows, along with their corresponding column indices, in two arrays, say AN and JA,respectively. An array of pointers, say IA, is also provided to indicate the locations in AN andJA where the description of each row begins. An extra entry in IA contains a pointer to the firstempty position in JA and AN. An example is convenient at this point. Consider the matrix:

A =

1 2 3 4 5 6 7 8 9 10

1 | 0 0 1. 3. 0 0 0 5. 0 0 |2 | 0 0 0 0 0 0 0 0 0 0 |3 | 0 0 0 0 0 7. 0 1. 0 0 |

Page 18: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

20 SPARSE MATRIX TECHNOLOGY

A is represented as follows:

1 2 3 4 5 6

IA = 1 4 4 6JA = 3 4 8 6 8 RR(C)OAN = 1. 3. 5. 7. 1.

The description of row 1 of A begins at the position IA(1) = 1 of AN and JA. Since the descriptionof row 2 begins at IA(2) = 4, this means that row 1 of A is described in positions 1, 2 and 3 of ANand JA. In this example:IA(1) = 1 first row begins at JA(1) and AN(1).IA(2) = 4 second row begins at JA(4) and AN(4)IA(3) = 4 third row begins at JA(4) and AN(4). Since this is the same position at

which row 2 begins, this means that row 2 is empty.IA(4) = 6 this is the first empty location in JA and AN. The description of row 3

thus ends at position 6− 1 = 5 of JA and AN.In general, row r of A is described in positions IA(r) to IA(r + 1)− 1 of JA and AN, except whenIA(r + 1) = IA(r) in which case row r is empty. If matrix A has m rows, then IA has m + 1positions.

This representation is said to be complete because the entire matrix A is represented, andordered because the elements of each row are stored in the ascending order of their column indices.It is thus a Row-wise Representation Complete and Ordered, or RR(C)O.

The arrays IA and JA represent the structure of A, given as the set of the adjacency lists ofthe graph associated with A. If an algorithm is divided into a symbolic section and a numericalsection (Section 1.12), the arrays IA and JA are computed by the symbolic section, and the arrayAN by the numerical section.

Gustavson (1972)112 also proposed a variant of row-wise storage, suitable for applications re-quiring both row and column operations. A is stored row-wise as described, and in addition thestructure of AT is computed and also stored row-wise. A row-wise representation of the structureof AT is identical to a column-wise representation of the structure of A. It can be obtained bytransposition of the row-wise structure of A (Chapter 7). This scheme has been used, for example,for linear programming applications (Reid, 1976).189

A much simpler row-oriented scheme was proposed by Key (1973)141 for unsymmetric matrices.The nonzeros are held in a two-dimensional array of size n by m, where n is the order of the matrixand m the maximum number of nonzeros in a row. This scheme is easy to manipulate but has thedisadvantage that m may not be predictable and may turn out to be large.

1.9 Ordered and unordered representations

Sparse matrix representations do not necessarily have to be ordered, in the sense that the elementsof each row can be stored in any order while still preserving the order of the rows. The matrix A

Page 19: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

LINEAR ALGEBRAIC EQUATIONS 51

The kth step consists of the elimination of the nonzeros on column k of A(k) both above and belowthe diagonal. Row k is first normalized by dividing all its elements by the diagonal element. Then,convenient multiples of the normalized row k are subtracted from all those rows which have anonzero in column k either above or below the diagonal. The matrix A(k+1) is thus obtained withzeros in its k initial columns. This process is continued until, at the end of step n, the identitymatrix A(n+1) ≡ I is obtained. The kth step of Gauss-Jordan elimination by columns is equivalentto pre-multiplication of A(k) by D−1

k and by the complete column elementary matrix (TCk )−1:

A(k+1) = (TCk )−1D−1

k A(k) (2.37)

where A(1) ≡ A and:

(Dk)kk = A(k)kk (2.38)

(TCk )ik = A

(k)ik for all i 6= k

Thus, we have:

(TCn )−1D−1

n . . . (TC2 )−1D−1

2 (TC1 )−1D−1

1 A = I. (2.39)

The factorized form of A is:

A = D1TC1 D2T

C2 . . .DnTC

n , (2.40)

and the product form of the inverse in terms of column matrices is:

A−1 = (TCn )−1D−1

n . . . (TC2 )−1D−1

2 (TC1 )−1D−1

1 . (2.41)

The close relationship between this expression and the elimination form of the inverse, Expression(2.24), will be discussed in Section 2.10. The results of the elimination are usually recorded as atable of factors:

(D1)−111 (TC

2 )12 (TC3 )13 . . .

(TC1 )21 (D2)−1

22 (TC3 )23 (2.42)

(TC1 )31 (TC

2 )32 (D3)−133

......

...

By Equation (2.38), this table is formed simply by leaving each off-diagonal A(k)ik where it is

obtained. The diagonal is obtained, as in Gauss elimination, by storing the reciprocals of thediagonal elements used to normalize each row. The lower triangle and diagonal of this table arethus identical to those of the Gauss table. Expressions (2.40) and (2.41) indicate how to use thetable (2.42). When solving linear equations by means of x = A−1b, Equation (2.41) is used, withthe matrices (TC

k )−1 obtained from the table by reversing the signs of the off-diagonal elements of

Page 20: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

52 SPARSE MATRIX TECHNOLOGY

column k (Property 2.4(d)). The matrices D−1k are directly available from the table. The product

of A with any matrix or vector can also be computed using the table, as indicated by Equation(2.40).

Gauss-Jordan elimination can also be performed by rows. The version by columns requiresthe addition of multiples of row k to all other rows in order to cancel the off-diagonal elementsof column k. This process can be understood conceptually as the construction of new equationswhich are linear combinations of the original ones. On the other hand, in Gauss-Jordan eliminationby rows, we add multiples of column k to all other columns, in such a way that the off-diagonalelements of row k become zero. This process can be viewed as the construction of new unknownswhich are linear combinations of the original ones and which satisfy linear equations with somezero coefficients. Alternatively, we can forget about the system of linear equations and view therow algorithm as the triangularization of AT , the transpose of A, by columns. Doing this, we obtainthe equivalent of Expression (2.41):

(AT )−1 = (T′Cn )−1(D′n)−1 . . . (T′C2 )−1(D′2)−1(T′C1 )−1(D′1)

−1, (2.43)

which by transposition and using (AT )−1 = (A−1)T yields:

A−1 = (D′1)−1(T′R1 )−1(D′2)

−1(T′R2 )−1 . . . (D′n)−1(T′Rn )−1 (2.44)

Equation (2.44) is the product form of the inverse in terms of row matrices. The elimination byrows is equivalent to multiplying A from the right by Expression (2.44). The nontrivial elementsof the matrices of Expression (2.44) are recorded as a table of factors in the usual way, and thetable can be used to solve linear equations or to multiply either A or A−1 by any matrix or vector.

2.10 Relation between the elimination form of the in-

verse and the product form of the inverse

From the preceding section it should be clear that Gauss-Jordan elimination by columns can beperformed equally well if we first eliminate all nonzeros from the lower triangle of A, and then allnonzeros from the upper triangle of A. In fact, when we start at the upper left-hand corner ofA, we can eliminate lower and upper portions of columns in any order, provided only that upperportions are eliminated in order, lower portions are also eliminated in order, and the upper portionof any column k is eliminated after the lower portion of the preceding column. This statementholds true due to the fact that a row k + 1 is obtained in final form immediately after the lowerportions of columns 1 to k have been eliminated and row k + 1 has been normalized; row k + 1can then be used either immediately or at any later stage to eliminate the upper portion of columnk + 1, provided that the upper portions of columns 1 to k have been previously eliminated. Thesefacts can be stated formally using the properties of the elementary matrices (Section 2.4). We useProperty 2.4(c) to express TC

k as follows:

TCk = LC

k UCk , (2.45)

Page 21: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

74 SPARSE MATRIX TECHNOLOGY

Table 3.1. Bounds for the norms of L, expression for nij (see Equation 2.16), andbounds for the norm of the error matrix E for the factorization LU = A + E, where allmatrices are of order n. The bandwidth of band matrices is assumed not to exceed n.

A Bounds for L nij Error bounds for factorization

Sparse ‖L‖1 ≤ aM

(maxj cL

j + 1) ∑m

k=1 n(k)ij ‖E‖1 ≤ 3.01εMaM maxj

∑ni=1 nij

‖L‖∞ ≤ aM

(maxi rL

i + 1)

m = min(i, j) ‖E‖∞ ≤ 3.01εMaM maxi

∑nj=1 nij

Full ‖L‖1 ≤ aMn min(i, j) ‖E‖1, ‖E‖∞ ≤ 3.012 εMaMn(n + 1)

‖L‖∞ ≤ aMn

Band ‖L‖1 ≤ aM (β + 1) max[0,min(i, j, i− j + β + 1, ‖E‖1, ‖E‖∞ ≤ 3.01εMaM (β + 1)2

|\β\β\| ‖L‖∞ ≤ aM (β + 1) j − i + β + 1)]

Band ‖L‖1 ≤ aM (β + 1) max[0,min(i, j, i− j + 2β + 1, ‖E‖1, ‖E‖∞ ≤ 3.01εMaM (β + 1)

|\β\2β\| ‖L‖∞ ≤ aM (β + 1) j − i + β + 1, β + 1)] ×(2β + 1)

Then, the computed result w satisfies the exact relation:

Lw = b + δb (3.52)

where, from Equations 3.47 and 3.50, the following bounds hold for the components of δb:

|δbi| ≤ 3.01εMbMi(rLi + 1). (3.53)

A less tight but simpler bound is obtained if bM is the absolute value of the largest element of allthe vectors b(k), so that bMi ≤ bM and:

|b(k)i | ≤ bM ; i = 1, 2, . . . , n; k ≤ i. (3.54)

Then:

|δbi| ≤ 3.01εMbM (rLi + 1). (3.55)

Backward substitution is the solution of Ux = w. It can be viewed as an algorithm with n steps,where the sequence of vectors w(n) ≡ w,w(n−1), . . . ,w(2),w(1) is computed, with w(k) and w(k−1)

having their components k to n identical. Step k, k = n, n− 1, . . . , 1, is:

xk = w(k)k

w(k−1)i = w

(k)i − Uikxk + g

(k)i ; i = 1, . . . , k − 1, (3.56)

Page 22: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

NUMERICAL ERRORS IN GAUSS ELIMINATION 75

where g(k)i is the error introduced by the floating point computation. The operations performed on

an element wi, i < n, are:

wi − Uinxn + g(n)i + g

(n)i − Ui,n−1xn−1 + g

(n−1)i − . . .− Ui,i+1xi+1 + g

(i+1)i = xi (3.57)

or:

wi +n∑

k=i+1

g(k)i =

n∑k=i

Uikxk; i < n, (3.58)

Thus, if we define the error vector δw:

δwi =n∑

k=i+1

g(k)i ; i < n

δwn = 0, (3.59)

we have the following exact relation between the computed numbers:

Ux = w + δw. (3.60)

In order to obtain bounds for δw, we let wMi = maxk |w(k)i |, so that:

|w(k)i | ≤ wMi; 1 ≤ i ≤ n; i ≤ k ≤ n. (3.61)

In particular, for k = i, w(i)i = xi, so that |xi| ≤ wMi. We also let wM be the largest wMi; therefore:

|w(k)i | ≤ wM ; i = 1, 2, . . . , n; k ≥ i. (3.62)

Then, using Equation 3.22:

|g(k)i | ≤ 3.01εMwMi; k > i (3.63)

and

|δwi| ≤ 3.01εMwMirUi , (3.64)

where rUi is the number of off-diagonal nonzeros in row i of U. Alternatively, using Equation 3.62:

|δwi| ≤ 3.01εMwMrUi . (3.65)

Finally, we consider the residual

r = Ax− b (3.66)

Page 23: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

76 SPARSE MATRIX TECHNOLOGY

obtained when the solution x of System 3.1 is computed using floating point arithmetic. UsingEquations 3.41, 3.52 and 3.60, we obtain:

r = −Ex + Lδw + δb. (3.67)

Taking the 1-norm or the ∞-norm, we have:

‖r‖ ≤ ‖E‖‖x‖+ ‖L‖‖δw‖+ ‖δb‖. (3.68)

From Equation 3.62 we obtain bounds for the norms of x:

‖x‖1 ≤ nwM

‖x‖∞ ≤ wM . (3.69)

Bounds for the norms of E and L are given in table 3.1. Bounds for the norms of δw and δb wereobtained from Equations 3.65 and 3.55, respectively, and are listed in Table 3.2. Thus, a bound for‖r‖ can be computed using Equation 3.68.

The residual r has another interpretation. Let x be the exact solution of Equation 3.1; thenAx = b and

r = A(x− x), (3.70)

Table 3.2. Values of some parameters and bounds for the norms δb and δw forforward and backward substitution.

A Parameters of Section 3.4 Forward substitution Backward substitutionSparse See Section 3.4 ‖δb‖1 ≤ 3.01εMbMnL ‖δw‖1 ≤ 3.01εMwMn′U

‖δb‖∞ ≤ 3.01εMbM

(maxi rL

i + 1)‖δw‖∞ ≤ 3.01εMwM maxi rU

i

Full rLi = i− 1 ‖δb‖1 ≤ (3.01/2)εMbMn(n + 1) ‖δw‖1 ≤ (3.01/2)εMwMn(n− 1)

rUi = n− i ‖δb‖∞ ≤ 3.01εMbMn ‖δw‖∞ ≤ 3.01εMwM (n− 1)

nL = n(n + 1)/2n′U = n(n− 1)/2

Band rLi = min(i− 1, β) ‖δb‖1 ≤ 3.01εMbM (n− β/2)(β + 1) ‖δw‖1 ≤ 3.01εMwM (n− β/2− 1/2)β

|\β\β\| rUi = min(n− i, β) ‖δb‖∞ ≤ 3.01εMbM (β + 1) ‖δw‖∞ ≤ 3.01εMwMβ

nL = (n− β/2)(β + 1)n′U = (n− β/2− 1/2)β

Band rLi = min(i− 1, β) ‖δb‖1 ≤ 3.01εMbM (n− β/2)(β + 1) ‖δw‖1 ≤ 3.01εMwM (2n− 2β − 1)β

|\β\2β\| rUi = min(n− i, 2β) ‖δb‖∞ ≤ 3.01εMbM (β + 1) ‖δw‖∞ ≤ 6.02εMwMβ

nL = (n− β/2)(β + 1)n′U = (2n− 2β − 1)β

Page 24: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

102 SPARSE MATRIX TECHNOLOGY

spondence between fill-ins and new edges added to the graph is evident. The reader can finish theexercise.

2

9

6

1

4

10

7

11

3

8

5

G2

(a)

2

9

6

1

4

10

7

11

3

8

5

G3

(b)

2

9

6

1

4

10

7

11

3

8

5

G4

(c)

A(2) =

1 2 3 4 5 6 7 8 9 10 111 |× × × |2 | × × × |3 | × × × × |4 | × × × |5 | × × × |6 | × ×⊗ |7 | ×× × × |8 | × × × |9 | × × × × |

10 | ⊗ ×× |11 | × ××××× |

A(3) =

1 2 3 4 5 6 7 8 9 10 111 |× × × |2 | × × × |3 | × × × × |4 | × × ⊗ |5 | × × × |6 | × ×⊗ |7 | ×× × × |8 | × × × |9 | ⊗ × × × |

10 | ⊗ ×× |11 | × ××××× |

A(4) =

1 2 3 4 5 6 7 8 9 10 111 |× × × |2 | × × × |3 | × × × × |4 | × × ⊗ |5 | × ⊗× ⊗ |6 | × ×⊗ |7 | ×⊗ × × |8 | × × × |9 | ⊗ × × × |

10 | ⊗ ×× |11 | ⊗ ××××× |

Figure 4.8: The three initial elimination steps and the corresponding elimi-nation graphs for the matrix of Fig. 4.1(a). Fill-ins are encircled.

In terms of graph theory, Parter’s rule says that the adjacent set of vertex k becomes a cliquewhen vertex k is eliminated. Thus, Gauss elimination generates cliques systematically. Later, aselimination progresses, cliques grow or sets of cliques join to form larger cliques, a process known

Page 25: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

112 SPARSE MATRIX TECHNOLOGY

Y = {14, 16, 1, 7} and finds that Y has adjacent vertices in L5 which have not yet been placedin any partition. Thus S = {7} is pushed onto the stack and the algorithm branches to Step 5,where, picking v5 = 13, it is found that the path can not be prolonged any longer, so t = 1. LettingS = {13}, the algorithm continues with Step 1, where S is not modified, and with Step 2, where Yis determined to be {13, 15}, which becomes the third partition member.

(a)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

1 |× × × |2 | × ×× ×× |3 | × × × |4 | × × ×× |5 | ××× × |6 | ×× × |7 |× × × × × |8 | × ×× × |9 | × ××× × |

10 | × ××× ×× |11 |× × ×× × × × |12 | × × × |13 | ××× |14 | × ×××× |15 | ××× |16 |× × × × |17 | × × × ×× |18 | × × ×× ×× |19 | × ××× × |20 | ××× × |

(b)

6 20 5 15 13 16 1 14 7 12 4 11 17 18 2 10 3 9 19 8

6 |××× |20 |××× × |5 |××× × |

15 | ×× × |13 | ×× × |16 | ××× × |1 | ×× × × |

14 | ××× × × |7 | ×× × × × |

12 | ×× × |4 | ×× ×× |

11 | ×××× × × × |17 | ×× ××× |18 | ×××××× |2 | ×××× × |

10 | × ××× ×× |3 | × ×× |9 | ×× ××× |

19 | ××××× |8 | ×××× |

Figure 4.12: The Refined Quotient Tree algorithm. (a) Structure of thematrix corresponding to the graph of Fig. 4.2(a). (b) The permuted blockmatrix corresponding to the quotient tree of Fig. 4.2(c).

Page 26: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

ORDERING FOR GAUSS ELIMINATION: SYMMETRIC MATRICES 123

Table 4.1

Class of graphs Bound for fill-in Bound for multipli-cation count

Observations and references

Any, such that σ = 1/2 c3n log2 n + O(n) c7n3/2 + O[n(log n)2]

Ordering time is O[(m+n) log n]if separators can be found inO(m + n) time. c3 and c7 givenby Eq. 4.23 (Lipton et al.,1977152

Planar graphs (in this case σ =1/2, α = 2/3, β = 2

√2) c3n log n + O(n) c7n

3/2 + O[n(log n)2]

c3 ≤ 129, c7 ≤ 4002. Orderingtime is O(n log n) (Lipton andTarjan, 1979151; Lipton et al.,1979153)

Two-dimensional finite elementgraphs (in this case σ = 1/2, α =2/3, β = 4bk/2c)

O(k2n log n) O(k3n3/2)

k is the maximum number ofboundary nodes of the elements.Ordering time is O(n log n) (Lip-ton et al., 1979153)

Regular planar grid 318 n log2 n + O(n) 829

84 n3/2 + O(n log2 n) (George and Liu, 198197)

Any such that σ > 1/2 O(n2σ) O(n3σ) (Lipton et al., 1979153)Three-dimensional grid graphs(in this case σ = 2/3) O(n4/3) O(n2) (Lipton et al., 1979153)

Any, such that 1/3 < σ < 1/2 O(n) O(n3σ) (Lipton et al., 1979153)

Any, such that σ = 1/3 O(n) O(n log2 n) (Lipton et al., 1979153)

Any, such that σ < 1/3 O(n) O(n) (Lipton et al., 1979153)

The idea is illustrated in Fig. 4.19(a), where the rectangle represents the set of nodes of atwo-dimensional finite element grid. Choose σ small separators (σ = 3 in the figure) which consistof grid lines and dissect the grid into σ+1 blocks R1, R2, . . . of comparable size. If all separators areconsidered to form another single block, a tree partitioning is obtained as shown by the quotient treeof Fig. 4.19(b). The advantages of tree partitioning regarding the reduction of fill-in and operationcount were discussed in Section 4.9. Now, let us number the nodes of each R-set sequentially,following lines from left to right as closely as possible, and starting at the bottom left as indicatedby the arrows. When all R-sets have been numbered, the separators are also numbered sequentially,as the arrows show. The numbering corresponds to a monotone ordering of the tree. The matrixassociated with the finite element grid is partitioned into blocks as shown in Fig. 4.19(c), whereall nonzeros are confined to the cross-hatched areas. If Gauss elimination is performed on thismatrix, fill-in will result only inside the cross-hatched areas and in the dotted areas. Besides, thehatched blocks are not completely full. For example, the four leading diagonal blocks are banded.

Page 27: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

ORDERING FOR GAUSS ELIMINATION: SYMMETRIC MATRICES 135

17

4

12

18

2

9

19

8

3

10

11

14

13

15

16 1 7

5

20

6

12

11

10

18

17

16

15

14

13

19

20

9

2

1

8 7 6

5

4

3

(a)

1513 6 20 5 7 1 161412 4 17 3 8 19 9 2 181011

15|×× × |13|×× × |6| ××× |

20| ×××× |5| ×××× |7| ×××× ×|1| ××× ×|

16| ××× ×|14|×× ×× ×|12| ××× |4| ××× × |

17| ××× ×× |3| ××× |8| ×××× |

19| ×××× × |9| ×××× × |2| × ×××× |

18| ×× ××××|10| ××××××|11| ×××× ×××|

(b)

Figure 4.25: Reverse depth-first ordering, short frond strategy, for the graph of Fig. 4.2(a).

in favor of vertex 19, which is adjacent to two visited vertices: 9 and 10. The reader may continuethe search and verify that the spanning tree and reverse depth-first ordering shown in Fig. 4.25(a)may be obtained. The separators (11), (10, 18, 2) and (14) can be immediately identified. Thecorresponding permuted matrix is shown in Fig. 4.25(b). No fill-in at all is produced by eliminationon this matrix, a result obtained at a very low computational cost. The reason why an orderingwith no fill-in exists for the graph of Fig. 4.2(a) is that this graph is triangulated (Rose, 1970194),see Section 4.16.

Now consider the application of the long frond strategy to the same graph. Again 11 is thestarting vertex. Vertices 10 and 18 are the next candidates, both of degree 5. We arbitrarily selectvertex 10. At this point Vv = {11, 10}, and vertices 18, 2, 9 and 19 all have three edges leadingto vertices not in Vv. Vertex 18 is discarded because it is adjacent to both visited vertices, while2, 9 and 19 are adjacent to only one of the visited vertices. Let us choose vertex 2 to be the nextvertex to visit.

At this point Vv = {11, 10, 2} and |Adj(w)− Vv| is equal to 3, 2 and 2 for vertices 17, 18 and 9,respectively. Thus, we select vertex 17. Next is vertex 4, which introduces two new edges (while 12or 18 would have introduced only one), and finally vertex 12, which is adjacent to only two visitedvertices (while 18 is adjacent to five). On backtracking to vertex 4 we find the tree arc (4, 18).Figure 4.26(a) shows one possible ordering obtained in this way. The four separators (11), (10, 2),(17, 4) and (14) can be identified. As expected, this strategy has produced more separators thanthe short frond strategy. The corresponding permuted matrix is shown in Fig. 4.26(b). Eliminationwould produce 10 fill-ins in this matrix.

Page 28: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

136 SPARSE MATRIX TECHNOLOGY

9

8

3

19

10

2

17

4

12

11

18

14

16

1

7

5

13

6

15

2010

11

12

13

15

16

17

18

19

20

14

3 2 1

4

5

6

9 8 7

(a)

20 6 5 7 1 1615131419 3 8 9 1812 4 17 2 1011

20|×××× |6|××× |5|×××× |7|× ××× ×|1| ××× ×|

16| ×× × ×|15| ××× |13| ××× |14| ×××× ×|19| ×××× × |3| ××× |8| ×××× |9| × ×× ×× |

18| × ×××××|12| ××× |4| ×××× |

17| ××××× |2| ×× ××× |

10| × ×× ×××|11| ××× × × ××|

(b)

Figure 4.26: Reverse depth-first ordering, long frond strategy, for the graph of Fig. 4.2(a).

When the user is dealing with a large problem, a sophisticated ordering algorithm may beconvenient, and may even determine whether the problem is tractable or not. For a medium-sizeproblem, a simple ordering technique may often produce a large improvement as compared withno ordering at all, at a low programming cost.

4.16 Lexicographic search

In this section we continue the analysis of low fill orderings for symmetric matrices, but now froma different point of view. We consider a special class of matrices which can be ordered in such away that Gauss elimination would cause no fill-in. Then we take advantage of the properties ofsuch matrices to give a procedure which finds a low fill ordering for any symmetric matrix. Asusual, we discuss the ideas in terms of graph theory. Let GA = (V,E) be the undirected graphassociated with a symmetric matrix A, and let GF = (V,E ∪ F ) be the corresponding filled graphassociated with U + UT , where A = UT DU is the factorization of A and F is the set of new edges(or nonzeros of U) introduced during factorization. If the graph GA has an elimination ordering forwhich F = ∅, i.e., no fill-in is produced if elimination is carried out in that order, we say that GA isa perfect elimination graph. The ordering itself is called a perfect elimination ordering. Notethat fill-in may result if we eliminate in a different order, even when GA is a perfect eliminationgraph. Note also that every elimination graph GF is a perfect elimination graph since no fill-inwould result if elimination were performed again in the same order.

Page 29: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

Chapter 6

Sparse Eigenanalysis

6.1 Introduction

The standard eigenvalue problem is defined by

Ax = λx (6.1)

where A is the given n by n matrix. It is desired to find the eigenpairs (λ,x) of A, where λ is aneigenvalue and x is the corresponding eigenvector. The generalized eigenvalue problem is

Ax = λ Bx (6.2)

where A and B are given n by n matrices and again we wish to determine λ and x. For historicalreasons the pair A,B is called a pencil (Gantmacher, 195983). When B = I the generalized problemreduces to the standard one.

Both for simplicity and to follow the general trend imposed by most of the literature and existingsoftware, we restrict the analysis to the case where A is real symmetric and B is real symmetric andpositive definite, except when stated otherwise. Almost all the results become valid for hermitianmatrices when the conjugate transpose superscript H is written in place of the transpose superscriptT . On the other hand, an eigenvalue problem where A or A and B, are hermitian, can be solvedusing software for real matrices (Section 6.15).

Equation 6.1 has a nonzero solution x when

Det(A− λ I) = 0. (6.3)

This is a polynomial equation of the nth degree in λ, which has n roots λ1, λ2, . . . , λn. The rootsare the eigenvalues of A, and they may be either all different or there may be multiple roots withany multiplicity. When A is real symmetric, the eigenvalues are all real. The simplest example isthe identity matrix I, which has an eigenvalue equal to 1 with multiplicity n. To each eigenvalue

177

Page 30: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

SPARSE MATRIX ALGEBRA 223

array of pointers IC at lines 5 and 24. The multiple switch array IX is initialized to 0 at lines 2 and3. I, defined at line 4, identifies each row. The DO 20 loop scans row I of the first given matrix:the column indices, if any, are stored in JC at line 11 and the row index is stored in IX at line 13,thus turning “on” the corresponding switch. The DO 40 loop runs over row I of the second matrix.For each column index J, defined at line 18, the multiple switch is tested at line 19: if the valueof IX(J) is I, then the switch is on, which means that J has already been added to the list JCand should not be added again. Otherwise, J is added to JC at line 20. The reader may expectthat the sentence IX(J)=I should appear between lines 21 and 22 in order to record the fact thatthe column index J has been added to the list JC. However, such a record is now not necessarybecause, during the processing of row I, the same value of J will never be found again: there areno repeated column indices in the representation of row I in the array JB.

7.11 Algorithm for the numerical addition of two sparse

matrices with N rows

Input: IA, JA, AN first given matrix in RR(C)U.

IB, JB, BN second given matrix in RR(C)U.

IC, JC structure of the resulting matrix in RR(C)U.

N number of rows of the matrices.

Output: CN numerical values of the nonzeros of the resulting matrix.

Workspace: X expanded array used to accumulate the nonzeros; the dimension of Xis M, the number of columns of the matrices.

1. DO 70 I=1,N2. IH=I+13. ICA=IC(I)4. ICB=IC(IH)-15. IF(ICB.LT.ICA)GO TO 706. DO 10 IP=ICA,ICB7. 10 X(JC(IP))=0.8. IAA=IA(I)9. IAB=IA(IH)-110. IF(IAB.LT.IAA)GO TO 3011. DO 20 IP=IAA,IAB12. 20 X(JA(IP))=AN(IP)

Page 31: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

292 REFERENCES

213 Sherman, A. H. (1975). On the efficient solution of sparse systems of linear and nonlinearequations. Ph.D. Thesis, Department of Computer Science, Yale University, New Haven, CT.Report No. 46.

214 Shirey, R. W. (1969). “Implementation and analysis of efficient graph planarity testing algo-rithms.” Ph.D. Dissertation, University of Wisconsin, Madison, WI.

215 Silvester, P. P. (1980). Software engineering aspects of finite elements. In Chari abd Silvester(1980) 30, pp. 69-85.

216 Skeel, R. D. (1981). Effect of equilibration on residual size for partial pivoting. SIAM J.Numer. Anal. 18, 449-454.

217 Smith, B. T., Boyle, J. M., Dongarra, J. J., Garbow, B. S., Ikebe, Y., Klema, V. C. and Moler,C. B. (1976). Matrix Eigensystem Routines – EISPACK Guide. Lecture Notes in ComputerScience, Vol. 6, 2nd. edn. Springer-Verlag: Berlin.

218 Speelpenning, B. (1978). “The generalized element method.” Department of Computer Sci-ence, University of Illinois, Urbana, Champaign, Il. Report UIUCDCS-R-78.

219 Stewart, G. W. (1973). Introduction to Matrix Computations. Academic Press; New York.220 Stewart, G. W. (1974). Modifying pivot elements in Gaussian elimination. Math. Comput.

28, 537-542.221 Stewart, G. W. (1976a). A bibliographical tour of the large sparse generalized eigenvalue

problem. In Bunch and Rose (1976) 28, pp. 113-130.222 Stewart, G. W. (1976b). Simultaneous iteration for computing invariant subspaces of non-

hermitian matrices. Numer. Math. 25, 123-136.223 Stewart, W. J. and Jennings, A. (1981). Algorithm 570.LOPSI: A simultaneous iteration

algorithm for real matrices. ACM Trans. Math. Software 7, 230-232.224 Strassen, V. (1969). Gaussian elimination is not optimal. Numer. Math. 13, 354-356.225 Swift, G. (1960). A comment on matrix inversion by partitioning. SIAM Rev. 2, 132-133.226 Szyld, D. B. and Vishnepolsky, O. (1982). “Some operations on sparse matrices.” Institute

for Economic Analysis, New York University. Private communication.227 Takahashi, H. and Natori, M. (1972). Eigenvalue problem of large sparse matrices. Rep.

Comput. Cent. Univ. Tokyo 4, 129-148.228 Tarjan, R. E. (1971). “An efficient planarity algorithm.” Computer Science Department,

Stanford University, Stanford, CA. Technical Report 244.229 Tarjan, R. E. (1972). Depth first search and linear graph algorithms. SIAM J. Comput. 1,

146-160.230 Tarjan, R. E. (1975). Efficiency of a good but not linear set union algorithm. J. Assoc.

Comput. Mach. 22, 215-225.231 Tarjan, R. E. (1976). Graph theory and Gaussian elimination. In Bunch and Rose (1976) 28,

pp. 3-22.232 Tewarson, R. P. (1967). On the product form of inverses of sparse matrices and graph theory.

SIAM Rev. 9, 91-99.233 Tewarson, R. P. (1967). Row-column permutation of sparse matrices. Comput. J. 10, 300-305.

Page 32: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

Index

n-dimensional space, 185

Accidental cancellation, 58, 69, 85, 143Accumulator

expanded, 30, 230, 234, 244Active column, 15Active elements, 78Active submatrix, 64Acyclic digraph, 150

paths in, 157Addition

of sparse matrices, 219of sparse matrices, numerical algorithm., 223of sparse matrices, symbolic algorithm., 222of sparse vectors, 30, 32

Adjacency level structure, 93directed, 155

Adjacency matrix, 12Adjacency structure of a graph, 10Adjacent set, 89, 94Adjacent vertex, 10Algebra for sparse matrices, 211Algebraic equations

linear, 35Algolw, 8Algorithm

conjugate gradient, 15Lanczos, 15

Almost-planar graph, 92, 122Amalgamation of cliques, 103Ancestor, 90Arc of tree, 93, 133, 134

redundant, 154

Array, 5data structure, 8storage, 5switch, 29

Assemblynodal, 249

Assembly of element matrices, 127, 258example, 257numerical algorithm, 261symbolic algorithm, 259

Assignmentmaximum, 148

Augmented system, 132Augmenting path, 159, 161

shortest, 163

Backsubstitution, 57Backtracking, 133, 151Backward error analysis, 67Backward substitution, 48, 56

example, 245Balancing, 84Band

generalized eigenproblem, reduction, 188Lanczos algorithm, 206matrix, 12of a matrix, 12variable, 14

Band matrixband, 12bandwidth, 12diagonal storage, 12, 13half-bandwidth, 12

295

Page 33: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

296 REFERENCES

semiband, 13Bandwidth, 12

reduction algorithm, 96Basis, 194

orthonormal, 194Bidirectional linked list, 7Bigraph, 146, 148Biorthogonalization Lanczos algorithm, 210Bipartite graph, 146, 148, 163Bireducible matrix, 145Bisection method, 184Block-partitioned matrix

storage of, 24Block-within-block-column storage, 25Block diagonal pivoting, 82Block Lanczos algorithm, 206Block lower triangular form, 144, 152, 157Block matrix, 110Block methods, 37Boundary conditions

for scalar problems, 251for vector problems, 252

Boundary element method, 249Bounds for eigenvalues, 182Boy, 148, 164Breadth-first search, 93

algorithm, 94of a digraph, 155of undirected graph, 93

Bunch’s error formulation, 67

Cancellationaccidental, 69, 85

Cardinality, 87Cell, 6Characteristic polynomial, 183Chebyshev acceleration, 198Checking a sparse representation, 276Cholesky factorization, 38, 53

implementation, 55

Circular linked list, 7Circular storage, 17Clique, 12, 89Clique amalgamation, 103Codiagonal, 13Collapsing of vertex, 167Column

active, 15equilibrated matrix, 83graph, 148head, 16permutation, 217

Column-wise representation, 20complete, ordered, 21

Column heads, 16Compact storage, 8, 30Compatible numbering, 118Complete pivoting, 78–80Complete representation, 20Component partitioning, 90Composite vertex, 91, 167Compression

Sherman’s, 22Condensation, 150, 256Congruence transformation, 178Congruent pencils, 179Conjugate gradient algorithm, 15Connected component, 90Connected digraph, 147Connected graph, 89Connected nodes, 251Connection table, 11Connectivity level structure, 149Connectivity matrix, 12, 249, 256Consistent numbering, 118Control of numerical errors, 77Convenient ordering, 87Coordinate over-relaxation, 181Coordinate relaxation, 181Copying a sparse matrix, 279

Page 34: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

REFERENCES 297

Cost considerations, 57CR(C)O, 21Cross-link, 93, 154, 155Cuthill and McKee algorithm, 96

reverse, 98Cutvertex, 90Cycle, 89

directed, 147

Data structure, 26array, 8dynamic, 27record, 8static, 26

Data structure set-up, 26Definitions and properties, 37Deflation, 190Degree, 11, 89Depth-first search, 93, 132

of a digraph, 151of undirected graph, 132

Descendant, 90Desirable forms, 27Determinant, 183Diagonal elementary matrix, 40Diagonally dominant matrix, 39

properly, 39Diagonal pivoting, 79Diagonal storage of band matrix, 12, 13Diakoptical system, 131Diameter of graph, 89Difference

symmetric, 162Digraph, 10, 87, 145

breadth-first search, 155depth-first search, 151

Dimension, 194Directed adjacency level structure, 155Directed adjacency level substructure, 156Directed cycle, 147

Directed graph, 10, 87, 145Direct iteration, 190

for generalized eigenproblem, 193Dirichlet nodes, 251Disconnected graph, 89Disjoint list

multiple, 9Displaying a sparse matrix, 277Dissection

generalized nested, 121height, 114nested, 113

Distance, 89, 147Dot product, 194

of sparse vectors, 33Dual structure, 150Dynamic storage, 26

allocation, 27Dynamic storage allocation, 27Dynamic structure, 27

Eccentricity, 89Edge, 10, 87Eigenanalysis, 177

of hermitian matrix, 209of Hessenberg matrix, 189of tridiagonal matrix, 189of tridiagonal unsymmetric matrix, 189

Eigenpair, 177Eigenproblem

generalized, 177standard, 177unsymmetric, 210

Eigenvalue, 177economizer, 256

Eigenvaluesbounds for, 182

Eigenvector, 177left-hand, 210right-hand, 210

Page 35: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

298 REFERENCES

Elementgeneralized, 130super, 130

Elementary matrices, 40properties, 41

Elementary matrix, 40Element matrix, 128

assembly, 128Elimination digraph, 147Elimination form

relation with product form, 52Elimination form of the inverse, 47, 52Elimination graph, 101

perfect, 136Elimination ordering

minimal, 138minimum, 138perfect, 136

Embeddingplanar, 88

Entrance, 149Envelope, 14Envelope storage

of symmetric matrices, 14Equilibrated matrix, 83Equilibration, 83Error

estimator, 82Error bounds

for factorization, 74for substitution, 76

Error growthmonitoring, 82

Errorscontrol, 77in floating point operations, 65in sparse factorization, 68in sparse substitution, 73

Estimator, 82Euclidean space, 193

Exit, 149Expanded array of pointers, 33, 34Expanded real accumulator, 31Expanded storage, 9, 30

FactorizationCholesky, 38, 53error bounds, 74errors, 68orthogonal, 37triangular, 22, 35

Fast Givens rotation, 186Fill, 26, 36Fill-in, 85

for nested dissection, 123Filled digraph, 147Filled graph, 103Finite element, 127

graph, 92method, 92, 127, 249ordering, 127

Fixed length records, 16Floating point operations

errors, 65Flutter

aircraft analysis, 210Forest

spanning, 92, 152Format, sparse

column-wise, 20row-wise, 19

Forward and backward substitutionalgorithm, 246

Forward row-backward column storage, 18Forward substitution, 48, 56

example, 245Free vertex, 161Frond, 133, 154Front, 129Frontal method, 128

Page 36: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

REFERENCES 299

for general matrix, 175Front of queue, 7Frontwidth, 15Fundamentals, 5

Gauss-Jordan eliminationby columns, 50by rows, 52

Gauss-Seidelalgorithm, 275method, 274

Gauss eliminationand graph tehory, 101by columns, 45by rows, 49

Generalized eigenproblem, 177Generalized element, 130Generalized nested dissection, 121Gerschgorin

interval, 183Gerschgorin disc, 183Girl, 148, 164Givens rotation, 186

fast, 186Gram-Schmidt orthonormalization, 196, 206Graph, 87

adjacency structure, 10bipartite, 146connected, 89directed, 10, 87disconnected, 89edge, 10labelling, 10planar, 88, 119representation, 10storage, 10undirected, 10vertex, 10

Graphsclique, 12

Graph theoryand Gauss elimination, 101for symmetric matrices, 87for unsymmetric matrices, 146–148

Holder’s inequality, 65Half-bandwidth, 12Hall’s algorithm, 158Head, 6

of column, 16of row, 16

Height of dissection, 114Hermitian matrix, 40

eigenanalysis of, 209Hessenberg form, 37Hessenberg matrix, 185

eigenanalysis of, 189Hopcroft and Karp’s algorithm, 161Householder’s reflection, 186

matrix, 186Hypermatrix storage, 25

Implicit storage, 24Incident edge, 89Indefinite matrix, 37Indefinite symmetric system, ordering, 140Indegree, 146Indistinguishable vertices, 107Inertia theorem, 184Infinite element, 127Inner product, 193Integer array of pointers, 32, 34Integers

merging of lists, 28storage of lists, 8

Interval of Gerschgorin, 183Introduction, 1, 5, 63Invariance of a graph, 88, 145, 148Invariant subspace, 194Inverse iteration, 190

for generalized eigenproblem, 193

Page 37: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

300 REFERENCES

simultaneous, 198Isostructural rows, 24

Jacobi rotation, 186Jenning’s storage, 14Jungle, 156

Key’s storage, 20King’s algorithm, 98

reverse, 101Knuth-Rheinboldt-Mesztenyi storage, 17Knuth sparse storage scheme, 16Knuth storage

column heads, 16row heads, 16

KRM circular storage, 17Krylov subspace, 199

Label, 10Labelled graph, 10, 87Laguerre’s iteration, 183Lanczos’ basis, 199Lanczos algorithm, 15, 199

band, 206biorthogonalization, 210block, 206block, for generalized eigenproblems, 208for generalized eigenproblem, 203in practice, 203with no orthogonalization, 205with periodic orthogonalization, 206with reorthogonalization, 204with selective orthogonalization, 204

Left-hand eigenvector, 210Left row elementary matrix, 41Length

of level structure, 93, 155of partitioning, 150

Level structure, 90, 93ajacency, 93connectivity of, 149

directed adjacency, 155, 156length of, 93rooted, 93width, 93

Lexicographic search, 136algorithm, 138

Linear algebraic equations, 35Line of a matrix, 18Linked list, 6

bidirectional, 7circular, 7

Linked sparse storage schemes, 15Linked storage, 15List

head, 6linked, 6merging, 28operations with, 5, 9range, 8sparse, 8storage of, 5terminator, 6

Lists of integers, 8compact storage, 8expanded storage, 9merging, 28multiple disjoint, 9range, 8sparse, 8storage, 8

Long frond ordering, 134Loop, 88Lower column elementary matrix, 40Lower triangular matrix, 22, 40

block form, 144Lowlink, 168

Machine precision, 65Markowitz’s algorithm, 172Markowitz’s pivoting, 172

Page 38: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

REFERENCES 301

Matching, 148, 161Matrices

elementary, 40triangular, 40

Matrixadjacency, 12bireducible, 145connectivity, 12diagonally dominant, 39elementary, 40hermitian, 40indefinite, 37lower triangular, 22, 40minor, 38nondefinite, 37nullity, 39of rank one, 39orthogonal, 38permutation, 44positive definite, 37principal minor, 38properly diagonally dominant, 39rank, 39rank deficiency, 39singular, 39structure, 16triangular factorization, 38unit diagonal, 40unsymmetric, 37upper triangular, 22, 40zero-nonzero pattern, 16

Maximal set, 157Maximum assignment, 148Maximum set, 157Merging sparse lists of integers, 28Mesh, 127Mesh generation, 250Minimal elimination ordering, 138Minimal nested dissection partitioning, 115Minimal separator, 90

Minimization of trace, 208Minimum degree algorithm, 104Minimum elimination ordering, 138Minor, 38

principal, 38Minrow-within-mincolumn pivoting, 174Modularity, 27Monitoring error growth, 82Monotone ordering, 90Multi-frontal method, 130Multiple disjoint lists, 9Multiple switch technique, 29Multiplication

of diagonal matrix by matrix, 279of general matrix by vector, 224of sparse matrices, 230of symmetric matrix by vector, 228, 229of triangular matrix by matrix, 268–270of triangular matrix by vector, 272

Multiplicity, 177

Nested dissection, 113algorithm, 116fill-in, 123generalized, 121ordering, 113properties, 118tree, 114

Nodal assembly matrix, 249, 251, 257Nodes, 127

connected, 251Dirichlet, 251

Nonzero, 69, 85definition, 69

Normof matrix, 65, 72of vector, 64

Nullity, 39symbolic, 159

Nullity of a matrix, 39

Page 39: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

302 REFERENCES

Numbered graph, 87Numbering

compatible, 118consistent, 118

Numerical assembly algorithm, 261Numerical errors, 63, 65, see also ErrorsNumerical examples, 59Numerical processing, 26Numerical stability and pivot selection, 78–82Numerical triangular factorization algorithm, 242–

245in row-wise format, 238–239

Offspring, 90One-way dissection, 122–126

algorithm, 125–126Operations with lists, 5Operations with sparse matrices, 211Ordered graph, 87Ordered representation, 20Ordering

convenient, 87for pivot selection, 45monotone, 90

Origin shift, 191Orthogonal factorization, 37Orthogonal matrix, 38Orthogonal similarity, 178Orthonormal basis, 194Orthonormalization

Gram-Schmidt, 206Outdegree, 146Overhead storage, 15Overrelaxation

coordinate, 181parameter, 181

Packed storage, 30Partial pivoting, 80Partitioned matrix

storage, 24–26

Partitioning, 90component, 90tree, 91

Pascal, 8Path, 89

augmenting, 159, 161length, 89shortest augmenting, 162

Paths in an acyclic digraph, 157–158algorithm for finding, 157

Patternzero-nonzero, 16

Pedigree, 90Pencil, 177

congruent, 179Perfect elimination graph, 136Perfect elimination ordering, 136Peripheral vertex, 89Permutation

of columns, 217of rows, 217

Permutation matrix, 44storage, 45

Phase counter, 30Pivot, 45Pivoting, 78

block diagonal, 82complete, 79diagonal, 79for symmetric matrix, 86, 141for unsymmetric band matrix, 175for unsymmetric matrix, 172–175partial, 80threshold, 80

Pivot selection, 45, 77and numerical stability, 78–83

Planar embedding, 88Planar graph, 88, 119Plane in n-dimensional space, 185Plane rotation, 186

Page 40: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

REFERENCES 303

Popitem on stack, 7

Positive definite matrix, 37Power method, 190–191

for generalized eigenproblem, 193Practical Cholesky factorization, 55Preface, xiiiPrimary candidates, 78Principal minor, 38Printing a sparse matrix, 277Processing

numerical, 26symbolic, 26

Product, see MultiplicationProduct form of the inverse, 51–53Profile, 14

reduction, 98–101Properties and definitions, 37Properties of elementary matrices, 41Properties of triangular matrices, 42–44Pseudoperipheral vertex, 89

algorithm for finding, 95Push

item on stack, 7

Queue, 7front, 7rear, 7storage, 5

Quotient graph, 90Quotient tree, 91

algorithm, refined, 110

Radix sort, simultaneous, 217Range of list, 8Rank

deficiency, 39of a matrix, 39symbolic, 159

Rank one matrix, 39Rayleigh-Ritz procedure, 195

Rayleigh matrix, 182, 195Rayleigh quotient, 180–182

iteration, 193iteration, for generalized eigenproblem, 193procedure, 195procedure, for generalized eigenproblem, 195

Reachability matrix, 146Reachable set, 90Reachable vertex, 90, 146Real accumulator

expanded, 31Rear of queue, 7Receiver, 146Record data structure, 8Records

fixed length, 16Records of variable length, 28Reducible matrix, 145Reduction

of band generalized eigenproblem, 188of band matrix, 188–189of bandwidth, 96–98of general matrix, 185–187of profile, 98–101

Reflection of Householder, 186Reflector, 186Relaxation coordinate, 181Representation, 19–20

complete, 20of graphs, 10–12ordered, 20ordering, 215–216, 218transforming, 278unordered, 20

Residual, 75, 84Residual matrix, 200Residual vector, 181Restriction, 194Reverse

depth-first ordering, 134

Page 41: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

304 REFERENCES

monotone ordering, 133Right-hand eigenvector, 210Right row elementary matrix, 41Ritz values, 195Ritz vector, 195

threshold, 204Rooted level structure, 93Rooted substructure, 155Rooted tree, 90Root of strong component, 153Rotation

fast Givens, 186Givens, 186Jacobi, 186plane, 186

Rowequilibrated matrix, 83graph, 148head, 16

Row-wise format, 19–20Row-wise representation, 19

complete, unordered, 21complete and ordered, 20diagonal and upper, ordered, 21upper, ordered, 22

Row heads, 16Row permutation, 217–218Rows

isostructural, 24RR(C)O, 20RR(C)U, 21RR(DU)O, 21RR(U)O, 22

Sargent and Westerberg’s algorithm, 167–168Scalar product, 194

of sparse vectors, 33Scaling, 83–84Search, 93Section graph, 88

Selection of pivots, 45, 77Selfedge, 88Semiband, 13Separator, 90

minimal, 90Set

notation, 162operations, 162

Shape functions, 250Sherman’s compression, 22–24Shift of origin, 191Short frond ordering, 134Similarity, orthogonal, 178Simultaneous iteration, 196–199

for generalized eigenproblem, 198–199inverse, 198

Simultaneous radix sort, 217Singular matrix, 39Singular values, 208Sink, 146Skeleton, 92Skyline storage, 15Software for unsymmetric systems, 175Source, 146Space, 193Span, 90Spanning forest, 92, 152Spanning set, 194Spanning tree, 92Sparse list, 8Sparse matrix

algebra, 211–247operations, 211

Sparse representationchecking of, 276

Sparse row-wise format, 19–20Sparse substitution

errors in, 73–77Sparse tableau, 132Sparse vectors

Page 42: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

REFERENCES 305

addition, 30–33dot product, 33scalar product, 33–34

Spectral factorization, 178Stability

numerical, 78–82Stack, 7

pop an item, 7push an item, 7storage, 5top, 7

Standard eigenproblem, 177Static data structure, 26Stiffness matrix, 251Stodola’s iteration, 190Storage, 5–28

allocation, 26block-partitioned matrix, 24block-within-block-column, 25compact, 30compressed, 22connection table, 11dynamic allocation, 27dynamic schemes, 26–28expanded, 30forward row-backward column, 18hypermatrix, 25implicit, 24Knuth-Rheinboldt-Mesztenyi, 17Knuth scheme, 16KRM, 17linked sparse schemes, 15of arrays, 5of band matrices, 12of graphs, 10of integers, 8of lists, 5of lists of integers, 8of queues, 5of stacks, 5

of symmetric matrices, 14overhead, 15packed, 30skyline, 15sparse row-wise format, 19supersparse, 26variable band, 14

Strong component, 145, 148–151, 167, 168root, 153

Strongly connected component, 148Strongly connected digraph, 148Structure of a matrix, 16, 20Sturm sequence, 184Subgraph, 88Subspace, 194

invariant, 190, 194iteration, 196Krylov, 199

Substitutionbackward, 48, 56–57error bounds for, 76errors in, 73–77forward, 48, 56–57

Substructurerooted, 155

Substructuring, 130Super-element, 130Supersparse storage, 26Switch, 29

array, 29multiple, 29phase counter, 30

Switch array, 29Switch technique

multiple, 29–30Sylvester’s inertia theorem, 184Symbolic

nullity, 159Symbolic assembly algorithm, 259–260Symbolic processing, 26

Page 43: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

306 REFERENCES

Symbolic rank, 159Symbolic section, 26Symbolic singular matrix, 159Symbolic triangular factorization

algorithm, 240–242in row-wise format, 235

Symmetricdifference, 162

Symmetric indefinite systemordering, 140–141

Symmetric matricesenvelope storage, 14

Symmetric matrix, 37System

augmented, 132diakoptical, 131

Table of factors, 43, 47, 51Tarjan’s algorithm, 168–172Terminal members, 114Terminator, 6Threshold pivoting, 80Threshold vector, 204Tolerance, 80Top of stack, 7Trace, 183Trace minimization, 208Transforming a representation, 278Transmitter, 146Transportability, 212Transposition of a matrix, 213–215

algorithm, 215–216Transversal, 18, 145, 146, 158Tree, 90

nested dissection, 114partitioning, 109–113quotient, 90rooted, 90spanning, 92

Tree arc, 93, 133, 152, 155

redundant, 154Tree partitioning, 91Triangular factorization, 22, 35

in row-wise format, 235–245numerical, 238–239numerical algorithm, 242–245symbolic algorithm, 240–242

Triangular matrices, 40properties, 42–44

Triangulated graph, 137Triangulation, 137Tridiagonal matrix, 185

eigenanalysis of, 189eigenanalysis of unsymmetric, 189

Triple, 16

Undirected graph, 10, 87breadth-first search, 93–95depth-first search, 132–136

Uni-frontal method, 130Unit diagonal matrix, 40Unordered representation, 20–22Unsymmetric band matrix pivoting, 175Unsymmetric eigenproblem, 210Unsymmetric matrix, 37

graph theory, 146–148pivoting strategies for, 172–175

Unsymmetric system software, 175Upper almost-triangular matrix, 185Upper column elementary matrix, 41Upper Hessenberg matrix, 185Upper triangular matrix, 22, 40

Variable band, 14Variable length records, 28Vectors

addition, 30–32Vertex, 10, 87

adjacent, 10degree, 11

Vertex collapsing, 167

Page 44: Sergio Pissanetzkysergio.pissanetzky.com/Publications/BookSampleSMT.pdf · This is an electronic edition of the classic book Sparse Matrix Technology by Sergio Pissanetzky, originally

REFERENCES 307

Wavefront, 15Width

of level structure, 155

Zero-nonzero pattern, 16Zlatev’s pivoting, 81

improved, 81