Draft: Provide hybrid range and size utilities for matrices and vectors
Compare changes
Files
5+ 2
− 0
This MR extends the idea of hybrid size from dune-common to matrices and vectors. It provides free functions Hybrid::numRows
, Hybrid::numCols
and Hybrid::numEntries
for number of rows and number of columns of matrices, as well as number of entries in a vector, respectively. Thereby the specialization is done with dynamic-first idea. If a container provides dynamic index access, the corresponding size functions return a std::size_t
. Otherwise if element access is not dynamic and size is a static constant, the methods provide size information as std::integral_constant
. This allows to iterate over the containers using Hybrid::forEach
where again, dynamic iteration is preferred over static (unrolled/recursive) iteration.
Dune::Hybrid::size
.numEntries
from size
for vectors.