From 73c3bbea3b2f234b7b3d015c93a53c2885c6e8e6 Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Fri, 28 Jun 2013 12:19:01 +0200
Subject: [PATCH] Use Arithmetic

---
 dune/tectonic/minimisation.hh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/dune/tectonic/minimisation.hh b/dune/tectonic/minimisation.hh
index 7cf815b7..ef818bdb 100644
--- a/dune/tectonic/minimisation.hh
+++ b/dune/tectonic/minimisation.hh
@@ -5,6 +5,7 @@
 #include <dune/common/fvector.hh>
 #include <dune/common/stdstreams.hh>
 
+#include <dune/fufem/arithmetic.hh>
 #include <dune/fufem/interval.hh>
 #include <dune/solvers/computeenergy.hh>
 #include <dune/tnnmg/problem-classes/bisection.hh>
@@ -28,9 +29,9 @@ void descentMinimisation(Functional const &J,
 
      since A is symmetric.
   */
-  SmallVector tmp = J.b;         //  b
-  J.A.mmv(x, tmp);               //  b-Au
-  double const JRestb = tmp * v; // <b-Au,v>
+  SmallVector tmp = J.b;
+  Arithmetic::addProduct(tmp, -1.0, J.A, x);
+  double const JRestb = tmp * v;
 
   MyDirectionalConvexFunction<LocalNonlinearityType> const JRest(
       2.0 * computeEnergy(J.A, v), JRestb, *J.phi, x, v);
-- 
GitLab