aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h
diff options
context:
space:
mode:
authorGravatar Antonio Sanchez <cantonios@google.com>2020-11-12 15:59:29 -0800
committerGravatar Antonio Sánchez <cantonios@google.com>2020-11-18 18:14:53 +0000
commit3669498f5a7cce29935386ab5380537b06a58edb (patch)
tree2a02ff13cc86f107c3e2cb5413137a1dc5c3a997 /unsupported/Eigen/CXX11/src/Tensor/TensorMap.h
parent60218829b71b2d1c69ec989e47147d35fce980ca (diff)
Fix rule-of-3 for the Tensor module.
Adds copy constructors to Tensor ops, inherits assignment operators from `TensorBase`. Addresses #1863
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorMap.h')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorMap.h22
1 files changed, 3 insertions, 19 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h b/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h
index 172a6bab8..6834c97e4 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h
@@ -30,7 +30,7 @@ template<typename PlainObjectType, int Options_, template <class> class MakePoin
{
public:
typedef TensorMap<PlainObjectType, Options_, MakePointer_> Self;
- typedef typename PlainObjectType::Base Base;
+ typedef TensorBase<TensorMap<PlainObjectType, Options_, MakePointer_> > Base;
#ifdef EIGEN_USE_SYCL
typedef typename Eigen::internal::remove_reference<typename Eigen::internal::nested<Self>::type>::type Nested;
#else
@@ -40,7 +40,7 @@ template<typename PlainObjectType, int Options_, template <class> class MakePoin
typedef typename internal::traits<PlainObjectType>::Index Index;
typedef typename internal::traits<PlainObjectType>::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
- typedef typename Base::CoeffReturnType CoeffReturnType;
+ typedef typename PlainObjectType::Base::CoeffReturnType CoeffReturnType;
typedef typename MakePointer_<Scalar>::Type PointerType;
typedef typename MakePointer_<Scalar>::ConstType PointerConstType;
@@ -315,23 +315,7 @@ template<typename PlainObjectType, int Options_, template <class> class MakePoin
}
#endif
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Self& operator=(const Self& other)
- {
- typedef TensorAssignOp<Self, const Self> Assign;
- Assign assign(*this, other);
- internal::TensorExecutor<const Assign, DefaultDevice>::run(assign, DefaultDevice());
- return *this;
- }
-
- template<typename OtherDerived>
- EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
- Self& operator=(const OtherDerived& other)
- {
- typedef TensorAssignOp<Self, const OtherDerived> Assign;
- Assign assign(*this, other);
- internal::TensorExecutor<const Assign, DefaultDevice>::run(assign, DefaultDevice());
- return *this;
- }
+ EIGEN_TENSOR_INHERIT_ASSIGNMENT_OPERATORS(TensorMap)
private:
StoragePointerType m_data;