mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
add operators *= and /=
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user