]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
small change that makes it faster
authorhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 4 May 1999 17:57:27 +0000 (17:57 +0000)
committerhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 4 May 1999 17:57:27 +0000 (17:57 +0000)
git-svn-id: https://svn.dealii.org/trunk@1269 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/solver_richardson.h

index 10c92cd915e345e33a725cd2b24f3ab1653fbd97..e5ef9a9fcfa9d687acedc551c380c875af1e051a 100644 (file)
@@ -85,7 +85,7 @@ class SolverRichardson : public Solver<Matrix, Vector>
     
                                     /**
                                      * 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<Matrix, Vector>
                                      * norm of the residual vector and thus
                                      * the square root of the #res2# value.
                                      */
-    double res2;
+    double res;
 };
 
 
@@ -129,9 +129,8 @@ SolverRichardson<Matrix,Vector>::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<class Matrix,class Vector>
 inline double
 SolverRichardson<Matrix,Vector>::criterion()
 {
-  return sqrt(res2);
+  return res;
 }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.