]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Avoid vmult_add in matrix blocks with some performance trade-off
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 25 Apr 2003 12:35:14 +0000 (12:35 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 25 Apr 2003 12:35:14 +0000 (12:35 +0000)
git-svn-id: https://svn.dealii.org/trunk@7477 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/block_matrix_array.h

index 840f57458b5c9f554e08371b9b04a2d31a1373ef..f998a654a30dffd30b481e09192a5298334d105f 100644 (file)
@@ -388,24 +388,12 @@ BlockMatrixArray<MATRIX>::vmult_add (BlockVector<number>& 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<MATRIX>::Tvmult_add (BlockVector<number>& 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);
     }
 }
 

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.