From 4710eeb8d2d44a7ec3a3136328836fffc6ee1010 Mon Sep 17 00:00:00 2001
From: Uli Sack <usack@math.fu-berlin.de>
Date: Wed, 25 Jan 2012 09:51:09 +0000
Subject: [PATCH] added specialization of GenericVector::resize for
 VectorTypeB=SumOperator<SparseM,LowRankM>

[[Imported from SVN: r5476]]
---
 dune/solvers/common/genericvectortools.hh | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/dune/solvers/common/genericvectortools.hh b/dune/solvers/common/genericvectortools.hh
index a77b2b62..18d850d9 100644
--- a/dune/solvers/common/genericvectortools.hh
+++ b/dune/solvers/common/genericvectortools.hh
@@ -80,6 +80,17 @@ struct GenericVector
             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());
+        typedef SumOperator<SparseMatrixType,LowRankMatrixType> TypeB;
+        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, const VectorTypeB& b)
     {}
-- 
GitLab