]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Work around another issue with libc++. 919/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 9 May 2015 20:48:55 +0000 (15:48 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 9 May 2015 20:49:08 +0000 (15:49 -0500)
The same issue we had with operator== also exists with operator<,
namely that apparently the constructor of the one-past-the-end
object does not initialize the position within the row. This
fixes the problem in essentially the same way.

This should address the remaining failures referenced in #899.

include/deal.II/lac/dynamic_sparsity_pattern.h

index d42bb76bb063589a95c7016ca642e919baac78dc..515b90fb530e9ec351c5c94e7f7c07e3ff3dc6ac 100644 (file)
@@ -757,6 +757,18 @@ namespace DynamicSparsityPatternIterators
     Assert (sparsity_pattern == other.sparsity_pattern,
             ExcInternalError());
 
+    // compare the sparsity pattern the iterator points into, properly
+    // taking into account the one-past-the-end iterator state
+    if ((current_row < sparsity_pattern->n_rows())
+        &&
+        (other.current_row == numbers::invalid_unsigned_int))
+      return true;
+    if ((other.current_row < other.sparsity_pattern->n_rows())
+        &&
+        (current_row == numbers::invalid_unsigned_int))
+      return false;
+
+    // both iterators are not one-past-the-end
     return ((current_row < other.current_row) ||
             ((current_row == other.current_row) &&
              (current_entry < other.current_entry)));

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.