diff --git a/src/matrix.rs b/src/matrix.rs index e09f534..59804fd 100644 --- a/src/matrix.rs +++ b/src/matrix.rs @@ -53,10 +53,7 @@ pub trait Matrix { pure fn mul_v(other: &ColV) -> ColV; } -// -// NxN Matrix -// -pub trait SquareMatrix { +pub trait SquareMatrix { pure fn add_m(other: &self) -> self; pure fn sub_m(other: &self) -> self; pure fn mul_m(other: &self) -> self; @@ -175,7 +172,7 @@ pub impl Mat2: Matrix, Vec2> { } } -pub impl Mat2: SquareMatrix> { +pub impl Mat2: SquareMatrix { #[inline(always)] pure fn add_m(other: &Mat2) -> Mat2 { Mat2::from_cols(self[0].add_v(&other[0]), @@ -390,7 +387,7 @@ pub impl Mat3: Matrix, Vec3> { } } -pub impl Mat3: SquareMatrix> { +pub impl Mat3: SquareMatrix { #[inline(always)] pure fn add_m(other: &Mat3) -> Mat3 { Mat3::from_cols(self[0].add_v(&other[0]), @@ -693,7 +690,7 @@ pub impl Mat4: Matrix, Vec4> { } } -pub impl Mat4: SquareMatrix> { +pub impl Mat4: SquareMatrix { #[inline(always)] pure fn add_m(other: &Mat4) -> Mat4 { Mat4::from_cols(self[0].add_v(&other[0]),