// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2014 Benoit Steiner // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. #ifndef EIGEN_CXX11_TENSOR_TENSOR_TRAITS_H #define EIGEN_CXX11_TENSOR_TENSOR_TRAITS_H namespace Eigen { namespace internal { template class compute_tensor_flags { enum { is_dynamic_size_storage = 1, aligned_bit = ( ((Options&DontAlign)==0) && ( #if EIGEN_ALIGN_STATICALLY (!is_dynamic_size_storage) #else 0 #endif || #if EIGEN_ALIGN is_dynamic_size_storage #else 0 #endif ) ) ? AlignedBit : 0, packet_access_bit = packet_traits::Vectorizable && aligned_bit ? PacketAccessBit : 0 }; public: enum { ret = packet_access_bit | aligned_bit}; }; template struct traits > { typedef Scalar_ Scalar; typedef Dense StorageKind; typedef DenseIndex Index; enum { Options = Options_, Flags = compute_tensor_flags::ret | LvalueBit, }; }; template struct traits > { typedef Scalar_ Scalar; typedef Dense StorageKind; typedef DenseIndex Index; enum { Options = Options_, Flags = compute_tensor_flags::ret | LvalueBit, }; }; template struct traits > : public traits { typedef traits 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), }; }; template struct traits > : public traits { typedef traits BaseTraits; typedef typename BaseTraits::Scalar Scalar; typedef typename BaseTraits::StorageKind StorageKind; typedef typename BaseTraits::Index Index; enum { Options = BaseTraits::Options, Flags = ((BaseTraits::Flags | LvalueBit) & ~AlignedBit) | (Options&Aligned ? AlignedBit : 0), }; }; template struct eval, Eigen::Dense> { typedef const Tensor<_Scalar, NumIndices_, Options>& type; }; template struct eval, Eigen::Dense> { typedef const Tensor<_Scalar, NumIndices_, Options>& type; }; template struct eval, Eigen::Dense> { typedef const TensorFixedSize& type; }; template struct eval, Eigen::Dense> { typedef const TensorFixedSize& type; }; template struct eval, Eigen::Dense> { typedef const TensorMap& type; }; template struct eval, Eigen::Dense> { typedef const TensorMap& type; }; template struct eval, Eigen::Dense> { typedef const TensorRef& type; }; template struct eval, Eigen::Dense> { typedef const TensorRef& type; }; template struct nested, 1, typename eval >::type> { typedef const Tensor& type; }; template struct nested, 1, typename eval >::type> { typedef const Tensor& type; }; template struct nested, 1, typename eval >::type> { typedef const TensorFixedSize& type; }; template struct nested, 1, typename eval >::type> { typedef const TensorFixedSize& type; }; template struct nested, 1, typename eval >::type> { typedef const TensorMap& type; }; template struct nested, 1, typename eval >::type> { typedef const TensorMap& type; }; template struct nested, 1, typename eval >::type> { typedef const TensorRef& type; }; template struct nested, 1, typename eval >::type> { typedef const TensorRef& type; }; } // end namespace internal } // end namespace Eigen #endif // EIGEN_CXX11_TENSOR_TENSOR_TRAITS_H