From: Denis Davydov Date: Tue, 16 Jun 2015 21:06:07 +0000 (+0200) Subject: modify methods description in PETSc sparse matrix for complex numbers X-Git-Tag: v8.3.0-rc1~104^2~13 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=faac0202854ba27ebdbd1ffd5e1135454aeaa2a2;p=dealii.git modify methods description in PETSc sparse matrix for complex numbers --- diff --git a/include/deal.II/lac/petsc_parallel_sparse_matrix.h b/include/deal.II/lac/petsc_parallel_sparse_matrix.h index 13499cbf3a..b10c92f6e9 100644 --- a/include/deal.II/lac/petsc_parallel_sparse_matrix.h +++ b/include/deal.II/lac/petsc_parallel_sparse_matrix.h @@ -353,7 +353,7 @@ namespace PETScWrappers /** * Return the square of the norm of the vector $v$ with respect to the - * norm induced by this matrix, i.e. $\left(v,Mv\right)$. This is + * norm induced by this matrix, 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 equals the matrix norm with respect to the mass matrix of * the vector representing the nodal values of the finite element @@ -369,7 +369,7 @@ namespace PETScWrappers PetscScalar matrix_norm_square (const Vector &v) const; /** - * Compute the matrix scalar product $\left(u,Mv\right)$. + * Compute the matrix scalar product $\left(u^\ast,Mv\right)$. * * The implementation of this function is not as efficient as the one in * the @p MatrixBase class used in deal.II (i.e. the original one, not diff --git a/source/lac/petsc_parallel_sparse_matrix.cc b/source/lac/petsc_parallel_sparse_matrix.cc index 4e1f2fa63a..ba9d281a72 100644 --- a/source/lac/petsc_parallel_sparse_matrix.cc +++ b/source/lac/petsc_parallel_sparse_matrix.cc @@ -858,7 +858,8 @@ namespace PETScWrappers { Vector tmp (v); vmult (tmp, v); - return tmp*v; + // note, that v*tmp returns sum_i conjugate(v)_i * tmp_i + return v*tmp; } PetscScalar @@ -867,6 +868,7 @@ namespace PETScWrappers { Vector tmp (v); vmult (tmp, v); + // note, that v*tmp returns sum_i conjugate(v)_i * tmp_i return u*tmp; }