diff options
Diffstat (limited to 'Eigen/src/Array/ArrayBase.h')
-rw-r--r-- | Eigen/src/Array/ArrayBase.h | 33 |
1 files changed, 32 insertions, 1 deletions
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 @@ -146,6 +146,9 @@ template<typename Derived> class ArrayBase Derived& operator*=(const ArrayBase<OtherDerived>& other); template<typename OtherDerived> + Derived& operator/=(const ArrayBase<OtherDerived>& other); + + template<typename OtherDerived> inline bool operator==(const ArrayBase<OtherDerived>& other) const { return cwiseEqual(other).all(); } @@ -162,7 +165,7 @@ template<typename Derived> class ArrayBase protected: ArrayBase() : Base() {} - + private: explicit ArrayBase(int); ArrayBase(int,int); @@ -197,4 +200,32 @@ ArrayBase<Derived>::operator+=(const ArrayBase<OtherDerived>& other) return derived(); } +/** replaces \c *this by \c *this * \a other coefficient wise. + * + * \returns a reference to \c *this + */ +template<typename Derived> +template<typename OtherDerived> +EIGEN_STRONG_INLINE Derived & +ArrayBase<Derived>::operator*=(const ArrayBase<OtherDerived>& other) +{ + SelfCwiseBinaryOp<ei_scalar_product_op<Scalar>, 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<typename Derived> +template<typename OtherDerived> +EIGEN_STRONG_INLINE Derived & +ArrayBase<Derived>::operator/=(const ArrayBase<OtherDerived>& other) +{ + SelfCwiseBinaryOp<ei_scalar_quotient_op<Scalar>, Derived> tmp(derived()); + tmp = other.derived(); + return derived(); +} + #endif // EIGEN_ARRAYBASE_H |