Skip to main content

Module mtx

Module mtx 

Source
Expand description

Matrix Market I/O.

sprs::io::write_matrix_market_sym writes the upper triangle, but the Matrix Market spec calls for the lower triangle (i ≥ j). To stay compatible with strict readers (e.g. fast_matrix_market), we hand roll the symmetric writer. We delegate to sprs for general (non symmetric) output and for reading.

Functions§

emit_mtx
emit_vector_mtx
Emit a dense vector as Matrix Market array real general.
read_mtx
Read a Matrix Market file into a CSR matrix.
read_vector_mtx
Read a dense vector emitted by emit_vector_mtx (array real general): %-comment lines, a <len> 1 dimensions line, then one value per line.
to_mtx_bytes
The complete Matrix Market text for one matrix, symmetric when the header round trips exactly and general otherwise.
to_vector_mtx_bytes
The complete Matrix Market array real general text for one vector.