pub fn deserialize_sparse_matrix<P, A>(
path: P,
format: SerializationFormat,
) -> Result<SparseMatrixCOO<A>>
Expand description
Deserialize a sparse matrix from a file
§Arguments
path
- Path to the input fileformat
- Serialization format
§Returns
Result<SparseMatrixCOO<A>>
- Deserialized sparse matrix or error
§Examples
use scirs2_io::serialize::{deserialize_sparse_matrix, SerializationFormat};
// Deserialize sparse matrix
let sparse = deserialize_sparse_matrix::<_, f64>("sparse.json", SerializationFormat::JSON).unwrap();
println!("Sparse matrix: {}x{} with {} non-zero elements", sparse.rows, sparse.cols, sparse.nnz());