Skip to content

Commit ea8dc6c

Browse files
committed
Add test for diag-only
1 parent 44821c9 commit ea8dc6c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/svd.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ fn test_no_u(a: &Array2<f64>) {
4141
assert_eq!(vt.dim().1, m);
4242
}
4343

44+
fn test_diag_only(a: &Array2<f64>) {
45+
println!("a = \n{:?}", a);
46+
let (u, _s, vt): (_, Array1<_>, _) = a.svd(false, false).unwrap();
47+
assert!(u.is_none());
48+
assert!(vt.is_none());
49+
}
50+
4451
macro_rules! test_svd_impl {
4552
($test:ident, $n:expr, $m:expr) => {
4653
paste::item! {
@@ -62,9 +69,12 @@ macro_rules! test_svd_impl {
6269
test_svd_impl!(test, 3, 3);
6370
test_svd_impl!(test_no_vt, 3, 3);
6471
test_svd_impl!(test_no_u, 3, 3);
72+
test_svd_impl!(test_diag_only, 3, 3);
6573
test_svd_impl!(test, 4, 3);
6674
test_svd_impl!(test_no_vt, 4, 3);
6775
test_svd_impl!(test_no_u, 4, 3);
76+
test_svd_impl!(test_diag_only, 4, 3);
6877
test_svd_impl!(test, 3, 4);
6978
test_svd_impl!(test_no_vt, 3, 4);
7079
test_svd_impl!(test_no_u, 3, 4);
80+
test_svd_impl!(test_diag_only, 3, 4);

0 commit comments

Comments
 (0)