ST
Sparse Triplet Matrix File Format


ST, the "sparse triplet format", is a simple data structure and a file format for storing sparse matrices.

The sparse triplet data structure simply records, for each nonzero entry of the matrix, the row, column and value. Thus, the information in the data structure might be

Row and column indices are 0-based.

The sparse triplet file format is an ASCII file of NZ_NUM lines, with each line corresponding to a nonzero entry of the matrix, and containing the row index, column index and value of that entry, separated by spaces.

Related Data and Programs:

DSP is a sparse matrix file format that is identical to the ST format, except that it uses 1-based indexing, which is suitable for FORTRAN77, FORTRAN90 and MATLAB programming.

LINPLUS is a library of routines for matrix tasks, which includes routines for matrices stored in the DSP format. LINPLUS is available in a C++ version, and a FORTRAN90 version, and a MATLAB version,

MGMRES is a C++ routine which applies the restarted GMRES iterative technique to a sparse linear system stored in the DSP format.

Example:

The 4 by 6 matrix

        11   0   0  14   0  16
         0  22   0   0  25  26
         0   0  33  34   0  36
        41   0  43  44   0  46
      
could be stored as an ST file which reads:
        0  0  11.0
        0  3  14.0
        0  5  16.0
        1  1  22.0
        1  3  25.0
        1  5  26.0
        2  2  33.0
        2  3  34.0
        2  5  36.0
        3  0  41.0
        3  2  43.0
        3  3  44.0
        3  5  46.0
      

ST File Characteristics:

Reference:

  1. Timothy Davis,
    Direct Methods for Sparse Linear Systems,
    SIAM, 2006.

Routines to write a matrix to a file in the ST format:

Routines to read a matrix from a file in the ST format:

Routines to convert another file to ST format:

Routines to convert a ST file to another format:

Sample ST Files:

You can go up one level to the DATA page.


Last revised on 01 September 2006.