mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
sparse module: makes -= and += operator working
Question 1: why are *=scalar and /=scalar working right away ? Same weirdness in DynamicSparseMatrix where operators += and -= work wihout having to redefine them ???
This commit is contained in:
@@ -344,7 +344,7 @@ template<typename OtherDerived>
|
||||
EIGEN_STRONG_INLINE Derived &
|
||||
SparseMatrixBase<Derived>::operator-=(const SparseMatrixBase<OtherDerived> &other)
|
||||
{
|
||||
return *this = *this - other;
|
||||
return *this = derived() - other.derived();
|
||||
}
|
||||
|
||||
template<typename Derived>
|
||||
@@ -360,7 +360,7 @@ template<typename OtherDerived>
|
||||
EIGEN_STRONG_INLINE Derived &
|
||||
SparseMatrixBase<Derived>::operator+=(const SparseMatrixBase<OtherDerived>& other)
|
||||
{
|
||||
return *this = *this + other;
|
||||
return *this = derived() + other.derived();
|
||||
}
|
||||
|
||||
template<typename ExpressionType>
|
||||
@@ -399,7 +399,7 @@ template<typename ExpressionType>
|
||||
template<typename OtherDerived>
|
||||
inline ExpressionType& SparseCwise<ExpressionType>::operator*=(const SparseMatrixBase<OtherDerived> &other)
|
||||
{
|
||||
return m_matrix.const_cast_derived() = *this * other;
|
||||
return m_matrix.const_cast_derived() = _expression() * other.derived();
|
||||
}
|
||||
|
||||
// template<typename ExpressionType>
|
||||
|
||||
Reference in New Issue
Block a user