aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/NoAlias.h
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2010-05-30 13:43:08 -0400
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2010-05-30 13:43:08 -0400
commit641d968a9a7ed57a3b8a3f45dea43c5ee6717f97 (patch)
treeecadb1e03dc32f41bed89a72048496c60af31a5e /Eigen/src/Core/NoAlias.h
parent48b8ace517ac61a214cb7d2ad782c67c8a411744 (diff)
* 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.
Diffstat (limited to 'Eigen/src/Core/NoAlias.h')
-rw-r--r--Eigen/src/Core/NoAlias.h10
1 files changed, 8 insertions, 2 deletions
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<typename OtherDerived>
EIGEN_STRONG_INLINE ExpressionType& operator=(const StorageBase<OtherDerived>& other)
{ return m_expression.lazyAssign(other.derived()); }
+ template<typename OtherDerived>
+ EIGEN_STRONG_INLINE ExpressionType& operator=(const ReturnByValue<OtherDerived>& other)
+ {
+ other.evalTo(m_expression);
+ return m_expression;
+ }
+
/** \sa MatrixBase::operator+= */
template<typename OtherDerived>
EIGEN_STRONG_INLINE ExpressionType& operator+=(const StorageBase<OtherDerived>& other)