]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Implement performance tweeks for Jacobi preconditioning.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 8 Jul 1998 12:56:44 +0000 (12:56 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 8 Jul 1998 12:56:44 +0000 (12:56 +0000)
git-svn-id: https://svn.dealii.org/trunk@440 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/source/dsmatrix.cc

index 100f9f3a9e030c514590100c5743303db4c399ab..e1c2da1bff3800e71050f7aca37e2974a38f4e16 100644 (file)
@@ -572,13 +572,16 @@ dSMatrix::precondition_Jacobi (dVector& dst, const dVector& src,
   Assert (m() == n(), ExcMatrixNotSquare());
 
   const unsigned int n = src.size();
-
-  for (unsigned int i=0; i<n; ++i)
+  double             *dst_ptr = dst.begin();
+  const double       *src_ptr = src.begin();
+  const unsigned int *rowstart_ptr = &cols->rowstart[0];
+  
+  for (unsigned int i=0; i<n; ++i, ++dst_ptr, ++src_ptr, ++rowstart_ptr)
                                     // note that for square matrices,
                                     // the diagonal entry is the first
                                     // in each row, i.e. at index
                                     // rowstart[i]
-    dst(i) = om * src(i) / val[cols->rowstart[i]];
+    *dst_ptr = om * *src_ptr / val[*rowstart_ptr];
 };
 
 

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.