From 9778fb8c7ae2ae525f4a27482158b34890663f72 Mon Sep 17 00:00:00 2001
From: Uli Sack <usack@math.fu-berlin.de>
Date: Mon, 2 Jul 2012 09:24:05 +0000
Subject: [PATCH] * export field_type * make method mv const * add method usmv

[[Imported from SVN: r6465]]
---
 dune/solvers/operators/sumoperator.hh | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/dune/solvers/operators/sumoperator.hh b/dune/solvers/operators/sumoperator.hh
index 237e705c..ddead966 100644
--- a/dune/solvers/operators/sumoperator.hh
+++ b/dune/solvers/operators/sumoperator.hh
@@ -18,6 +18,8 @@ class SumOperator
         //! export the summand type
         typedef LowRankMatrix LowRankMatrixType;
 
+        typedef typename SparseMatrixType::field_type field_type;
+
         //! default constructor - allocates memory for summand operators internally
         SumOperator():
             summands_allocated_internally_(true)
@@ -60,12 +62,20 @@ class SumOperator
 
         //! b = (A+M)x
         template <class LVectorType, class RVectorType>
-        void mv(const LVectorType& x, RVectorType& b)
+        void mv(const LVectorType& x, RVectorType& b) const
         {
             sparse_matrix_->mv(x,b);
             lowrank_matrix_->umv(x,b);
         }
 
+        //! b += a*(A+M)x
+        template <class LVectorType, class RVectorType>
+        void usmv(const field_type a, const LVectorType& x, RVectorType& b) const
+        {
+            sparse_matrix_->usmv(a,x,b);
+            lowrank_matrix_->usmv(a,x,b);
+        }
+
         //! return the number of rows
         size_t N() const
         {
-- 
GitLab