diff options
author | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2015-12-04 10:15:11 -0800 |
---|---|---|
committer | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2015-12-04 10:15:11 -0800 |
commit | 490d26e4c14554716298c3bc4123571bbf92a1b2 (patch) | |
tree | b6b186843212e55e140326bdd0cd902891a0814a /unsupported/Eigen/CXX11/src/Tensor/Tensor.h | |
parent | d20efc974d53f513668c0138e945171f6f4d85e8 (diff) |
Use integers instead of std::size_t to encode the number of dimensions in the Tensor class since most of the code currently already use integers.
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/Tensor.h')
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/Tensor.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/Tensor.h b/unsupported/Eigen/CXX11/src/Tensor/Tensor.h index 0df1345c2..6d357545c 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/Tensor.h +++ b/unsupported/Eigen/CXX11/src/Tensor/Tensor.h @@ -59,7 +59,7 @@ namespace Eigen { * \ref TopicStorageOrders */ -template<typename Scalar_, std::size_t NumIndices_, int Options_, typename IndexType_> +template<typename Scalar_, int NumIndices_, int Options_, typename IndexType_> class Tensor : public TensorBase<Tensor<Scalar_, NumIndices_, Options_, IndexType_> > { public: @@ -82,7 +82,7 @@ class Tensor : public TensorBase<Tensor<Scalar_, NumIndices_, Options_, IndexTyp }; static const int Options = Options_; - static const std::size_t NumIndices = NumIndices_; + static const int NumIndices = NumIndices_; typedef DSizes<Index, NumIndices_> Dimensions; protected: @@ -433,7 +433,7 @@ class Tensor : public TensorBase<Tensor<Scalar_, NumIndices_, Options_, IndexTyp /** Normal Dimension */ EIGEN_DEVICE_FUNC void resize(const array<Index, NumIndices>& dimensions) { - std::size_t i; + int i; Index size = Index(1); for (i = 0; i < NumIndices; i++) { internal::check_rows_cols_for_overflow<Dynamic>::run(size, dimensions[i]); @@ -451,7 +451,7 @@ class Tensor : public TensorBase<Tensor<Scalar_, NumIndices_, Options_, IndexTyp // Why this overload, DSizes is derived from array ??? // EIGEN_DEVICE_FUNC void resize(const DSizes<Index, NumIndices>& dimensions) { array<Index, NumIndices> dims; - for (std::size_t i = 0; i < NumIndices; ++i) { + for (int i = 0; i < NumIndices; ++i) { dims[i] = dimensions[i]; } resize(dims); @@ -480,7 +480,7 @@ class Tensor : public TensorBase<Tensor<Scalar_, NumIndices_, Options_, IndexTyp EIGEN_DEVICE_FUNC void resize(const Sizes<Indices...>& dimensions) { array<Index, NumIndices> dims; - for (std::size_t i = 0; i < NumIndices; ++i) { + for (int i = 0; i < NumIndices; ++i) { dims[i] = static_cast<Index>(dimensions[i]); } resize(dims); @@ -490,7 +490,7 @@ class Tensor : public TensorBase<Tensor<Scalar_, NumIndices_, Options_, IndexTyp EIGEN_DEVICE_FUNC void resize(const Sizes<V1, V2, V3, V4, V5>& dimensions) { array<Index, NumIndices> dims; - for (std::size_t i = 0; i < NumIndices; ++i) { + for (int i = 0; i < NumIndices; ++i) { dims[i] = static_cast<Index>(dimensions[i]); } resize(dims); |