Commit 3395bbca authored by Christian Engwer's avatar Christian Engwer Committed by Steffen Müthing

Merge branch 'feature/#5-rightmultiply' into 'master'

Fix FieldMatrix::rightmultiply()

This addresses an issue mentioned in #5 and additionally turns runtime checks into compile-time checks whenever possible.

See merge request !22
(cherry picked from commit 71e2e4b8)
Signed-off-by: Steffen Müthing's avatarSteffen Müthing <muething@dune-project.org>
parent 45f52b34
......@@ -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++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment