From 2ffada67d6f379d14e26d72bbbadfd4b511e5e3c Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Fri, 13 Sep 2013 22:52:21 +0000
Subject: [PATCH] computeenergy.hh: Use Axy()

[[Imported from SVN: r12098]]
---
 dune/solvers/computeenergy.hh | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/dune/solvers/computeenergy.hh b/dune/solvers/computeenergy.hh
index ec904ec7..f38a0729 100644
--- a/dune/solvers/computeenergy.hh
+++ b/dune/solvers/computeenergy.hh
@@ -6,22 +6,13 @@
 template <class M, class V>
 double computeEnergy(const M& mat, const V& x, const V& rhs)
 {
-    V tmp(x.size());
-    tmp = 0;
-    Arithmetic::addProduct(tmp, mat, x);
-//     std::cout << "tmp*x: " << (tmp*x) << "    rhs*x: " << (rhs*x) << std::endl;
-//     exit(0);
-    return 0.5*(tmp*x) - rhs*x;
+    return 0.5*Arithmetic::Axy(mat,x,x) - rhs*x;
 }
 
 template <class M, class V>
 double computeEnergy(const M& mat, const V& x)
 {
-    V tmp(x.size());
-    tmp = 0;
-    Arithmetic::addProduct(tmp, mat, x);
-    
-    return 0.5*(tmp*x);
+    return 0.5*Arithmetic::Axy(mat,x,x);
 }
 
 #endif
-- 
GitLab