From 67daf861165cb91ae1f2a71da1fac08b209c9262 Mon Sep 17 00:00:00 2001 From: "denis.davydov" Date: Wed, 21 May 2014 19:43:40 +0000 Subject: [PATCH] updated matrix_norm_square and matrix_scalar_product, as well as their descriptions git-svn-id: https://svn.dealii.org/branches/branch_petscscalar_complex@32960 0785d39b-7218-0410-832d-ea1e28bc413d --- .../include/deal.II/lac/petsc_parallel_sparse_matrix.h | 6 +++--- deal.II/source/lac/petsc_parallel_sparse_matrix.cc | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/deal.II/include/deal.II/lac/petsc_parallel_sparse_matrix.h b/deal.II/include/deal.II/lac/petsc_parallel_sparse_matrix.h index eaed3fec81..641968decb 100644 --- a/deal.II/include/deal.II/lac/petsc_parallel_sparse_matrix.h +++ b/deal.II/include/deal.II/lac/petsc_parallel_sparse_matrix.h @@ -424,7 +424,7 @@ namespace PETScWrappers * of the vector $v$ with respect * to the norm induced by this * matrix, - * i.e. $\left(v,Mv\right)$. This + * i.e. $\left(v^\ast,Mv\right)$. This * is useful, e.g. in the finite * element context, where the * $L_2$ norm of a function @@ -449,7 +449,7 @@ namespace PETScWrappers /** * Compute the matrix scalar - * product $\left(conjugate(u),Mv\right)$. + * product $\left(u^\ast,Mv\right)$. * * The implementation of this function * is not as efficient as the one in @@ -457,7 +457,7 @@ namespace PETScWrappers * deal.II (i.e. the original one, not * the PETSc wrapper class) since PETSc * doesn't support this operation and - * needs two temporary vectors. + * needs a temporary vector. */ PetscScalar matrix_scalar_product (const Vector &u, const Vector &v) const; diff --git a/deal.II/source/lac/petsc_parallel_sparse_matrix.cc b/deal.II/source/lac/petsc_parallel_sparse_matrix.cc index c594c702d3..c0e0ed35ea 100644 --- a/deal.II/source/lac/petsc_parallel_sparse_matrix.cc +++ b/deal.II/source/lac/petsc_parallel_sparse_matrix.cc @@ -855,7 +855,8 @@ namespace PETScWrappers { Vector tmp (v); vmult (tmp, v); - return tmp*v; + //note, that v*tmp returns conjugate(v) * tmp + return v*tmp; } PetscScalar @@ -863,10 +864,9 @@ namespace PETScWrappers const Vector &v) const { Vector tmp (v); - Vector copy_u (u); vmult (tmp, v); - copy_u.conjugate(); - return copy_u*tmp; + //note, that u*tmp returns conjugate(u) * tmp + return u*tmp; } } -- 2.39.5