From: Wolfgang Bangerth Date: Wed, 20 Apr 2016 02:53:02 +0000 (-0500) Subject: Reset object to native state in IndexSet::clear(). X-Git-Tag: v8.5.0-rc1~1093^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff8a0fb360dd7d4908e54ddec755977e8d585848;p=dealii.git Reset object to native state in IndexSet::clear(). IndexSet stores an index into an array. Upon construction, this index is set to an invalid value (because the array is empty), whereas after IndexSet::clear() the index was set to zero -- a perfectly reasonable, and consequently objectionable index. This patch sets the index to an invalid value instead, as is also done in the constructor. --- diff --git a/include/deal.II/base/index_set.h b/include/deal.II/base/index_set.h index 99e191702b..1fa278b935 100644 --- a/include/deal.II/base/index_set.h +++ b/include/deal.II/base/index_set.h @@ -1222,9 +1222,11 @@ inline void IndexSet::clear () { + // reset so that there are no indices in the set any more; however, + // as documented, the index set retains its size ranges.clear (); - largest_range = 0; is_compressed = true; + largest_range = numbers::invalid_unsigned_int; }