// src/sparse/csr/symbolic_own.rs
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn symbolic_sparse_row_mat_new_checked() {
let nrows = 4;
let ncols = 10;
let row_ptrs = vec![0_u32, 4, 6, 6, 8];
let col_indices = vec![0_u32, 1, 3, 5, 0, 3, 4, 5];
let new_checked =
SymbolicSparseRowMat::new_checked(nrows, ncols, row_ptrs, None, col_indices);
}
assert_eq!(new_checked.nrows, 4);
}
---- sparse::csr::symbolic_own::tests::symbolic_sparse_row_mat_new_checked stdout ----
thread 'sparse::csr::symbolic_own::tests::symbolic_sparse_row_mat_new_checked' panicked at src/sparse/csr/symbolic_own.rs:358:13:
index out of bounds: the len is 5 but the index is 10
stack backtrace:
0: rust_begin_unwind
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:652:5
1: core::panicking::panic_fmt
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/panicking.rs:72:14
2: core::panicking::panic_bounds_check
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/panicking.rs:275:5
3: faer::sparse::csr::symbolic_ref::SymbolicSparseRowMatRef<I>::new_checked
at ./src/sparse/csr/symbolic_ref.rs:93:17
4: faer::sparse::csr::symbolic_own::SymbolicSparseRowMat<I>::new_checked
at ./src/sparse/csr/symbolic_own.rs:52:9
5: faer::sparse::csr::symbolic_own::tests::symbolic_sparse_row_mat_new_checked
at ./src/sparse/csr/symbolic_own.rs:358:13
6: faer::sparse::csr::symbolic_own::tests::symbolic_sparse_row_mat_new_checked::{{closure}}
at ./src/sparse/csr/symbolic_own.rs:352:45
7: core::ops::function::FnOnce::call_once
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/ops/function.rs:250:5
8: core::ops::function::FnOnce::call_once
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
failures:
sparse::csr::symbolic_own::tests::symbolic_sparse_row_mat_new_checked
test result: FAILED. 30 passed; 1 failed; 0 ignored; 0 measured; 233 filtered out; finished in 1.74s
Describe the bug
Cannot create a
SymbolicSparseRowMat
withSymbolicSparseRowMat::new_checked()
ornew_unsorted_checked()
*To Reproduce**