Inherit operator+= and -= with 'using' kkeyword

This commit is contained in:
Gael Guennebaud 2015-06-24 17:49:20 +02:00
parent 53a61a067b
commit 02db7c9bc6
2 changed files with 3 additions and 7 deletions

View File

@ -97,8 +97,8 @@ class SparseMatrix
using Base::isCompressed; using Base::isCompressed;
using Base::nonZeros; using Base::nonZeros;
_EIGEN_SPARSE_PUBLIC_INTERFACE(SparseMatrix) _EIGEN_SPARSE_PUBLIC_INTERFACE(SparseMatrix)
EIGEN_SPARSE_INHERIT_ASSIGNMENT_OPERATOR(SparseMatrix, +=) using Base::operator+=;
EIGEN_SPARSE_INHERIT_ASSIGNMENT_OPERATOR(SparseMatrix, -=) using Base::operator-=;
typedef MappedSparseMatrix<Scalar,Flags> Map; typedef MappedSparseMatrix<Scalar,Flags> Map;
typedef Diagonal<SparseMatrix> DiagonalReturnType; typedef Diagonal<SparseMatrix> DiagonalReturnType;

View File

@ -37,11 +37,7 @@ EIGEN_STRONG_INLINE Derived& operator Op(const Other& scalar) \
} }
#define EIGEN_SPARSE_INHERIT_ASSIGNMENT_OPERATORS(Derived) \ #define EIGEN_SPARSE_INHERIT_ASSIGNMENT_OPERATORS(Derived) \
EIGEN_SPARSE_INHERIT_ASSIGNMENT_OPERATOR(Derived, =) \ EIGEN_SPARSE_INHERIT_ASSIGNMENT_OPERATOR(Derived, =)
EIGEN_SPARSE_INHERIT_ASSIGNMENT_OPERATOR(Derived, +=) \
EIGEN_SPARSE_INHERIT_ASSIGNMENT_OPERATOR(Derived, -=) \
EIGEN_SPARSE_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Derived, *=) \
EIGEN_SPARSE_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Derived, /=)
// TODO this is mostly the same as EIGEN_GENERIC_PUBLIC_INTERFACE // TODO this is mostly the same as EIGEN_GENERIC_PUBLIC_INTERFACE
#define _EIGEN_SPARSE_PUBLIC_INTERFACE(Derived) \ #define _EIGEN_SPARSE_PUBLIC_INTERFACE(Derived) \