From 4dab789bbe10a9d86c61af1986c1a34e0dfcec23 Mon Sep 17 00:00:00 2001 From: schnetter <> Date: Wed, 18 Feb 2004 14:10:00 +0000 Subject: 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 --- Carpet/CarpetLib/src/bbox.cc | 8 ++++---- 1 file 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 @@ -226,10 +226,9 @@ template typename bbox::iteratorT& bbox::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::iteratorT bbox::beginT () const { template typename bbox::iteratorT bbox::endT () const { - return iteratorT(*this, upper()+stride()); + return iteratorT(*this, upper()); } @@ -272,6 +271,7 @@ void bbox::output (ostream& os) const { // Note: We need all dimensions all the time. +template class bbox; template class bbox; template class bbox; template class bbox; -- cgit v1.2.3