From 445c3d073ba366a538741db83d1f04ede857168e Mon Sep 17 00:00:00 2001 From: kronbichler Date: Fri, 21 Nov 2008 13:26:57 +0000 Subject: [PATCH] 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 --- deal.II/lac/source/trilinos_sparse_matrix.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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; } -- 2.39.5