Matrix Market — Sparse Coordinate, Real, General (.mtx)
An 8x8 sparse matrix in Matrix Market coordinate form with twelve stored entries and 1-based indices, the convention that catches every reader written against 0-based arrays. Comment lines beginning with a percent sign appear before the size line, where the format requires them.
%%MatrixMarket matrix coordinate real general
% Synthetic sparse matrix for parser testing.
% Rows and columns are 1-based, and entries are NOT required to be sorted.
8 8 12
1 1 4.0
1 4 -1.5
2 2 3.25
2 5 0.75
3 1 -2.0
3 3 5.5
4 6 1.125
5 2 -0.25
5 7 2.0
6 8 -3.75
7 4 0.5
8 8 6.0
Specifications
- Format
- Matrix Market coordinate
- Field
- real
- Symmetry
- general
- Rows
- 8
- Columns
- 8
- Non Zeros
- 12
- Indexing
- 1-based
- Density
- 0.1875
Testing contract
Expected to pass- Scenario
- Parse the banner, skip the comment lines, read the size line and load all twelve triplets into a sparse matrix.
- Expected result
- The matrix is 8x8 with 12 stored entries, element (1,1) is 4.0 and element (8,8) is 6.0 under 1-based indexing, and a 0-based reader places every entry one row and one column too low.
What is a .mtx file?
Matrix Market (.mtx) is a plain-text exchange format for sparse and dense matrices from NIST. A banner line declares the object, format, field, and symmetry — for example `%%MatrixMarket matrix coordinate real general` — comment lines follow, and then a size line gives rows, columns, and the number of stored entries. Coordinate entries list a 1-based row, a 1-based column, and a value, with symmetric matrices storing only the lower triangle.
How to use this file
Use an example .mtx file to test sparse-matrix loaders and numerical pipelines, verifying 1-based to 0-based index conversion, correct expansion of symmetric and pattern matrices, and that the declared entry count matches the data.
How to use this file for testing
“Matrix Market — Sparse Coordinate, Real, General (.mtx)” is a deterministic Novus Examples fixture for Scientific data, Editor testing. Citation catalogs (BibTeX, RIS), chemistry structures (MDL Molfile, PDB), and gridded binary data (NetCDF, FITS) — for testing reference managers, molecule viewers, and scientific-data loaders.
Documented properties for this file: 8 rows · 8 columns · Matrix Market coordinate. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.
Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.
Scientific fixtures are small, valid, and fully synthetic — no real organism, patient, sample, or observation. Point your parser or loader at the file and check it reads the documented records, variables, or headers; binary formats ship a readable twin or metadata listing for comparison.
Related files
- mtxIntentionally Corrupt Matrix Market — Declared Count Exceeds the Entries (.mtx)An intentionally corrupt Matrix Market file whose banner and size line are perfectly valid and whose entry block stops seven lines short of the declared count. A reader that preallocates from the declared count and never checks ends up with seven silent zeros.

- mtxMatrix Market — Complex Hermitian With Conjugate Mirroring (.mtx)A Hermitian complex matrix where each line carries a real and an imaginary part and the implied mirror entry is the complex conjugate rather than a copy. Every diagonal entry has a zero imaginary part, which the Hermitian property requires and a validator should check.

- mtxMatrix Market — Dense Array, Column-Major Order (.mtx)A 4x3 dense matrix where values run down each column rather than across each row, which is the Matrix Market array convention and the opposite of what most readers assume. Getting it wrong rearranges every element rather than raising an error.

- mtxMatrix Market — Integer Field, Not Floats (.mtx)A matrix whose banner declares an integer field, so the values are integers and must not be widened to floats on the way in. The stored range deliberately reaches the signed 16-bit limits, so a narrow integer type overflows visibly.

- mtxMatrix Market — Symmetric Pattern, Lower Triangle Only (.mtx)A symmetric pattern matrix carrying only positions and only the lower triangle, so nine stored lines describe sixteen non-zeros. Both halves of that — no value column and an implied mirror — are places a reader can silently disagree with the file.

- bedBED6 Intervals — 0-Based Half-Open Coordinates (.bed)The same six features as the GFF3 file expressed in BED's 0-based half-open coordinates, where the start is one lower and the end is unchanged. Confusing the two conventions shifts every interval by a base, and this pair makes that shift a visible diff.

Generated by generation/scientific.py. Free for any use, no attribution required — license.