From 1b3c6d8c70a13a691294e40f36e04676a542cea9 Mon Sep 17 00:00:00 2001 From: wolf Date: Wed, 9 Jan 2002 08:14:54 +0000 Subject: [PATCH] Optimize slightly. git-svn-id: https://svn.dealii.org/trunk@5364 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/solver_richardson.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/deal.II/lac/include/lac/solver_richardson.h b/deal.II/lac/include/lac/solver_richardson.h index 76e8bb4f94..954c1827b0 100644 --- a/deal.II/lac/include/lac/solver_richardson.h +++ b/deal.II/lac/include/lac/solver_richardson.h @@ -206,8 +206,7 @@ SolverRichardson::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::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::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) -- 2.39.5