10#if !defined(EIGEN_PARSED_BY_DOXYGEN)
14#ifndef EIGEN_INDEXED_VIEW_METHOD_2ND_PASS
15#define EIGEN_INDEXED_VIEW_METHOD_CONST const
16#define EIGEN_INDEXED_VIEW_METHOD_TYPE ConstIndexedViewType
18#define EIGEN_INDEXED_VIEW_METHOD_CONST
19#define EIGEN_INDEXED_VIEW_METHOD_TYPE IndexedViewType
22#ifndef EIGEN_INDEXED_VIEW_METHOD_2ND_PASS
27template<
typename Indices>
28struct IvcRowType :
public internal::IndexedViewCompatibleType<Indices,RowsAtCompileTime> {};
30template<
typename Indices>
31struct IvcColType :
public internal::IndexedViewCompatibleType<Indices,ColsAtCompileTime> {};
33template<
typename Indices>
34struct IvcType :
public internal::IndexedViewCompatibleType<Indices,SizeAtCompileTime> {};
36typedef typename internal::IndexedViewCompatibleType<Index,1>::type
IvcIndex;
38template<
typename Indices>
40ivcRow(
const Indices& indices)
const {
41 return internal::makeIndexedViewCompatible(indices, internal::variable_if_dynamic<Index,RowsAtCompileTime>(derived().
rows()),Specialized);
44template<
typename Indices>
46ivcCol(
const Indices& indices)
const {
47 return internal::makeIndexedViewCompatible(indices, internal::variable_if_dynamic<Index,ColsAtCompileTime>(derived().
cols()),Specialized);
50template<
typename Indices>
53 return internal::makeIndexedViewCompatible(indices, internal::variable_if_dynamic<Index,SizeAtCompileTime>(derived().
size()),Specialized);
60template<
typename RowIndices,
typename ColIndices>
69template<
typename RowIndices,
typename ColIndices>
70typename internal::enable_if<internal::valid_indexed_view_overload<RowIndices,ColIndices>::value
71 && internal::traits<typename EIGEN_INDEXED_VIEW_METHOD_TYPE<RowIndices,ColIndices>::type>::ReturnAsIndexedView,
81template<
typename RowIndices,
typename ColIndices>
82typename internal::enable_if<internal::valid_indexed_view_overload<RowIndices,ColIndices>::value
83 && internal::traits<typename EIGEN_INDEXED_VIEW_METHOD_TYPE<RowIndices,ColIndices>::type>::ReturnAsBlock,
84 typename internal::traits<typename EIGEN_INDEXED_VIEW_METHOD_TYPE<RowIndices,ColIndices>::type>::BlockType>::type
87 typedef typename internal::traits<typename EIGEN_INDEXED_VIEW_METHOD_TYPE<RowIndices,ColIndices>::type>::BlockType BlockType;
90 return BlockType(derived(),
91 internal::first(actualRowIndices),
92 internal::first(actualColIndices),
93 internal::size(actualRowIndices),
94 internal::size(actualColIndices));
99template<
typename RowIndices,
typename ColIndices>
100typename internal::enable_if<internal::valid_indexed_view_overload<RowIndices,ColIndices>::value
101 && internal::traits<typename EIGEN_INDEXED_VIEW_METHOD_TYPE<RowIndices,ColIndices>::type>::ReturnAsScalar,
102 CoeffReturnType >::type
105 return Base::operator()(internal::eval_expr_given_size(rowIndices,
rows()),internal::eval_expr_given_size(colIndices,
cols()));
108#if EIGEN_HAS_STATIC_ARRAY_TEMPLATE
112template<
typename RowIndicesT, std::
size_t RowIndicesN,
typename ColIndices>
117 (derived(), rowIndices,
ivcCol(colIndices));
120template<
typename RowIndices,
typename ColIndicesT, std::
size_t ColIndicesN>
121IndexedView<EIGEN_INDEXED_VIEW_METHOD_CONST Derived,typename IvcRowType<RowIndices>::type,
const ColIndicesT (&)[ColIndicesN]>
124 return IndexedView<EIGEN_INDEXED_VIEW_METHOD_CONST Derived,typename IvcRowType<RowIndices>::type,
const ColIndicesT (&)[ColIndicesN]>
125 (derived(),
ivcRow(rowIndices), colIndices);
128template<
typename RowIndicesT, std::
size_t RowIndicesN,
typename ColIndicesT, std::
size_t ColIndicesN>
132 return IndexedView<EIGEN_INDEXED_VIEW_METHOD_CONST Derived,const RowIndicesT (&)[RowIndicesN],const ColIndicesT (&)[ColIndicesN]>
133 (derived(), rowIndices, colIndices);
140template<
typename Indices>
141typename internal::enable_if<
142 IsRowMajor && (!(internal::get_compile_time_incr<typename IvcType<Indices>::type>::value==1 || internal::is_valid_index_type<Indices>::value)),
143 IndexedView<EIGEN_INDEXED_VIEW_METHOD_CONST Derived,IvcIndex,typename IvcType<Indices>::type> >::type
147 return IndexedView<EIGEN_INDEXED_VIEW_METHOD_CONST Derived,IvcIndex,typename IvcType<Indices>::type>
151template<
typename Indices>
152typename internal::enable_if<
153 (!IsRowMajor) && (!(internal::get_compile_time_incr<
typename IvcType<Indices>::type>::value==1 || internal::is_valid_index_type<Indices>::value)),
158 return IndexedView<EIGEN_INDEXED_VIEW_METHOD_CONST Derived,typename IvcType<Indices>::type,
IvcIndex>
162template<
typename Indices>
163typename internal::enable_if<
164 (internal::get_compile_time_incr<typename IvcType<Indices>::type>::value==1) && (!internal::is_valid_index_type<Indices>::value) && (!symbolic::is_symbolic<Indices>::value),
170 return VectorBlock<EIGEN_INDEXED_VIEW_METHOD_CONST Derived,internal::array_size<Indices>::value>
171 (derived(), internal::first(actualIndices), internal::size(actualIndices));
174template<
typename IndexType>
175typename internal::enable_if<symbolic::is_symbolic<IndexType>::value, CoeffReturnType >::type
178 return Base::operator()(internal::eval_expr_given_size(
id,
size()));
181#if EIGEN_HAS_STATIC_ARRAY_TEMPLATE
183template<
typename IndicesT, std::
size_t IndicesN>
184typename internal::enable_if<IsRowMajor,
189 return IndexedView<EIGEN_INDEXED_VIEW_METHOD_CONST Derived,IvcIndex,const IndicesT (&)[IndicesN]>
193template<
typename IndicesT, std::
size_t IndicesN>
194typename internal::enable_if<!IsRowMajor,
199 return IndexedView<EIGEN_INDEXED_VIEW_METHOD_CONST Derived,const IndicesT (&)[IndicesN],IvcIndex>
205#undef EIGEN_INDEXED_VIEW_METHOD_CONST
206#undef EIGEN_INDEXED_VIEW_METHOD_TYPE
208#ifndef EIGEN_INDEXED_VIEW_METHOD_2ND_PASS
209#define EIGEN_INDEXED_VIEW_METHOD_2ND_PASS
211#undef EIGEN_INDEXED_VIEW_METHOD_2ND_PASS
250template<
typename RowIndices,
typename ColIndices>
252operator()(
const RowIndices& rowIndices,
const ColIndices& colIndices);
258template<
typename Indices>
259IndexedView_or_VectorBlock
IvcColType< Indices >::type ivcSize(const Indices &indices) const
Definition IndexedViewMethods.h:52
internal::enable_if< internal::valid_indexed_view_overload< RowIndices, ColIndices >::value &&internal::traits< typenameEIGEN_INDEXED_VIEW_METHOD_TYPE< RowIndices, ColIndices >::type >::ReturnAsIndexedView, typenameEIGEN_INDEXED_VIEW_METHOD_TYPE< RowIndices, ColIndices >::type >::type operator()(const RowIndices &rowIndices, const ColIndices &colIndices) EIGEN_INDEXED_VIEW_METHOD_CONST
Definition IndexedViewMethods.h:73
#define EIGEN_INDEXED_VIEW_METHOD_CONST
Definition IndexedViewMethods.h:15
IvcRowType< Indices >::type ivcRow(const Indices &indices) const
Definition IndexedViewMethods.h:40
IvcColType< Indices >::type ivcCol(const Indices &indices) const
Definition IndexedViewMethods.h:46
internal::IndexedViewCompatibleType< Index, 1 >::type IvcIndex
Definition IndexedViewMethods.h:36
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE)
Definition StaticAssert.h:142
int rows
Definition Tutorial_commainit_02.cpp:1
int cols
Definition Tutorial_commainit_02.cpp:1
Scalar Scalar int size
Definition benchVecAdd.cpp:17
Definition IndexedViewMethods.h:61
IndexedView< EIGEN_INDEXED_VIEW_METHOD_CONST Derived, typename IvcRowType< RowIndices >::type, typename IvcColType< ColIndices >::type > type
Definition IndexedViewMethods.h:64
Definition IndexedViewMethods.h:31
Definition IndexedViewMethods.h:28
Definition IndexedViewMethods.h:34