Made the index type a template parameter of the tensor class instead of encoding it in the options.

This commit is contained in:
Benoit Steiner
2015-03-30 14:55:54 -07:00
parent 71950f02e5
commit 35722fa022
9 changed files with 66 additions and 104 deletions

View File

@@ -59,12 +59,12 @@ namespace Eigen {
* \ref TopicStorageOrders
*/
template<typename Scalar_, std::size_t NumIndices_, int Options_>
class Tensor : public TensorBase<Tensor<Scalar_, NumIndices_, Options_> >
template<typename Scalar_, std::size_t NumIndices_, int Options_, typename IndexType_>
class Tensor : public TensorBase<Tensor<Scalar_, NumIndices_, Options_, IndexType_> >
{
public:
typedef Tensor<Scalar_, NumIndices_, Options_> Self;
typedef TensorBase<Tensor<Scalar_, NumIndices_, Options_> > Base;
typedef Tensor<Scalar_, NumIndices_, Options_, IndexType_> Self;
typedef TensorBase<Tensor<Scalar_, NumIndices_, Options_, IndexType_> > Base;
typedef typename Eigen::internal::nested<Self>::type Nested;
typedef typename internal::traits<Self>::StorageKind StorageKind;
typedef typename internal::traits<Self>::Index Index;
@@ -86,7 +86,7 @@ class Tensor : public TensorBase<Tensor<Scalar_, NumIndices_, Options_> >
typedef DSizes<Index, NumIndices_> Dimensions;
protected:
TensorStorage<Scalar, NumIndices, Dynamic, Options> m_storage;
TensorStorage<Scalar, Dimensions, Options> m_storage;
public:
// Metadata