From 7462059900e60f87535fd77392a1b68cca4a3163 Mon Sep 17 00:00:00 2001 From: Tobias Leibner <tobias.leibner@uni-muenster.de> Date: Mon, 14 May 2018 12:15:03 +0200 Subject: [PATCH] [fmatrix] (properly) fix ambiguous operator* error --- dune/xt/common/fmatrix.hh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dune/xt/common/fmatrix.hh b/dune/xt/common/fmatrix.hh index dfee08eda..30af4c541 100644 --- a/dune/xt/common/fmatrix.hh +++ b/dune/xt/common/fmatrix.hh @@ -614,6 +614,16 @@ Dune::XT::Common::FieldMatrix<K, L_ROWS, R_COLS> operator*(const Dune::FieldMatr return left.rightmultiplyany(right); } +// we need this explicit overload to fix an ambiguous operator* error due to the automatic conversion from +// FieldMatrix<K, 1, 1> to K +template <class K, int L_ROWS> +Dune::XT::Common::FieldMatrix<K, L_ROWS, 1> operator*(const Dune::XT::Common::FieldMatrix<K, L_ROWS, 1>& left, + const Dune::FieldMatrix<K, 1, 1>& right) +{ + return left.rightmultiplyany(right); +} + + template <class K, int L_ROWS, int L_COLS, int R_COLS> void rightmultiply(Dune::FieldMatrix<K, L_ROWS, R_COLS>& ret, const Dune::FieldMatrix<K, L_ROWS, L_COLS>& left, -- GitLab