2018-10-21 04:27:18 +08:00
|
|
|
#![cfg_attr(rustfmt, rustfmt_skip)]
|
|
|
|
|
|
|
|
use na::{Matrix4x5, CsMatrix};
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn cs_from_to_matrix() {
|
|
|
|
let m = Matrix4x5::new(
|
|
|
|
5.0, 6.0, 0.0, 8.0, 15.0,
|
|
|
|
9.0, 10.0, 11.0, 12.0, 0.0,
|
|
|
|
0.0, 0.0, 13.0, 0.0, 0.0,
|
|
|
|
0.0, 1.0, 4.0, 0.0, 14.0,
|
|
|
|
);
|
|
|
|
|
|
|
|
let cs: CsMatrix<_, _, _> = m.into();
|
2018-11-05 23:38:43 +08:00
|
|
|
assert!(cs.is_sorted());
|
2018-10-21 04:27:18 +08:00
|
|
|
|
2018-11-05 23:38:43 +08:00
|
|
|
let m2: Matrix4x5<_> = cs.into();
|
2018-10-21 04:27:18 +08:00
|
|
|
assert_eq!(m2, m);
|
|
|
|
}
|