]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Ignore zero additions in add()
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 7 Apr 2003 18:07:07 +0000 (18:07 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 7 Apr 2003 18:07:07 +0000 (18:07 +0000)
git-svn-id: https://svn.dealii.org/trunk@7373 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/sparse_matrix_ez.h

index dd0d3335244041a42e8b892377221eeddc993a09..880d90b3a9bbb48c790539cb9d6d07a196f00c44 100644 (file)
@@ -1334,6 +1334,11 @@ void SparseMatrixEZ<number>::add (const unsigned int i,
 {
   Assert (i<m(), ExcIndexRange(i,0,m()));
   Assert (j<n(), ExcIndexRange(j,0,n()));
+
+                                  // ignore zero additions
+  if (value == 0)
+    return;
+  
   Entry* entry = allocate(i,j);
   entry->value += value;
 }

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.