MM - Matrix Market File Format (original) (raw)
MM is a data directory which contains files stored in the format used by the Matrix Market for the storage and exchange of matrices.
MM File Characteristics:
- ASCII format;
- allow comment lines, which begin with a percent sign;
- use a "coordinate" format for sparse matrices;
- use an "array" format for general dense matrices;
A file in the Matrix Market format comprises four parts:
- Header line: contains an identifier, and four text fields;
- Comment lines: allow a user to store information and comments;
- Size line: specifies the number of rows and columns, and the number of nonzero elements;
- Data lines: specify the location of the matrix entries (implicitly or explicitly) and their values.
The header line has the form
%%MatrixMarket object format field symmetry
The header line must be the first line of the file, and the header line must begin with the string %%MatrixMarket. The four fields that follow that string are
- object is usually matrix, and that is the case we will consider here. Another legal value isvector, whose format is similar, but with some obvious simplifications.
- format is either coordinate or array;
- field is either real, double, complex,integer or pattern.
- symmetry is either general (legal for real, complex, integer or pattern fields),symmetric (real, complex, integer or pattern),skew-symmetric (real, complex or integer), orhermitian (complex only).
If the field of a matrix is pattern, then only the locations of the nonzeros will be listed. This presumes, obviously, that we are using the coordinate format!
If the symmetry of a matrix is symmetric orhermitian, then only the entries on or below the main diagonal are to be listed. If the symmetry is skew-symmetric, then only the entries strictly below the main diagonal are to be listed.
The comment lines, if any, should follow the header line. The only requirement is that each comment line begin with a percent sign.
If format was specified as array, then the size line has the form:
_m n_
where
- m is the number of rows in the matrix;
- n is the number of columns in the matrix;
If format was specified as coordinate, then the size line has the form:
_m n nonzeros_
where
- m is the number of rows in the matrix;
- n is the number of columns in the matrix;
- nonzeros is the number of nonzero entries in the matrix (for general symmetry), or the number of nonzero entries on or below the diagonal (for symmetric or Hermitian symmetry), or the number of nonzero entries below the diagonal (for skew-symmetric symmetry).
If format was specified as array, there must follow exactly m * n data lines, one for each entry, listed by columns, having the form
_value_
where
- value is the value of the entry. If the field iscomplex, a pair of real numbers is required.
If format was specified as coordinate, there must follow exactly nonzeros data lines, one for each matrix entry that is to be listed, having the form
_i j value_
where
- i is the row of the entry;
- j is the column of the entry;
- value is the value of the entry. If the field iscomplex, a pair of real numbers is required. If the value of format was pattern, then no value is listed here; only the values of i and j occur.
Licensing:
The computer code and data files described and made available on this web page are distributed underthe GNU LGPL license.
Reference:
- http://math.nist.gov/MatrixMarket/
The Matrix Market Web Site. - Ronald Boisvert, Roldan Pozo, Karin Remington,
The Matrix Market Exchange Formats: Initial Design,
Technical Report NISTIR-5935,
National Institute of Standards and Technology, December 1996.
Sample Files:
- <gr%5F900%5F900%5Fcrg.mm>, a 900 by 900 matrix in COORDINATE REAL GENERAL form.
- <gre%5F343%5F343%5Fcrg.mm>, a 343 by 343 matrix in COORDINATE REAL GENERAL form.
- <m%5F04%5F03%5Farg.mm>, a 4 by 3 matrix in ARRAY REAL GENERAL form.
- <m%5F05%5F05%5Fcch.mm>, a 5 by 5 matrix in COORDINATE COMPLEX HERMITIAN form.
- <m%5F05%5F05%5Fcig.mm>, a 5 by 5 matrix in COORDINATE INTEGER GENERAL form.
- <m%5F05%5F05%5Fcpg.mm>, a 5 by 5 matrix in COORDINATE PATTERN GENERAL form.
- <m%5F05%5F05%5Fcrk.mm>, a 5 by 5 matrix in COORDINATE REAL SKEW-SYMMETRIC form.
- <m%5F05%5F05%5Fcrg.mm>, a 5 by 5 matrix in COORDINATE REAL GENERAL form.
- <m%5F05%5F05%5Fcrs.mm>, a 5 by 5 matrix in COORDINATE REAL SYMMETRIC form.
- <wathen%5F29%5F29%5Fadg.mm>, a 29 by 29 matrix in ARRAY DOUBLE GENERAL form.
- <west%5F67%5F67%5Fcrg.mm>, a 67 by 67 matrix in COORDINATE REAL GENERAL form.
You can go up one level tothe DATA page.
Last revised on 25 March 2006.