Sparsity Pattern of a Matrix

**SPARSE_DISPLAY**
is a MATLAB library which
can read information defining a matrix of numbers and display
the sparsity pattern or location of the nonzero elements using
gnuplot. This operation is already available in the built-in
MATLAB "spy" command.

The user can call "spy_ge" and pass in a matrix, in general (GE) format; the routine will then locate the nonzero entries, and write out a data file and a command file which together can be used to instruct gnuplot to create a sparsity plot.

If the user already has a file containing a list of pairs of indices (I,J) corresponding to nonzero matrix entries, then the user can call "spy_file", which will write out a command file only. Together, the user data file and the command file can be used to instruct gnuplot to create a sparsity plot.

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

**SPARSE_DISPLAY** is available in
a C version and
a C++ version and
a FORTRAN77 version and
a FORTRAN90 version and
a MATLAB version.

CG, a MATLAB library which implements a simple version of the conjugate gradient (CG) method for solving a system of linear equations of the form A*x=b, suitable for situations in which the matrix A is positive definite (only real, positive eigenvalues) and symmetric.

GNUPLOT, MATLAB programs which illustrate how a program can write data and command files so that gnuplot can create plots of the program results.

MM_IO, a MATLAB library which reads and writes sparse linear systems stored in the Matrix Market (MM) format.

WATHEN, a MATLAB library which compares storage schemes (full, banded, sparse triplet) and solution strategies (Linpack full, Linpack banded, conjugate gradient (CG)) for linear systems involving the Wathen matrix, which can arise when solving a problem using the finite element method (FEM).

- spy_file.m, plots a sparsity pattern stored in a file.
- spy_ge.m, plots a sparsity pattern for a general storage (GE) matrix.
- timestamp.m, prints the current YMDHMS date as a time stamp.

- sparse_display_test.m, a sample calling program.
- sparse_display_test_output.txt, the output file.
- sparse_display_test01.m, tests spy_ge().
- r8mat_uniform_01.m, returns a pseudorandom uniform R8MAT.
- wathen_ge.m, sets up the Wathen matrix in GE format.
- wathen_order.m, returns the size of the Wathen matrix.
- wathen_ge_data.txt, data defining the location of the nonzero entries of the Wathen matrix.
- wathen_ge_commands.txt, gnuplot commands to display the data.
- wathen_ge.png, an image of the sparsity pattern for the Wathen matrix.
- sparse_display_test02.m, tests spy_file().
- before_data.txt, data defining the location of the nonzero entries of a matrix, as created by DEAL.II.
- before_commands.txt, gnuplot commands to display the data.
- before.png, an image of the sparsity pattern for the before matrix.
- after_data.txt, data defining the location of the nonzero entries of a matrix, as created by DEAL.II (after reordering of variables).
- after_commands.txt, gnuplot commands to display the data.
- after.png, an image of the sparsity pattern for the after matrix.
- 30x20_data.txt, data defining the location of the nonzero entries of the 30x20 matrix.
- 30x20_commands.txt, gnuplot commands to display the data.
- 30x20.png, an image of the sparsity pattern for the 30x20 matrix.

You can go up one level to the MATLAB source codes.