aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src
diff options
context:
space:
mode:
authorschnetter <>2004-06-13 20:46:00 +0000
committerschnetter <>2004-06-13 20:46:00 +0000
commitbbbc536ec6fe58e3593acf975d94376040eed57e (patch)
tree240b96c1675d5dcb51ac07812ca5e460ac16bb45 /Carpet/CarpetLib/src
parentdaea9ee556e612f08357d8369dde084bf34548ce (diff)
Simplify logic when evaluating the invariant.
Simplify logic when evaluating the invariant. Evaluate the invariant after normalising. darcs-hash:20040613204648-07bb3-a87112f7ef0cde77040e6453947318cd4e8a7c99.gz
Diffstat (limited to 'Carpet/CarpetLib/src')
-rw-r--r--Carpet/CarpetLib/src/bboxset.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/Carpet/CarpetLib/src/bboxset.cc b/Carpet/CarpetLib/src/bboxset.cc
index 01178af99..94cf1997e 100644
--- a/Carpet/CarpetLib/src/bboxset.cc
+++ b/Carpet/CarpetLib/src/bboxset.cc
@@ -1,4 +1,4 @@
-// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/bboxset.cc,v 1.15 2003/09/19 16:06:41 schnetter Exp $
+// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/bboxset.cc,v 1.16 2004/06/13 22:46:48 schnetter Exp $
#include <assert.h>
@@ -46,9 +46,7 @@ bool bboxset<T,D>::invariant () const {
if ((*bi).empty()) return false;
if (! (*bi).is_aligned_with(*bs.begin())) return false;
// check for overlap (quadratic -- expensive)
- int cnt=0;
- for (const_iterator bi2=bi; bi2!=end(); ++bi2) {
- if (!cnt++) continue;
+ for (const_iterator bi2=begin(); bi2!=bi; ++bi2) {
if (! ((*bi2) & (*bi)).empty()) return false;
}
}
@@ -121,6 +119,7 @@ void bboxset<T,D>::normalize () {
}
const int num_final_boxes = bs.size();
assert (num_initial_boxes - num_combined_boxes == num_final_boxes);
+ assert (invariant());
}