diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2010-04-27 09:46:29 -0500 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2010-04-27 09:46:29 -0500 |
commit | 04b7b480415f21ed124939f4cddcc451d0e312ab (patch) | |
tree | c8f2312473a6d7d4e06ebaf716aad5435899206b /Carpet/CarpetLib/src/bboxset.hh | |
parent | 8f45224eeb7dea54bff3b0e8d66f307ee9ab6bff (diff) |
CarpetLib: Add new bboxset functions
New functions:
- construct a bboxset from a container of bboxes
- expand or contract bboxsets
Diffstat (limited to 'Carpet/CarpetLib/src/bboxset.hh')
-rw-r--r-- | Carpet/CarpetLib/src/bboxset.hh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Carpet/CarpetLib/src/bboxset.hh b/Carpet/CarpetLib/src/bboxset.hh index 85eb2b2c8..5624ef4b1 100644 --- a/Carpet/CarpetLib/src/bboxset.hh +++ b/Carpet/CarpetLib/src/bboxset.hh @@ -63,6 +63,10 @@ public: bboxset (const list<box>& lb); bboxset (const vector<list<box> >& vlb); + template<typename U> + bboxset (const vector<U>& vb, const bbox<T,D> U::* const v); + template<typename U> + bboxset (const vector<U>& vb, const bboxset U::* const v); static bboxset poison (); @@ -133,6 +137,23 @@ public: // friend bboxset operator- <T,D>(const box& b, const bboxset& s); static bboxset minus (const box& b, const bboxset& s); + /** Find a bbox containing the whole set. */ + box container () const; + /** Find the pseudo-inverse. */ + bboxset pseudo_inverse (const int n) const; + + /** Expand (enlarge) the bbox by multiples of the stride. */ + bboxset expand (const vect<T,D>& lo, const vect<T,D>& hi) const; + bboxset expand (const vect<vect<T,D>,2>& lohi) const + { return expand (lohi[0], lohi[1]); } + + /** Find the smallest b-compatible box around this bbox. + ("compatible" means having the same stride.) */ + bboxset expanded_for (const box& b) const; + + /** Find the largest b-compatible box inside this bbox. */ + bboxset contracted_for (const box& b) const; + // Equality bool operator== (const bboxset& s) const; bool operator!= (const bboxset& s) const; |