11#if !defined(EIGEN_PARSED_BY_DOXYGEN)
16template <
typename RowIndices,
typename ColIndices>
17using EnableOverload = std::enable_if_t<
18 internal::valid_indexed_view_overload<RowIndices, ColIndices>::value && internal::is_lvalue<Derived>::value,
bool>;
20template <
typename RowIndices,
typename ColIndices>
21using EnableConstOverload =
22 std::enable_if_t<internal::valid_indexed_view_overload<RowIndices, ColIndices>::value,
bool>;
24template <
typename Indices>
25using EnableVectorOverload =
26 std::enable_if_t<!internal::is_valid_index_type<Indices>::value && internal::is_lvalue<Derived>::value,
bool>;
28template <
typename Indices>
29using EnableConstVectorOverload = std::enable_if_t<!internal::is_valid_index_type<Indices>::value,
bool>;
36 template <
typename RowIndices,
typename ColIndices>
37 using IndexedViewType =
typename internal::IndexedViewSelector<Derived, RowIndices, ColIndices>::ReturnType;
39 template <
typename RowIndices,
typename ColIndices, EnableOverload<RowIndices, ColIndices> = true>
40 IndexedViewType<RowIndices, ColIndices> operator()(
const RowIndices& rowIndices,
const ColIndices& colIndices) {
41 return internal::IndexedViewSelector<Derived, RowIndices, ColIndices>::run(derived(), rowIndices, colIndices);
44template <
typename RowType,
size_t RowSize,
typename ColIndices,
typename RowIndices = Array<RowType, RowSize, 1>,
45 EnableOverload<RowIndices, ColIndices> = true>
46IndexedViewType<RowIndices, ColIndices> operator()(
const RowType (&rowIndices)[RowSize],
const ColIndices& colIndices) {
47 return internal::IndexedViewSelector<Derived, RowIndices, ColIndices>::run(derived(), RowIndices{rowIndices},
51template <
typename RowIndices,
typename ColType,
size_t ColSize,
typename ColIndices = Array<ColType, ColSize, 1>,
52 EnableOverload<RowIndices, ColIndices> = true>
53IndexedViewType<RowIndices, ColIndices> operator()(
const RowIndices& rowIndices,
const ColType (&colIndices)[ColSize]) {
54 return internal::IndexedViewSelector<Derived, RowIndices, ColIndices>::run(derived(), rowIndices,
55 ColIndices{colIndices});
58template <
typename RowType,
size_t RowSize,
typename ColType,
size_t ColSize,
59 typename RowIndices = Array<RowType, RowSize, 1>,
typename ColIndices = Array<ColType, ColSize, 1>,
60 EnableOverload<RowIndices, ColIndices> =
true>
61IndexedViewType<RowIndices, ColIndices> operator()(
const RowType (&rowIndices)[RowSize],
62 const ColType (&colIndices)[ColSize]) {
63 return internal::IndexedViewSelector<Derived, RowIndices, ColIndices>::run(derived(), RowIndices{rowIndices},
64 ColIndices{colIndices});
69template <
typename RowIndices,
typename ColIndices>
70using ConstIndexedViewType =
typename internal::IndexedViewSelector<Derived, RowIndices, ColIndices>::ConstReturnType;
72template <
typename RowIndices,
typename ColIndices, EnableConstOverload<RowIndices, ColIndices> = true>
73ConstIndexedViewType<RowIndices, ColIndices> operator()(
const RowIndices& rowIndices,
74 const ColIndices& colIndices)
const {
75 return internal::IndexedViewSelector<Derived, RowIndices, ColIndices>::run(derived(), rowIndices, colIndices);
78template <
typename RowType,
size_t RowSize,
typename ColIndices,
typename RowIndices = Array<RowType, RowSize, 1>,
79 EnableConstOverload<RowIndices, ColIndices> = true>
80ConstIndexedViewType<RowIndices, ColIndices> operator()(
const RowType (&rowIndices)[RowSize],
81 const ColIndices& colIndices)
const {
82 return internal::IndexedViewSelector<Derived, RowIndices, ColIndices>::run(derived(), RowIndices{rowIndices},
86template <
typename RowIndices,
typename ColType,
size_t ColSize,
typename ColIndices = Array<ColType, ColSize, 1>,
87 EnableConstOverload<RowIndices, ColIndices> = true>
88ConstIndexedViewType<RowIndices, ColIndices> operator()(
const RowIndices& rowIndices,
89 const ColType (&colIndices)[ColSize])
const {
90 return internal::IndexedViewSelector<Derived, RowIndices, ColIndices>::run(derived(), rowIndices,
91 ColIndices{colIndices});
94template <
typename RowType,
size_t RowSize,
typename ColType,
size_t ColSize,
95 typename RowIndices = Array<RowType, RowSize, 1>,
typename ColIndices = Array<ColType, ColSize, 1>,
96 EnableConstOverload<RowIndices, ColIndices> =
true>
97ConstIndexedViewType<RowIndices, ColIndices> operator()(
const RowType (&rowIndices)[RowSize],
98 const ColType (&colIndices)[ColSize])
const {
99 return internal::IndexedViewSelector<Derived, RowIndices, ColIndices>::run(derived(), RowIndices{rowIndices},
100 ColIndices{colIndices});
107template <
typename Indices>
108using VectorIndexedViewType =
typename internal::VectorIndexedViewSelector<Derived, Indices>::ReturnType;
110template <
typename Indices, EnableVectorOverload<Indices> = true>
111VectorIndexedViewType<Indices> operator()(
const Indices& indices) {
112 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
113 return internal::VectorIndexedViewSelector<Derived, Indices>::run(derived(), indices);
116template <
typename IndexType,
size_t Size,
typename Indices = Array<IndexType, Size, 1>,
117 EnableVectorOverload<Indices> = true>
118VectorIndexedViewType<Indices> operator()(
const IndexType (&indices)[Size]) {
119 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
120 return internal::VectorIndexedViewSelector<Derived, Indices>::run(derived(), Indices{indices});
125template <
typename Indices>
126using ConstVectorIndexedViewType =
typename internal::VectorIndexedViewSelector<Derived, Indices>::ConstReturnType;
128template <
typename Indices, EnableConstVectorOverload<Indices> = true>
129ConstVectorIndexedViewType<Indices> operator()(
const Indices& indices)
const {
130 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
131 return internal::VectorIndexedViewSelector<Derived, Indices>::run(derived(), indices);
134template <
typename IndexType,
size_t Size,
typename Indices = Array<IndexType, Size, 1>,
135 EnableConstVectorOverload<Indices> = true>
136ConstVectorIndexedViewType<Indices> operator()(
const IndexType (&indices)[Size])
const {
137 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
138 return internal::VectorIndexedViewSelector<Derived, Indices>::run(derived(), Indices{indices});
183template <
typename RowIndices,
typename ColIndices>
184IndexedView_or_Block operator()(
const RowIndices& rowIndices,
const ColIndices& colIndices);
190template <
typename Indices>
191IndexedView_or_VectorBlock operator()(
const Indices& indices);