From 4ea08253a72a83cba07aea64256471b2e705db0f Mon Sep 17 00:00:00 2001 From: Brendan Zabarauskas Date: Thu, 29 Nov 2012 08:49:31 +1000 Subject: [PATCH] Remove is_col_major and is_square methods --- src/mat.rs | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/src/mat.rs b/src/mat.rs index 2c16e3d..6701029 100644 --- a/src/mat.rs +++ b/src/mat.rs @@ -20,8 +20,6 @@ use vec::{NumericVector, Vec2, Vec3, Vec4}; pub trait Matrix: Dimensional, Eq, DefaultEq { pure fn rows() -> uint; pure fn cols() -> uint; - pure fn is_col_major() -> bool; - pure fn is_square() -> bool; pure fn col(i: uint) -> Col; pure fn row(i: uint) -> Row; @@ -98,6 +96,8 @@ pub trait NumericMatrixNxN: MatrixNxN, NumericMatrix { static pure fn identity() -> self; + // static pure fn from_value(value: T) -> self; + pure fn mul_m(other: &self) -> self; pure fn dot(other: &self) -> T; @@ -116,7 +116,6 @@ pub trait NumericMatrixNxN: MatrixNxN, /// A 2 x 2 square matrix with numeric elements pub trait NumericMatrix2x2: Matrix2x2, NumericMatrixNxN { - // static pure fn from_value(value: T) -> self; pure fn to_mat3() -> Mat3; pure fn to_mat4() -> Mat4; @@ -125,15 +124,12 @@ pub trait NumericMatrix2x2: Matrix2x2, /// A 3 x 3 square matrix with numeric elements pub trait NumericMatrix3x3: Matrix3x3, NumericMatrixNxN { - // static pure fn from_value(value: T) -> self; - pure fn to_mat4() -> Mat4; } /// A 4 x 4 square matrix with numeric elements pub trait NumericMatrix4x4: Matrix4x4, NumericMatrixNxN { - // static pure fn from_value(value: T) -> self; } @@ -175,17 +171,11 @@ pub impl Mat2: Matrix, Vec2> { #[inline(always)] static pure fn size_of() -> uint { size_of::>() } - #[inline(always)] - pure fn rows() -> uint { 2 } - #[inline(always)] pure fn cols() -> uint { 2 } #[inline(always)] - pure fn is_col_major() -> bool { true } - - #[inline(always)] - pure fn is_square() -> bool { true } + pure fn rows() -> uint { 2 } #[inline(always)] pure fn col(i: uint) -> Vec2 { self[i] } @@ -414,17 +404,11 @@ pub impl Mat3: Matrix, Vec3> { #[inline(always)] static pure fn size_of() -> uint { size_of::>() } - #[inline(always)] - pure fn rows() -> uint { 3 } - #[inline(always)] pure fn cols() -> uint { 3 } #[inline(always)] - pure fn is_col_major() -> bool { true } - - #[inline(always)] - pure fn is_square() -> bool { true } + pure fn rows() -> uint { 3 } #[inline(always)] pure fn col(i: uint) -> Vec3 { self[i] } @@ -731,17 +715,11 @@ pub impl Mat4: Matrix, Vec4> { #[inline(always)] static pure fn size_of() -> uint { size_of::>() } - #[inline(always)] - pure fn rows() -> uint { 4 } - #[inline(always)] pure fn cols() -> uint { 4 } #[inline(always)] - pure fn is_col_major() -> bool { true } - - #[inline(always)] - pure fn is_square() -> bool { true } + pure fn rows() -> uint { 4 } #[inline(always)] pure fn col(i: uint) -> Vec4 { self[i] }