add operators *= and /=

This commit is contained in:
Benoit Jacob
2007-09-27 19:20:06 +00:00
parent 628b1a8f6d
commit d99d9407df
8 changed files with 70 additions and 11 deletions

View File

@@ -86,6 +86,22 @@ operator/(const EigenBase<Scalar, Derived>& matrix, \
OtherScalar scalar) \
{ \
return matrix * (static_cast<typename Derived::Scalar>(1) / scalar); \
} \
\
template<typename Scalar, typename Derived> \
Derived & \
EigenBase<Scalar, Derived>::operator*=(const OtherScalar &other) \
{ \
*this = *this * other; \
return *static_cast<Derived*>(this); \
} \
\
template<typename Scalar, typename Derived> \
Derived & \
EigenBase<Scalar, Derived>::operator/=(const OtherScalar &other) \
{ \
*this = *this / other; \
return *static_cast<Derived*>(this); \
}
EIGEN_MAKE_SCALAR_OPS(int)