From dd5d686859f04972209bba62d453779db713b29a Mon Sep 17 00:00:00 2001 From: guido Date: Wed, 16 Apr 2003 10:52:30 +0000 Subject: [PATCH] set ignores zeroes git-svn-id: https://svn.dealii.org/trunk@7396 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/sparse_matrix_ez.h | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) 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; + } } -- 2.39.5