From: Ralf Hartmann Date: Tue, 4 May 1999 17:57:27 +0000 (+0000) Subject: small change that makes it faster X-Git-Tag: v8.0.0~22017 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afe199747c3fed9a34742e6774890ea879ed6537;p=dealii.git small change that makes it faster git-svn-id: https://svn.dealii.org/trunk@1269 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/solver_richardson.h b/deal.II/lac/include/lac/solver_richardson.h index 10c92cd915..e5ef9a9fcf 100644 --- a/deal.II/lac/include/lac/solver_richardson.h +++ b/deal.II/lac/include/lac/solver_richardson.h @@ -85,7 +85,7 @@ class SolverRichardson : public Solver /** * Within the iteration loop, the - * square of the residual vector is + * norm of the residual is * stored in this variable. The * function #criterion# uses this * variable to compute the convergence @@ -93,7 +93,7 @@ class SolverRichardson : public Solver * norm of the residual vector and thus * the square root of the #res2# value. */ - double res2; + double res; }; @@ -129,9 +129,8 @@ SolverRichardson::solve (const Matrix &A, // Main loop for(int iter=0; conv==SolverControl::iterate; iter++) { - A.residual(r,x,b); + res=A.residual(r,x,b); - res2 = r*r; conv = control().check (iter, criterion()); if (conv != SolverControl::iterate) break; @@ -157,7 +156,7 @@ template inline double SolverRichardson::criterion() { - return sqrt(res2); + return res; }