From 68d2bb20dbb202550e6f1e3660162d321d4b47a7 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Mon, 4 May 2009 07:15:21 +0000 Subject: [PATCH] Small improvements in vmult. git-svn-id: https://svn.dealii.org/trunk@18806 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/sparse_ilu.templates.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/deal.II/lac/include/lac/sparse_ilu.templates.h b/deal.II/lac/include/lac/sparse_ilu.templates.h index 01b4a7164d..6a1c62ee68 100644 --- a/deal.II/lac/include/lac/sparse_ilu.templates.h +++ b/deal.II/lac/include/lac/sparse_ilu.templates.h @@ -200,12 +200,12 @@ void SparseILU::vmult (Vector &dst, // right of the diagonal starts const unsigned int * const first_after_diagonal = this->prebuilt_lower_bound[row]; - somenumber dst_row = 0; + somenumber dst_row = dst(row); const number * luval = this->SparseMatrix::val + (rowstart - column_numbers); for (const unsigned int * col=rowstart; col!=first_after_diagonal; ++col, ++luval) - dst_row += *luval * dst(*col); - dst(row) -= dst_row; + dst_row -= *luval * dst(*col); + dst(row) = dst_row; } // now the backward solve. same @@ -224,18 +224,16 @@ void SparseILU::vmult (Vector &dst, // right of the diagonal starts const unsigned int * const first_after_diagonal = this->prebuilt_lower_bound[row]; - somenumber dst_row = 0; + somenumber dst_row = dst(row); const number * luval = this->SparseMatrix::val + (first_after_diagonal - column_numbers); for (const unsigned int * col=first_after_diagonal; col!=rowend; ++col, ++luval) - dst_row += *luval * dst(*col); - - dst(row) -= dst_row; + dst_row -= *luval * dst(*col); // scale by the diagonal element. // note that the diagonal element // was stored inverted - dst(row) *= this->diag_element(row); + dst(row) = dst_row * this->diag_element(row); } } -- 2.39.5