Matrix 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.
%%MatrixMarket matrix array real general
% Dense storage: values run down each COLUMN, not across each row.
4 3
0.25
1.0
1.75
2.5
0.5
1.25
2.0
2.75
0.75
1.5
2.25
3.0
Specifications
- Format
- Matrix Market array
- Field
- real
- Rows
- 4
- Columns
- 3
- Values
- 12
- Order
- column-major
- Trap
- reading row-major scrambles the matrix without raising anything
- First Three Values In File
- 0.25, 1.0, 1.75 — the first COLUMN
Testing contract
Expected to pass- Scenario
- Read the size line, then load the twelve values in column-major order and report element (1, 2) under 1-based indexing.
- Expected result
- Element (1,2) is 0.5 under the correct column-major reading, and the file's first three values are 0.25, 1.0 and 1.75 — the first column; a row-major reader puts 1.0 at (1,2) instead.
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 — Dense Array, Column-Major Order (.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: 4 rows · 3 columns · Matrix Market array. 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 — 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.

- mtxMatrix Market — Zero Stored Entries, Still Valid (.mtx)A valid Matrix Market file describing a 6x6 matrix with no stored entries, which is an all-zero matrix rather than an error. It separates readers that model an empty result from readers that treat a missing entry block as truncation.

- csvSparse Triplets — Both Index Bases Side by Side (.csv)The twelve stored entries of the sparse matrix with both 1-based and 0-based indices in adjacent columns. It turns the Matrix Market indexing convention from a footnote into something a loader can be diffed against directly.

- 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.

- molBenzene — Molfile V3000 Extended Connection Table (.mol)Benzene written in the V3000 extended format, where the legacy counts line reports zero atoms and the real counts live in an M V30 COUNTS record. A parser that trusts the old counts line reads an empty molecule and reports no error whatsoever.

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