]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Allow adding the empty range [N,N) for IndexSets on spaces of size N.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 5 Oct 2010 20:34:29 +0000 (20:34 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 5 Oct 2010 20:34:29 +0000 (20:34 +0000)
git-svn-id: https://svn.dealii.org/trunk@22257 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/index_set.h

index ba43616e2c787cdc1a35cd1f75f8fb9a29353985..1d50be490dd2c9b5f13ea565ac9e6c5b1bbd91d7 100644 (file)
@@ -390,7 +390,7 @@ class IndexSet
         static bool nth_index_compare (const IndexSet::Range & x,
                                       const IndexSet::Range & y)
           {
-           return (x.nth_index_in_set+(x.end-x.begin) < 
+           return (x.nth_index_in_set+(x.end-x.begin) <
                    y.nth_index_in_set+(y.end-y.begin));
           }
 
@@ -526,7 +526,9 @@ void
 IndexSet::add_range (const unsigned int begin,
                     const unsigned int end)
 {
-  Assert (begin < index_space_size,
+  Assert ((begin < index_space_size)
+         ||
+         ((begin == index_space_size) && (end == index_space_size)),
          ExcIndexRange (begin, 0, index_space_size));
   Assert (end <= index_space_size,
          ExcIndexRange (end, 0, index_space_size+1));

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.