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/Core/NoAlias.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Eigen/src/Core/NoAlias.h') diff --git a/Eigen/src/Core/NoAlias.h b/Eigen/src/Core/NoAlias.h index 30ddbeb3c..0542571e2 100644 --- a/Eigen/src/Core/NoAlias.h +++ b/Eigen/src/Core/NoAlias.h @@ -45,12 +45,18 @@ class NoAlias public: NoAlias(ExpressionType& expression) : m_expression(expression) {} - /** Behaves like MatrixBase::lazyAssign(other) - * \sa MatrixBase::lazyAssign() */ + /* \sa MatrixBase::lazyAssign() */ template EIGEN_STRONG_INLINE ExpressionType& operator=(const StorageBase& other) { return m_expression.lazyAssign(other.derived()); } + template + EIGEN_STRONG_INLINE ExpressionType& operator=(const ReturnByValue& other) + { + other.evalTo(m_expression); + return m_expression; + } + /** \sa MatrixBase::operator+= */ template EIGEN_STRONG_INLINE ExpressionType& operator+=(const StorageBase& other) -- cgit v1.2.3