]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Changed the vmult_add function to make it a bit faster. Had to re-introduce the asser...
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 21 Nov 2008 13:26:57 +0000 (13:26 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 21 Nov 2008 13:26:57 +0000 (13:26 +0000)
git-svn-id: https://svn.dealii.org/trunk@17677 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/source/trilinos_sparse_matrix.cc

index 50a86af64bbd67afd4d6b2d66a7070eece099178..6e80264f5f7d336a0877165c89c7188ed6da8d35 100755 (executable)
@@ -1241,9 +1241,11 @@ namespace TrilinosWrappers
   SparseMatrix::vmult_add (VectorBase       &dst,
                           const VectorBase &src) const
   {
-    temp_vector.reinit(dst);
+    Assert (&src != &dst, ExcSourceEqualsDestination());
+
+    temp_vector.reinit(dst, true);
 
-    vmult (dst, src);
+    vmult (temp_vector, src);
     dst += temp_vector;
   }
 
@@ -1253,9 +1255,11 @@ namespace TrilinosWrappers
   SparseMatrix::Tvmult_add (VectorBase       &dst,
                            const VectorBase &src) const
   {
-    temp_vector.reinit(dst);
+    Assert (&src != &dst, ExcSourceEqualsDestination());
+
+    temp_vector.reinit(dst, true);
 
-    vmult (dst, src);
+    vmult (temp_vector, src);
     dst += temp_vector;
   }
 

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.