diff options
-rw-r--r-- | src/MatrixBase.h | 12 | ||||
-rw-r--r-- | test/vectorops.cpp | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/MatrixBase.h b/src/MatrixBase.h index 93552b467..7c817bda3 100644 --- a/src/MatrixBase.h +++ b/src/MatrixBase.h @@ -308,6 +308,18 @@ template<typename Derived> class MatrixAlias ref().xpr() = xpr; } + template<typename XprContent> + void operator+=(const MatrixConstXpr<XprContent> &xpr) + { + ref().xpr() += xpr; + } + + template<typename XprContent> + void operator-=(const MatrixConstXpr<XprContent> &xpr) + { + ref().xpr() -= xpr; + } + protected: MatrixRef<MatrixBase<Derived> > m_ref; Derived m_tmp; diff --git a/test/vectorops.cpp b/test/vectorops.cpp index 3aadb73c6..de0f03e6f 100644 --- a/test/vectorops.cpp +++ b/test/vectorops.cpp @@ -48,6 +48,7 @@ template<typename VectorType> void vectorOps(const VectorType& v) a += b + b; a.xpr() -= b; a.xpr() -= b + b; + a.alias() += a + a; } void EigenTest::testVectorOps() |