Closed avangogo closed 5 years ago
It seems that the conversion function from TrimatI to CsMat does not work properly when the matrix has empty lines. The following code
let tri_mat = sprs::TriMatI::new((2,4)); let m: sprs::CsMat<u64> = tri_mat.to_csr(); println!("{:?}", m); let _ = m.get(1,1);
outputs
CsMatBase { storage: CSR, nrows: 2, ncols: 4, indptr: [0, 1], indices: [0], data: [0] }
and then logically panics with index out of bounds: the len is 2 but the index is 2 in .../sprs-0.6.5/src/sparse/csmat.rs:1056:20.
index out of bounds: the len is 2 but the index is 2
/sprs-0.6.5/src/sparse/csmat.rs:1056:20
Thanks for the report, I should have a fix soon.
It seems that the conversion function from TrimatI to CsMat does not work properly when the matrix has empty lines. The following code
outputs
CsMatBase { storage: CSR, nrows: 2, ncols: 4, indptr: [0, 1], indices: [0], data: [0] }
and then logically panics with
index out of bounds: the len is 2 but the index is 2
in .../sprs-0.6.5/src/sparse/csmat.rs:1056:20
.