From: guido Date: Wed, 16 Apr 2003 10:52:30 +0000 (+0000) Subject: set ignores zeroes X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd5d686859f04972209bba62d453779db713b29a;p=dealii-svn.git set ignores zeroes git-svn-id: https://svn.dealii.org/trunk@7396 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/sparse_matrix_ez.h b/deal.II/lac/include/lac/sparse_matrix_ez.h index c8542d1e35..f49ec9d6be 100644 --- a/deal.II/lac/include/lac/sparse_matrix_ez.h +++ b/deal.II/lac/include/lac/sparse_matrix_ez.h @@ -439,9 +439,9 @@ class SparseMatrixEZ : public Subscriptor /** * Set the element @p{(i,j)} to - * @p{value}. Allocates the entry - * if it does not exist. Filters - * out zeroes automatically. + * @p{value}. Allocates the entry, + * if it does not exist and + * @p{value} is non-zero. */ void set (const unsigned int i, const unsigned int j, const number value); @@ -1322,9 +1322,18 @@ void SparseMatrixEZ::set (const unsigned int i, Assert (ivalue = value; + if (value == 0.) + { + Entry* entry = locate(i,j); + if (entry != 0) + { + } + } + else + { + Entry* entry = allocate(i,j); + entry->value = value; + } }