From 109f883c79f10c08523d6ea81cb8407ddd2e2a14 Mon Sep 17 00:00:00 2001 From: guido Date: Fri, 25 Apr 2003 12:35:14 +0000 Subject: [PATCH] Avoid vmult_add in matrix blocks with some performance trade-off git-svn-id: https://svn.dealii.org/trunk@7477 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/block_matrix_array.h | 48 +++++--------------- 1 file changed, 12 insertions(+), 36 deletions(-) diff --git a/deal.II/lac/include/lac/block_matrix_array.h b/deal.II/lac/include/lac/block_matrix_array.h index 840f57458b..f998a654a3 100644 --- a/deal.II/lac/include/lac/block_matrix_array.h +++ b/deal.II/lac/include/lac/block_matrix_array.h @@ -388,24 +388,12 @@ BlockMatrixArray::vmult_add (BlockVector& dst, for (; m != end ; ++m) { - if (m->prefix==1.) - { - if (m->transpose) - m->matrix->Tvmult_add(dst.block(m->row), - src.block(m->col)); - else - m->matrix->vmult_add(dst.block(m->row), - src.block(m->col)); - } else { - aux.reinit(dst.block(m->row)); - if (m->transpose) - m->matrix->Tvmult(aux, - src.block(m->col)); - else - m->matrix->vmult(aux, - src.block(m->col)); - dst.block(m->row).add (m->prefix, aux); - } + aux.reinit(dst.block(m->row)); + if (m->transpose) + m->matrix->Tvmult(aux, src.block(m->col)); + else + m->matrix->vmult(aux, src.block(m->col)); + dst.block(m->row).add (m->prefix, aux); } } @@ -445,24 +433,12 @@ BlockMatrixArray::Tvmult_add (BlockVector& dst, for (; m != end ; ++m) { - if (m->prefix==1.) - { - if (m->transpose) - m->matrix->vmult_add(dst.block(m->col), - src.block(m->row)); - else - m->matrix->Tvmult_add(dst.block(m->col), - src.block(m->row)); - } else { - aux.reinit(dst.block(m->col)); - if (m->transpose) - m->matrix->vmult(aux, - src.block(m->row)); - else - m->matrix->Tvmult(aux, - src.block(m->row)); - dst.block(m->col).add (m->prefix, aux); - } + aux.reinit(dst.block(m->col)); + if (m->transpose) + m->matrix->vmult(aux, src.block(m->row)); + else + m->matrix->Tvmult(aux, src.block(m->row)); + dst.block(m->col).add (m->prefix, aux); } } -- 2.39.5