10#if !defined(EIGEN_PARSED_BY_DOXYGEN)
15template <
typename RowIndices,
typename ColIndices>
16using EnableOverload = std::enable_if_t<
17 internal::valid_indexed_view_overload<RowIndices, ColIndices>::value && internal::is_lvalue<Derived>::value,
bool>;
19template <
typename RowIndices,
typename ColIndices>
20using EnableConstOverload =
21 std::enable_if_t<internal::valid_indexed_view_overload<RowIndices, ColIndices>::value,
bool>;
23template <
typename Indices>
24using EnableVectorOverload =
25 std::enable_if_t<!internal::is_valid_index_type<Indices>::value && internal::is_lvalue<Derived>::value,
bool>;
27template <
typename Indices>
28using EnableConstVectorOverload = std::enable_if_t<!internal::is_valid_index_type<Indices>::value,
bool>;
35 template <
typename RowIndices,
typename ColIndices>
36 using IndexedViewType =
typename internal::IndexedViewSelector<Derived, RowIndices, ColIndices>::ReturnType;
38 template <
typename RowIndices,
typename ColIndices, EnableOverload<RowIndices, ColIndices> = true>
39 IndexedViewType<RowIndices, ColIndices> operator()(
const RowIndices& rowIndices,
const ColIndices& colIndices) {
40 return internal::IndexedViewSelector<Derived, RowIndices, ColIndices>::run(derived(), rowIndices, colIndices);
43template <
typename RowType,
size_t RowSize,
typename ColIndices,
typename RowIndices = Array<RowType, RowSize, 1>,
44 EnableOverload<RowIndices, ColIndices> = true>
45IndexedViewType<RowIndices, ColIndices> operator()(
const RowType (&rowIndices)[RowSize],
const ColIndices& colIndices) {
46 return internal::IndexedViewSelector<Derived, RowIndices, ColIndices>::run(derived(), RowIndices{rowIndices},
50template <
typename RowIndices,
typename ColType,
size_t ColSize,
typename ColIndices = Array<ColType, ColSize, 1>,
51 EnableOverload<RowIndices, ColIndices> = true>
52IndexedViewType<RowIndices, ColIndices> operator()(
const RowIndices& rowIndices,
const ColType (&colIndices)[ColSize]) {
53 return internal::IndexedViewSelector<Derived, RowIndices, ColIndices>::run(derived(), rowIndices,
54 ColIndices{colIndices});
57template <
typename RowType,
size_t RowSize,
typename ColType,
size_t ColSize,
58 typename RowIndices = Array<RowType, RowSize, 1>,
typename ColIndices = Array<ColType, ColSize, 1>,
59 EnableOverload<RowIndices, ColIndices> =
true>
60IndexedViewType<RowIndices, ColIndices> operator()(
const RowType (&rowIndices)[RowSize],
61 const ColType (&colIndices)[ColSize]) {
62 return internal::IndexedViewSelector<Derived, RowIndices, ColIndices>::run(derived(), RowIndices{rowIndices},
63 ColIndices{colIndices});
68template <
typename RowIndices,
typename ColIndices>
69using ConstIndexedViewType =
typename internal::IndexedViewSelector<Derived, RowIndices, ColIndices>::ConstReturnType;
71template <
typename RowIndices,
typename ColIndices, EnableConstOverload<RowIndices, ColIndices> = true>
72ConstIndexedViewType<RowIndices, ColIndices> operator()(
const RowIndices& rowIndices,
73 const ColIndices& colIndices)
const {
74 return internal::IndexedViewSelector<Derived, RowIndices, ColIndices>::run(derived(), rowIndices, colIndices);
77template <
typename RowType,
size_t RowSize,
typename ColIndices,
typename RowIndices = Array<RowType, RowSize, 1>,
78 EnableConstOverload<RowIndices, ColIndices> = true>
79ConstIndexedViewType<RowIndices, ColIndices> operator()(
const RowType (&rowIndices)[RowSize],
80 const ColIndices& colIndices)
const {
81 return internal::IndexedViewSelector<Derived, RowIndices, ColIndices>::run(derived(), RowIndices{rowIndices},
85template <
typename RowIndices,
typename ColType,
size_t ColSize,
typename ColIndices = Array<ColType, ColSize, 1>,
86 EnableConstOverload<RowIndices, ColIndices> = true>
87ConstIndexedViewType<RowIndices, ColIndices> operator()(
const RowIndices& rowIndices,
88 const ColType (&colIndices)[ColSize])
const {
89 return internal::IndexedViewSelector<Derived, RowIndices, ColIndices>::run(derived(), rowIndices,
90 ColIndices{colIndices});
93template <
typename RowType,
size_t RowSize,
typename ColType,
size_t ColSize,
94 typename RowIndices = Array<RowType, RowSize, 1>,
typename ColIndices = Array<ColType, ColSize, 1>,
95 EnableConstOverload<RowIndices, ColIndices> =
true>
96ConstIndexedViewType<RowIndices, ColIndices> operator()(
const RowType (&rowIndices)[RowSize],
97 const ColType (&colIndices)[ColSize])
const {
98 return internal::IndexedViewSelector<Derived, RowIndices, ColIndices>::run(derived(), RowIndices{rowIndices},
99 ColIndices{colIndices});
106template <
typename Indices>
107using VectorIndexedViewType =
typename internal::VectorIndexedViewSelector<Derived, Indices>::ReturnType;
109template <
typename Indices, EnableVectorOverload<Indices> = true>
110VectorIndexedViewType<Indices> operator()(
const Indices& indices) {
111 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
112 return internal::VectorIndexedViewSelector<Derived, Indices>::run(derived(), indices);
115template <
typename IndexType,
size_t Size,
typename Indices = Array<IndexType, Size, 1>,
116 EnableVectorOverload<Indices> = true>
117VectorIndexedViewType<Indices> operator()(
const IndexType (&indices)[Size]) {
118 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
119 return internal::VectorIndexedViewSelector<Derived, Indices>::run(derived(), Indices{indices});
124template <
typename Indices>
125using ConstVectorIndexedViewType =
typename internal::VectorIndexedViewSelector<Derived, Indices>::ConstReturnType;
127template <
typename Indices, EnableConstVectorOverload<Indices> = true>
128ConstVectorIndexedViewType<Indices> operator()(
const Indices& indices)
const {
129 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
130 return internal::VectorIndexedViewSelector<Derived, Indices>::run(derived(), indices);
133template <
typename IndexType,
size_t Size,
typename Indices = Array<IndexType, Size, 1>,
134 EnableConstVectorOverload<Indices> = true>
135ConstVectorIndexedViewType<Indices> operator()(
const IndexType (&indices)[Size])
const {
136 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
137 return internal::VectorIndexedViewSelector<Derived, Indices>::run(derived(), Indices{indices});
182template <
typename RowIndices,
typename ColIndices>
183IndexedView_or_Block operator()(
const RowIndices& rowIndices,
const ColIndices& colIndices);
189template <
typename Indices>
190IndexedView_or_VectorBlock operator()(
const Indices& indices);