aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2015-10-15 14:58:49 -0700
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2015-10-15 14:58:49 -0700
commitde1e9f29f4db2c837ffb354c90f9e9fb7df05e85 (patch)
tree99832d8d52f1b46063a82c1c9133e9b598df2d1b /unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h
parent6585efc55354b38c65de8c23599e99f3caaca843 (diff)
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
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h8
1 files changed, 4 insertions, 4 deletions
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<typename IndexType, Index... Is>
EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
- array<Index,sizeof...(Is)> customIndices2Array(const IndexType & idx, numeric_list<Index,Is...>) {
- return { idx(Is)... };
+ array<Index, sizeof...(Is)> customIndices2Array(IndexType& idx, numeric_list<Index, Is...>) {
+ return { idx[Is]... };
}
/** Make an array (for index/dimensions) out of a custom index */
template<typename Index, int NumIndices, typename IndexType>
EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
- array<Index,NumIndices> customIndices2Array(const IndexType & idx) {
- return customIndices2Array(idx, typename gen_numeric_list<Index,NumIndices>::type{});
+ array<Index, NumIndices> customIndices2Array(IndexType& idx) {
+ return customIndices2Array(idx, typename gen_numeric_list<Index, NumIndices>::type{});
}