Skip to content
Novus Examples
mtx280 B

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.

Preview — first 17 linesmtx
%%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.

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