Skip to content

Rework DenseMatrix assignment

This is meant as a fix for bug #5 (closed).

It

  • Enables assignment across different DenseMatrix implementations, e.g. assignment from a DynamicMatrix to a FieldMatrix (this previously either compiled and segfaulted or did not compile)
  • Catches invalid FieldMatrix assignments at compile-time
  • Retaines the DenseMatrixAssigner class in order to remain compatible with user-defined matrix classes

To me it looks 99% good to go. There is only remaining question that I cannot answer on my own:

  • Should FieldMatrix<double, 3, 3> x = 27 compile? In other words, should the constructor be marked as explicit or not? Of course, one can always use FieldMatrix<double, 3, 3> x(27) instead.

I've tested this fix with multiple modules and it doesn't break anything for me.

Merge request reports