Skip to content
Novus Examples
mtx166 B

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.

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

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