diff --git a/src/mat_impl.rs b/src/mat_impl.rs index ff597e79..37bc221c 100644 --- a/src/mat_impl.rs +++ b/src/mat_impl.rs @@ -84,7 +84,7 @@ macro_rules! column_impl( if i == Dim::dim::<$t>() { break } - self.at((i, col)) = copy *e; + self.set((i, col), copy *e); } } diff --git a/src/tests/mat.rs b/src/tests/mat.rs index aa34c711..37f62e8e 100644 --- a/src/tests/mat.rs +++ b/src/tests/mat.rs @@ -9,6 +9,10 @@ use traits::inv::Inv; #[test] use traits::rotation::{Rotation, Rotatable}; #[test] +use traits::indexable::Indexable; +#[test] +use traits::transpose::Transpose; +#[test] use vec::Vec1; #[test] use mat::{Mat1, Mat2, Mat3}; @@ -54,3 +58,11 @@ fn test_rotation2() assert!(randmat.rotated(ang).rotation().approx_eq(ang)); } } + +#[test] +fn test_index_mat2() +{ + let mat: Mat2 = random(); + + assert!(mat.at((0, 1)) == mat.transposed().at((1, 0))); +}