]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Let IndexSet::nth_index_within_set() call compress().
authorWolfgang Bangerth <bangerth@colostate.edu>
Mon, 19 Dec 2016 22:50:20 +0000 (15:50 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Mon, 19 Dec 2016 22:50:20 +0000 (15:50 -0700)
This follows the pattern of all other const functions of the class.

doc/news/changes/minor/20161219Bangerth [new file with mode: 0644]
include/deal.II/base/index_set.h

diff --git a/doc/news/changes/minor/20161219Bangerth b/doc/news/changes/minor/20161219Bangerth
new file mode 100644 (file)
index 0000000..94887e2
--- /dev/null
@@ -0,0 +1,6 @@
+ <li> Changed: IndexSet::nth_index_in_set() can now be called without
+ calling IndexSet::compress() first.
+ <br>
+ (Wolfgang Bangerth, 2016/12/19)
+ </li>
+
index cc3caf01704d3db1420c5cad8c8af2746b8ca490..67dd11a99caa79d168992f41ed7d6aac0431aa03 100644 (file)
@@ -1604,11 +1604,10 @@ inline
 IndexSet::size_type
 IndexSet::nth_index_in_set (const unsigned int n) const
 {
-  // to make this call thread-safe, compress() must not be called through this
-  // function
-  Assert (is_compressed == true, ExcMessage ("IndexSet must be compressed."));
   Assert (n < n_elements(), ExcIndexRangeType<size_type> (n, 0, n_elements()));
 
+  compress ();
+
   // first check whether the index is in the largest range
   Assert (largest_range < ranges.size(), ExcInternalError());
   std::vector<Range>::const_iterator main_range=ranges.begin()+largest_range;

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.