diff options
author | eschnett <> | 2001-03-07 12:00:00 +0000 |
---|---|---|
committer | eschnett <> | 2001-03-07 12:00:00 +0000 |
commit | ff17e4f38df050650e951f49fb3c32a9791f98f5 (patch) | |
tree | 5d082d81756bcf0be221c7f6f05f6588c7d6e4b9 /Carpet/CarpetLib/src/bbox.hh | |
parent | db6e33738bc2b4aba5c96178135ba43f70eb29b6 (diff) |
Made WaveToyF77 run on multiple processors with CarpetSlab.
Made WaveToyF77 run on multiple processors with CarpetSlab.
Addes "bases" in gh and dh. They contain the extent of a bounding box
enclosing all components on a level.
darcs-hash:20010307120057-f6438-829d3c60a80c7b13f850c0ad187257bb6e1b963f.gz
Diffstat (limited to 'Carpet/CarpetLib/src/bbox.hh')
-rw-r--r-- | Carpet/CarpetLib/src/bbox.hh | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/Carpet/CarpetLib/src/bbox.hh b/Carpet/CarpetLib/src/bbox.hh index 5cc6fa1ff..6787b9240 100644 --- a/Carpet/CarpetLib/src/bbox.hh +++ b/Carpet/CarpetLib/src/bbox.hh @@ -5,7 +5,7 @@ copyright : (C) 2000 by Erik Schnetter email : schnetter@astro.psu.edu - $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/bbox.hh,v 1.2 2001/03/05 21:48:38 eschnett Exp $ + $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/bbox.hh,v 1.3 2001/03/07 13:00:57 eschnett Exp $ ***************************************************************************/ @@ -42,7 +42,7 @@ template<class T, int D> class bbox { // Fields - vect<T,D> _lower, _upper, _stride;// bounds are inclusive + vect<T,D> _lower, _upper, _stride; // bounds are inclusive public: @@ -63,15 +63,8 @@ public: return any(lower()>upper()); } - T size () const { - if (empty()) return 0; - return prod(shape()); - } - - T num_points () const { - if (empty()) return 0; - return prod((shape()+stride()-1)/stride()); - } + T size () const; + T num_points () const; // Queries bool contains (const vect<T,D>& x) const; @@ -102,6 +95,14 @@ public: // Find the largest b-compatible box inside *this bbox contracted_for (const bbox& b) const; + // Set operations + // Smallest bbox containing both boxes + bbox operator* (const bbox& b) const; + bbox& operator*= (const bbox& b); + // Largest bbox inside both boxes + bbox operator+ (const bbox& b) const; + bbox& operator+= (const bbox& b); + // Iterators class iterator { protected: |