10 #ifndef EIGEN_CXX11_TENSOR_TENSOR_MAP_H
11 #define EIGEN_CXX11_TENSOR_TENSOR_MAP_H
31 template<
typename PlainObjectType,
int Options_,
template <
class>
class MakePointer_>
class TensorMap :
public TensorBase<TensorMap<PlainObjectType, Options_, MakePointer_> >
37 typedef std::remove_reference_t<typename Eigen::internal::nested<Self>::type>
Nested;
39 typedef typename Eigen::internal::nested<Self>::type
Nested;
41 typedef typename internal::traits<PlainObjectType>::StorageKind
StorageKind;
42 typedef typename internal::traits<PlainObjectType>::Index
Index;
43 typedef typename internal::traits<PlainObjectType>::Scalar
Scalar;
54 typedef std::conditional_t<
55 bool(internal::is_lvalue<PlainObjectType>::value),
63 typedef std::conditional_t<
64 bool(internal::is_lvalue<PlainObjectType>::value),
74 static constexpr
int Layout = PlainObjectType::Layout;
97 template <
typename Dimensions>
123 if (PlainObjectType::Options&
RowMajor) {
151 if (PlainObjectType::Options&
RowMajor) {
164 if (PlainObjectType::Options&
RowMajor) {
190 static_assert(
sizeof...(otherIndices) + 2 ==
NumIndices ||
NumIndices ==
Dynamic,
"Number of indices used to access a tensor coefficient must be equal to the rank of the tensor.");
192 const std::size_t NumDims =
sizeof...(otherIndices) + 2;
193 if (PlainObjectType::Options&
RowMajor) {
#define eigen_internal_assert(x)
#define EIGEN_DEVICE_FUNC
#define EIGEN_STATIC_ASSERT(X, MSG)
#define EIGEN_TENSOR_INHERIT_ASSIGNMENT_OPERATORS(Derived)
A tensor expression mapping an existing array of data.
Index dimension(Index n) const
PlainObjectType::Dimensions Dimensions
StorageRefType operator()()
const Dimensions & dimensions() const
Eigen::internal::nested< Self >::type Nested
TensorMap(PlainObjectType &tensor)
MakePointer_< Scalar >::ConstType PointerConstType
MakePointer_< Scalar >::Type PointerType
StoragePointerType data() const
TensorMap(StoragePointerType dataPtr, const Dimensions &dimensions)
TensorMap(StoragePointerType dataPtr, Index firstDimension, IndexTypes... otherDimensions)
StorageRefType operator()(Index index)
std::conditional_t< bool(internal::is_lvalue< PlainObjectType >::value), Scalar &, const Scalar & > StorageRefType
StorageRefType operator()() const
StoragePointerType m_data
static constexpr Index NumIndices
StorageRefType operator()(const array< Index, NumIndices > &indices)
TensorMap< PlainObjectType, Options_, MakePointer_ > Self
StorageRefType operator()(Index firstIndex, Index secondIndex, IndexTypes... otherIndices)
StoragePointerType data()
internal::traits< PlainObjectType >::StorageKind StorageKind
internal::traits< PlainObjectType >::Scalar Scalar
std::conditional_t< bool(internal::is_lvalue< PlainObjectType >::value), PointerType, PointerConstType > StoragePointerType
static constexpr int Options
PlainObjectType::Base::CoeffReturnType CoeffReturnType
StorageRefType operator()(const array< Index, NumIndices > &indices) const
TensorBase< TensorMap< PlainObjectType, Options_, MakePointer_ > > Base
NumTraits< Scalar >::Real RealScalar
internal::traits< PlainObjectType >::Index Index
static constexpr int Layout
StorageRefType operator()(Index firstIndex, Index secondIndex, IndexTypes... otherIndices) const
TensorMap(StoragePointerType dataPtr)
TensorMap(StoragePointerType dataPtr, const array< Index, NumIndices > &dimensions)
StorageRefType operator()(Index index) const
: TensorContractionSycl.h, provides various tensor contraction kernel for SYCL backend