]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
modified matrix_scalar_product to do conjugate(u)*M*v
authordenis.davydov <denis.davydov@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 19 May 2014 14:07:42 +0000 (14:07 +0000)
committerdenis.davydov <denis.davydov@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 19 May 2014 14:07:42 +0000 (14:07 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_petscscalar_complex@32937 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 115bb94bfce1522b00ca72461db933188eb16e06..eaed3fec81874abb0ff462782586c910502fbe70 100644 (file)
@@ -449,7 +449,7 @@ namespace PETScWrappers
 
       /**
        * Compute the matrix scalar
-       * product $\left(u,Mv\right)$.
+       * product $\left(conjugate(u),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 a temporary vector.
+       * needs two temporary vectors.
        */
       PetscScalar matrix_scalar_product (const Vector &u,
                                          const Vector &v) const;
index f514ad7d7297a92f32b24d4c14ec87009fc00b4f..114d1ff207b021da75532b61cd25a42fe5549385 100644 (file)
@@ -863,8 +863,10 @@ namespace PETScWrappers
                                          const Vector &v) const
     {
       Vector tmp (v);
+      Vector copy_u (u);
+      Vector & conj = dynamic_cast<Vector&>(copy_u.conjugate());
       vmult (tmp, v);
-      return u*tmp;
+      return conj*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.