Skip to content
Novus Examples
mtx174 B

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

Preview — first 11 linesmtx
%%MatrixMarket matrix coordinate integer general
% The integer field means values must NOT be parsed as floats.
5 5 7
1 1 7
1 5 -3
2 3 12
3 2 -1
4 4 255
5 1 -32768
5 5 32767

Specifications

Field
integer
Symmetry
general
Rows
5
Columns
5
Non Zeros
7
Value Range
-32768 to 32767
Trap
a float parser turns 255 into 255.0 and changes the declared field

Testing contract

Expected to pass
Scenario
Parse the banner to learn the field is integer, then load the values into an integer type and check the extremes.
Expected result
The values load as integers with -32768 and 32767 preserved exactly, and a reader that stores them as float64 or as int16-with-overflow disagrees on at least one entry.

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 — Integer Field, Not Floats (.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: 5 rows · 5 columns. 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.