| 92 | * \sa PlainObjectBase::Map(), \ref TopicStorageOrders |
| 93 | */ |
| 94 | template<typename PlainObjectType, int MapOptions, typename StrideType> class Map |
| 95 | : public MapBase<Map<PlainObjectType, MapOptions, StrideType> > |
| 96 | { |
| 97 | public: |
| 98 | |
| 99 | typedef MapBase<Map> Base; |
| 100 | EIGEN_DENSE_PUBLIC_INTERFACE(Map) |
| 101 | |
| 102 | typedef typename Base::PointerType PointerType; |
| 103 | typedef PointerType PointerArgType; |
| 104 | EIGEN_DEVICE_FUNC |
| 105 | inline PointerType cast_to_pointer_type(PointerArgType ptr) { return ptr; } |
| 106 | |
| 107 | EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR |
| 108 | inline Index innerStride() const |
| 109 | { |
| 110 | return StrideType::InnerStrideAtCompileTime != 0 ? m_stride.inner() : 1; |
| 111 | } |
| 112 | |
| 113 | EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR |
| 114 | inline Index outerStride() const |
| 115 | { |
| 116 | return StrideType::OuterStrideAtCompileTime != 0 ? m_stride.outer() |
| 117 | : 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()); |
| 121 | } |
| 122 | |
| 123 | /** Constructor in the fixed-size case. |
| 124 | * |
| 125 | * \param dataPtr pointer to the array to map |
| 126 | * \param stride optional Stride object, passing the strides. |
| 127 | */ |
| 128 | EIGEN_DEVICE_FUNC |
| 129 | explicit inline Map(PointerArgType dataPtr, const StrideType& stride = StrideType()) |
| 130 | : Base(cast_to_pointer_type(dataPtr)), m_stride(stride) |
| 131 | { |
| 132 | PlainObjectType::Base::_check_template_params(); |
| 133 | } |
| 134 | |
| 135 | /** Constructor in the dynamic-size vector case. |
| 136 | * |
| 137 | * \param dataPtr pointer to the array to map |
| 138 | * \param size the size of the vector expression |
| 139 | * \param stride optional Stride object, passing the strides. |
| 140 | */ |
| 141 | EIGEN_DEVICE_FUNC |
| 142 | inline Map(PointerArgType dataPtr, Index size, const StrideType& stride = StrideType()) |
| 143 | : Base(cast_to_pointer_type(dataPtr), size), m_stride(stride) |
| 144 | { |
| 145 | PlainObjectType::Base::_check_template_params(); |
| 146 | } |
| 147 | |
| 148 | /** Constructor in the dynamic-size matrix case. |
| 149 | * |
no outgoing calls
no test coverage detected