umfpack_test, a C code which calls umfpack(), which solves sparse linear systems, part of the SuiteSparse package, by Timothy Davis.

The SuiteSparse package, which is available from .

Calling UMFPACK requires linking additional libraries from the SuiteSparse collection. The executable shell scripts given here suggest how this might be done.

UMFPACK requires that the sparse matrix be stored in a common format known as compressed column (CC) storage.

UMFPACK uses the C indexing convention, in which the first element of a vector has index 0.

As an example, the matrix whose full representation is:

       11 12  0  0  0
       21  0 23  0 25
        0 32 33 34  0
        0  0 43  0  0
        0 52 53  0 55
would be stored in compressed column storage as:
         #  R   CC   X
        --  -   --  --
         0  0    0  11
         1  1       21

         2  0    2  12
         3  2       32
         4  4       52

         5  1    5  23
         6  2       33
         7  3       43
         8  4       53

         9  2    9  34

        10  1   10  25
        11  4       55

        12  -   12
and this is the matrix used in the simple example code.


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


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

Related Data and Programs:

cc, a data directory which contains examples of the compressed column (CC) sparse matrix format;

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

CSPARSE, a C code which carries out the direct solution of sparse linear systems, by Timothy Davis.

HB_IO, a C code which reads and writes sparse linear systems stored in the Harwell Boeing (HB) format for sparse matrices.

MGMRES, a C code which applies the restarted Generalized Minimum Residual (GMRES) algorithm to solve a sparse linear system, by Lili Ju.

ST_IO, a C code which reads and writes sparse linear systems stored in the Sparse Triplet (ST) format.

SUPERLU, a C code which illustrates the usage of the SUPERLU library, which applies a fast direct solution method to solve sparse linear systems, by James Demmel, John Gilbert, and Xiaoye Li.


  1. Timothy Davis,
    Algorithm 832: UMFPACK, an unsymmetric-pattern multifrontal method,
    ACM Transactions on Mathematical Software,
    Volume 30, Number 2, June 2004, pages 196-199.
  2. Timothy Davis,
    Direct Methods for Sparse Linear Systems,
    SIAM, 2006,
    ISBN: 0898716136,
    LC: QA188.D386.

Examples and Tests:

The SIMPLE example demonstrates the use of UMFPACK on a 5x5 "sparse" matrix.

The WATHEN example demonstrates the use of UMFPACK on a sparse matrix that is an instance of the Wathen finite element mass matrix. The matrix is created using the sparse triplet (ST) format, and must be converted to the compressed column (CC) format before calling UMFPACK. This demonstrates why the 5x5 SIMPLE example is not representative of the typical use of UMFPACK.

The WEST example demonstrates the use of UMFPACK on a sparse matrix in the compressed column (CC) format, stored in three files. The matrix is read from the files, and then UMFPACK is called to handle an associated linear system.

Last revised on 10 September 2023.