Add support for plain-array as indices, e.g., mat({1,2,3,4})

This commit is contained in:
Gael Guennebaud
2017-01-06 21:53:32 +01:00
parent a875167d99
commit 3264d3c761
4 changed files with 23 additions and 2 deletions

View File

@@ -566,6 +566,13 @@ template<typename Derived> class DenseBase
derived(), internal::make_indexing(rowIndices,derived().rows()), internal::make_indexing(colIndices,derived().cols()));
}
template<typename RowIndicesT, std::size_t RowIndicesN, typename ColIndices>
IndexedView<const Derived,const RowIndicesT (&)[RowIndicesN],typename internal::MakeIndexing<ColIndices>::type>
operator()(const RowIndicesT (&rowIndices)[RowIndicesN], const ColIndices& colIndices) const {
return IndexedView<const Derived,const RowIndicesT (&) [RowIndicesN],typename internal::MakeIndexing<ColIndices>::type>(
derived(), rowIndices, internal::make_indexing(colIndices,derived().cols()));
}
#define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::DenseBase
#define EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
#define EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(COND)