From: bangerth Date: Tue, 6 Nov 2007 21:20:06 +0000 (+0000) Subject: Fix up the norm type of PETSc vectors. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3da6996fc3af6b5883f54df65a556ce81f3f2ea2;p=dealii-svn.git Fix up the norm type of PETSc vectors. git-svn-id: https://svn.dealii.org/trunk@15453 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/petsc_vector_base.h b/deal.II/lac/include/lac/petsc_vector_base.h index 5dd04ba5e1..be949df8c7 100644 --- a/deal.II/lac/include/lac/petsc_vector_base.h +++ b/deal.II/lac/include/lac/petsc_vector_base.h @@ -224,6 +224,7 @@ namespace PETScWrappers * class. */ typedef PetscScalar value_type; + typedef PetscScalar real_type; typedef size_t size_type; typedef internal::VectorReference reference; typedef const internal::VectorReference const_reference; @@ -393,7 +394,7 @@ namespace PETScWrappers /** * Return square of the $l_2$-norm. */ - PetscScalar norm_sqr () const; + real_type norm_sqr () const; /** * Mean value of the elements of @@ -405,14 +406,14 @@ namespace PETScWrappers * $l_1$-norm of the vector. * The sum of the absolute values. */ - PetscScalar l1_norm () const; + real_type l1_norm () const; /** * $l_2$-norm of the vector. The * square root of the sum of the * squares of the elements. */ - PetscScalar l2_norm () const; + real_type l2_norm () const; /** * $l_p$-norm of the vector. The @@ -420,13 +421,13 @@ namespace PETScWrappers * powers of the absolute values * of the elements. */ - PetscScalar lp_norm (const PetscScalar p) const; + real_type lp_norm (const PetscScalar p) const; /** * Maximum absolute value of the * elements. */ - PetscScalar linfty_norm () const; + real_type linfty_norm () const; /** * Return whether the vector contains diff --git a/deal.II/lac/source/petsc_vector_base.cc b/deal.II/lac/source/petsc_vector_base.cc index b8e9b4dd90..41e838b214 100644 --- a/deal.II/lac/source/petsc_vector_base.cc +++ b/deal.II/lac/source/petsc_vector_base.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2004, 2005, 2006 by the deal.II authors +// Copyright (C) 2004, 2005, 2006, 2007 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -260,7 +260,7 @@ namespace PETScWrappers - PetscScalar + VectorBase::real_type VectorBase::norm_sqr () const { const PetscScalar d = l2_norm(); @@ -314,7 +314,7 @@ namespace PETScWrappers - PetscScalar + VectorBase::real_type VectorBase::l1_norm () const { PetscScalar d; @@ -327,7 +327,7 @@ namespace PETScWrappers - PetscScalar + VectorBase::real_type VectorBase::l2_norm () const { PetscScalar d; @@ -340,7 +340,7 @@ namespace PETScWrappers - PetscScalar + VectorBase::real_type VectorBase::lp_norm (const PetscScalar p) const { // get a representation of the vector and @@ -386,7 +386,7 @@ namespace PETScWrappers - PetscScalar + VectorBase::real_type VectorBase::linfty_norm () const { PetscScalar d;