17 template<
typename PlainObjectType,
int MapOptions,
typename Str
ideType>
18 struct traits<Map<PlainObjectType, MapOptions, StrideType> >
19 :
public traits<PlainObjectType>
21 typedef traits<PlainObjectType> TraitsBase;
24 ? PlainObjectType::ColsAtCompileTime
25 : PlainObjectType::RowsAtCompileTime,
27 InnerStrideAtCompileTime = StrideType::InnerStrideAtCompileTime == 0
28 ? int(PlainObjectType::InnerStrideAtCompileTime)
29 : int(StrideType::InnerStrideAtCompileTime),
30 OuterStrideAtCompileTime = StrideType::OuterStrideAtCompileTime == 0
31 ? (InnerStrideAtCompileTime==
Dynamic || PlainObjectTypeInnerSize==
Dynamic
33 : int(InnerStrideAtCompileTime) * int(PlainObjectTypeInnerSize))
34 : int(StrideType::OuterStrideAtCompileTime),
35 Alignment = int(MapOptions)&int(AlignedMask),
36 Flags0 = TraitsBase::Flags & (~NestByRefBit),
37 Flags = is_lvalue<PlainObjectType>::value ? int(Flags0) : (int(Flags0) & ~
LvalueBit)
94 template<
typename PlainObjectType,
int MapOptions,
typename Str
ideType>
class Map
95 :
public MapBase<Map<PlainObjectType, MapOptions, StrideType> >
99 typedef MapBase<Map> Base;
100 EIGEN_DENSE_PUBLIC_INTERFACE(
Map)
102 typedef typename Base::PointerType PointerType;
103 typedef PointerType PointerArgType;
105 inline PointerType cast_to_pointer_type(PointerArgType ptr) {
return ptr; }
108 inline Index innerStride()
const
110 return StrideType::InnerStrideAtCompileTime != 0 ? m_stride.inner() : 1;
114 inline Index outerStride()
const
116 return int(StrideType::OuterStrideAtCompileTime) != 0 ? m_stride.outer()
117 : int(internal::traits<Map>::OuterStrideAtCompileTime) !=
Dynamic ?
Index(internal::traits<Map>::OuterStrideAtCompileTime)
118 : IsVectorAtCompileTime ? (this->size() * innerStride())
119 : (
int(Flags)&
RowMajorBit) ? (this->cols() * innerStride())
120 : (this->rows() * innerStride());
129 explicit inline Map(PointerArgType dataPtr,
const StrideType& stride = StrideType())
130 : Base(cast_to_pointer_type(dataPtr)), m_stride(stride)
132 PlainObjectType::Base::_check_template_params();
142 inline Map(PointerArgType dataPtr,
Index size,
const StrideType& stride = StrideType())
143 : Base(cast_to_pointer_type(dataPtr), size), m_stride(stride)
145 PlainObjectType::Base::_check_template_params();
156 inline Map(PointerArgType dataPtr,
Index rows,
Index cols,
const StrideType& stride = StrideType())
157 : Base(cast_to_pointer_type(dataPtr), rows, cols), m_stride(stride)
159 PlainObjectType::Base::_check_template_params();
162 EIGEN_INHERIT_ASSIGNMENT_OPERATORS(
Map)
171 #endif // EIGEN_MAP_H