From 8918cb5d7e79d61ff06109db18bdcf79ab02f100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Sat, 13 Jul 2013 13:34:41 +0000 Subject: [PATCH] invert -> inplace_inverse to avoid name clash with iterators. --- src/adaptors/rotmat.rs | 2 +- src/adaptors/transform.rs | 6 +++--- src/dmat.rs | 4 ++-- src/mat_impl.rs | 4 ++-- src/mat_spec.rs | 12 ++++++------ src/traits/inv.rs | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/adaptors/rotmat.rs b/src/adaptors/rotmat.rs index cdad3c03..9b927d6c 100644 --- a/src/adaptors/rotmat.rs +++ b/src/adaptors/rotmat.rs @@ -193,7 +193,7 @@ impl> LMul for Rotmat impl Inv for Rotmat { #[inline] - fn invert(&mut self) -> bool + fn inplace_inverse(&mut self) -> bool { self.transpose(); diff --git a/src/adaptors/transform.rs b/src/adaptors/transform.rs index a56092f3..2285117e 100644 --- a/src/adaptors/transform.rs +++ b/src/adaptors/transform.rs @@ -218,9 +218,9 @@ impl, V: Copy + Neg> Inv for Transform { #[inline] - fn invert(&mut self) -> bool + fn inplace_inverse(&mut self) -> bool { - if !self.submat.invert() + if !self.submat.inplace_inverse() { false } else { @@ -234,7 +234,7 @@ Inv for Transform { let mut res = copy *self; - if res.invert() + if res.inplace_inverse() { Some(res) } else { None } diff --git a/src/dmat.rs b/src/dmat.rs index ebe7f2cf..eb4d32a5 100644 --- a/src/dmat.rs +++ b/src/dmat.rs @@ -141,13 +141,13 @@ Inv for DMat { let mut res : DMat = copy *self; - if res.invert() + if res.inplace_inverse() { Some(res) } else { None } } - fn invert(&mut self) -> bool + fn inplace_inverse(&mut self) -> bool { let dim = self.dim; let mut res = one_mat_with_dim::(dim); diff --git a/src/mat_impl.rs b/src/mat_impl.rs index 6918f2cb..2df49151 100644 --- a/src/mat_impl.rs +++ b/src/mat_impl.rs @@ -226,13 +226,13 @@ macro_rules! inv_impl( { let mut res : $t = self.clone(); - if res.invert() + if res.inplace_inverse() { Some(res) } else { None } } - fn invert(&mut self) -> bool + fn inplace_inverse(&mut self) -> bool { let mut res: $t = One::one(); let _0N: N = Zero::zero(); diff --git a/src/mat_spec.rs b/src/mat_spec.rs index 6f85f306..229b1896 100644 --- a/src/mat_spec.rs +++ b/src/mat_spec.rs @@ -12,14 +12,14 @@ Inv for Mat1 { let mut res : Mat1 = copy *self; - if res.invert() + if res.inplace_inverse() { Some(res) } else { None } } #[inline] - fn invert(&mut self) -> bool + fn inplace_inverse(&mut self) -> bool { if self.mij[0].is_zero() { false } @@ -39,14 +39,14 @@ Inv for Mat2 { let mut res : Mat2 = copy *self; - if res.invert() + if res.inplace_inverse() { Some(res) } else { None } } #[inline] - fn invert(&mut self) -> bool + fn inplace_inverse(&mut self) -> bool { let det = self.mij[0 * 2 + 0] * self.mij[1 * 2 + 1] - self.mij[1 * 2 + 0] * self.mij[0 * 2 + 1]; @@ -70,14 +70,14 @@ Inv for Mat3 { let mut res = copy *self; - if res.invert() + if res.inplace_inverse() { Some(res) } else { None } } #[inline] - fn invert(&mut self) -> bool + fn inplace_inverse(&mut self) -> bool { let minor_m12_m23 = self.mij[1 * 3 + 1] * self.mij[2 * 3 + 2] - self.mij[2 * 3 + 1] * self.mij[1 * 3 + 2]; let minor_m11_m23 = self.mij[1 * 3 + 0] * self.mij[2 * 3 + 2] - self.mij[2 * 3 + 0] * self.mij[1 * 3 + 2]; diff --git a/src/traits/inv.rs b/src/traits/inv.rs index 932b2a1c..0864904b 100644 --- a/src/traits/inv.rs +++ b/src/traits/inv.rs @@ -6,5 +6,5 @@ pub trait Inv /// Returns the inverse of an element. fn inverse(&self) -> Option; /// Inplace version of `inverse`. - fn invert(&mut self) -> bool; + fn inplace_inverse(&mut self) -> bool; }