Fix the matrix inversion test.

This prevent the test from failing when the matrix is non-inversible.
This commit is contained in:
Sébastien Crozet 2014-09-19 23:53:36 +02:00
parent 086088a0ed
commit a9c7fe7420

View File

@ -9,7 +9,10 @@ macro_rules! test_inv_mat_impl(
for _ in range(0u, 10000) {
let randmat : $t = random();
assert!(na::approx_eq(&(na::inv(&randmat).unwrap() * randmat), &na::one()));
match na::inv(&randmat) {
None => { },
Some(i) => assert!(na::approx_eq(&(i * randmat), &na::one()))
}
}
);
)