From f783a5e7356c4d4aadcc438aba17e84b6ecea7eb Mon Sep 17 00:00:00 2001
From: Tobias Malkmus <tomalk@mathematik.uni-freiburg.de>
Date: Thu, 17 Oct 2013 08:48:17 +0200
Subject: [PATCH] [Release][GMRES] don't copy the Krylov basis in the update
 method

The full krylov basis is copied in the call of the method update(),
working with a reference to the krylov basis reduced the peak amount of allocated memory
by a factor of about 1.7 and improves the runtime by 4%.

Steffen: Also constified all applicable function arguments as suggested
         by Christian.

Closes FS#1378
---
 dune/istl/solvers.hh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dune/istl/solvers.hh b/dune/istl/solvers.hh
index d19e05978..5055a124f 100644
--- a/dune/istl/solvers.hh
+++ b/dune/istl/solvers.hh
@@ -1301,8 +1301,8 @@ namespace Dune {
 
     static void
     update(X &x, int k,
-           std::vector< std::vector<field_type> > & h,
-           std::vector<field_type> & s, std::vector<F> v)
+           const std::vector< std::vector<field_type> > & h,
+           const std::vector<field_type> & s, const std::vector<F> &v)
     {
       std::vector<field_type> y(s);
 
-- 
GitLab