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

tcgsolver.hh: Use Axy()

[[Imported from SVN: r12100]]
parent 03b85de8
Branches
Tags
No related merge requests found
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
return std::sqrt(this->EnergyNorm<OperatorType,VectorType>::normSquared(f)); return std::sqrt(this->EnergyNorm<OperatorType,VectorType>::normSquared(f));
} }
/** \brief Compute the square of the norm of the given vector // \brief Compute the square of the norm of the given vector
virtual field_type normSquared(const VectorType& f) const virtual field_type normSquared(const VectorType& f) const
{ {
if (iterationStep_ == NULL && matrix_ == NULL) if (iterationStep_ == NULL && matrix_ == NULL)
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
return ret; return ret;
} }
/** \brief Compute the squared norm for a given vector and matrix // \brief Compute the squared norm for a given vector and matrix
DUNE_DEPRECATED static field_type normSquared(const VectorType& u, DUNE_DEPRECATED static field_type normSquared(const VectorType& u,
const OperatorType& A, const OperatorType& A,
const double tol=1e-10) const double tol=1e-10)
......
...@@ -34,18 +34,12 @@ class TruncatedCGSolver : public IterativeSolver<VectorType> ...@@ -34,18 +34,12 @@ class TruncatedCGSolver : public IterativeSolver<VectorType>
return std::max(root1, root2); return std::max(root1, root2);
} }
/** \brief Computes <a,Mb>, where M is the norm that defines the trust region /** \brief Computes <Mb,a>, where M is the norm that defines the trust region */
\todo This could be implemented without the temporary.
*/
field_type trustRegionScalarProduct(const VectorType& a, field_type trustRegionScalarProduct(const VectorType& a,
const VectorType& b) const { const VectorType& b) const {
if (trustRegionNormMatrix_) { if (trustRegionNormMatrix_)
VectorType tmp(b.size()); return Arithmetic::Axy(*trustRegionNormMatrix_, b, a);
tmp = 0;
trustRegionNormMatrix_->umv(b, tmp);
return a*tmp;
}
return a*b; return a*b;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment