68 template<
typename PlainObjectType,
int MapOptions,
typename Str
ideType>
69 struct traits<
Map<PlainObjectType, MapOptions, StrideType> >
70 :
public traits<PlainObjectType>
73 typedef typename PlainObjectType::Index
Index;
74 typedef typename PlainObjectType::Scalar
Scalar;
76 InnerStrideAtCompileTime = StrideType::InnerStrideAtCompileTime == 0
77 ? int(PlainObjectType::InnerStrideAtCompileTime)
78 : int(StrideType::InnerStrideAtCompileTime),
79 OuterStrideAtCompileTime = StrideType::OuterStrideAtCompileTime == 0
80 ? int(PlainObjectType::OuterStrideAtCompileTime)
81 : int(StrideType::OuterStrideAtCompileTime),
82 HasNoInnerStride = InnerStrideAtCompileTime == 1,
83 HasNoOuterStride = StrideType::OuterStrideAtCompileTime == 0,
84 HasNoStride = HasNoInnerStride && HasNoOuterStride,
86 IsDynamicSize = PlainObjectType::SizeAtCompileTime==
Dynamic,
87 KeepsPacketAccess = bool(HasNoInnerStride)
88 && ( bool(IsDynamicSize)
90 || ( OuterStrideAtCompileTime!=
Dynamic 91 && ((static_cast<int>(sizeof(Scalar))*OuterStrideAtCompileTime)%16)==0 ) ),
94 Flags2 = (bool(HasNoStride) || bool(PlainObjectType::IsVectorAtCompileTime))
104 template<
typename PlainObjectType,
int MapOptions,
typename Str
ideType>
class Map 105 :
public MapBase<Map<PlainObjectType, MapOptions, StrideType> >
113 #if EIGEN2_SUPPORT_STAGE <= STAGE30_FULL_EIGEN3_API 117 typedef PointerType PointerArgType;
118 inline PointerType cast_to_pointer_type(PointerArgType ptr) {
return ptr; }
123 return StrideType::InnerStrideAtCompileTime != 0 ? m_stride.inner() : 1;
128 return StrideType::OuterStrideAtCompileTime != 0 ? m_stride.outer()
129 : IsVectorAtCompileTime ? this->size()
139 inline Map(PointerArgType dataPtr,
const StrideType& a_stride = StrideType())
140 : Base(cast_to_pointer_type(dataPtr)), m_stride(a_stride)
142 PlainObjectType::Base::_check_template_params();
151 inline Map(PointerArgType dataPtr, Index a_size,
const StrideType& a_stride = StrideType())
152 : Base(cast_to_pointer_type(dataPtr), a_size), m_stride(a_stride)
154 PlainObjectType::Base::_check_template_params();
164 inline Map(PointerArgType dataPtr, Index nbRows, Index nbCols,
const StrideType& a_stride = StrideType())
165 : Base(cast_to_pointer_type(dataPtr), nbRows, nbCols), m_stride(a_stride)
167 PlainObjectType::Base::_check_template_params();
176 template<
typename _Scalar,
int _Rows,
int _Cols,
int _Options,
int _MaxRows,
int _MaxCols>
183 template<
typename _Scalar,
int _Rows,
int _Cols,
int _Options,
int _MaxRows,
int _MaxCols>
192 #endif // EIGEN_MAP_H Map(PointerArgType dataPtr, Index a_size, const StrideType &a_stride=StrideType())
Base class for Map and Block expression with direct access.
A matrix or vector expression mapping an existing array of data.
traits< PlainObjectType > TraitsBase
const unsigned int LvalueBit
Index outerStride() const
Map(PointerArgType dataPtr, Index nbRows, Index nbCols, const StrideType &a_stride=StrideType())
const unsigned int RowMajorBit
const unsigned int PacketAccessBit
PlainObjectType::Scalar Scalar
#define EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Derived)
const Scalar * PointerArgType
const unsigned int AlignedBit
EIGEN_STRONG_INLINE Matrix()
Default constructor.
Map(PointerArgType dataPtr, const StrideType &a_stride=StrideType())
EIGEN_STRONG_INLINE Array()
const unsigned int NestByRefBit
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
Base::PointerType PointerType
const unsigned int LinearAccessBit
PlainObjectType::Index Index
Index innerStride() const
PointerType cast_to_pointer_type(PointerArgType ptr)