From 22302cbdc5a0e4201af151a77531119274de609f Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Thu, 15 Dec 2011 13:58:00 +0100
Subject: [PATCH] Switch around order of computation

Simply because it's the same as in the blocktnnmgproblem class
---
 dune/tectonic/samplefunctional.hh | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/dune/tectonic/samplefunctional.hh b/dune/tectonic/samplefunctional.hh
index 1192ad6a..08390444 100644
--- a/dune/tectonic/samplefunctional.hh
+++ b/dune/tectonic/samplefunctional.hh
@@ -163,15 +163,13 @@ void minimise(Functional const J, typename Functional::SmallVector &x,
 
          since A is symmetric.
       */
-      SmallVector tmp;
+      SmallVector tmp = J.b;               //  b
+      J.A.mmv(x, tmp);                     //  b-Au
+      double const JRestb = tmp * descDir; // <b-Au,v>
 
       J.A.mv(descDir, tmp);                //  Av
       double const JRestA = tmp * descDir; // <Av,v>
 
-      tmp = J.b;                           //  b
-      J.A.mmv(x, tmp);                     //  b-Au
-      double const JRestb = tmp * descDir; // <b-Au,v>
-
       MyDirectionalConvexFunction<LocalNonlinearityType> JRest(
           JRestA, JRestb, *J.phi, x, descDir);
       // }}}
-- 
GitLab