forked from M-Labs/nalgebra
Add (failing) test for empty matrix market matrix
This commit is contained in:
parent
4c039573f2
commit
4d0f401882
@ -4,6 +4,24 @@ use nalgebra::Complex;
|
|||||||
use nalgebra_sparse::io::load_coo_from_matrix_market_str;
|
use nalgebra_sparse::io::load_coo_from_matrix_market_str;
|
||||||
use nalgebra_sparse::CooMatrix;
|
use nalgebra_sparse::CooMatrix;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[rustfmt::skip]
|
||||||
|
fn test_matrixmarket_sparse_real_general_empty() {
|
||||||
|
// Test several valid zero-shapes of a matrix
|
||||||
|
let shapes = vec![ (0, 0), (1, 0), (0, 1) ];
|
||||||
|
let strings: Vec<String> = shapes
|
||||||
|
.into_iter()
|
||||||
|
.map(|(m, n)| format!("%%MatrixMarket matrix coordinate real general\n {} {} 0", m, n))
|
||||||
|
.collect();
|
||||||
|
|
||||||
|
for string in &strings {
|
||||||
|
let sparse_mat = load_coo_from_matrix_market_str::<f32>(string).unwrap();
|
||||||
|
assert_eq!(sparse_mat.nrows(), 0);
|
||||||
|
assert_eq!(sparse_mat.ncols(), 0);
|
||||||
|
assert_eq!(sparse_mat.nnz(), 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
fn test_matrixmarket_sparse_real_general() {
|
fn test_matrixmarket_sparse_real_general() {
|
||||||
|
Loading…
Reference in New Issue
Block a user