From 6126ad801f89cb88d46ed0dae0d8e9448652c506 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 31 Jul 2013 15:30:50 +0200 Subject: Extend support for nvcc to Array objects and wrappers --- Eigen/src/Core/ArrayBase.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Eigen/src/Core/ArrayBase.h') diff --git a/Eigen/src/Core/ArrayBase.h b/Eigen/src/Core/ArrayBase.h index 38852600d..9c6daf4fe 100644 --- a/Eigen/src/Core/ArrayBase.h +++ b/Eigen/src/Core/ArrayBase.h @@ -118,40 +118,52 @@ template class ArrayBase /** Special case of the template operator=, in order to prevent the compiler * from generating a default operator= (issue hit with g++ 4.1) */ + EIGEN_DEVICE_FUNC Derived& operator=(const ArrayBase& other) { return internal::assign_selector::run(derived(), other.derived()); } + EIGEN_DEVICE_FUNC Derived& operator+=(const Scalar& scalar) { return *this = derived() + scalar; } + EIGEN_DEVICE_FUNC Derived& operator-=(const Scalar& scalar) { return *this = derived() - scalar; } template + EIGEN_DEVICE_FUNC Derived& operator+=(const ArrayBase& other); template + EIGEN_DEVICE_FUNC Derived& operator-=(const ArrayBase& other); template + EIGEN_DEVICE_FUNC Derived& operator*=(const ArrayBase& other); template + EIGEN_DEVICE_FUNC Derived& operator/=(const ArrayBase& other); public: + EIGEN_DEVICE_FUNC ArrayBase& array() { return *this; } + EIGEN_DEVICE_FUNC const ArrayBase& array() const { return *this; } /** \returns an \link Eigen::MatrixBase Matrix \endlink expression of this array * \sa MatrixBase::array() */ + EIGEN_DEVICE_FUNC MatrixWrapper matrix() { return derived(); } + EIGEN_DEVICE_FUNC const MatrixWrapper matrix() const { return derived(); } // template // inline void evalTo(Dest& dst) const { dst = matrix(); } protected: + EIGEN_DEVICE_FUNC ArrayBase() : Base() {} private: -- cgit v1.2.3