aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/bbox.cc
diff options
context:
space:
mode:
authorschnetter <>2004-02-18 14:10:00 +0000
committerschnetter <>2004-02-18 14:10:00 +0000
commit4dab789bbe10a9d86c61af1986c1a34e0dfcec23 (patch)
treeb05b89f42f47c5a67e35dba4558a9dd6d49b7050 /Carpet/CarpetLib/src/bbox.cc
parente5389df9c4d0f6c7847c41f66edd399e7c452757 (diff)
Change definition for the bbox iterators, so that they work with
Change definition for the bbox iterators, so that they work with 0-dimensional bboxes as well. Instantiate the templates for 0 dimensions. darcs-hash:20040218141001-07bb3-df6baa90f8b8ae69a788d863ef663d55587d1d25.gz
Diffstat (limited to 'Carpet/CarpetLib/src/bbox.cc')
-rw-r--r--Carpet/CarpetLib/src/bbox.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/Carpet/CarpetLib/src/bbox.cc b/Carpet/CarpetLib/src/bbox.cc
index 6decccabe..c1af312a8 100644
--- a/Carpet/CarpetLib/src/bbox.cc
+++ b/Carpet/CarpetLib/src/bbox.cc
@@ -1,4 +1,4 @@
-// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/bbox.cc,v 1.19 2004/01/25 14:57:29 schnetter Exp $
+// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/bbox.cc,v 1.20 2004/02/18 15:10:01 schnetter Exp $
#include <assert.h>
@@ -226,10 +226,9 @@ template<class T, int D>
typename bbox<T,D>::iteratorT& bbox<T,D>::iteratorT::operator++ () {
for (int d=D-1; d>=0; --d) {
pos[d]+=box.stride()[d];
- if (pos[d]<=box.upper()[d]) return *this;
+ if (pos[d]<=box.upper()[d]) break;
pos[d]=box.lower()[d];
}
- pos=box.endT().pos;
return *this;
}
@@ -240,7 +239,7 @@ typename bbox<T,D>::iteratorT bbox<T,D>::beginT () const {
template<class T, int D>
typename bbox<T,D>::iteratorT bbox<T,D>::endT () const {
- return iteratorT(*this, upper()+stride());
+ return iteratorT(*this, upper());
}
@@ -272,6 +271,7 @@ void bbox<T,D>::output (ostream& os) const {
// Note: We need all dimensions all the time.
+template class bbox<int,0>;
template class bbox<int,1>;
template class bbox<int,2>;
template class bbox<int,3>;