diff options
author | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2014-10-13 17:02:09 -0700 |
---|---|---|
committer | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2014-10-13 17:02:09 -0700 |
commit | 99d75235a9567865d2c070a2840d54c8a5ad0f43 (patch) | |
tree | 8ef64899252a8be7b6a868bd64bd167063ea4b2d /unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h | |
parent | 4c70b0a7627d45286ecbb3c73d2d774412168205 (diff) |
Misc improvements and cleanups
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h')
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h b/unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h index 40f805741..5940a8cf1 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h @@ -70,14 +70,18 @@ struct traits<TensorFixedSize<Scalar_, Dimensions, Options_> > }; -template<typename PlainObjectType> -struct traits<TensorMap<PlainObjectType> > +template<typename PlainObjectType, int Options_> +struct traits<TensorMap<PlainObjectType, Options_> > : public traits<PlainObjectType> { typedef traits<PlainObjectType> BaseTraits; typedef typename BaseTraits::Scalar Scalar; typedef typename BaseTraits::StorageKind StorageKind; typedef typename BaseTraits::Index Index; + enum { + Options = Options_, + Flags = ((BaseTraits::Flags | LvalueBit) & ~AlignedBit) | (Options&Aligned ? AlignedBit : 0), + }; }; @@ -105,16 +109,16 @@ struct eval<const TensorFixedSize<Scalar_, Dimensions, Options>, Eigen::Dense> typedef const TensorFixedSize<Scalar_, Dimensions, Options>& type; }; -template<typename PlainObjectType> -struct eval<TensorMap<PlainObjectType>, Eigen::Dense> +template<typename PlainObjectType, int Options> +struct eval<TensorMap<PlainObjectType, Options>, Eigen::Dense> { - typedef const TensorMap<PlainObjectType>& type; + typedef const TensorMap<PlainObjectType, Options>& type; }; -template<typename PlainObjectType> -struct eval<const TensorMap<PlainObjectType>, Eigen::Dense> +template<typename PlainObjectType, int Options> +struct eval<const TensorMap<PlainObjectType, Options>, Eigen::Dense> { - typedef const TensorMap<PlainObjectType>& type; + typedef const TensorMap<PlainObjectType, Options>& type; }; template <typename Scalar_, std::size_t NumIndices_, int Options_> @@ -141,16 +145,16 @@ struct nested<const TensorFixedSize<Scalar_, Dimensions, Options>, 1, typename e typedef const TensorFixedSize<Scalar_, Dimensions, Options>& type; }; -template <typename PlainObjectType> -struct nested<TensorMap<PlainObjectType>, 1, typename eval<TensorMap<PlainObjectType> >::type> +template <typename PlainObjectType, int Options> +struct nested<TensorMap<PlainObjectType, Options>, 1, typename eval<TensorMap<PlainObjectType, Options> >::type> { - typedef const TensorMap<PlainObjectType>& type; + typedef const TensorMap<PlainObjectType, Options>& type; }; -template <typename PlainObjectType> -struct nested<const TensorMap<PlainObjectType>, 1, typename eval<TensorMap<PlainObjectType> >::type> +template <typename PlainObjectType, int Options> +struct nested<const TensorMap<PlainObjectType, Options>, 1, typename eval<TensorMap<PlainObjectType, Options> >::type> { - typedef const TensorMap<PlainObjectType>& type; + typedef const TensorMap<PlainObjectType, Options>& type; }; } // end namespace internal |