From 99232bb1a64be5b62912ee478a92366189ef068a Mon Sep 17 00:00:00 2001 From: Dmitri Naumov <dmitri.naumov@ufz.de> Date: Thu, 22 Feb 2018 17:48:09 +0100 Subject: [PATCH] [MaL] LinAlg; Remove default impl of finalizeAsm. The default impl., which is not doing anything, is error prone, because passing an object of not matrix type, e.g. std::unique_ptr<PETScVector>, the default impl. will be taken. --- MathLib/LinAlg/LinAlg.cpp | 2 ++ MathLib/LinAlg/LinAlg.h | 8 +++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/MathLib/LinAlg/LinAlg.cpp b/MathLib/LinAlg/LinAlg.cpp index ceb5fc991b0..fc6432473e9 100644 --- a/MathLib/LinAlg/LinAlg.cpp +++ b/MathLib/LinAlg/LinAlg.cpp @@ -308,6 +308,8 @@ void finalizeAssembly(EigenMatrix& x) x.getRawMatrix().makeCompressed(); } +void finalizeAssembly(EigenVector& x) {} + } // namespace LinAlg } // namespace MathLib diff --git a/MathLib/LinAlg/LinAlg.h b/MathLib/LinAlg/LinAlg.h index 16c344376b2..f03c4119994 100644 --- a/MathLib/LinAlg/LinAlg.h +++ b/MathLib/LinAlg/LinAlg.h @@ -98,11 +98,8 @@ double norm(MatrixOrVector const& x, MathLib::VecNormType type) } } -template<typename Matrix> -void finalizeAssembly(Matrix& /*A*/) -{ - // By default do nothing. -} +template <typename Matrix> +void finalizeAssembly(Matrix& /*A*/); // Matrix and Vector @@ -260,6 +257,7 @@ void matMultAdd(EigenMatrix const& A, EigenVector const& v1, EigenVector const& v2, EigenVector& v3); void finalizeAssembly(EigenMatrix& A); +void finalizeAssembly(EigenVector& A); } // namespace LinAlg -- GitLab