# mgmres

mgmres, a FORTRAN90 code which applies the restarted Generalized Minimum Residual (GMRES) algorithm to solve a sparse linear system, using compressed rows storage (CRS) or sparse triplet (ST) format, by Lili Ju.

One matrix format used is the sparse triplet (ST) format, which simply stores NZ_NUM, the number of nonzeros, and stores the K-th nonzero matrix entry as

• A(K), the value of the entry;
• IA(K), the row of the entry;
• JA(K), the column of the entry;

Another matrix format used is the compressed row storage (CRS) format, which is similar to the sparse triplet format except that the vector of row indices is compressed to a vector of length N+1 which points to the beginning of the set of entries for each row.

• A(1:NZ_NUM), the value of the entry;
• IA(1:N+1), row I values occur in entries IA(I) to IA(I+1)-1;
• JA(1:NZ_NUM), the column of the entry;

### Licensing:

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

### Languages:

mgmres is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version.

### Related Data and Programs:

CG_RC, a FORTRAN90 code which implements the conjugate gradient method for solving a positive definite sparse linear system A*x=b, using reverse communication.

JACOBI, a FORTRAN90 code which implements the Jacobi iteration for solving symmetric positive definite systems of linear equations.

SPARSEKIT, a FORTRAN90 code which implements operations on sparse matrices, including conversion between various formats.

TEST_MAT, a FORTRAN90 code which defines test matrices.

### Author:

C version by Lili Ju, Mathematics Department, University of South Carolina; FORTRAN90 version by John Burkardt.

### Reference:

1. Richard Barrett, Michael Berry, Tony Chan, James Demmel, June Donato, Jack Dongarra, Victor Eijkhout, Roidan Pozo, Charles Romine, Henk van der Vorst,
Templates for the Solution of Linear Systems:
Building Blocks for Iterative Methods,
SIAM, 1994,
ISBN: 0898714710,
LC: QA297.8.T45.
2. Tim Kelley,
Iterative Methods for Linear and Nonlinear Equations,
SIAM, 2004,
ISBN: 0898713528,
LC: QA297.8.K45.