Working notes - Indexing++
The goal of this page is to summarize the different ideas and working plan to (finally!) provide support for flexible row/column indexing in Eigen. See this bug report.
We aim to support various indexing mechanisms. For each dimension, we would like to be able to have any of:
- all: as in
- singleton: as in
- index-array: as in
A([3 1 5])
- range-based: as in
A(3:9)(partly supported via Block)
- slicing: as in
- negative indices: as in
- boolean masking: as in
All of this with a concise and unambiguous API! We should also be able to provide compile-time information such as lengths.
Since achieving a lean API in C++03 seems to be rather impossible, let's first see what could be done in C++11 and provide more verbose fallbacks for C++03.
C++03 fallback API
Internal implementation details
One could be tempted to leverage AVX2 gather/scatter instructions, but those are horribly slow. Better emulate them for now.