diff --git a/src/rotation.rs b/src/rotation.rs index 340fb0e..6a2dba5 100644 --- a/src/rotation.rs +++ b/src/rotation.rs @@ -198,11 +198,6 @@ impl Rotation> for Basis2 { // to be faster #[inline] fn invert(&self) -> Basis2 { Basis2 { mat: self.mat.invert().unwrap() } } - - // TODO: we know the matrix is orthogonal, so this could be re-written - // to be faster - #[inline] - fn invert_self(&mut self) { self.mat.invert_self(); } } impl ApproxEq for Basis2 { @@ -289,11 +284,6 @@ impl Rotation> for Basis3 { // to be faster #[inline] fn invert(&self) -> Basis3 { Basis3 { mat: self.mat.invert().unwrap() } } - - // TODO: we know the matrix is orthogonal, so this could be re-written - // to be faster - #[inline] - fn invert_self(&mut self) { self.mat.invert_self(); } } impl ApproxEq for Basis3 { diff --git a/src/structure.rs b/src/structure.rs index 0e77d1a..c707551 100644 --- a/src/structure.rs +++ b/src/structure.rs @@ -509,12 +509,6 @@ pub trait SquareMatrix where #[must_use] fn invert(&self) -> Option; - /// Invert this matrix in-place. - #[inline] - fn invert_self(&mut self) { - *self = self.invert().expect("Attempted to invert a matrix with zero determinant."); - } - /// Test if this matrix is invertible. #[inline] fn is_invertible(&self) -> bool { !self.determinant().approx_eq(&Self::Scalar::zero()) } diff --git a/src/transform.rs b/src/transform.rs index feb01da..5427b69 100644 --- a/src/transform.rs +++ b/src/transform.rs @@ -60,13 +60,6 @@ pub trait Transform: Sized { fn concat_self(&mut self, other: &Self) { *self = Self::concat(self, other); } - - /// Invert this transform in-place, failing if the transformation is not - /// invertible. - #[inline] - fn to_inverse(&mut self) { - *self = self.inverse_transform().unwrap() - } } /// A generic transformation consisting of a rotation, diff --git a/tests/matrix.rs b/tests/matrix.rs index 10e2c83..d5c6f06 100644 --- a/tests/matrix.rs +++ b/tests/matrix.rs @@ -129,13 +129,6 @@ pub mod matrix2 { 0.0f64, 5.0f64).invert().is_none()); } - #[test] - fn test_invert_self() { - let mut mut_a = A; - mut_a.invert_self(); - assert_eq!(mut_a, A.invert().unwrap()); - } - #[test] fn test_predicates() { assert!(Matrix2::::identity().is_identity()); @@ -300,13 +293,6 @@ pub mod matrix3 { 0.0f64, 0.0f64, 1.0f64)); } - #[test] - fn test_invert_self() { - let mut mut_c = C; - mut_c.invert_self(); - assert_eq!(mut_c, C.invert().unwrap()); - } - #[test] fn test_predicates() { assert!(Matrix3::::identity().is_identity()); @@ -579,13 +565,6 @@ pub mod matrix4 { assert!((mat_f.invert().unwrap() * mat_f).is_identity()); } - #[test] - fn test_invert_self() { - let mut mut_c = C; - mut_c.invert_self(); - assert_eq!(mut_c, C.invert().unwrap()); - } - #[test] fn test_predicates() { assert!(Matrix4::::identity().is_identity());