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 class MatrixAlias ref().xpr() = xpr; } + template + void operator+=(const MatrixConstXpr &xpr) + { + ref().xpr() += xpr; + } + + template + void operator-=(const MatrixConstXpr &xpr) + { + ref().xpr() -= xpr; + } + protected: MatrixRef > 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 void vectorOps(const VectorType& v) a += b + b; a.xpr() -= b; a.xpr() -= b + b; + a.alias() += a + a; } void EigenTest::testVectorOps()