From ff8a0fb360dd7d4908e54ddec755977e8d585848 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 19 Apr 2016 21:53:02 -0500 Subject: [PATCH] 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. --- include/deal.II/base/index_set.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- 2.39.5