implement scalar operators separately for each type using a macro.

This is required e.g. to allow "2 * m" with m a matrix of doubles.
This commit is contained in:
Benoit Jacob
2007-09-27 07:42:12 +00:00
parent 8a024825d2
commit 628b1a8f6d
9 changed files with 50 additions and 41 deletions

View File

@@ -84,8 +84,8 @@ class Matrix : public EigenBase<_Scalar, Matrix<_Scalar, _Rows, _Cols> >,
return Base::operator=(other);
}
INHERIT_ASSIGNMENT_OPERATOR(Matrix, +=)
INHERIT_ASSIGNMENT_OPERATOR(Matrix, -=)
EIGEN_INHERIT_ASSIGNMENT_OPERATOR(Matrix, +=)
EIGEN_INHERIT_ASSIGNMENT_OPERATOR(Matrix, -=)
explicit Matrix(int rows = 1, int cols = 1) : Storage(rows, cols) {}
template<typename OtherDerived>
@@ -124,6 +124,9 @@ EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex<int>, ci)
EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex<float>, cf)
EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex<double>, cd)
#undef EIGEN_MAKE_TYPEDEFS_ALL_SIZES
#undef EIGEN_MAKE_TYPEDEFS
} // namespace Eigen
#include "MatrixOps.h"