Open jbrezmorf opened 9 years ago
Proposed concept for the first drawback:
mem_local
member into Shape. Test.n_rows, n_cols, n_elem, vec_state, mem_state
as const referencesmem
using a typedef from StateMat<eT>::fixed<N,M>
as Mat<eT, Shape<N,M>>
(or derived)Shape<0,0>
with const static members for n_rows, n_cols, n_elem, ...
(reuse from Matfor both fixed dimensions nonzero we try to set all types into auxiliary classes which contains no data.
introduce Mat<...>::nrows(), ncols() methods and use them through the library instead of nrows, ncols attributes
derive final classes exposed to users, the fixed variant defines nrows, ncols attributes as static consts, while the free size variant defines them as current implementation and set them in constructors (these have to be defined)
Question: how can expression templates work with Mat_fixed derived from the Mat implementation?
Point 1. resolved by introduction of Armor interface classes. Point 2. can be resolved by own implementation of matrices in the LocalSystem. Point 3. ... not clear why this is an issue. Armadillo fixed Mat are not literals probably because of its derivation from general Mat class. So possibly Armor Mat can resolve this issue as well.
Resolution:
Armadillo provides very fast algebra for dens matrices and objects with very simple syntax. How ever there are two drawbacks for its usage in Flow123d: