]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Optimize slightly.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 9 Jan 2002 08:14:54 +0000 (08:14 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 9 Jan 2002 08:14:54 +0000 (08:14 +0000)
git-svn-id: https://svn.dealii.org/trunk@5364 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 76e8bb4f94d7a2e3db34c1f2dd6e0ff48cf92007..954c1827b0921469c6e0395d08ea618ca6c6cb0f 100644 (file)
@@ -206,8 +206,7 @@ SolverRichardson<VECTOR>::solve (const MATRIX         &A,
 
       if (!additional_data.use_preconditioned_residual)
        {
-         res = r*r;
-         res=sqrt(res);
+         res = r.l2_norm();
          conv = control().check (iter, criterion());
          if (conv != SolverControl::iterate)
            break;
@@ -216,8 +215,7 @@ SolverRichardson<VECTOR>::solve (const MATRIX         &A,
       precondition.vmult(d,r);
       if (additional_data.use_preconditioned_residual)
        {
-         res = d*d;
-         res=sqrt(res);
+         res = d.l2_norm();
          conv = control().check (iter, criterion());
          if (conv != SolverControl::iterate)
            break;
@@ -264,7 +262,7 @@ SolverRichardson<VECTOR>::Tsolve (const MATRIX         &A,
                                       // but do it in 2 steps
       A.Tvmult(r,x);
       r.sadd(-1.,1.,b);
-      res=sqrt(r*r);
+      res=r.l2_norm();
 
       conv = control().check (iter, criterion());
       if (conv != SolverControl::iterate)

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.