[cleanup]Simplify ISTLMatrixBackend entry access by multi-indices
This cleans up the entry access by a pair of row- and column-multi-indices as follows:
- Factor out a generic utility function
visitMatrixEntry()
for accessing the(i,j)
-th entry of a matrix with dynamic indices. By combininghybridIndexAccess()
andhybridRowIndexAccess()
this also works with multi-type matrices. - Factor out a generic utility function
visitMatrixEntryRecursive()
for recursively accessing matrix entries with dynamic row- and column-multi-indices. The action to apply to the resolved matrix entry is customizable. - Use
visitMatrixEntryRecursive()
to return matrix entries.
This is a significant simplification of the old MultiIndexResolver
-code
and far more readable. It is also more generic, and forms the foundation
of possible extensions to other methods that need multi-index-access,
like, e.g., matrixEntryExists(i,j)
or addToMatrixEntry(i,j)
.