Add tests for Csr/CscMatrix::identity
This commit is contained in:
parent
2d11b90149
commit
0936c4fad9
|
@ -375,4 +375,11 @@ proptest! {
|
|||
|
||||
prop_assert_eq!(d_entries, csc_diagonal_entries);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn csc_identity(n in 0 ..= 6usize) {
|
||||
let csc = CscMatrix::<i32>::identity(n);
|
||||
prop_assert_eq!(csc.nnz(), n);
|
||||
prop_assert_eq!(DMatrix::from(&csc), DMatrix::identity(n, n));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -375,4 +375,11 @@ proptest! {
|
|||
|
||||
prop_assert_eq!(d_entries, csr_diagonal_entries);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn csr_identity(n in 0 ..= 6usize) {
|
||||
let csr = CsrMatrix::<i32>::identity(n);
|
||||
prop_assert_eq!(csr.nnz(), n);
|
||||
prop_assert_eq!(DMatrix::from(&csr), DMatrix::identity(n, n));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue