From 6fa6cdd2b988da98cbdd2b1a5fd2fd3b9d56a4b1 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Wed, 4 Jun 2014 09:21:48 -0700 Subject: Added support for tensor contractions Updated expression evaluation mechanism to also compute the size of the tensor result Misc fixes and improvements. --- unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h b/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h index 64098343e..c9d6517eb 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h @@ -53,7 +53,7 @@ class TensorStorage EIGEN_STRONG_INLINE const T *data() const { return m_data; } EIGEN_DEVICE_FUNC - EIGEN_STRONG_INLINE const FixedDimensions dimensions() const { return m_dimensions; } + EIGEN_STRONG_INLINE const FixedDimensions& dimensions() const { return m_dimensions; } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DenseIndex size() const { return m_dimensions.TotalSize(); } @@ -111,7 +111,8 @@ class TensorStorage(m_data, internal::array_prod(m_dimensions)); } void swap(Self_& other) { std::swap(m_data,other.m_data); std::swap(m_dimensions,other.m_dimensions); } - const DSizes& dimensions() const {return m_dimensions;} + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DSizes& dimensions() const {return m_dimensions;} void conservativeResize(DenseIndex size, const array& nbDimensions) { @@ -132,10 +133,10 @@ class TensorStorage