Replace Eigen type metaprogramming with corresponding std types and make use of alias templates

This commit is contained in:
Erik Schultheis
2022-03-16 16:43:40 +00:00
committed by Antonio Sánchez
parent 514f90c9ff
commit 421cbf0866
191 changed files with 1147 additions and 1221 deletions

View File

@@ -34,7 +34,7 @@ template<typename PlainObjectType, int Options_, template <class> class MakePoin
typedef TensorMap<PlainObjectType, Options_, MakePointer_> Self;
typedef TensorBase<TensorMap<PlainObjectType, Options_, MakePointer_> > Base;
#ifdef EIGEN_USE_SYCL
typedef typename Eigen::internal::remove_reference<typename Eigen::internal::nested<Self>::type>::type Nested;
typedef std::remove_reference_t<typename Eigen::internal::nested<Self>::type> Nested;
#else
typedef typename Eigen::internal::nested<Self>::type Nested;
#endif
@@ -51,29 +51,29 @@ template<typename PlainObjectType, int Options_, template <class> class MakePoin
// example in TensorMap<Tensor<const Scalar, ...>> expression. This type of
// expression should be illegal, but adding this restriction is not possible
// in practice (see https://bitbucket.org/eigen/eigen/pull-requests/488).
typedef typename internal::conditional<
typedef std::conditional_t<
bool(internal::is_lvalue<PlainObjectType>::value),
PointerType, // use simple pointer in lvalue expressions
PointerConstType // use const pointer in rvalue expressions
>::type StoragePointerType;
> StoragePointerType;
// If TensorMap was constructed over rvalue expression (e.g. const Tensor),
// we should return a reference to const from operator() (and others), even
// if TensorMap itself is not const.
typedef typename internal::conditional<
typedef std::conditional_t<
bool(internal::is_lvalue<PlainObjectType>::value),
Scalar&,
const Scalar&
>::type StorageRefType;
> StorageRefType;
static const int Options = Options_;
static const Index NumIndices = PlainObjectType::NumIndices;
typedef typename PlainObjectType::Dimensions Dimensions;
static constexpr int Layout = PlainObjectType::Layout;
enum {
IsAligned = ((int(Options_)&Aligned)==Aligned),
Layout = PlainObjectType::Layout,
CoordAccess = true,
RawAccess = true
};