From de1e9f29f4db2c837ffb354c90f9e9fb7df05e85 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Thu, 15 Oct 2015 14:58:49 -0700 Subject: Updated the custom indexing code: we can now use any container that provides the [] operator to index a tensor. Added unit tests to validate the use of std::map and a few more types as valid custom index containers --- unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h b/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h index d1efc1a87..07735fa5f 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h @@ -82,15 +82,15 @@ namespace internal{ template EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - array customIndices2Array(const IndexType & idx, numeric_list) { - return { idx(Is)... }; + array customIndices2Array(IndexType& idx, numeric_list) { + return { idx[Is]... }; } /** Make an array (for index/dimensions) out of a custom index */ template EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - array customIndices2Array(const IndexType & idx) { - return customIndices2Array(idx, typename gen_numeric_list::type{}); + array customIndices2Array(IndexType& idx) { + return customIndices2Array(idx, typename gen_numeric_list::type{}); } -- cgit v1.2.3