From 641d968a9a7ed57a3b8a3f45dea43c5ee6717f97 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Sun, 30 May 2010 13:43:08 -0400 Subject: * Make ReturnByValue have the EvalBeforeAssigningBit and explicitly enforce this mechanism (otherwise ReturnByValue bypasses it). (use .noalias() to get the old behavior.) * Remove a hack in Inverse, futile optimization for 2x2 expressions. --- Eigen/src/LU/Inverse.h | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'Eigen/src/LU') diff --git a/Eigen/src/LU/Inverse.h b/Eigen/src/LU/Inverse.h index 9e0c46094..1e9d69a22 100644 --- a/Eigen/src/LU/Inverse.h +++ b/Eigen/src/LU/Inverse.h @@ -281,15 +281,9 @@ struct ei_traits > template struct ei_inverse_impl : public ReturnByValue > { - // for 2x2, it's worth giving a chance to avoid evaluating. - // for larger sizes, evaluating has negligible cost, limits code size, - // and allows for vectorized paths. - typedef typename ei_meta_if< - MatrixType::RowsAtCompileTime == 2, - typename ei_nested::type, - typename ei_eval::type - >::ret MatrixTypeNested; + typedef typename MatrixType::Nested MatrixTypeNested; typedef typename ei_cleantype::type MatrixTypeNestedCleaned; + const MatrixTypeNested m_matrix; ei_inverse_impl(const MatrixType& matrix) @@ -359,14 +353,7 @@ inline void MatrixBase::computeInverseAndDetWithCheck( { // i'd love to put some static assertions there, but SFINAE means that they have no effect... ei_assert(rows() == cols()); - // for 2x2, it's worth giving a chance to avoid evaluating. - // for larger sizes, evaluating has negligible cost and limits code size. - typedef typename ei_meta_if< - RowsAtCompileTime == 2, - typename ei_cleantype::type>::type, - PlainObject - >::ret MatrixType; - ei_compute_inverse_and_det_with_check::run + ei_compute_inverse_and_det_with_check::run (derived(), absDeterminantThreshold, inverse, determinant, invertible); } -- cgit v1.2.3