Skip to content

Commit a6eee3b

Browse files
authored
Merge pull request #175 from stefan-k/inv_test
Added test for 2x2 inverse (related to #123)
2 parents f20dcbb + cca80de commit a6eee3b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/inv.rs

+9
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,12 @@ fn inv_error() {
2525
let a_inv = a.inv().unwrap();
2626
println!("{:?}", a_inv);
2727
}
28+
29+
#[test]
30+
fn inv_2x2() {
31+
// Related to issue #123 where this problem led to a wrongly computed inverse when using the
32+
// `openblas` backend.
33+
let a: Array2<f64> = array!([1.0, 2.0], [3.0, 4.0]);
34+
let a_inv = a.inv().unwrap();
35+
assert_close_l2!(&a_inv, &array!([-2.0, 1.0], [1.5, -0.5]), 1e-7);
36+
}

0 commit comments

Comments
 (0)