Remove self inversion methods
This commit is contained in:
parent
a4763647ec
commit
65e744c8cd
4 changed files with 0 additions and 44 deletions
|
@ -198,11 +198,6 @@ impl<S: BaseFloat> Rotation<Point2<S>> for Basis2<S> {
|
|||
// to be faster
|
||||
#[inline]
|
||||
fn invert(&self) -> Basis2<S> { 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<S: BaseFloat> ApproxEq for Basis2<S> {
|
||||
|
@ -289,11 +284,6 @@ impl<S: BaseFloat> Rotation<Point3<S>> for Basis3<S> {
|
|||
// to be faster
|
||||
#[inline]
|
||||
fn invert(&self) -> Basis3<S> { 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<S: BaseFloat> ApproxEq for Basis3<S> {
|
||||
|
|
|
@ -509,12 +509,6 @@ pub trait SquareMatrix where
|
|||
#[must_use]
|
||||
fn invert(&self) -> Option<Self>;
|
||||
|
||||
/// 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()) }
|
||||
|
|
|
@ -60,13 +60,6 @@ pub trait Transform<P: EuclideanSpace>: 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,
|
||||
|
|
|
@ -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::<f64>::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::<f64>::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::<f64>::identity().is_identity());
|
||||
|
|
Loading…
Reference in a new issue