]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
updated matrix_norm_square and matrix_scalar_product, as well as their descriptions
authordenis.davydov <denis.davydov@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 21 May 2014 19:43:40 +0000 (19:43 +0000)
committerdenis.davydov <denis.davydov@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 21 May 2014 19:43:40 +0000 (19:43 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_petscscalar_complex@32960 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/petsc_parallel_sparse_matrix.h
deal.II/source/lac/petsc_parallel_sparse_matrix.cc

index eaed3fec81874abb0ff462782586c910502fbe70..641968decb1149131f9a699cb04c03e332bc8602 100644 (file)
@@ -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;
index c594c702d3aa0ea76ef364facfd1e40ef7073c54..c0e0ed35ea2c0171281e8b348b0325a995bc7660 100644 (file)
@@ -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;
     }
 
   }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.