From: kronbichler Date: Fri, 21 Nov 2008 13:26:57 +0000 (+0000) Subject: Changed the vmult_add function to make it a bit faster. Had to re-introduce the asser... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=445c3d073ba366a538741db83d1f04ede857168e;p=dealii-svn.git Changed the vmult_add function to make it a bit faster. Had to re-introduce the assertion I removed before. git-svn-id: https://svn.dealii.org/trunk@17677 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/source/trilinos_sparse_matrix.cc b/deal.II/lac/source/trilinos_sparse_matrix.cc index 50a86af64b..6e80264f5f 100755 --- a/deal.II/lac/source/trilinos_sparse_matrix.cc +++ b/deal.II/lac/source/trilinos_sparse_matrix.cc @@ -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; }