diff --git a/dune/common/fmatrix.hh b/dune/common/fmatrix.hh index ffc8dfc9ae0ba329f4e507c4e19e364edd44af30..86dd727026d821358e8e961f2f6bade20728cf1b 100644 --- a/dune/common/fmatrix.hh +++ b/dune/common/fmatrix.hh @@ -134,9 +134,14 @@ namespace Dune return C; } + using Base::rightmultiply; + //! Multiplies M from the right to this matrix - FieldMatrix& rightmultiply (const FieldMatrix<K,cols,cols>& M) + template <int r, int c> + FieldMatrix& rightmultiply (const FieldMatrix<K,r,c>& M) { + static_assert(r == c, "Cannot rightmultiply with non-square matrix"); + static_assert(r == cols, "Size mismatch"); FieldMatrix<K,rows,cols> C(*this); for (size_type i=0; i<rows; i++)