Skip to content
Snippets Groups Projects
Commit 2ffada67 authored by Elias Pipping's avatar Elias Pipping Committed by pipping
Browse files

computeenergy.hh: Use Axy()

[[Imported from SVN: r12098]]
parent 978e1b68
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment