Rethinking matrix classes and interfaces
This task is supposed to collect and organise criticism and suggestions that have accumulated in flyspray/FS#1669 (closed).
So far, it has been suggested that (I'm making a few additions myself and do not both to properly trace back suggestions to their respective authors)
-
IdentityMatrix
(dune-common) andScaledIdentityMatrix
(dune-istl) are too close in functionality. Suggestions include:- Removing
IdentityMatrix
and replacing any instances withScaledIdentityMatrix(1)
. - Replacing
ScaledIdentityMatrix
with a more general template classScaledIdentityMatrix<MatrixClass>
, so that current uses ofScaledIdentityMatrix
would be replaced withScaledIdentityMatrix<IdentityMatrix>
.
- Removing
- The CRTP approach with the
DenseMatrix
class appears rather complicated, leading to issues such asflyspray/FS#1712
. - Sparse
blocklevel=0
Matrix classes (DiagonalMatrix
,ScaledIdentityMatrix
,IdentityMatrix
, potentially more?) could be plugged into general-purpose implementations of functions likeFieldMatrix::rightmultiply
with optimal arithmetic efficiency if they provided iterators. - Symmetric matrices could be implemented such that they take less storage (in 3D, 6 scalars instead of 9) and/or perform fewer arithmetic operations.
Update: added symmetric matrices.