From 11a5d83cfe3b8636130dab44820b4d2693cb0a8a Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Mon, 31 Oct 2011 17:59:40 +0100
Subject: [PATCH] Cleanup

---
 src/samplefunctional.hh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/samplefunctional.hh b/src/samplefunctional.hh
index 70d92c71..a2f413d9 100644
--- a/src/samplefunctional.hh
+++ b/src/samplefunctional.hh
@@ -155,8 +155,9 @@ void minimise(Functional const J, typename Functional::SmallVector &x,
     J.A.mv(descDir, tmp);                // Av
     double const JRestA = tmp * descDir; // <Av,v>
 
-    J.A.mv(x, tmp);                              // Au
-    double const JRestb = (J.b - tmp) * descDir; // <b-Au,v>
+    tmp = J.b;
+    J.A.mmv(x, tmp);                     //  b-Au
+    double const JRestb = tmp * descDir; // <b-Au,v>
 
     typedef typename Functional::NonlinearityType MyNonlinearityType;
     MyNonlinearityType phi = J.phi;
-- 
GitLab