83 template<
typename PlainObjectType,
int MapOptions,
typename Str
ideType>
84 struct traits<Map<PlainObjectType, MapOptions, StrideType> >
85 :
public traits<PlainObjectType>
88 typedef typename PlainObjectType::Index Index;
89 typedef typename PlainObjectType::Scalar Scalar;
91 InnerStrideAtCompileTime = StrideType::InnerStrideAtCompileTime == 0
92 ?
int(PlainObjectType::InnerStrideAtCompileTime)
93 :
int(StrideType::InnerStrideAtCompileTime),
94 OuterStrideAtCompileTime = StrideType::OuterStrideAtCompileTime == 0
95 ?
int(PlainObjectType::OuterStrideAtCompileTime)
96 :
int(StrideType::OuterStrideAtCompileTime),
97 HasNoInnerStride = InnerStrideAtCompileTime == 1,
98 HasNoOuterStride = StrideType::OuterStrideAtCompileTime == 0,
99 HasNoStride = HasNoInnerStride && HasNoOuterStride,
101 IsDynamicSize = PlainObjectType::SizeAtCompileTime==
Dynamic,
102 KeepsPacketAccess =
bool(HasNoInnerStride)
103 && (
bool(IsDynamicSize)
105 || ( OuterStrideAtCompileTime!=
Dynamic
106 && ((static_cast<
int>(sizeof(Scalar))*OuterStrideAtCompileTime)%16)==0 ) ),
109 Flags2 = (
bool(HasNoStride) ||
bool(PlainObjectType::IsVectorAtCompileTime))
111 Flags3 = is_lvalue<PlainObjectType>::value ?
int(Flags2) : (
int(Flags2) & ~
LvalueBit),
119 template<
typename PlainObjectType,
int MapOptions,
typename Str
ideType>
class Map
120 :
public MapBase<Map<PlainObjectType, MapOptions, StrideType> >
128 #if EIGEN2_SUPPORT_STAGE <= STAGE30_FULL_EIGEN3_API
130 inline PointerType cast_to_pointer_type(
PointerArgType ptr) {
return const_cast<PointerType
>(ptr); }
136 inline Index innerStride()
const
138 return StrideType::InnerStrideAtCompileTime != 0 ? m_stride.inner() : 1;
141 inline Index outerStride()
const
143 return StrideType::OuterStrideAtCompileTime != 0 ? m_stride.outer()
144 : IsVectorAtCompileTime ? this->size()
155 :
Base(cast_to_pointer_type(data)), m_stride(stride)
157 PlainObjectType::Base::_check_template_params();
167 :
Base(cast_to_pointer_type(data), size), m_stride(stride)
169 PlainObjectType::Base::_check_template_params();
179 inline Map(
PointerArgType data, Index rows, Index cols,
const StrideType& stride = StrideType())
180 :
Base(cast_to_pointer_type(data), rows, cols), m_stride(stride)
182 PlainObjectType::Base::_check_template_params();
191 template<typename _Scalar,
int _Rows,
int _Cols,
int _Options,
int _MaxRows,
int _MaxCols>
192 inline
Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>
198 template<
typename _Scalar,
int _Rows,
int _Cols,
int _Options,
int _MaxRows,
int _MaxCols>
207 #endif // EIGEN_MAP_H