Function sprs::io::write_matrix_market

source ·
pub fn write_matrix_market<'a, N, I, M, P>(path: P, mat: M) -> Result<(), Error>where
    I: 'a + SpIndex + Display,
    N: 'a + PrimitiveKind + MatrixMarketDisplay,
    for<'n> Displayable<&'n N>: Display,
    M: IntoIterator<Item = (&'a N, (I, I))> + SparseMat,
    P: AsRef<Path>,
Expand description

Write a sparse matrix into the matrix market format.

Example

use sprs::{CsMat};
let save_path = "/tmp/identity5.mm";
let eye : CsMat<f64> = CsMat::eye(5);
sprs::io::write_matrix_market(&save_path, &eye)?;