diff --git a/Eigen/src/Array/ArrayBase.h b/Eigen/src/Array/ArrayBase.h index d846c4a9c..9e8d0c927 100644 --- a/Eigen/src/Array/ArrayBase.h +++ b/Eigen/src/Array/ArrayBase.h @@ -145,6 +145,9 @@ template class ArrayBase template Derived& operator*=(const ArrayBase& other); + template + Derived& operator/=(const ArrayBase& other); + template inline bool operator==(const ArrayBase& other) const { return cwiseEqual(other).all(); } @@ -162,7 +165,7 @@ template class ArrayBase protected: ArrayBase() : Base() {} - + private: explicit ArrayBase(int); ArrayBase(int,int); @@ -197,4 +200,32 @@ ArrayBase::operator+=(const ArrayBase& other) return derived(); } +/** replaces \c *this by \c *this * \a other coefficient wise. + * + * \returns a reference to \c *this + */ +template +template +EIGEN_STRONG_INLINE Derived & +ArrayBase::operator*=(const ArrayBase& other) +{ + SelfCwiseBinaryOp, Derived> tmp(derived()); + tmp = other.derived(); + return derived(); +} + +/** replaces \c *this by \c *this / \a other coefficient wise. + * + * \returns a reference to \c *this + */ +template +template +EIGEN_STRONG_INLINE Derived & +ArrayBase::operator/=(const ArrayBase& other) +{ + SelfCwiseBinaryOp, Derived> tmp(derived()); + tmp = other.derived(); + return derived(); +} + #endif // EIGEN_ARRAYBASE_H