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

energynorm.hh: Use Axy()

[[Imported from SVN: r12099]]
parent 2ffada67
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@
#include <cmath>
#include "norm.hh"
#include <dune/solvers/common/arithmetic.hh>
#include <dune/solvers/iterationsteps/lineariterationstep.hh>
/** \brief Vector norm induced by linear operator
......@@ -66,7 +67,6 @@
}
/** \brief Compute the square of the norm of the given vector
\todo This could be implemented without the temporary. */
virtual field_type normSquared(const VectorType& f) const
{
if (iterationStep_ == NULL && matrix_ == NULL)
......@@ -76,10 +76,7 @@
? *(iterationStep_->getMatrix())
: *matrix_;
VectorType tmp(f.size());
A.mv(f, tmp);
field_type const ret = f*tmp;
const field_type ret = Arithmetic::Axy(A, f, f);
if (ret < 0)
{
......@@ -92,15 +89,11 @@
}
/** \brief Compute the squared norm for a given vector and matrix
\todo This could be implemented without the temporary. */
DUNE_DEPRECATED static field_type normSquared(const VectorType& u,
const OperatorType& A,
const double tol=1e-10)
{
VectorType tmp(u.size());
A.mv(u, tmp);
double const ret = u*tmp;
const field_type ret = Arithmetic::Axy(A, u, u);
if (ret < 0)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment