Module io

Source
Expand description

Functionality for importing and exporting sparse matrices to and from files.

Available only when the io feature is enabled.

The following formats are currently supported:

FormatImportExport
Matrix marketYesYes

§Matrix Market format

The Matrix Market format is a simple ASCII-based file format for sparse matrices, and was initially developed for the NIST Matrix Market, a repository of example sparse matrices. In later years it has largely been superseded by the SuiteSparse Matrix Collection (formerly University of Florida Sparse Matrix Collection), which also uses the Matrix Market file format.

We currently offer functionality for importing a Matrix market file to an instance of a CooMatrix through the function load_coo_from_matrix_market_file, as well as functionality for writing various sparse matrices to the matrix market format through save_to_matrix_market_file. It is also possible to load a matrix stored as a string in the matrix market format with the function load_coo_from_matrix_market_str, or similarly write to a string with save_to_matrix_market_str.

Our implementation is based on the format description on the Matrix Market website and the following NIST whitepaper:

Boisvert, Ronald F., Roldan Pozo, and Karin A. Remington.
The Matrix Market Exchange Formats: Initial Design.” (1996).

Structs§

MatrixMarketError
A description of the error that occurred during importing a matrix from a matrix market format data.

Enums§

MatrixMarketErrorKind
Errors produced by functions that expect well-formed matrix market format data.

Traits§

MatrixMarketExport
A marker trait for sparse matrix types that can be exported to the matrix market format.
MatrixMarketScalar
A marker trait for supported matrix market scalars.

Functions§

load_coo_from_matrix_market_file
Parses a Matrix Market file at the given path as a CooMatrix.
load_coo_from_matrix_market_str
Parses a Matrix Market file described by the given string as a CooMatrix.
save_to_matrix_market
Save a sparse matrix to an std::io::Write instance.
save_to_matrix_market_file
Save a sparse matrix to a Matrix Market format file.
save_to_matrix_market_str
Save a sparse matrix as a Matrix Market format string.
OSZAR »