Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ > Class Template Reference

A tensor expression mapping an existing array of data. More...

#include <TensorMap.h>

+ Inheritance diagram for Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >:

Public Types

enum  { IsAligned = ((int(Options_) & Aligned) == Aligned) , CoordAccess = true , RawAccess = true }
 
typedef TensorMap< PlainObjectType, Options_, MakePointer_ > Self
 
typedef TensorBase< TensorMap< PlainObjectType, Options_, MakePointer_ > > Base
 
typedef Eigen::internal::nested< Self >::type Nested
 
typedef internal::traits< PlainObjectType >::StorageKind StorageKind
 
typedef internal::traits< PlainObjectType >::Index Index
 
typedef internal::traits< PlainObjectType >::Scalar Scalar
 
typedef NumTraits< Scalar >::Real RealScalar
 
typedef PlainObjectType::Base::CoeffReturnType CoeffReturnType
 
typedef MakePointer_< Scalar >::Type PointerType
 
typedef MakePointer_< Scalar >::ConstType PointerConstType
 
typedef std::conditional_t< bool(internal::is_lvalue< PlainObjectType >::value), PointerType, PointerConstTypeStoragePointerType
 
typedef std::conditional_t< bool(internal::is_lvalue< PlainObjectType >::value), Scalar &, const Scalar & > StorageRefType
 
typedef PlainObjectType::Dimensions Dimensions
 
- Public Types inherited from Eigen::TensorBase< TensorMap< PlainObjectType, Options_, MakePointer_ > >
typedef TensorBase< TensorMap< PlainObjectType, Options_, MakePointer_ >, ReadOnlyAccessors > Base
 
typedef internal::traits< TensorMap< PlainObjectType, Options_, MakePointer_ > > DerivedTraits
 
typedef DerivedTraits::Scalar Scalar
 
typedef DerivedTraits::Index Index
 
typedef Scalar CoeffReturnType
 

Public Member Functions

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorMap (StoragePointerType dataPtr)
 
template<typename... IndexTypes>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorMap (StoragePointerType dataPtr, Index firstDimension, IndexTypes... otherDimensions)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorMap (StoragePointerType dataPtr, const array< Index, NumIndices > &dimensions)
 
template<typename Dimensions >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorMap (StoragePointerType dataPtr, const Dimensions &dimensions)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorMap (PlainObjectType &tensor)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rank () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index dimension (Index n) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Dimensionsdimensions () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index size () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE StoragePointerType data ()
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE StoragePointerType data () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE StorageRefType operator() (const array< Index, NumIndices > &indices) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE StorageRefType operator() () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE StorageRefType operator() (Index index) const
 
template<typename... IndexTypes>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE StorageRefType operator() (Index firstIndex, Index secondIndex, IndexTypes... otherIndices) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE StorageRefType operator() (const array< Index, NumIndices > &indices)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE StorageRefType operator() ()
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE StorageRefType operator() (Index index)
 
template<typename... IndexTypes>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE StorageRefType operator() (Index firstIndex, Index secondIndex, IndexTypes... otherIndices)
 
- Public Member Functions inherited from Eigen::TensorBase< TensorMap< PlainObjectType, Options_, MakePointer_ > >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorMap< PlainObjectType, Options_, MakePointer_ > & setZero ()
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorMap< PlainObjectType, Options_, MakePointer_ > & setConstant (const Scalar &val)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorMap< PlainObjectType, Options_, MakePointer_ > & setRandom ()
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorMap< PlainObjectType, Options_, MakePointer_ > & setRandom ()
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorMap< PlainObjectType, Options_, MakePointer_ > & setValues (const typename internal::Initializer< TensorMap< PlainObjectType, Options_, MakePointer_ >, NumDimensions >::InitList &vals)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorMap< PlainObjectType, Options_, MakePointer_ > & operator+= (const OtherDerived &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorMap< PlainObjectType, Options_, MakePointer_ > & operator-= (const OtherDerived &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorMap< PlainObjectType, Options_, MakePointer_ > & operator*= (const OtherDerived &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorMap< PlainObjectType, Options_, MakePointer_ > & operator/= (const OtherDerived &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorLayoutSwapOp< const TensorMap< PlainObjectType, Options_, MakePointer_ > > swap_layout () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorLayoutSwapOp< TensorMap< PlainObjectType, Options_, MakePointer_ > > swap_layout ()
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorConcatenationOp< const Axis, const TensorMap< PlainObjectType, Options_, MakePointer_ >, const OtherDerived > concatenate (const OtherDerived &other, const Axis &axis) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorConcatenationOp< const Axis, TensorMap< PlainObjectType, Options_, MakePointer_ >, OtherDerived > concatenate (const OtherDerived &other, const Axis &axis)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorReshapingOp< const NewDimensions, const TensorMap< PlainObjectType, Options_, MakePointer_ > > reshape (const NewDimensions &newDimensions) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorReshapingOp< const NewDimensions, TensorMap< PlainObjectType, Options_, MakePointer_ > > reshape (const NewDimensions &newDimensions)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorSlicingOp< const StartIndices, const Sizes, const TensorMap< PlainObjectType, Options_, MakePointer_ > > slice (const StartIndices &startIndices, const Sizes &sizes) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorSlicingOp< const StartIndices, const Sizes, TensorMap< PlainObjectType, Options_, MakePointer_ > > slice (const StartIndices &startIndices, const Sizes &sizes)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorStridingSlicingOp< const StartIndices, const StopIndices, const Strides, const TensorMap< PlainObjectType, Options_, MakePointer_ > > stridedSlice (const StartIndices &startIndices, const StopIndices &stopIndices, const Strides &strides) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorStridingSlicingOp< const StartIndices, const StopIndices, const Strides, TensorMap< PlainObjectType, Options_, MakePointer_ > > stridedSlice (const StartIndices &startIndices, const StopIndices &stopIndices, const Strides &strides)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorChippingOp< DimId, const TensorMap< PlainObjectType, Options_, MakePointer_ > > chip (const Index offset) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorChippingOp< DimId, TensorMap< PlainObjectType, Options_, MakePointer_ > > chip (const Index offset)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorChippingOp< Dynamic, const TensorMap< PlainObjectType, Options_, MakePointer_ > > chip (const Index offset, const Index dim) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorChippingOp< Dynamic, TensorMap< PlainObjectType, Options_, MakePointer_ > > chip (const Index offset, const Index dim)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorReverseOp< const ReverseDimensions, const TensorMap< PlainObjectType, Options_, MakePointer_ > > reverse (const ReverseDimensions &rev) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorReverseOp< const ReverseDimensions, TensorMap< PlainObjectType, Options_, MakePointer_ > > reverse (const ReverseDimensions &rev)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorRollOp< const Rolls, const TensorMap< PlainObjectType, Options_, MakePointer_ > > roll (const Rolls &roll) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorRollOp< const Rolls, TensorMap< PlainObjectType, Options_, MakePointer_ > > roll (const Rolls &roll)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorShufflingOp< const Shuffle, const TensorMap< PlainObjectType, Options_, MakePointer_ > > shuffle (const Shuffle &shfl) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorShufflingOp< const Shuffle, TensorMap< PlainObjectType, Options_, MakePointer_ > > shuffle (const Shuffle &shfl)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorStridingOp< const Strides, const TensorMap< PlainObjectType, Options_, MakePointer_ > > stride (const Strides &strides) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorStridingOp< const Strides, TensorMap< PlainObjectType, Options_, MakePointer_ > > stride (const Strides &strides)
 
TensorDevice< TensorMap< PlainObjectType, Options_, MakePointer_ >, DeviceType > device (const DeviceType &dev)
 
TensorAsyncDevice< TensorMap< PlainObjectType, Options_, MakePointer_ >, DeviceType, DoneCallback > device (const DeviceType &dev, DoneCallback done)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorMap< PlainObjectType, Options_, MakePointer_ > & derived ()
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorMap< PlainObjectType, Options_, MakePointer_ > & derived () const
 

Static Public Attributes

static constexpr int Options = Options_
 
static constexpr Index NumIndices = PlainObjectType::NumIndices
 
static constexpr int Layout = PlainObjectType::Layout
 
- Static Public Attributes inherited from Eigen::TensorBase< TensorMap< PlainObjectType, Options_, MakePointer_ > >
static constexpr int NumDimensions
 

Private Attributes

StoragePointerType m_data
 
Dimensions m_dimensions
 

Additional Inherited Members

- Protected Member Functions inherited from Eigen::TensorBase< TensorMap< PlainObjectType, Options_, MakePointer_ > >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorMap< PlainObjectType, Options_, MakePointer_ > & operator= (const OtherDerived &other)
 

Detailed Description

template<typename PlainObjectType, int Options_, template< class > class MakePointer_>
class Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >

A tensor expression mapping an existing array of data.

template <class> class MakePointer_ is added to convert the host pointer to the device pointer. It is added due to the fact that for our device compiler T* is not allowed. If we wanted to use the same Evaluator functions we have to convert that type to our pointer T. This is done through our MakePointer_ class. By default the Type in the MakePointer_<T> is T* . Therefore, by adding the default value, we managed to convert the type and it does not break any existing code as its default value is T*.

Member Typedef Documentation

◆ Base

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
typedef TensorBase<TensorMap<PlainObjectType, Options_, MakePointer_> > Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::Base

◆ CoeffReturnType

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
typedef PlainObjectType::Base::CoeffReturnType Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::CoeffReturnType

◆ Dimensions

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
typedef PlainObjectType::Dimensions Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::Dimensions

◆ Index

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
typedef internal::traits<PlainObjectType>::Index Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::Index

◆ Nested

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
typedef Eigen::internal::nested<Self>::type Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::Nested

◆ PointerConstType

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
typedef MakePointer_<Scalar>::ConstType Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::PointerConstType

◆ PointerType

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
typedef MakePointer_<Scalar>::Type Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::PointerType

◆ RealScalar

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
typedef NumTraits<Scalar>::Real Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::RealScalar

◆ Scalar

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
typedef internal::traits<PlainObjectType>::Scalar Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::Scalar

◆ Self

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
typedef TensorMap<PlainObjectType, Options_, MakePointer_> Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::Self

◆ StorageKind

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
typedef internal::traits<PlainObjectType>::StorageKind Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::StorageKind

◆ StoragePointerType

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
typedef std::conditional_t<bool(internal::is_lvalue<PlainObjectType>::value), PointerType, PointerConstType > Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::StoragePointerType

◆ StorageRefType

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
typedef std::conditional_t<bool(internal::is_lvalue<PlainObjectType>::value), Scalar&, const Scalar&> Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::StorageRefType

Member Enumeration Documentation

◆ anonymous enum

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
anonymous enum
Enumerator
IsAligned 
CoordAccess 
RawAccess 
72 { IsAligned = ((int(Options_) & Aligned) == Aligned), CoordAccess = true, RawAccess = true };
@ CoordAccess
Definition: TensorMap.h:72
@ RawAccess
Definition: TensorMap.h:72
@ IsAligned
Definition: TensorMap.h:72
@ Aligned
Definition: Constants.h:242
return int(ret)+1

Constructor & Destructor Documentation

◆ TensorMap() [1/5]

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::TensorMap ( StoragePointerType  dataPtr)
inline
74  : m_data(dataPtr), m_dimensions() {
75  // The number of dimensions used to construct a tensor must be equal to the rank of the tensor.
76  EIGEN_STATIC_ASSERT((0 == NumIndices || NumIndices == Dynamic), YOU_MADE_A_PROGRAMMING_MISTAKE)
77  }
#define EIGEN_STATIC_ASSERT(X, MSG)
Definition: StaticAssert.h:26
StoragePointerType m_data
Definition: TensorMap.h:185
static constexpr Index NumIndices
Definition: TensorMap.h:68
Dimensions m_dimensions
Definition: TensorMap.h:186
const int Dynamic
Definition: Constants.h:25

References Eigen::Dynamic, EIGEN_STATIC_ASSERT, and Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::NumIndices.

◆ TensorMap() [2/5]

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
template<typename... IndexTypes>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::TensorMap ( StoragePointerType  dataPtr,
Index  firstDimension,
IndexTypes...  otherDimensions 
)
inline
82  : m_data(dataPtr), m_dimensions(firstDimension, otherDimensions...) {
83  // The number of dimensions used to construct a tensor must be equal to the rank of the tensor.
84  EIGEN_STATIC_ASSERT((sizeof...(otherDimensions) + 1 == NumIndices || NumIndices == Dynamic),
85  YOU_MADE_A_PROGRAMMING_MISTAKE)
86  }

References Eigen::Dynamic, EIGEN_STATIC_ASSERT, and Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::NumIndices.

◆ TensorMap() [3/5]

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::TensorMap ( StoragePointerType  dataPtr,
const array< Index, NumIndices > &  dimensions 
)
inline
90  : m_data(dataPtr), m_dimensions(dimensions) {}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Dimensions & dimensions() const
Definition: TensorMap.h:101

◆ TensorMap() [4/5]

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
template<typename Dimensions >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::TensorMap ( StoragePointerType  dataPtr,
const Dimensions dimensions 
)
inline
94  : m_data(dataPtr), m_dimensions(dimensions) {}

◆ TensorMap() [5/5]

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::TensorMap ( PlainObjectType &  tensor)
inline
97  : m_data(tensor.data()), m_dimensions(tensor.dimensions()) {}

Member Function Documentation

◆ data() [1/2]

◆ data() [2/2]

◆ dimension()

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::dimension ( Index  n) const
inline
100 { return m_dimensions[n]; }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11

References Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::m_dimensions, and n.

Referenced by test_2d(), test_3d(), and test_from_tensor().

◆ dimensions()

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Dimensions& Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::dimensions ( ) const
inline

◆ operator()() [1/8]

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE StorageRefType Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::operator() ( )
inline

◆ operator()() [2/8]

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE StorageRefType Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::operator() ( ) const
inline

◆ operator()() [3/8]

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE StorageRefType Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::operator() ( const array< Index, NumIndices > &  indices)
inline
143  {
144  // eigen_assert(checkIndexRange(indices));
145  if (PlainObjectType::Options & RowMajor) {
146  const Index index = m_dimensions.IndexOfRowMajor(indices);
147  return m_data[index];
148  } else {
149  const Index index = m_dimensions.IndexOfColMajor(indices);
150  return m_data[index];
151  }
152  }
internal::traits< PlainObjectType >::Index Index
Definition: TensorMap.h:43
@ RowMajor
Definition: Constants.h:320

References Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::m_data, Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::m_dimensions, and Eigen::RowMajor.

◆ operator()() [4/8]

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE StorageRefType Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::operator() ( const array< Index, NumIndices > &  indices) const
inline
106  {
107  // eigen_assert(checkIndexRange(indices));
108  if (PlainObjectType::Options & RowMajor) {
109  const Index index = m_dimensions.IndexOfRowMajor(indices);
110  return m_data[index];
111  } else {
112  const Index index = m_dimensions.IndexOfColMajor(indices);
113  return m_data[index];
114  }
115  }

References Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::m_data, Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::m_dimensions, and Eigen::RowMajor.

◆ operator()() [5/8]

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
template<typename... IndexTypes>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE StorageRefType Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::operator() ( Index  firstIndex,
Index  secondIndex,
IndexTypes...  otherIndices 
)
inline
166  {
167  static_assert(sizeof...(otherIndices) + 2 == NumIndices || NumIndices == Dynamic,
168  "Number of indices used to access a tensor coefficient must be equal to the rank of the tensor.");
170  const std::size_t NumDims = sizeof...(otherIndices) + 2;
171  if (PlainObjectType::Options & RowMajor) {
172  const Index index =
173  m_dimensions.IndexOfRowMajor(array<Index, NumDims>{{firstIndex, secondIndex, otherIndices...}});
174  return m_data[index];
175  } else {
176  const Index index =
177  m_dimensions.IndexOfColMajor(array<Index, NumDims>{{firstIndex, secondIndex, otherIndices...}});
178  return m_data[index];
179  }
180  }
#define eigen_assert(x)
Definition: Macros.h:910
EIGEN_DEVICE_FUNC bool all()
Definition: Macros.h:1276
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:217

References Eigen::internal::all(), Eigen::Dynamic, eigen_assert, Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::m_data, Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::m_dimensions, Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::NumIndices, and Eigen::RowMajor.

◆ operator()() [6/8]

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
template<typename... IndexTypes>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE StorageRefType Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::operator() ( Index  firstIndex,
Index  secondIndex,
IndexTypes...  otherIndices 
) const
inline
129  {
130  EIGEN_STATIC_ASSERT(sizeof...(otherIndices) + 2 == NumIndices, YOU_MADE_A_PROGRAMMING_MISTAKE)
132  if (PlainObjectType::Options & RowMajor) {
133  const Index index =
134  m_dimensions.IndexOfRowMajor(array<Index, NumIndices>{{firstIndex, secondIndex, otherIndices...}});
135  return m_data[index];
136  } else {
137  const Index index =
138  m_dimensions.IndexOfColMajor(array<Index, NumIndices>{{firstIndex, secondIndex, otherIndices...}});
139  return m_data[index];
140  }
141  }

References Eigen::internal::all(), eigen_assert, EIGEN_STATIC_ASSERT, Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::m_data, Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::m_dimensions, Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::NumIndices, and Eigen::RowMajor.

◆ operator()() [7/8]

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE StorageRefType Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::operator() ( Index  index)
inline
159  {
160  eigen_internal_assert(index >= 0 && index < size());
161  return m_data[index];
162  }
#define eigen_internal_assert(x)
Definition: Macros.h:916
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index size() const
Definition: TensorMap.h:102

References eigen_internal_assert, Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::m_data, and Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::size().

◆ operator()() [8/8]

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE StorageRefType Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::operator() ( Index  index) const
inline

◆ rank()

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::rank ( ) const
inline

◆ size()

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::size ( ) const
inline

Member Data Documentation

◆ Layout

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
constexpr int Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::Layout = PlainObjectType::Layout
staticconstexpr

◆ m_data

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
StoragePointerType Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::m_data
private

◆ m_dimensions

◆ NumIndices

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
constexpr Index Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::NumIndices = PlainObjectType::NumIndices
staticconstexpr

◆ Options

template<typename PlainObjectType , int Options_, template< class > class MakePointer_>
constexpr int Eigen::TensorMap< PlainObjectType, Options_, MakePointer_ >::Options = Options_
staticconstexpr

The documentation for this class was generated from the following files: