remove operator *= between matrices: too much hassle.

This commit is contained in:
Benoit Jacob
2007-09-07 09:47:13 +00:00
parent 61158b1922
commit 506cc5db12
4 changed files with 4 additions and 35 deletions

View File

@@ -206,14 +206,10 @@ class MatrixBase
MatrixBase& operator+=(const MatrixConstXpr<Content> &xpr);
template<typename Content>
MatrixBase& operator-=(const MatrixConstXpr<Content> &xpr);
template<typename Content>
MatrixBase& operator*=(const MatrixConstXpr<Content> &xpr);
template<typename Derived2>
MatrixBase& operator+=(const MatrixBase<Derived2> &other);
template<typename Derived2>
MatrixBase& operator-=(const MatrixBase<Derived2> &other);
template<typename Derived2>
MatrixBase& operator*=(const MatrixBase<Derived2> &other);
protected:
@@ -269,12 +265,12 @@ template<typename Derived> class MatrixAlias
typedef MatrixRef<MatrixAlias<Derived> > Ref;
typedef MatrixXpr<Ref> Xpr;
MatrixAlias(Derived& matrix) : m_ref(matrix), m_tmp(matrix) {}
MatrixAlias(const MatrixAlias& other) : m_ref(other.m_ref), m_tmp(other.m_tmp) {}
MatrixAlias(Derived& matrix) : m_aliased(matrix), m_tmp(matrix) {}
MatrixAlias(const MatrixAlias& other) : m_aliased(other.m_aliased), m_tmp(other.m_tmp) {}
~MatrixAlias()
{
m_ref.xpr() = m_tmp;
m_aliased.xpr() = m_tmp;
}
Xpr xpr()
@@ -324,7 +320,7 @@ template<typename Derived> class MatrixAlias
}
protected:
MatrixRef<MatrixBase<Derived> > m_ref;
MatrixRef<MatrixBase<Derived> > m_aliased;
Derived m_tmp;
};

View File

@@ -213,24 +213,6 @@ EIGEN_MAKE_MATRIX_OP_EQ(-)
#undef EIGEN_MAKE_MATRIX_OP_EQ
template<typename Derived1>
template<typename Derived2>
MatrixBase<Derived1> &
MatrixBase<Derived1>::operator *=(const MatrixBase<Derived2> &mat2)
{
alias() = *this * mat2;
return *this;
}
template<typename Derived>
template<typename Content>
MatrixBase<Derived> &
MatrixBase<Derived>::operator *=(const MatrixConstXpr<Content> &xpr)
{
alias() = *this * xpr;
return *this;
}
} // namespace Eigen
#endif // EIGEN_MATRIXOPS_H

View File

@@ -123,8 +123,6 @@ template<typename Content> class MatrixXpr
MatrixXpr& operator+=(const MatrixBase<Derived> &matrix);
template<typename Derived>
MatrixXpr& operator-=(const MatrixBase<Derived> &matrix);
private:
void operator=(const MatrixXpr &other)