From 126d0898e57ba997bb91108f1729e539d6666c0a Mon Sep 17 00:00:00 2001 From: Max Kahnt <max.kahnt@fu-berlin.de> Date: Thu, 28 Sep 2017 18:43:57 +0200 Subject: [PATCH] Use resize from dune-matrix-vector module. --- dune/solvers/common/genericvectortools.hh | 37 ++--------------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/dune/solvers/common/genericvectortools.hh b/dune/solvers/common/genericvectortools.hh index 50d2641e..4a1dcccf 100644 --- a/dune/solvers/common/genericvectortools.hh +++ b/dune/solvers/common/genericvectortools.hh @@ -22,6 +22,7 @@ #include <dune/istl/bvector.hh> #include <dune/matrix-vector/genericvectortools.hh> +#include <dune/matrix-vector/resize.hh> #include <dune/solvers/operators/sumoperator.hh> @@ -49,44 +50,12 @@ struct GenericVector //! Resize vector recursivly to size of given vector/matrix template <class VectorTypeA, class VectorTypeB> + DUNE_DEPRECATED_MSG("Please use Dune::MatrixVector::resize instead.") static void resize(VectorTypeA& a, const VectorTypeB& b) { - a.resize(b.size()); - typename VectorTypeB::const_iterator it = b.begin(); - typename VectorTypeB::const_iterator end = b.end(); - for(; it!=end; ++it) - GenericVector::resize(a[it.index()], *it); + Dune::MatrixVector::resize(a, b); } - template <class VectorTypeA, class T, class A> - static void resize(VectorTypeA& a, const Dune::BCRSMatrix<T,A>& b) - { - a.resize(b.N()); - typedef typename Dune::BCRSMatrix<T,A> VectorTypeB; - typename VectorTypeB::const_iterator it = b.begin(); - typename VectorTypeB::const_iterator end = b.end(); - for(; it!=end; ++it) - GenericVector::resize(a[it.index()], *(it->begin())); - } - - template <class VectorTypeA, class SparseMatrixType, class LowRankMatrixType> - static void resize(VectorTypeA& a, const SumOperator<SparseMatrixType, LowRankMatrixType>& b) - { - a.resize(b.N()); - typename SparseMatrixType::const_iterator it = b.sparseMatrix().begin(); - typename SparseMatrixType::const_iterator end = b.sparseMatrix().end(); - for(; it!=end; ++it) - GenericVector::resize(a[it.index()], *(it->begin())); - } - - template <class field_type, int n, class VectorTypeB> - static void resize(Dune::FieldVector<field_type,n>& a DUNE_UNUSED, const VectorTypeB& b DUNE_UNUSED) - {} - - template <int n, class VectorTypeB> - static void resize(std::bitset<n>& a DUNE_UNUSED, const VectorTypeB& b DUNE_UNUSED) - {} - //! Set vector to zero at indices that are true in bitvector recursivly template <class VectorType, class BitVectorType> DUNE_DEPRECATED_MSG("Please use Dune::MatrixVector::Generic::truncate instead.") -- GitLab