From b056ca66ec495c2b7a21bf0ed79a27bc6977c468 Mon Sep 17 00:00:00 2001
From: Max Kahnt <max.kahnt@fu-berlin.de>
Date: Mon, 21 Nov 2016 11:55:22 +0100
Subject: [PATCH] Create a temporary ignore set only if needed.

As a side note: The construction of the temporary ignore nodes
eventually needs to be generalized just like the diagonal block.
---
 dune/solvers/iterationsteps/blockgssteps.hh | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/dune/solvers/iterationsteps/blockgssteps.hh b/dune/solvers/iterationsteps/blockgssteps.hh
index f3d17ae7..21e3ad38 100644
--- a/dune/solvers/iterationsteps/blockgssteps.hh
+++ b/dune/solvers/iterationsteps/blockgssteps.hh
@@ -52,12 +52,11 @@ void linearStep(const M& m, V& x, const V& b, const BitVector* ignore,
         diag = &*cIt;
     }
 
-    std::bitset<V::block_type::dimension> ignore_i(0);
-    if (ignore != nullptr)
-      ignore_i = (*ignore)[i];
+    using Ignore = std::bitset<V::block_type::dimension>;
 
     // Update iterate with correction
-    x[i] += localSolver(diag != nullptr ? *diag : Block(0.0), std::move(ri), ignore_i);
+    x[i] += localSolver(diag != nullptr ? *diag : Block(0.0), std::move(ri),
+                        ignore != nullptr ? (*ignore)[i] : Ignore(0));
   };
 
   if (direction != Direction::BACKWARD)
-- 
GitLab