From: denis.davydov Date: Wed, 21 May 2014 19:43:40 +0000 (+0000) Subject: updated matrix_norm_square and matrix_scalar_product, as well as their descriptions X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67daf861165cb91ae1f2a71da1fac08b209c9262;p=dealii-svn.git 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 --- 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; } }